Re: [FFmpeg-user] yuv420p format
Ran Shalit gmail.com> writes: > The ffmpeg tool also showd that the format is 422 YUYV. I just remembered the following: $ ffmpeg -list_formats 1 -i /dev/video0 $ v4l2-ctl --list-formats Sorry for not realizing this earlier, Carl Eugen ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Re: [FFmpeg-user] yuv420p format
On Fri, Jan 8, 2016 at 5:57 PM, Carl Eugen Hoyos wrote: > Ran Shalit gmail.com> writes: > >> But It seems that the captured video is always the same: 422 YUYV. > > Did you try to record with FFmpeg? > > $ ffmpeg -i /dev/video0 -vcodec copy -t 10 out1.yuv > > $ ffmpeg -pix_fmt yuv420p -i /dev/video0 -t 10 out2.yuv > > The console output will tell you the used colour space, > I suspect that not every v4l2 hardware supports yuv420p. > > Carl Eugen > Thank you very much, You're Right. The ffmpeg tool also showd that the format is 422 YUYV. This v4l2 device (virtual device, vivid ) always output 422 YUYV, although trying to change its format . Probably it can't output this format. Best Regards, Ran ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Re: [FFmpeg-user] yuv420p format
Ran Shalit gmail.com> writes: > But It seems that the captured video is always the same: 422 YUYV. Did you try to record with FFmpeg? $ ffmpeg -i /dev/video0 -vcodec copy -t 10 out1.yuv $ ffmpeg -pix_fmt yuv420p -i /dev/video0 -t 10 out2.yuv The console output will tell you the used colour space, I suspect that not every v4l2 hardware supports yuv420p. Carl Eugen ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Re: [FFmpeg-user] yuv420p format
On Fri, Jan 8, 2016 at 2:23 PM, Ran Shalit wrote: > On Fri, Jan 8, 2016 at 11:02 AM, Carl Eugen Hoyos wrote: >> Ran Shalit 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@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 ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Re: [FFmpeg-user] yuv420p format
On Fri, Jan 8, 2016 at 11:02 AM, Carl Eugen Hoyos wrote: > Ran Shalit 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@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 ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Re: [FFmpeg-user] yuv420p format
Ran Shalit 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@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user
[FFmpeg-user] yuv420p format
Hello, I would like to ask what is the actual color format of yuv420p as used with ffmpeg in pixel_format option. I have captured video with V4L2_PIX_FMT_YUV420 format (described in https://linuxtv.org/downloads/v4l-dvb-apis/re25.html ) But the captured video is not played correctly with ffplay -f rawvideo -pixel_format yuv420p -video_size 1920x1080 -i cap_yuv420p.yuv Is V4L2_PIX_FMT_YUV420 (v4l2) and yuv420p (ffmpeg) the same ? Thank you, Ran ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user