[FFmpeg-soc] Trying to write a new filter but unclear on callback order

Brandon Mintern bmintern at gmail.com
Sat Mar 27 12:46:26 CET 2010


I'm trying to build a filter called "clone" (as discussed with Vitor
on #ffmpeg-devel). I was modeling my filter after fifo, but apparently
I'm wrong about the callback process (sidenote: a more detailed
explanation in the wiki documentation would be very helpful!). I think
I'm reasonably close with the code I have, but I can't finish it until
I better understand the callback order in the filter chain. I would
appreciate it if someone could point me in the write direction.

My current code is at http://bmintern.homeunix.com/~brandon/vf_clone.c

Here's what I'm getting right now:
./ffmpeg_g -i ~/grinderschool/title-sequence/resources/intro-base.wmv
-vfilters clone=0:30 test-out.wmv
[snip]
Stream mapping:
  Stream #0.1 -> #0.0
  Stream #0.0 -> #0.1
Press [q] to stop encoding
[buffer @ 0x90b4e60]request_frame() called with no available frame!

There is a comment near the top of vf_clone.c which indicates the
intended purpose of clone, but the idea is to create a new video which
is a frame or a short sequence of frames repeated a given number of
times. I'm expecting to use it to duplicate the first/last frame of a
video in the filter chain in order to fade the "paused" video in/out
for 2 seconds. (I'm also planning on writing the fade filter, which
should be MUCH easier than this one has turned out to be.) In case
that's not clear enough, here's my expected filter chain:

ffmpeg -i video.avi -vfilters "movie=0:wmv3:intro-base.wmv [intro]; \
movie=0:png:title.png [title]; \
movie=0:wmv3:outro-base.wmv [outro]; \
movie=0:png:credits.png [credits]; \
[intro][title] overlay=0:0:1 [intro+title]; \
[outro][credits] overlay=0:0:1, fade=in:0:30 [OC]; \
[intro+title] split [IT], clone=-1:30, fade=out:0:30 [Ifadeout]; \
[in] split [movie], clone=0:30, fade=in:0:30 [Mfadein]; \
[movie] split [M], clone=-1:30, fade=out:0:30 [Mfadeout]; \
[IT][Ifadeout][Mfadein][M][Mfadeout][OC] concatenate [out]" \
final_video.avi

(And obviously I'll be writing concatenate as well! (I think it might
end up needing to be a 2-input, 1-output filter which gets chained
together.))

Thanks in advance for any help you can offer,
Brandon


More information about the FFmpeg-soc mailing list