Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

scaling (resizing) raw yuv video with ffmpeg

Tags:

video

ffmpeg

Is it possible to scale a raw YUV video using ffmpeg? I have a 1920x1080 raw yuv video and i want to downscale it to 960x540.

I used below command but i didn't work.

ffmpeg -i input.yuv -vf scale=960:540 -c:v rawvideo -pix_fmt yuv420p out.yuv

Output:

[IMGUTILS @ 0xbfbd3924] Picture size 0x0 is invalid
[IMGUTILS @ 0xbfbd34e4] Picture size 0x0 is invalid
[IMGUTILS @ 0xbfbd3534] Picture size 0x0 is invalid
[rawvideo @ 0xa79f340] Could not find codec parameters for stream 0 (Video: rawvideo (I420 / 0x30323449), yuv420p, -4 kb/s): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
crowd_run_1080p50_100frame.yuv: could not find codec parameters
like image 603
Necip Onur Uzun Avatar asked Dec 25 '22 13:12

Necip Onur Uzun


1 Answers

For the YUV input file you need to specify frame rate and size, because it doesn't have that information.

ffmpeg -s:v 1920x1080 -r 25 -i input.yuv -vf scale=960:540 -c:v rawvideo -pix_fmt yuv420p out.yuv
like image 158
Duvrai Avatar answered Dec 28 '22 07:12

Duvrai