Penguin

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

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

Newer page: version 14 Last edited on Saturday, June 6, 2009 1:00:39 am by JohnBillings Revert
Older page: version 9 Last edited on Wednesday, May 27, 2009 12:32:21 am by LawrenceDoliveiro Revert
@@ -19,11 +19,25 @@
 FFmpeg does not ''concatenate'' multiple input files, it ''multiplexes'' them. Thus, you can specify an input video-only file and an input audio-only file, and get a combined video-plus-audio output file. Or you can ''demultiplex'' the input into multiple output files, for example video-only into one output file, audio-only into another, or different encodings of the same video or audio input into different outputs. 
  
 The ''mapping-options'' allow the specification of which streams from whicn input file(s) are mapped onto which streams in the output file(s). These are only necessary if FFmpeg can't figure out the right thing to do. 
  
-!Tips 
+! !Tips 
  
-Extract a single video frame into a JPEG file: 
+!Extract an audio file from a MP4 or other video file:  
+  
+ffmpeg -i Videofile.mp4 -vn -acodec mp3 audiofile.mp3  
+  
+Result on Ubuntu 9.04:  
+  
+Unknown encoder 'mp3'  
+  
+Fail!  
+  
+You could follow the advice [in this bug report|https://bugs.launchpad.net/ubuntu/+source/ffmpeg/+bug/296922], but why bother. Just do this:  
+  
+ffmpeg -i Videofile.mp4 -vn -acodec vorbis audiofile.ogg  
+  
+! Extract a single video frame into a JPEG file: 
  
 <pre> 
  ffmpeg -ss ''hh'':''mm'':''ss'':''cc'' -t 00:00:00.01 -i ''input-filename'' -f mjpeg ''output-name''.jpeg 
 </pre> 
@@ -33,9 +47,9 @@
 <pre> 
  ffmpeg -ss 00:03:51.04 -t 00:00:00.01 -i my-doggie.mpg -f mjpeg my-doggie-thumbnail.jpeg 
 </pre> 
  
-Generate a specified duration of silence: 
+! Generate a specified duration of silence: 
  
 <pre> 
  ~NrChannels~=2 
  ~SampleRate~=48000 
@@ -45,9 +59,11 @@
  -i <(dd if=/dev/zero bs=$(($~SampleRate * $~NrChannels * 2)) count=$~NrSeconds) \ 
  silence.wav 
 </pre> 
  
-Generate a static background suitable for a non-animated [DVD-Video|DVDVideo] menu. This takes a single still frame (probably best to stick to [JPEG] format, certainly [PNG] didn't work) and turns it into an [MPEG]-2 output movie with a silent soundtrack. The movie is of one-second duration, which is sufficient because it can be set to loop during the DVD authoring process: 
+! Generate a static background suitable for a non-animated [DVD-Video|DVDVideo] menu.  
+  
+ This takes a single still frame (probably best to stick to [JPEG] format, certainly [PNG] didn't work) and turns it into an [MPEG]-2 output movie with a silent soundtrack. The movie is of one-second duration, which is sufficient because it can be set to loop during the DVD authoring process: 
  
 <pre> 
  ffmpeg -loop_input -t 1.0 -i ''stillframename'' \ 
  -ar 48000 -f s16le -i <(dd if=/dev/zero bs=192000 count=1) \ 
@@ -55,9 +71,11 @@
 </pre> 
  
 where <tt>pal-dvd</tt> can be replaced with <tt>ntsc-dvd</tt> if authoring an NTSC disc rather than PAL. 
  
-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.), 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 .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: 
+! 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.), 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 .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: 
  
 <pre> 
  ffmpeg \ 
  -ss 00:01:04.00 -i ''srcmovie'' \ 
@@ -65,7 +83,8 @@
  -vcodec copy -acodec copy ''dstmovie'' \ 
  -map 1.0 -map 0.1 
 </pre> 
  
-Links: 
+!! Links:  
+  
 * [FFmpeg home|http://ffmpeg.mplayerhq.hu/] 
 * [libamr home page|http://www.penguin.cz/~utx/amr] -- needed for audio encoding if you're making 3GPP movies to play on cell phones. Recent versions of FFmpeg no longer expect the AMR source code to be inserted into the FFmpeg source tree.