Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to extract frames(or a perticular frame) from a YUV video using ffmpeg

Tags:

video

ffmpeg

yuv

Here is the code for extracting frames from a MP4 video. ffmpeg -i above_marathon_250.mp4 images%03d.bmp But the same code does not work for YUV format video. Does anyone knows how it is possible to extract frame(s) from YUVformat video?

like image 437
mrana Avatar asked Aug 13 '15 06:08

mrana


1 Answers

It's not working because yuv files have no header, so ffmpeg doesn't know what size/pixfmt the file is. You need to specify resolution and pixmt manually:

ffmpeg -video_size 1920x1080 -r 25 -pixel_format yuv422p -i file.yuv output-%d.png

And then adjust size/pixfmt to match your particular video.

[edit] I'd also suggest to post such questions on superuser in the future, this has nothing to do with programming.

like image 94
Ronald S. Bultje Avatar answered Nov 15 '22 13:11

Ronald S. Bultje