Add an audio soundtrack to a series of images to create an flv

ffmpeg -t 300 -r '0.5' -i head-%03d.png -i ../TvQuran.com__144.mp3 -acodec copy muxed.flv
Creates a 5 minute flv file, with the given sequence of images and audio with 0.5 fps. The images were created using the following command: for x in `seq 0 300`; do cp ../head.PNG head-`printf '%03d' $x`.png; done You can also inject metadata to seek easier using yamdi as follows: yamdi -i muxed.flv -o video.flv
Sample Output
Input #0, image2, from 'head-%03d.png':
  Duration: 00:10:02.00, start: 0.000000, bitrate: N/A
    Stream #0.0: Video: png, rgb24, 600x107, 0.50 tbr, 0.50 tbn, 0.50 tbc
[mp3 @ 0xc93ae50]mdb:255, lastbuf:0 skipping granule 0
    Last message repeated 1 times
Input #1, mp3, from '../TvQuran.com__144.mp3':
  Duration: 00:05:39.40, start: 0.000000, bitrate: 63 kb/s
    Stream #1.0: Audio: mp3, 22050 Hz, stereo, s16, 64 kb/s
File 'muxed.flv' already exists. Overwrite ? [y/N] y
Output #0, flv, to 'muxed.flv':
    Stream #0.0: Video: flv, yuv420p, 600x107, q=2-31, 200 kb/s, 90k tbn, 0.50 tbc
    Stream #0.1: Audio: libmp3lame, 22050 Hz, stereo, s16, 64 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
  Stream #1.0 -> #0.1
Press [q] to stop encoding
frame=  167 fps=  0 q=2.0 Lsize=    3163kB time=334.00 bitrate=  77.6kbits/s
video:351kB audio:2610kB global headers:0kB muxing overhead 6.847169%

4
By: pykler
2010-10-07 16:29:08

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: