[FFmpeg-user] Changing video size mid-stream

Moritz Barsnick barsnick at gmx.net
Mon Oct 31 21:31:08 EET 2016

On Mon, Oct 31, 2016 at 12:09:52 -0700, Joshua Grauman wrote:
> ./gen-vid | ffmpeg -f rawvideo -pixel_format bgra -video_size 1366x713 -framerate 30 -i - -vcodec png overtest.avi
> I am wondering if there is any way to change the video size mid-stream 
> without skipping any frames? Any ideas? Thanks!

Do you want to allow the raw input stream to resize, or do you want to
resize the output?

I believe the former can't be done. There's no way to tell ffmpeg to
change those parameters. You would need to make ./gen-vid wrap its
output into some codec and/or container which could provide its size.

If, on the other hand, you want to resize only the output, you would
use the scale filter along with the zmq filter. I outlined its use (for
audio with the azmq filter) here:


More information about the ffmpeg-user mailing list