[Ffmpeg-devel] Modding ffmpeg to add fade-in/out and sound looping

Joel Reymont joelr1
Wed Oct 25 16:57:27 CEST 2006


I need to mod ffmpeg to be able to overlay several sound samples  
along the length of a video composed of a number of picture frames.

I could not figure out if ffmpeg is able to build a 24fps movie out  
of, say, one jpeg by repeating it 24 times a second. I believe this  
requires creating several thousand symlinks or copies of my jpeg for  
a movie of several minutes.

Did I miss the "repeat-frame" capability in ffmpeg or is this  
something that I can easily accomplish in code?

My sound samples have start time, duration, fade-in time, fade-out  
time as well as a loop flag. If a sample is looped then it continues  
along the video. This could be a repeated chorus of a song, for example.

I figure that I can do the fades fairly easily by following the  
existing volume code. To loop back to the beginning of my audio  
sample I could use the code that currently seeks to start time. I  
also think that I will need to change the algorithm used by ffmpeg to  
grab the next packet to write out.

ffmpeg will write the packet with the lowest pts, I believe, but this  
won't work if I need to stop an audio sample after a specified length  
of time. It also won't work since I need to seek back to the  
beginning of the audio sample when looping.

I haven't dug into repeating the jpeg frame 24 times a second yet.

Do you have any tips for me?

Am I going about this properly or is there an easier way?

	Thanks, Joel


More information about the ffmpeg-devel mailing list