On Mon, 24 Feb 2014 09:52:19 -0500 "[email protected]"
<[email protected]> wrote:
> A few months ago I made this simple Android camera app that records a
> sample of camera footage in h.264 to a file. The goal is to sort out
> things on Android and then port over to Linux.
>
> https://github.com/jonsmirl/cam
Android and binary blobs, sorry i can't help.
>
> The app works in NV12 mode except the color space is messed up during
> replay on VLC. So I tried commenting out a few lines and switching to
> YUYV mode.
>
> } else if (!tryFmt(V4L2_PIX_FMT_YUYV)) {
> mCaptureFormat = V4L2_PIX_FMT_YUYV; // maybe usb camera
> printf("capture format: V4L2_PIX_FMT_YUYV \n");
>
> Putting the camera into this mode creates the bug I'm seeing on three
> other Allwinner Android devices I have here. The color space is ok,
> but something goes wrong in the buffering and the video frames are out
> of order. This is a good bug to fix since every device I have here has
> it.
Did you read all that previous thread named "Demo h264 encoding app"?
This exact problem was there, but as for my use case to get frames from
a camera isn't required, the camera code was removed.
My guess the problem is in camera side driver or how this application is
using V4L api.
The encoder binary blob works great, but only takes in a few color
formats, see here what was found that the hardware supports.
http://linux-sunxi.org/VE_Register_guide#MACC_ISP_CTRL
Suggestion, ignore the encoder for know, and verify what format are you
getting from the camera. Check what format is byte data in the actual
buffer, don't believe what V4L says.
>
> Also, what is the standard color space for a h.264 stream?
This is not a concern, the hardware always generates a valid bitstream,
independent of how the input buffer is set. You only have to set the
input buffer picture to the same format that hardware was set to.
But i never played a raw h264 bitstream in VLC, so don't know if works.
In mplayer tried didn't work, but in ffmpeg does.
Use mkvmerge to mux the raw bitstream into a mkv container, then you
don't need to worry about the player.
--
--
You received this message because you are subscribed to the Google Groups
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.