Differences between version 9 and previous revision of FFmpeg.
Other diffs: Previous Major Revision, Previous Author, or view the Annotated Edit History
Newer page: | version 9 | Last edited on Wednesday, May 27, 2009 12:32:21 am | by LawrenceDoliveiro | Revert |
Older page: | version 8 | Last edited on Tuesday, May 26, 2009 9:46:10 pm | by LawrenceDoliveiro | Revert |
@@ -23,14 +23,17 @@
!Tips
Extract a single video frame into a JPEG file:
-ffmpeg -ss ''hh'':''mm'':''ss'':''cc'' -t 00:00:00.01 -i ''input-filename'' -f mjpeg ''output-name''.jpeg
+<pre>
+
ffmpeg -ss ''hh'':''mm'':''ss'':''cc'' -t 00:00:00.01 -i ''input-filename'' -f mjpeg ''output-name''.jpeg
+</pre>
For example, extract the frame at time 3 minutes and 51.04 seconds into the input video file:
-ffmpeg -ss 00:03:51.04 -t 00:00:00.01 -i my-doggie.mpg -f mjpeg
-
my-doggie-thumbnail.jpeg
+<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:
<pre>
@@ -48,11 +51,21 @@
<pre>
ffmpeg -loop_input -t 1.0 -i ''stillframename'' \
-ar 48000 -f s16le -i <(dd if=/dev/zero bs=192000 count=1) \
-target pal-dvd ''outputmoviename''
-
</pre>
+</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.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:
+
+<pre>
+ ffmpeg \
+ -ss 00:01:04.00 -i ''srcmovie'' \
+ -i ''srcmovie'' \
+ -vcodec copy -acodec copy ''dstmovie'' \
+ -map 1.0 -map 0.1
+</pre>
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.