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

Nicolas George nicolas.george at normalesup.org
Sat Dec 31 20:11:32 CET 2011

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]

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.


  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-user/attachments/20111231/84f5962c/attachment.asc>

More information about the ffmpeg-user mailing list