[FFmpeg-user] FAQ: how to join videos

Paul Lenz paul at lenz-online.de
Sat Feb 11 13:48:18 CET 2012


This job seems not to be as easy as written in the FAQ. If you get bad 
results, there are more tings to do.

I grab several sets of JPG pictures from a webcam and record a WAV file 
for each set.
I create a new empty file "result.mpg" and do this for each set:
1.) I duplicate the pictures until I have 25 pictures per second
2.) ffmpeg -r 25 -f image2 -i img-%06d.jpg pics.mpg  (I collect 
pictures into a mpg video)
3.) ffmpeg -i pics.mpg -i set_xxx.wav set_xxx.mpg    (I add the sound 
to the video)
4.) open the video file and paste its content to "result.mpg"
5.) continue with the next set

I save "result.mpg" and convert it into WMV:
ffmpeg -i result.mpg -f avi result.wmv
(For unknown reasons, "-f avi" is necessary, otherwise the sound is 
very distorted.)

Both results can be played in Windows Media Player and in Media Player 
Classic, but Windows Media Player seems not to be able to calculate the 
correct length and the correct playing position of the MPG video.

The biggest trouble is: both results can not be used in Adobe Premiere 
CS5. It refuses to import the WMV file ("can not be opened") and it 
shows the MPG file only partly (the part from the first set).

The solution is to convert "result.mpg" into another "result2.mpg" as 
an additional step:
ffmpeg -i result.mpg result2.mpg
ffmpeg -i temp.mpg -f avi result.wmv

Both files are now perfectly usable in video players and Premiere.

IMHO this should be mentioned in the FAQ.

Paul Lenz



More information about the ffmpeg-user mailing list