Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
ffmpeg:map [2008/11/27 12:12] – angelegt gerald | ffmpeg:map [2024/02/29 13:36] (aktuell) – Externe Bearbeitung 127.0.0.1 | ||
---|---|---|---|
Zeile 36: | Zeile 36: | ||
Hoff es hilft Dir weiter. | Hoff es hilft Dir weiter. | ||
+ | |||
+ | ---- | ||
+ | Um z.B. den 2. (deutschen) Audiostream aus einem mpeg2 zu nehmen (0. Stream ist der Videostream) und ein mp4 draus zu machen: | ||
+ | < | ||
+ | ffmpeg -i Fellinis\ Casanova\[remux\].m2p -vcodec mpeg4 -b 1400kb -acodec mp3 -ab 112kb -ar 44100 -map 0:0 -map 0:2 Fellinis\ Casanova2.mp4 | ||
+ | |||
+ | </ | ||
+ | ---- | ||
+ | |||
+ | |||
+ | ====== FFMPEG AUDIO ====== | ||
+ | |||
+ | Quelle((http:// | ||
+ | ===== MAPPING CHANNELS ===== | ||
+ | |||
+ | | ||
+ | |||
+ | It so happens that I have such a .vob file on-disk, so let's see what ffmpeg thinks of it: | ||
+ | < | ||
+ | $ ffmpeg -i mr.vob | ||
+ | FFmpeg version SVN-r9607, Copyright (c) 2000-2007 Fabrice Bellard, et al. | ||
+ | {snipped} | ||
+ | Seems that stream 0 comes from film source: 25.00 (25025/ | ||
+ | Input #0, mpeg, from ' | ||
+ | Duration: 00:03:16.2, start: 620.890956, bitrate: 7704 kb/s | ||
+ | Stream # | ||
+ | Stream #0.1[0x89]: Audio: dts, 48000 Hz, stereo, 768 kb/s | ||
+ | Stream #0.2[0x80]: Audio: ac3, 48000 Hz, 5:1, 384 kb/s | ||
+ | Stream #0.3[0x83]: Audio: ac3, 48000 Hz, stereo, 96 kb/s | ||
+ | Stream #0.4[0x82]: Audio: ac3, 48000 Hz, stereo, 96 kb/s | ||
+ | Stream #0.5[0x84]: Audio: ac3, 48000 Hz, stereo, 192 kb/s | ||
+ | Stream #0.6[0x2d]: Subtitle: dvdsub | ||
+ | Stream #0.7[0x2c]: Subtitle: dvdsub | ||
+ | Stream #0.8[0x2b]: Subtitle: dvdsub | ||
+ | Stream #0.9[0x2a]: Subtitle: dvdsub | ||
+ | Stream # | ||
+ | Stream # | ||
+ | Stream # | ||
+ | Stream # | ||
+ | Stream # | ||
+ | Stream # | ||
+ | Stream # | ||
+ | Stream # | ||
+ | Stream # | ||
+ | Stream # | ||
+ | </ | ||
+ | |||
+ | The first stream, #0.0, is the video stream. Stream #0.1 is the DTS-encoded sound track and #0.2 is its AC3-encoded Dolby 5:1 equivalent. Stereo audio streams #0.3 through #0.5 are soundtracks with commentaries. Say I want to create a mono MP3 from this with the commentary from the third audio stream, #0.3. If I don't tell ffmpeg which one to use, it'll go ahead and transcode the first one it finds, the DTS stream in this case. I don't want that. This is where the " | ||
+ | < | ||
+ | $ ffmpeg -i mr.vob -map 0:3 -vn -acodec mp3 -ar 22050 -ab 96k -ac 1 mr.mp3 | ||
+ | </ | ||
+ | "-map input: | ||
+ | |||
+ | " | ||
+ | < | ||
+ | $ ffmpeg -i mr.vob -map 0:0 -map 0:5 -vcodec mpeg4 -b 1000k \ | ||
+ | -s 640x360 -acodec mp3 -ar 22050 -ab 64k -ac 1 -f avi mr.avi | ||
+ | </ | ||
+ | |||
+ | ===== MULTIPLE SOURCES ===== | ||
+ | |||
+ | |||
+ | One of the pieces of equipment adorning my video rig here at home is a DVD recorder. Almost invariably, I record direct onto a DVD+RW so that I can take the program I'm recording apart, rework the audio track (boost the volume level among other things), put it back together again, archive the modified program onto a DVD±R and put the DVD+RW back into circulation for the next recording. | ||
+ | |||
+ | Once the audio track has been extracted and reworked, I can reassemble the movie in either of two manners: | ||
+ | |||
+ | Also extract the mpeg2video data from the .vob file and then multiplex it and the reworked audio (duly converted to MP2 or AC3) with mplex, or | ||
+ | Ask ffmpeg to pull the video in from the original .vob file and the audio from the reworked .wav audio file and transcode it on-the-fly. | ||
+ | | ||
+ | < | ||
+ | $ ffmpeg -i oldmovie.vob -i altered_audio.wav -map 0:0 -map 1:0 -target ntsc-dvd \ | ||
+ | -b required_video_bit_rate -aspect 16:9 newmovie.mpg | ||
+ | </ | ||
+ | Or, if you'd rather use MP2 audio and a lower audio bit rate: | ||
+ | < | ||
+ | $ ffmpeg -i oldmovie.vob -i altered_audio.wav -map 0:0 -map 1:0 -target ntsc-dvd \ | ||
+ | -b required_video_bit_rate -acodec mp2 -ab audio_bit_rate -aspect 16:9 newmovie.mpg | ||
+ | </ | ||
+ | Obviously replace " | ||
+ | The " |