Benutzer-Werkzeuge

Webseiten-Werkzeuge


untertitel_in_filmen

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen RevisionVorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
untertitel_in_filmen [2018-12-21 10:22:45] – [so bearbeiten wir ihn erfolgreich] manfreduntertitel_in_filmen [2022-08-10 23:04:20] (aktuell) manfred
Zeile 1: Zeile 1:
 +====== Untertitel in Filmen ======
 +
 +  * OGV unterstützt nur "ogg Kate"
 +  * WebM unterstützt nur "WebVTT"
 +  * MP4 unterstützt sehr viele Untertitelvormate, auch das SubDVD
 +  * MKV unterstützt sehr viele Untertitelvormate, auch das SubDVD
 +
 +
 +===== allgemeines zu FFmpeg und Untertitelspuren =====
 +
 +Untertitel entfernen:
 +  > ffmpeg -i <rein> -sn <raus>.mkv
 +
 +drei Beispiele um verschiedene Untertitelspuren zu verwenden (1., 2. und 3. Untertitelspur) => [[https://en.wikibooks.org/wiki/FFMPEG_An_Intermediate_Guide/subtitle_options]]:
 +  > ffmpeg -i <rein> -filter_complex "[0:v][0:s:0]overlay[v]" -map [v] -map 0:a <Ausgabeoptionen> <raus>.mkv
 +  > ffmpeg -i <rein> -filter_complex "[0:v][0:s:1]overlay[v]" -map [v] -map 0:a <Ausgabeoptionen> <raus>.mkv
 +  > ffmpeg -i <rein> -filter_complex "[0:v][0:s:2]overlay[v]" -map [v] -map 0:a <Ausgabeoptionen> <raus>.mkv
 +
 +leider kann man die Option ''filter_complex'' nicht zusammen mit ''vf'' benutzen, deshalb hier noch ein weiteres Beispiel, bei der die 1. Untertitelspur 1-zu-1 mit übernommen wird...
 +
 +**__ACHTUNG!__ ''ffmpeg'' durchsucht nur max. die ersten 5 Sekunden und kann deshalb die Untertitelspuren nur finden, wenn sie bereits am Anfang der Video-Datei beginnen.**
 +**Um ''ffmpeg'' zu sagen, dass er die komplette Filmdatei durchsuchen soll, muss man weitere Parameter angeben (''-probesize'' und ''-analyzeduration'').**
 +**Um eine bestimmte Untertitelspur zum "Standard" zu erklären, braucht man eine weitere Option. Hiermit ''-disposition:s:0 default'' wird die erste Untertitelspur markiert.**
 +
 +um aus einer VOB-Datei auch die erste Untertitelspur mit zu übernehmen, muss diese Option ''-map 0:s:0 -c:s copy'' mit übergeben werden:
 +  > ffmpeg -probesize 9223372036G -analyzeduration 9223372036G -i VTS_1_1.VOB -map 0:v:0 -c:v libx264 -crf 24 -vf scale=856x482,pad='max(iw\,ih*(16/9)):ow/(16/9):(ow-iw)/2:(oh-ih)/2',setsar='1/1' -keyint_min 2-8 -map 0:a:0 -c:a libfdk_aac -map 0:s:0 -c:s copy -map 0:s:1 -c:s copy -disposition:s:0 default -f mp4 -y Film_mit_Untertitelspur.mp4
 +
 +der PAL-Film "''Film.vob''" (von einer DVD) enthält eine Video-Spur, 6 Ton-Spuren und 14 Untertitel-Spuren;
 +mit diesem Kommando werden 4 Tonspuren in der Reihenfolge (2, 1, 6, 4) und allen Untertitelspuren (alle bleiben in der Originalreihenfolge, nur die 8. wird an den Anfang gesetzt) in das MP4-Format übersetzt, welches sowohl Blu-Ray- als auch HTML5-kompatibel ist:
 +  > ffmpeg -nostdin -fflags +genpts -r 25 -i Film.vob -map 0:v -c:v libx264 -profile:v high -preset veryslow -tune film -x264opts ref=4:b-pyramid=strict:bluray-compat=1:weightp=0:vbv-maxrate=17500:vbv-bufsize=17500:level=3.1:slices=1:b-adapt=2:direct=auto:colorprim=bt709:transfer=bt709:colormatrix=bt709:keyint=50:aud:subme=9:nal-hrd=vbr -crf 18 -vf scale=768x576,pad=max(iw\\,ih*(4/3)):ow/(4/3):(ow-iw)/2:(oh-ih)/2,setsar=1/1 -keyint_min 2-8 -map 0:a:1 -c:a libfdk_aac -b:a 160k -map 0:a:0 -c:a libfdk_aac -b:a 160k -map 0:a:5 -c:a libfdk_aac -b:a 160k -map 0:a:3 -c:a libfdk_aac -b:a 160k -map 0:s:7 -c:s copy -map 0:s:0 -c:s copy -map 0:s:1 -c:s copy -map 0:s:2 -c:s copy -map 0:s:3 -c:s copy -map 0:s:4 -c:s copy -map 0:s:5 -c:s copy -map 0:s:6 -c:s copy -map 0:s:8 -c:s copy -map 0:s:9 -c:s copy -map 0:s:10 -c:s copy -map 0:s:11 -c:s copy -map 0:s:12 -c:s copy -map 0:s:13 -c:s copy -f mp4 -y Film.mp4
 +
 +Die Option "''-nostdin''" verhindert, dass ''ffmpeg'' seine Arbeit bei Eingabe von ''[Q]'' beendet.
 +
 +
 +===== ein Beispiel auf FreeBSD 11.2p4 mit ''ffmpeg Version 4.0.2'' und ''mkvmerge v27.0.0'' (Dezember 2018) =====
 +
 +
 +==== dieser Film liegt uns vor ====
 +
 +  > ffprobe -i Untertiteltest.mpg
 +  ...
 +  Input #0, mpeg, from 'Untertiteltest.mpg':
 +    Duration: 02:00:53.02, start: 179.778000, bitrate: 5027 kb/s
 +      Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, progressive), 720x576 [SAR 16:15 DAR 4:3], 25 fps, 25 tbr, 90k tbn, 50 tbc
 +      Stream #0:1[0x80]: Audio: ac3, 48000 Hz, mono, fltp, 96 kb/s
 +      Stream #0:2[0x81]: Audio: ac3, 48000 Hz, mono, fltp, 96 kb/s
 +      Stream #0:3[0x82]: Audio: ac3, 48000 Hz, mono, fltp, 96 kb/s
 +      Stream #0:4[0x83]: Audio: ac3, 48000 Hz, mono, fltp, 96 kb/s
 +      Stream #0:5[0x84]: Audio: eac3, 48000 Hz, mono, fltp, 96 kb/s
 +      Stream #0:6[0x85]: Audio: ac3, 48000 Hz, mono, fltp, 96 kb/s
 +      Stream #0:7[0x1bf]: Data: dvd_nav_packet
 +      Stream #0:8[0x20]: Subtitle: dvd_subtitle
 +      Stream #0:9[0x21]: Subtitle: dvd_subtitle
 +      Stream #0:10[0x22]: Subtitle: dvd_subtitle
 +      Stream #0:11[0x23]: Subtitle: dvd_subtitle
 +      Stream #0:12[0x24]: Subtitle: dvd_subtitle
 +      Stream #0:13[0x25]: Subtitle: dvd_subtitle
 +      Stream #0:14[0x26]: Subtitle: dvd_subtitle
 +      Stream #0:15[0x27]: Subtitle: dvd_subtitle
 +      Stream #0:16[0x28]: Subtitle: dvd_subtitle
 +      Stream #0:17[0x29]: Subtitle: dvd_subtitle
 +      Stream #0:18[0x2a]: Subtitle: dvd_subtitle
 +      Stream #0:19[0x2b]: Subtitle: dvd_subtitle
 +      Stream #0:20[0x2c]: Subtitle: dvd_subtitle
 +      Stream #0:21[0x2d]: Subtitle: dvd_subtitle
 +  Unsupported codec with id 100357 for input stream 7
 +
 +<hidden mediainfo Untertiteltest.mpg>
 +<file text mediainfo Untertiteltest.mpg>
 +General
 +Complete name                            : Untertiteltest.mpg
 +Format                                   : MPEG-PS
 +File size                                : 4.25 GiB
 +Duration                                 : 2 h 0 min
 +Overall bit rate mode                    : Variable
 +Overall bit rate                         : 5 028 kb/s
 +
 +Video
 +ID                                       : 224 (0xE0)
 +Format                                   : MPEG Video
 +Format version                           : Version 2
 +Format profile                           : Main@Main
 +Format settings                          : CustomMatrix / BVOP
 +Format settings, BVOP                    : Yes
 +Format settings, Matrix                  : Custom
 +Format settings, GOP                     : M=3, N=12
 +Duration                                 : 2 h 0 min
 +Bit rate mode                            : Variable
 +Bit rate                                 : 4 352 kb/s
 +Maximum bit rate                         : 9 800 kb/s
 +Width                                    : 720 pixels
 +Height                                   : 576 pixels
 +Display aspect ratio                     : 4:3
 +Frame rate                               : 25.000 FPS
 +Standard                                 : PAL
 +Color space                              : YUV
 +Chroma subsampling                       : 4:2:0
 +Bit depth                                : 8 bits
 +Scan type                                : Progressive
 +Scan order                               : Top Field First
 +Compression mode                         : Lossy
 +Bits/(Pixel*Frame)                       : 0.420
 +Stream size                              : 3.67 GiB (87%)
 +
 +Audio #1
 +ID                                       : 189 (0xBD)-128 (0x80)
 +Format                                   : AC-3
 +Format/Info                              : Audio Coding 3
 +Commercial name                          : Dolby Digital
 +Muxing mode                              : DVD-Video
 +Duration                                 : 2 h 0 min
 +Bit rate mode                            : Constant
 +Bit rate                                 : 96.0 kb/s
 +Channel(s)                               : 1 channel
 +Channel layout                           : C
 +Sampling rate                            : 48.0 kHz
 +Frame rate                               : 31.250 FPS (1536 SPF)
 +Bit depth                                : 16 bits
 +Compression mode                         : Lossy
 +Delay relative to video                  : -656 ms
 +Stream size                              : 83.0 MiB (2%)
 +Service kind                             : Complete Main
 +
 +Audio #2
 +ID                                       : 189 (0xBD)-129 (0x81)
 +Format                                   : AC-3
 +Format/Info                              : Audio Coding 3
 +Commercial name                          : Dolby Digital
 +Muxing mode                              : DVD-Video
 +Duration                                 : 2 h 0 min
 +Bit rate mode                            : Constant
 +Bit rate                                 : 96.0 kb/s
 +Channel(s)                               : 1 channel
 +Channel layout                           : C
 +Sampling rate                            : 48.0 kHz
 +Frame rate                               : 31.250 FPS (1536 SPF)
 +Bit depth                                : 16 bits
 +Compression mode                         : Lossy
 +Delay relative to video                  : -656 ms
 +Stream size                              : 83.0 MiB (2%)
 +Service kind                             : Complete Main
 +
 +Audio #3
 +ID                                       : 189 (0xBD)-130 (0x82)
 +Format                                   : AC-3
 +Format/Info                              : Audio Coding 3
 +Commercial name                          : Dolby Digital
 +Muxing mode                              : DVD-Video
 +Duration                                 : 2 h 0 min
 +Bit rate mode                            : Constant
 +Bit rate                                 : 96.0 kb/s
 +Channel(s)                               : 1 channel
 +Channel layout                           : C
 +Sampling rate                            : 48.0 kHz
 +Frame rate                               : 31.250 FPS (1536 SPF)
 +Bit depth                                : 16 bits
 +Compression mode                         : Lossy
 +Delay relative to video                  : -656 ms
 +Stream size                              : 83.0 MiB (2%)
 +Service kind                             : Complete Main
 +
 +Audio #4
 +ID                                       : 189 (0xBD)-131 (0x83)
 +Format                                   : AC-3
 +Format/Info                              : Audio Coding 3
 +Commercial name                          : Dolby Digital
 +Muxing mode                              : DVD-Video
 +Duration                                 : 2 h 0 min
 +Bit rate mode                            : Constant
 +Bit rate                                 : 96.0 kb/s
 +Channel(s)                               : 1 channel
 +Channel layout                           : C
 +Sampling rate                            : 48.0 kHz
 +Frame rate                               : 31.250 FPS (1536 SPF)
 +Bit depth                                : 16 bits
 +Compression mode                         : Lossy
 +Delay relative to video                  : -656 ms
 +Stream size                              : 83.0 MiB (2%)
 +Service kind                             : Complete Main
 +
 +Audio #5
 +ID                                       : 189 (0xBD)-132 (0x84)
 +Format                                   : AC-3
 +Format/Info                              : Audio Coding 3
 +Commercial name                          : Dolby Digital
 +Muxing mode                              : DVD-Video
 +Duration                                 : 2 h 0 min
 +Bit rate mode                            : Constant
 +Bit rate                                 : 96.0 kb/s
 +Channel(s)                               : 1 channel
 +Channel layout                           : C
 +Sampling rate                            : 48.0 kHz
 +Frame rate                               : 31.250 FPS (1536 SPF)
 +Bit depth                                : 16 bits
 +Compression mode                         : Lossy
 +Delay relative to video                  : -656 ms
 +Stream size                              : 83.0 MiB (2%)
 +Service kind                             : Complete Main
 +
 +Audio #6
 +ID                                       : 189 (0xBD)-133 (0x85)
 +Format                                   : AC-3
 +Format/Info                              : Audio Coding 3
 +Commercial name                          : Dolby Digital
 +Muxing mode                              : DVD-Video
 +Duration                                 : 2 h 0 min
 +Bit rate mode                            : Constant
 +Bit rate                                 : 96.0 kb/s
 +Channel(s)                               : 1 channel
 +Channel layout                           : C
 +Sampling rate                            : 48.0 kHz
 +Frame rate                               : 31.250 FPS (1536 SPF)
 +Bit depth                                : 16 bits
 +Compression mode                         : Lossy
 +Delay relative to video                  : -656 ms
 +Stream size                              : 83.0 MiB (2%)
 +Service kind                             : Complete Main
 +
 +Text #1
 +ID                                       : 189 (0xBD)-32 (0x20)
 +Format                                   : RLE
 +Format/Info                              : Run-length encoding
 +Muxing mode                              : DVD-Video
 +Delay relative to video                  : 280 ms
 +
 +Text #2
 +ID                                       : 189 (0xBD)-33 (0x21)
 +Format                                   : RLE
 +Format/Info                              : Run-length encoding
 +Muxing mode                              : DVD-Video
 +Delay relative to video                  : 280 ms
 +
 +Text #3
 +ID                                       : 189 (0xBD)-34 (0x22)
 +Format                                   : RLE
 +Format/Info                              : Run-length encoding
 +Muxing mode                              : DVD-Video
 +Delay relative to video                  : 280 ms
 +
 +Text #4
 +ID                                       : 189 (0xBD)-35 (0x23)
 +Format                                   : RLE
 +Format/Info                              : Run-length encoding
 +Muxing mode                              : DVD-Video
 +Delay relative to video                  : 280 ms
 +
 +Text #5
 +ID                                       : 189 (0xBD)-36 (0x24)
 +Format                                   : RLE
 +Format/Info                              : Run-length encoding
 +Muxing mode                              : DVD-Video
 +Delay relative to video                  : 280 ms
 +
 +Text #6
 +ID                                       : 189 (0xBD)-37 (0x25)
 +Format                                   : RLE
 +Format/Info                              : Run-length encoding
 +Muxing mode                              : DVD-Video
 +Delay relative to video                  : 280 ms
 +
 +Text #7
 +ID                                       : 189 (0xBD)-38 (0x26)
 +Format                                   : RLE
 +Format/Info                              : Run-length encoding
 +Muxing mode                              : DVD-Video
 +Delay relative to video                  : 280 ms
 +
 +Text #8
 +ID                                       : 189 (0xBD)-39 (0x27)
 +Format                                   : RLE
 +Format/Info                              : Run-length encoding
 +Muxing mode                              : DVD-Video
 +Delay relative to video                  : 280 ms
 +
 +Text #9
 +ID                                       : 189 (0xBD)-40 (0x28)
 +Format                                   : RLE
 +Format/Info                              : Run-length encoding
 +Muxing mode                              : DVD-Video
 +Delay relative to video                  : 280 ms
 +
 +Text #10
 +ID                                       : 189 (0xBD)-41 (0x29)
 +Format                                   : RLE
 +Format/Info                              : Run-length encoding
 +Muxing mode                              : DVD-Video
 +Delay relative to video                  : 280 ms
 +
 +Text #11
 +ID                                       : 189 (0xBD)-42 (0x2A)
 +Format                                   : RLE
 +Format/Info                              : Run-length encoding
 +Muxing mode                              : DVD-Video
 +Delay relative to video                  : 280 ms
 +
 +Text #12
 +ID                                       : 189 (0xBD)-43 (0x2B)
 +Format                                   : RLE
 +Format/Info                              : Run-length encoding
 +Muxing mode                              : DVD-Video
 +Delay relative to video                  : 280 ms
 +
 +Text #13
 +ID                                       : 189 (0xBD)-44 (0x2C)
 +Format                                   : RLE
 +Format/Info                              : Run-length encoding
 +Muxing mode                              : DVD-Video
 +Delay relative to video                  : 280 ms
 +
 +Text #14
 +ID                                       : 189 (0xBD)-45 (0x2D)
 +Format                                   : RLE
 +Format/Info                              : Run-length encoding
 +Muxing mode                              : DVD-Video
 +Delay relative to video                  : 280 ms
 +
 +Menu
 +</file>
 +</hidden>
 +
 +
 +==== so bearbeiten wir ihn erfolgreich ====
 +
 +[[FFmpeg]] kann mit Untertiteln nur umgehen, wenn sie am Anfang des Films beginnen und wenn der Film in das Ziel-Format "MP4" oder "MKV" transkodiert wird. Anderenfalls gehen die Untertitelspuren verloren. Leider kann FFmpeg aber Filmteile im MP4-Format nicht zusammenfühgen, man müsste sie dafür erst aufwendig in das Zwischenformat MPEGTS überführen. Es ist aber relativ einfach möglich einzelne Filmteile mit Untertitel mit Hilfe von [[MKVToolnix#filmteile_zusammensetzen|mkvmerge]] zusammenzufühgen, wenn sie im MKV-Format vorliegen.
 +//([[MKVToolnix#filmteile_zusammensetzen|mkvmerge]] kann die einzelnen Filmteile auch lesen, wenn sie im MP4-Format vorligen, jedoch werden dann die Untertitel nicht mit in den kompletten Film übernommen.)//
 +[[MKVToolnix#filmteile_zusammensetzen|mkvmerge]] kann den kompletten Film nur im MKV-Format exportieren.
 +Daraus folgt, dass es nur dann möglich ist mit ''ffmpeg'' am Ende eine einzige zusammenhängende Filmdatei zu erhalten, wenn:
 +  - mit ''ffmpeg'' ein Film in einem Stück transkodiert wird, dafür sind nur die Ziel-Formate "MP4" oder "MKV" verwendbar;
 +  - um Werbepausen zu entfernen muss man den Film mit Werbung an allen Übergängen zwischen Film und Werbung zerteilen,
 +    - diese einzelnen Filmteile (zwischen den Werbepausen) sollte man im "MKV"-Format ablegen,
 +    - anschließend kann man diese Teile mit "mkvmerge" zu einem einzigen zusammenhängenden Film im MKV-Format zusamenfühgen;
 +    - benötigt man die Datei im MP4-Format, dann ist man z.Z. gezwungen diesen Film mit ffmpeg nocheinmal umzuwandeln, wobei darauf zu achten ist, dass jede einzelne benötigte Spur durch geeignete Optionen dem Programm (''ffmpeg'') bekannt gemacht wird
 +
 +
 +=== Beispiel mit FFmpeg + MKVmerge ===
 +
 +In diesem Beispiel werden wir nicht alle Tonspuren übernehmen und für Ton- und Untertitelspuren eine veränderte Reihenfolge festlegen:
 +  - => 1. Bildspur (''map 0:v'')
 +  - => 2. Tonspur (''map 0:a:1'') -> deutsch
 +  - => 1. Tonspur (''map 0:a:0'') -> englisch
 +  - => 6. Tonspur (''map 0:a:5'') -> englisch
 +  - => 4. Tonspur (''map 0:a:3'') -> französisch
 +  - => 8. Untertitelspur (''map 0:s:7'') -> deutsch
 +  - => 1. Untertitelspur (''map 0:s:0'') -> englisch
 +  - => 2. Untertitelspur (''map 0:s:1'') -> französisch
 +  - => 3. Untertitelspur (''map 0:s:2'')
 +  - => 4. Untertitelspur (''map 0:s:3'')
 +  - => 5. Untertitelspur (''map 0:s:4'')
 +  - => 6. Untertitelspur (''map 0:s:5'')
 +  - => 7. Untertitelspur (''map 0:s:6'')
 +  - => 9. Untertitelspur (''map 0:s:8'')
 +  - => 10. Untertitelspur (''map 0:s:9'')
 +  - => 11. Untertitelspur (''map 0:s:10'')
 +  - => 12. Untertitelspur (''map 0:s:11'')
 +  - => 13. Untertitelspur (''map 0:s:12'')
 +  - => 14. Untertitelspur (''map 0:s:13'') -> russisch
 +
 +ich möchte die Bildspur noch in einem ganz bestimmten Format haben und werde deshalb noch ein paar Optionen für den Video-Encoder übergeben (diese Parameter sind nicht zwingend nötig und müssen immer auf den jeweiligen Film neu abgestimmt werden => //das Skript [[https://github.com/FlatheadV8/Filmwandler/releases|Filmwandler]] tut das im Hintergrund automatisch//):
 +  > export AVC_OPTS="-profile:v high -preset veryslow -tune film -x264opts ref=4:b-pyramid=strict:bluray-compat=1:weightp=0:vbv-maxrate=17500:vbv-bufsize=17500:level=3.1:slices=1:b-adapt=2:direct=auto:colorprim=bt709:transfer=bt709:colormatrix=bt709:keyint=50:aud:subme=9:nal-hrd=vbr -crf 18 -vf scale=768x576,pad='max(iw\,ih*(4/3)):ow/(4/3):(ow-iw)/2:(oh-ih)/2',setsar='1/1' -keyint_min 2-8"
 +
 +auch setze ich aus Paranoia noch ein paar Optionen, die es ermöglichen einen beschädigten Film ggf. trotzdem zu bearbeiten, auch gebe ich deshalb die FPS-Zahl für das Quellmaterial (''-r 25'') an (diese Parameter sind nicht zwingend nötig):
 +  > export FF_OPTS="-nostdin -fflags +genpts"
 +
 +Mapping der Untertitel:
 +  > export MAP_UNT="-map 0:s:7 -c:s copy -map 0:s:0 -c:s copy -map 0:s:1 -c:s copy -map 0:s:2 -c:s copy -map 0:s:3 -c:s copy -map 0:s:4 -c:s copy -map 0:s:5 -c:s copy -map 0:s:6 -c:s copy -map 0:s:8 -c:s copy -map 0:s:9 -c:s copy -map 0:s:10 -c:s copy -map 0:s:11 -c:s copy -map 0:s:12 -c:s copy -map 0:s:13 -c:s copy"
 +
 +Beschriftung der Tonspuren (hier gilt die Reihenfolge wie sie in der Ziel-Datei existieren wird):
 +  > export META_TON="-metadata:s:a:0 language=deu -metadata:s:a:1 language=eng -metadata:s:a:2 language=eng -metadata:s:a:3 language=fra"
 +
 +Beschriftung der Untertitelspuren (hier gilt die Reihenfolge wie sie in der Ziel-Datei existieren wird):
 +  > export META_UNT="-metadata:s:s:0 language=deu -metadata:s:s:1 language=eng -metadata:s:s:2 language=fra -metadata:s:s:13 language=rus"
 +
 +ich habe einige Optionen in Variablen ausgelagert, um es (hoffentlich) etwas übersichtlicher darzustellen, man kann aber auch alles direkt in das Kommando packen
 +  > ffmpeg ${FF_OPTS} -r 25 -to 10 -i Untertiteltest.mpg -map 0:v -c:v libx264 ${AVC_OPTS} -map 0:a:1 -c:a libfdk_aac -b:a 160k -map 0:a:0 -c:a libfdk_aac -b:a 160k -map 0:a:5 -c:a libfdk_aac -b:a 160k -map 0:a:3 -c:a libfdk_aac -b:a 160k ${MAP_UNT} ${META_TON} ${META_UNT} -f matroska -y Untertiteltest_00.mkv
 +  > ffmpeg ${FF_OPTS} -r 25 -ss 10 -to 20 -i Untertiteltest.mpg -map 0:v -c:v libx264 ${AVC_OPTS} -map 0:a:1 -c:a libfdk_aac -b:a 160k -map 0:a:0 -c:a libfdk_aac -b:a 160k -map 0:a:5 -c:a libfdk_aac -b:a 160k -map 0:a:3 -c:a libfdk_aac -b:a 160k ${MAP_UNT} ${META_TON} ${META_UNT} -f matroska -y Untertiteltest_01.mkv
 +  > ffmpeg ${FF_OPTS} -r 25 -ss 20 -to 30 -i Untertiteltest.mpg -map 0:v -c:v libx264 ${AVC_OPTS} -map 0:a:1 -c:a libfdk_aac -b:a 160k -map 0:a:0 -c:a libfdk_aac -b:a 160k -map 0:a:5 -c:a libfdk_aac -b:a 160k -map 0:a:3 -c:a libfdk_aac -b:a 160k ${MAP_UNT} ${META_TON} ${META_UNT} -f matroska -y Untertiteltest_02.mkv
 +
 +jetzt liegen uns alle Einzelteile vor, die werden jetzt zusammengefühgt
 +  > mkvmerge -o Untertiteltest.mkv Untertiteltest_00.mkv + Untertiteltest_01.mkv + Untertiteltest_02.mkv
 +
 +nun haben wir den kompletten Film und benötigen die Einzelteile nicht mehr
 +  > rm Untertiteltest_00.mkv Untertiteltest_01.mkv Untertiteltest_02.mkv
 +
 +...wie wir sehen sind alle 19 Spuren vorhanden:
 +  > ffprobe -i Untertiteltest.mkv
 +  > mediainfo Untertiteltest.mkv
 +
 +Der erste Erfolg!
 +Jetzt liegt uns der Film im MKV-Format vor. Eigentlich sind das die gewünschten Filmausschnitte aneinandergereiht...
 +
 +Wollen wir den Film im MP4-Format haben, dann können wir ihn wie folgt umwandeln.
 +Zu beachten ist dabei, dass jede einzelne Spur mit einer "copy"-Option versehen wird. Es ist hier nicht möglich (wie in anderen Fällen), dass man eine "Sammeloption" (''-c copy'') verwendet.
 +
 +...bitte daran denken, dass jetzt alle Spuren bereits in der richtigen Reihenfolge vorliegen!
 +  > ffmpeg -i Untertiteltest.mkv -map 0:v -c:v copy -map 0:a:0 -c:a copy -map 0:a:1 -c:a copy -map 0:a:2 -c:a copy -map 0:a:3 -c:a copy -map 0:s:0 -c:s copy -map 0:s:1 -c:s copy -map 0:s:2 -c:s copy -map 0:s:3 -c:s copy -map 0:s:4 -c:s copy -map 0:s:5 -c:s copy -map 0:s:6 -c:s copy -map 0:s:7 -c:s copy -map 0:s:8 -c:s copy -map 0:s:9 -c:s copy -map 0:s:10 -c:s copy -map 0:s:11 -c:s copy -map 0:s:12 -c:s copy -map 0:s:13 -c:s copy -f mp4 -y Untertiteltest.mp4
 +
 +...wie wir sehen sind (immernoch) alle 19 Spuren vorhanden:
 +  > ffprobe -i Untertiteltest.mp4
 +  Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Untertiteltest.mp4':
 +    Metadata:
 +      major_brand     : isom
 +      minor_version   : 512
 +      compatible_brands: isomiso2avc1mp41
 +      encoder         : Lavf58.12.100
 +    Duration: 00:00:30.14, start: 0.000000, bitrate: 3644 kb/s
 +      Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 768x576 [SAR 1:1 DAR 4:3], 2868 kb/s, 24.88 fps, 25 tbr, 16k tbn, 50 tbc (default)
 +      Metadata:
 +        handler_name    : VideoHandler
 +      Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 160 kb/s (default)
 +      Metadata:
 +        handler_name    : SoundHandler
 +      Stream #0:2(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 160 kb/s
 +      Metadata:
 +        handler_name    : SoundHandler
 +      Stream #0:3(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 160 kb/s
 +      Metadata:
 +        handler_name    : SoundHandler
 +      Stream #0:4(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 160 kb/s
 +      Metadata:
 +        handler_name    : SoundHandler
 +      Stream #0:5(und): Subtitle: dvd_subtitle (mp4s / 0x7334706D), 720x576, 9 kb/s (default)
 +      Metadata:
 +        handler_name    : SubtitleHandler
 +      Stream #0:6(und): Subtitle: dvd_subtitle (mp4s / 0x7334706D), 720x576, 7 kb/s
 +      Metadata:
 +        handler_name    : SubtitleHandler
 +      Stream #0:7(und): Subtitle: dvd_subtitle (mp4s / 0x7334706D), 720x576, 8 kb/s
 +      Metadata:
 +        handler_name    : SubtitleHandler
 +      Stream #0:8(und): Subtitle: dvd_subtitle (mp4s / 0x7334706D), 720x576, 8 kb/s
 +      Metadata:
 +        handler_name    : SubtitleHandler
 +      Stream #0:9(und): Subtitle: dvd_subtitle (mp4s / 0x7334706D), 720x576, 7 kb/s
 +      Metadata:
 +        handler_name    : SubtitleHandler
 +      Stream #0:10(und): Subtitle: dvd_subtitle (mp4s / 0x7334706D), 720x576, 8 kb/s
 +      Metadata:
 +        handler_name    : SubtitleHandler
 +      Stream #0:11(und): Subtitle: dvd_subtitle (mp4s / 0x7334706D), 720x576, 8 kb/s
 +      Metadata:
 +        handler_name    : SubtitleHandler
 +      Stream #0:12(und): Subtitle: dvd_subtitle (mp4s / 0x7334706D), 720x576, 8 kb/s
 +      Metadata:
 +        handler_name    : SubtitleHandler
 +      Stream #0:13(und): Subtitle: dvd_subtitle (mp4s / 0x7334706D), 720x576, 8 kb/s
 +      Metadata:
 +        handler_name    : SubtitleHandler
 +      Stream #0:14(und): Subtitle: dvd_subtitle (mp4s / 0x7334706D), 720x576, 8 kb/s
 +      Metadata:
 +        handler_name    : SubtitleHandler
 +      Stream #0:15(und): Subtitle: dvd_subtitle (mp4s / 0x7334706D), 720x576, 8 kb/s
 +      Metadata:
 +        handler_name    : SubtitleHandler
 +      Stream #0:16(und): Subtitle: dvd_subtitle (mp4s / 0x7334706D), 720x576, 10 kb/s
 +      Metadata:
 +        handler_name    : SubtitleHandler
 +      Stream #0:17(und): Subtitle: dvd_subtitle (mp4s / 0x7334706D), 720x576, 7 kb/s
 +      Metadata:
 +        handler_name    : SubtitleHandler
 +      Stream #0:18(und): Subtitle: dvd_subtitle (mp4s / 0x7334706D), 720x576, 7 kb/s
 +      Metadata:
 +        handler_name    : SubtitleHandler
 +
 +  > mediainfo Untertiteltest.mp4
 +
 +<file text mediainfo Untertiteltest.mp4>
 +General
 +Complete name                            : Untertiteltest.mp4
 +Format                                   : MPEG-4
 +Format profile                           : Base Media
 +Codec ID                                 : isom (isom/iso2/avc1/mp41)
 +File size                                : 13.1 MiB
 +Duration                                 : 30 s 144 ms
 +Overall bit rate mode                    : Variable
 +Overall bit rate                         : 3 645 kb/s
 +Writing application                      : Lavf58.12.100
 +
 +Video
 +ID                                       : 1
 +Format                                   : AVC
 +Format/Info                              : Advanced Video Codec
 +Format profile                           : High@L3.1
 +Format settings                          : CABAC / 3 Ref Frames
 +Format settings, CABAC                   : Yes
 +Format settings, ReFrames                : 3 frames
 +Codec ID                                 : avc1
 +Codec ID/Info                            : Advanced Video Coding
 +Duration                                 : 30 s 139 ms
 +Bit rate mode                            : Variable
 +Bit rate                                 : 2 869 kb/s
 +Maximum bit rate                         : 17.5 Mb/s
 +Width                                    : 768 pixels
 +Height                                   : 576 pixels
 +Display aspect ratio                     : 4:3
 +Frame rate mode                          : Variable
 +Frame rate                               : 24.885 FPS
 +Minimum frame rate                       : 12.048 FPS
 +Maximum frame rate                       : 34.483 FPS
 +Color space                              : YUV
 +Chroma subsampling                       : 4:2:0
 +Bit depth                                : 8 bits
 +Scan type                                : Progressive
 +Bits/(Pixel*Frame)                       : 0.261
 +Stream size                              : 10.3 MiB (79%)
 +Writing library                          : x264 core 155
 +Encoding settings                        : cabac=1 / ref=4 / deblock=1:-1:-1 / analyse=0x3:0x133 / me=umh / subme=9 / psy=1 / psy_rd=1.00:0.15 / mixed_ref=1 / me_range=24 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-3 / threads=6 / lookahead_threads=1 / sliced_threads=0 / slices=1 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=1 / constrained_intra=0 / bframes=3 / b_pyramid=1 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=0 / keyint=50 / keyint_min=1 / scenecut=40 / intra_refresh=0 / rc_lookahead=50 / rc=crf / mbtree=1 / crf=18.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / vbv_maxrate=17500 / vbv_bufsize=17500 / crf_max=0.0 / nal_hrd=vbr / filler=0 / ip_ratio=1.40 / aq=1:1.00
 +Color range                              : Limited
 +Color primaries                          : BT.709
 +Transfer characteristics                 : BT.709
 +Matrix coefficients                      : BT.709
 +Codec configuration box                  : avcC
 +
 +Audio #1
 +ID                                       : 2
 +Format                                   : AAC LC
 +Format/Info                              : Advanced Audio Codec Low Complexity
 +Codec ID                                 : mp4a-40-2
 +Duration                                 : 30 s 144 ms
 +Bit rate mode                            : Constant
 +Bit rate                                 : 160 kb/s
 +Channel(s)                               : 1 channel
 +Channel layout                           : C
 +Sampling rate                            : 48.0 kHz
 +Frame rate                               : 46.875 FPS (1024 SPF)
 +Compression mode                         : Lossy
 +Stream size                              : 589 KiB (4%)
 +Default                                  : Yes
 +Alternate group                          : 1
 +
 +Audio #2
 +ID                                       : 3
 +Format                                   : AAC LC
 +Format/Info                              : Advanced Audio Codec Low Complexity
 +Codec ID                                 : mp4a-40-2
 +Duration                                 : 30 s 144 ms
 +Bit rate mode                            : Constant
 +Bit rate                                 : 160 kb/s
 +Channel(s)                               : 1 channel
 +Channel layout                           : C
 +Sampling rate                            : 48.0 kHz
 +Frame rate                               : 46.875 FPS (1024 SPF)
 +Compression mode                         : Lossy
 +Stream size                              : 589 KiB (4%)
 +Default                                  : No
 +Alternate group                          : 1
 +
 +Audio #3
 +ID                                       : 4
 +Format                                   : AAC LC
 +Format/Info                              : Advanced Audio Codec Low Complexity
 +Codec ID                                 : mp4a-40-2
 +Duration                                 : 30 s 144 ms
 +Bit rate mode                            : Constant
 +Bit rate                                 : 160 kb/s
 +Channel(s)                               : 1 channel
 +Channel layout                           : C
 +Sampling rate                            : 48.0 kHz
 +Frame rate                               : 46.875 FPS (1024 SPF)
 +Compression mode                         : Lossy
 +Stream size                              : 589 KiB (4%)
 +Default                                  : No
 +Alternate group                          : 1
 +
 +Audio #4
 +ID                                       : 5
 +Format                                   : AAC LC
 +Format/Info                              : Advanced Audio Codec Low Complexity
 +Codec ID                                 : mp4a-40-2
 +Duration                                 : 30 s 144 ms
 +Bit rate mode                            : Constant
 +Bit rate                                 : 160 kb/s
 +Channel(s)                               : 1 channel
 +Channel layout                           : C
 +Sampling rate                            : 48.0 kHz
 +Frame rate                               : 46.875 FPS (1024 SPF)
 +Compression mode                         : Lossy
 +Stream size                              : 589 KiB (4%)
 +Default                                  : No
 +Alternate group                          : 1
 +
 +Text #1
 +ID                                       : 6
 +Format                                   : VobSub
 +Codec ID                                 : mp4s-E0
 +Codec ID/Info                            : The same subtitle format used on DVDs
 +Duration                                 : 28 s 798 ms
 +Bit rate mode                            : Constant
 +Bit rate                                 : 9 460 b/s
 +Stream size                              : 33.3 KiB (0%)
 +Default                                  : Yes
 +Forced                                   : No
 +Alternate group                          : 3
 +
 +Text #2
 +ID                                       : 7
 +Format                                   : VobSub
 +Codec ID                                 : mp4s-E0
 +Codec ID/Info                            : The same subtitle format used on DVDs
 +Duration                                 : 28 s 798 ms
 +Bit rate mode                            : Constant
 +Bit rate                                 : 7 888 b/s
 +Stream size                              : 27.7 KiB (0%)
 +Default                                  : No
 +Forced                                   : No
 +Alternate group                          : 3
 +
 +Text #3
 +ID                                       : 8
 +Format                                   : VobSub
 +Codec ID                                 : mp4s-E0
 +Codec ID/Info                            : The same subtitle format used on DVDs
 +Duration                                 : 28 s 798 ms
 +Bit rate mode                            : Constant
 +Bit rate                                 : 8 817 b/s
 +Stream size                              : 31.0 KiB (0%)
 +Default                                  : No
 +Forced                                   : No
 +Alternate group                          : 3
 +
 +Text #4
 +ID                                       : 9
 +Format                                   : VobSub
 +Codec ID                                 : mp4s-E0
 +Codec ID/Info                            : The same subtitle format used on DVDs
 +Duration                                 : 28 s 798 ms
 +Bit rate mode                            : Constant
 +Bit rate                                 : 8 129 b/s
 +Stream size                              : 28.6 KiB (0%)
 +Default                                  : No
 +Forced                                   : No
 +Alternate group                          : 3
 +
 +Text #5
 +ID                                       : 10
 +Format                                   : VobSub
 +Codec ID                                 : mp4s-E0
 +Codec ID/Info                            : The same subtitle format used on DVDs
 +Duration                                 : 28 s 798 ms
 +Bit rate mode                            : Constant
 +Bit rate                                 : 7 499 b/s
 +Stream size                              : 26.4 KiB (0%)
 +Default                                  : No
 +Forced                                   : No
 +Alternate group                          : 3
 +
 +Text #6
 +ID                                       : 11
 +Format                                   : VobSub
 +Codec ID                                 : mp4s-E0
 +Codec ID/Info                            : The same subtitle format used on DVDs
 +Duration                                 : 28 s 798 ms
 +Bit rate mode                            : Constant
 +Bit rate                                 : 8 708 b/s
 +Stream size                              : 30.6 KiB (0%)
 +Default                                  : No
 +Forced                                   : No
 +Alternate group                          : 3
 +
 +Text #7
 +ID                                       : 12
 +Format                                   : VobSub
 +Codec ID                                 : mp4s-E0
 +Codec ID/Info                            : The same subtitle format used on DVDs
 +Duration                                 : 28 s 798 ms
 +Bit rate mode                            : Constant
 +Bit rate                                 : 8 047 b/s
 +Stream size                              : 28.3 KiB (0%)
 +Default                                  : No
 +Forced                                   : No
 +Alternate group                          : 3
 +
 +Text #8
 +ID                                       : 13
 +Format                                   : VobSub
 +Codec ID                                 : mp4s-E0
 +Codec ID/Info                            : The same subtitle format used on DVDs
 +Duration                                 : 28 s 798 ms
 +Bit rate mode                            : Constant
 +Bit rate                                 : 8 620 b/s
 +Stream size                              : 30.3 KiB (0%)
 +Default                                  : No
 +Forced                                   : No
 +Alternate group                          : 3
 +
 +Text #9
 +ID                                       : 14
 +Format                                   : VobSub
 +Codec ID                                 : mp4s-E0
 +Codec ID/Info                            : The same subtitle format used on DVDs
 +Duration                                 : 28 s 798 ms
 +Bit rate mode                            : Constant
 +Bit rate                                 : 8 112 b/s
 +Stream size                              : 28.5 KiB (0%)
 +Default                                  : No
 +Forced                                   : No
 +Alternate group                          : 3
 +
 +Text #10
 +ID                                       : 15
 +Format                                   : VobSub
 +Codec ID                                 : mp4s-E0
 +Codec ID/Info                            : The same subtitle format used on DVDs
 +Duration                                 : 28 s 798 ms
 +Bit rate mode                            : Constant
 +Bit rate                                 : 8 499 b/s
 +Stream size                              : 29.9 KiB (0%)
 +Default                                  : No
 +Forced                                   : No
 +Alternate group                          : 3
 +
 +Text #11
 +ID                                       : 16
 +Format                                   : VobSub
 +Codec ID                                 : mp4s-E0
 +Codec ID/Info                            : The same subtitle format used on DVDs
 +Duration                                 : 28 s 798 ms
 +Bit rate mode                            : Constant
 +Bit rate                                 : 8 946 b/s
 +Stream size                              : 31.4 KiB (0%)
 +Default                                  : No
 +Forced                                   : No
 +Alternate group                          : 3
 +
 +Text #12
 +ID                                       : 17
 +Format                                   : VobSub
 +Codec ID                                 : mp4s-E0
 +Codec ID/Info                            : The same subtitle format used on DVDs
 +Duration                                 : 28 s 798 ms
 +Bit rate mode                            : Constant
 +Bit rate                                 : 10.1 kb/s
 +Stream size                              : 35.6 KiB (0%)
 +Default                                  : No
 +Forced                                   : No
 +Alternate group                          : 3
 +
 +Text #13
 +ID                                       : 18
 +Format                                   : VobSub
 +Codec ID                                 : mp4s-E0
 +Codec ID/Info                            : The same subtitle format used on DVDs
 +Duration                                 : 28 s 798 ms
 +Bit rate mode                            : Constant
 +Bit rate                                 : 7 988 b/s
 +Stream size                              : 28.1 KiB (0%)
 +Default                                  : No
 +Forced                                   : No
 +Alternate group                          : 3
 +
 +Text #14
 +ID                                       : 19
 +Format                                   : VobSub
 +Codec ID                                 : mp4s-E0
 +Codec ID/Info                            : The same subtitle format used on DVDs
 +Duration                                 : 28 s 798 ms
 +Bit rate mode                            : Constant
 +Bit rate                                 : 7 720 b/s
 +Stream size                              : 27.1 KiB (0%)
 +Default                                  : No
 +Forced                                   : No
 +Alternate group                          : 3
 +</file>
 +
 +Zu beachten ist, dass ich das Bildformat geändert habe und das der Untertitel scheinbar auch ein Format besitzt, welches hier aber nicht geändert wurde.
 +Dadurch kann es sein, dass der Untertitel im neuen Film etwas verschoben ist.
 +