Penguin

Differences between version 15 and predecessor to the previous major change of FFmpeg.

Other diffs: Previous Revision, Previous Author, or view the Annotated Edit History

Newer page: version 15 Last edited on Monday, June 15, 2009 8:19:31 pm by LawrenceDoliveiro Revert
Older page: version 14 Last edited on Saturday, June 6, 2009 1:00:39 am by JohnBillings Revert
@@ -70,8 +70,28 @@
  -target pal-dvd ''outputmoviename'' 
 </pre> 
  
 where <tt>pal-dvd</tt> can be replaced with <tt>ntsc-dvd</tt> if authoring an NTSC disc rather than PAL. 
+  
+!Concatenate two movies  
+  
+This technique takes apart the video frames from the input movies and reassembles them into the output movie without decompressing and recompressing them. It uses the <tt>image2pipe</tt> container format to stream the frames. Unfortunately there doesn’t seem to be an equivalent pipe container format for audio, so that ends up being reencoded into the specified output format (which can of course be changed as required).  
+  
+<pre>  
+ audioparms="-f s16le -ar 48000 -ac 2"  
+ ffmpeg \  
+ -i <(  
+ ffmpeg -v 0 -i ''inputfile1'' -f image2pipe -vcodec copy -y /dev/stdout;  
+ ffmpeg -v 0 -i ''inputfile2'' -f image2pipe -vcodec copy -y /dev/stdout  
+ ) \  
+ $audioparms -i <(  
+ ffmpeg -v 0 -i ''inputfile1'' $audioparms -y /dev/stdout;  
+ ffmpeg -v 0 -i ''inputfile2'' $audioparms -y /dev/stdout  
+ ) \  
+ -vcodec copy -acodec pcm_s16le ''outputfile''  
+</pre>  
+  
+Extending the example to concatenate more than two files is left as an exercise for the reader. :)  
  
 !Fix audio/video sync in a movie 
  
 In this example, 64 seconds (determined by trial and error while observing lip sync) was trimmed from the start of the audio track. The video track happens to come first in the list; the source movie is specified twice, once with the appropriate offset applied, and the <tt>-map</tt> option is used to select the appropriate audio and video streams to combine into the output movie: the first <tt>-map</tt> specification says that the first (video) output stream is to come from the first stream of the second input file (stream 1.0), while the second <tt>-map</tt> specification says that the second (audio) output stream is to come from the second stream of the first input file (stream 0.1). Note the use also of <tt>-vcodec copy</tt> and <tt>-acodec copy</tt> to ensure that no re-encoding of audio or video data takes place: