[FFmpeg-user] -vf split + overlay uses all RAM

Mark Himsley mark at mdsh.com
Sat Dec 31 20:51:38 CET 2011

On 31/12/11 19:11, Nicolas George wrote:
> Le primidi 11 nivôse, an CCXX, Mark Himsley a écrit :
>> Running this command uses all RAM (and lots of swap) and outputs no
>> frames to the output file:
>> ffmpeg -loglevel verbose -i input.mov -vf
>> "split[one][two];[one][two]overlay=0:0" -aspect 16:9 -vcodec dvvideo
>> -acodec pcm_s16le -ac 2 -y output.mov
>> I know it's a crazy command, but I was trying to overlay a smaller
>> version of a video over its self, like this:
>> ./ffmpeg -loglevel verbose -i input.mov -vf
>> "split[one][two];[two]scale=200:200[three];[one][three]overlay=0:0[out]"
>> -aspect 16:9 -vcodec dvvideo -acodec pcm_s16le -ac 2 -y output.mov
>> That also uses all RAM and swap and doesn't output any frames, so I
>> tried the simpler version.
>> Can anyone else confirm this?
> I can confirm, and I can suggest a workaroun: insert a FIFO before the first
> input of your overlay filter:
> 	[one] fifo, [three]overlay=0:0[out]

Thank you Nicolas - perfect workaround

> What happens, I believe, is that when the filter gets a frame for the
> background, it requests a frame for the overlay, not knowing that it will
> get one immediately. As a result, the split filter outputs a frame for the
> overlay as requested, but also for the background, and that recurse.
> There is clearly room for improvement here.

Thanks. Interesting.


More information about the ffmpeg-user mailing list