scaling (resizing) raw yuv video with ffmpeg

18,095

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
Share:
18,095
Necip Onur Uzun
Author by

Necip Onur Uzun

Updated on June 07, 2022

Comments

  • Necip Onur Uzun
    Necip Onur Uzun about 2 years

    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