[FFmpeg-user] yuv420p format
Ran Shalit
ranshalit at gmail.com
Fri Jan 8 15:08:41 CET 2016
On Fri, Jan 8, 2016 at 2:23 PM, Ran Shalit <ranshalit at gmail.com> wrote:
> On Fri, Jan 8, 2016 at 11:02 AM, Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:
>> Ran Shalit <ranshalit <at> gmail.com> writes:
>>
>>> I have captured video with V4L2_PIX_FMT_YUV420 format
>>
>> How did you capture the video?
>>
>>> But the captured video is not played correctly with
>>
>> What does "not correctly" mean?
>> Please provide a sample.
>>
>>> ffplay -f rawvideo -pixel_format yuv420p
>>> -video_size 1920x1080 -i cap_yuv420p.yuv
>>>
>>> Is V4L2_PIX_FMT_YUV420 (v4l2) and yuv420p (ffmpeg) the same ?
>>
>> Yes, see:
>> http://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavdevice/v4l2-common.c
>>
>> Carl Eugen
>>
>> _______________________________________________
>> ffmpeg-user mailing list
>> ffmpeg-user at ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
>
>
> Hi Carl,
>
> Thank you very much for your reply.
>
> The sample are here:
> https://drive.google.com/folderview?id=0B22GsWueReZTTmItd1NFWjFBV2M&usp=sharing
> 1. They were created by compiling the v4l2 API example from:
> http://linuxtv.org/downloads/v4l-dvb-apis/capture-example.html
> 2. modprobe vivi (kernel must contain module vivi)
> 3. runnning the compiled executable:
> 3.1 the example as-is (no changes)
> ./v4l2_example -o -c 10 > v4l2_default.yuv
>
> 3.2 the example as-is (no changes) but unning with (-f) - force
> parameter to 640x480 interleaved, yuyv (can be seen in the example
> code)
> ./v4l2_example -f -o -c 10 >
> v4l2_default_force_640_480_interleaved_yuyv.yuv
>
> 3.3 the example with minor modification so that the force section
> in code will use V4L2_PIX_FMT_YUV422P format, and progressive
> (V4L2_FIELD_NONE instead of V4L2_FIELD_INTERLEAVED), the
> resolution is the same (640x480).
> ./v4l2_example -f -o -c 10 >
> v4l2_default_force_640_480_progressive_yuv420.yuv
>
>
> Trying to run the yuv420 sample (and the other two) always gives bad images:
>
> ffplay -f rawvideo -pixel_format yuv420p -video_size 640x480 -i
> v4l2_default_force_640_480_progressive_yuv420.yuv
>
> I've tried many change in ffplay parameters, but can't understand
> what's the problem.
>
> Any hint is most appreciated,
>
> Best Regards,
> Ran
Hi,
One more update:
I did manage to play the video with the example as-is (no code modification)
But It seems that the captured video is always the same: 422 YUYV.
It is v4l2 issue probably, but for some reason the captured video is
always 422 YUYV.
Trying to make the modification in code for YUV420, although giving no
error, the captured video is always the same.
Regards,
Ran
More information about the ffmpeg-user
mailing list