Guten Morgen!
Ich möchte gern die comskip Daten als Kapitelmarker in die .mkv Dateien einbetten. Die Aufnahme stammt vom tvheadend42.
Dazu habe ich das .edl File in das FMETADATA1 Format für ffmpeg konvertiert (basierend auf dem Skript comchap.sh
Code: in.ffmeta
;FFMETADATA1
[CHAPTER]
TIMEBASE=1/1000
START=0
END=556440
title=Chapter 1
[CHAPTER]
TIMEBASE=1/1000
START=556440
END=612560
title=Commercial 1
[CHAPTER]
TIMEBASE=1/1000
START=612560
END=1714280
title=Chapter 2
[CHAPTER]
TIMEBASE=1/1000
START=1714280
END=2108640
title=Commercial 2
[CHAPTER]
TIMEBASE=1/1000
START=2108640
END=3704560
title=Chapter 3
[CHAPTER]
TIMEBASE=1/1000
START=3704560
END=4033720
title=Commercial 3
[CHAPTER]
TIMEBASE=1/1000
START=4033720
END=5288200
title=Chapter 4
[CHAPTER]
TIMEBASE=1/1000
START=5288200
END=5653160
title=Commercial 4
[CHAPTER]
TIMEBASE=1/1000
START=5653160
END=7077960
title=Chapter 5
[CHAPTER]
TIMEBASE=1/1000
START=7077960
END=7149840
title=Commercial 5
[CHAPTER]
TIMEBASE=1/1000
START=7149840
END=7671710
title=Chapter 6
Alles anzeigen
Nun rufe ich ffmpeg auf:
Code
MediaPC:~/temp # ffmpeg -loglevel level+verbose -i in.mkv -i in.ffmeta -map_metadata -1 -codec copy -y out.mkv
[info] ffmpeg version 4.2.1 Copyright (c) 2000-2019 the FFmpeg developers
[info] built with gcc 8.3.0 (GCC)
[info] configuration: --enable-ffmpeg --disable-ffplay --enable-ffprobe --enable-static --disable-shared --enable-gpl --disable-doc --enable-encoder=h264_vaapi --enable-encoder=hevc_vaapi --enable-encoder=mjpeg_vaapi --enable-encoder=mpeg2_vaapi --enable-encoder=vp8_vaapi --enable-encoder=vp9_vaapi --disable-encoder=h264_nvenc --disable-encoder=hevc_nvenc --enable-hwaccel=h263_vaapi --enable-hwaccel=h264_vaapi --enable-hwaccel=hevc_vaapi --enable-hwaccel=mjpeg_vaapi --enable-hwaccel=mpeg2_vaapi --enable-hwaccel=mpeg4_vaapi --enable-hwaccel=vc1_vaapi --enable-hwaccel=vp8_vaapi --enable-hwaccel=vp9_vaapi --enable-hwaccel=wmv3_vaapi --enable-avresample --disable-lzma --disable-alsa --enable-libxcb --enable-libxcb-shm --enable-libxcb-xfixes --enable-libxcb-shape --arch=x86_64 --cpu=x86-64 --cross-prefix=/var/lib/jenkins/LE/build4/workspace/Addons/All_Add-ons/build.LibreELEC-Generic.x86_64-9.1-devel/toolchain/bin/x86_64-libreelec-linux-gnu- --enable-cross-compile --sysroot=/var/lib/jenkins/LE/build4/workspace/Addons/All_Add-ons/build.LibreELEC-Generic.x86_64-9.1-devel/toolchain/x86_64-libreelec-linux-gnu/sysroot --sysinclude=/var/lib/jenkins/LE/build4/workspace/Addons/All_Add-ons/build.LibreELEC-Generic.x86_64-9.1-devel/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/include --target-os=linux --nm=/var/lib/jenkins/LE/build4/workspace/Addons/All_Add-ons/build.LibreELEC-Generic.x86_64-9.1-devel/toolchain/bin/x86_64-libreelec-linux-gnu-nm --ar=/var/lib/jenkins/LE/build4/workspace/Addons/All_Add-ons/build.LibreELEC-Generic.x86_64-9.1-devel/toolchain/bin/x86_64-libreelec-linux-gnu-ar --as=/var/lib/jenkins/LE/build4/workspace/Addons/All_Add-ons/build.LibreELEC-Generic.x86_64-9.1-devel/toolchain/bin/x86_64-libreelec-linux-gnu-gcc --cc=/var/lib/jenkins/LE/build4/workspace/Addons/All_Add-ons/build.LibreELEC-Generic.x86_64-9.1-devel/toolchain/bin/x86_64-libreelec-linux-gnu-gcc --ld=/var/lib/jenkins/LE/build4/workspace/Addons/All_Add-ons/build.LibreELEC-Generic.x86_64-9.1-devel/toolchain/bin/x86_64-libreelec-linux-gnu-gcc --pkg-config=/var/lib/jenkins/LE/build4/workspace/Addons/All_Add-ons/build.LibreELEC-Generic.x86_64-9.1-devel/toolchain/bin/pkg-config --host-cc=/var/lib/jenkins/LE/build4/workspace/Addons/All_Add-ons/build.LibreELEC-Generic.x86_64-9.1-devel/toolchain/bin/host-gcc --host-cflags='-march=native -O2 -Wall -pipe -I/var/lib/jenkins/LE/build4/workspace/Addons/All_Add-ons/build.LibreELEC-Generic.x86_64-9.1-devel/toolchain/include -Wno-format-security' --host-ldflags='-Wl,-rpath,/var/lib/jenkins/LE/build4/workspace/Addons/All_Add-ons/build.LibreELEC-Generic.x86_64-9.1-devel/toolchain/lib -L/var/lib/jenkins/LE/build4/workspace/Addons/All_Add-ons/build.LibreELEC-Generic.x86_64-9.1-devel/toolchain/lib' --host-extralibs=-lm --extra-cflags='-march=x86-64 -m64 -mmmx -msse -msse2 -mfpmath=sse -fomit-frame-pointer -Wall -pipe -Os -I/var/lib/jenkins/LE/build4/workspace/Addons/All_Add-ons/build.LibreELEC-Generic.x86_64-9.1-devel/gnutls-3.6.10/.INSTALL_PKG/usr/include' --extra-ldflags='-march=x86-64 -m64 -Wl,--as-needed -L/var/lib/jenkins/LE/build4/workspace/Addons/All_Add-ons/build.LibreELEC-Generic.x86_64-9.1-devel/gnutls-3.6.10/.INSTALL_PKG/usr/lib' --extra-libs=' -lX11' --enable-pic --enable-gnutls --disable-openssl --disable-hardcoded-tables
[info] libavutil 56. 31.100 / 56. 31.100
[info] libavcodec 58. 54.100 / 58. 54.100
[info] libavformat 58. 29.100 / 58. 29.100
[info] libavdevice 58. 8.100 / 58. 8.100
[info] libavfilter 7. 57.100 / 7. 57.100
[info] libavresample 4. 0. 0 / 4. 0. 0
[info] libswscale 5. 5.100 / 5. 5.100
[info] libswresample 3. 5.100 / 3. 5.100
[info] libpostproc 55. 5.100 / 55. 5.100
[info] Input #0, matroska,webm, from 'in.mkv':
[info] Metadata:
[info] ENCODER : Lavf58.29.100
[info] Duration: 02:07:51.71, start: 0.000000, bitrate: 3977 kb/s
[info] Chapter #0:0: start 0.000000, end 7078.153000
[info] Chapter #0:1: start 7078.153000, end 7671.713000
[info] Stream #0:0(eng): Video: mpeg2video (Main), 1 reference frame, yuv420p(tv, top first, left), 720x576 [SAR 64:45 DAR 16:9], 25 fps, 25 tbr, 1k tbn, 50 tbc (default)
[info] Metadata:
[info] DURATION : 02:07:51.713000000
[info] Stream #0:1(ger): Audio: mp2, 48000 Hz, stereo, s16p, 192 kb/s (default)
[info] Metadata:
[info] DURATION : 02:07:51.432000000
[info] Stream #0:2(ger): Subtitle: subrip (default)
[info] Metadata:
[info] DURATION : 00:00:00.000000000
[info] Input #1, ffmetadata, from 'in.ffmeta':
[info] Duration: 02:07:51.71, start: 0.000000, bitrate: N/A
[info] Chapter #1:0: start 0.000000, end 556.440000
[info] Metadata:
[info] title : Chapter 1
[info] Chapter #1:1: start 556.440000, end 612.560000
[info] Metadata:
[info] title : Commercial 1
[info] Chapter #1:2: start 612.560000, end 1714.280000
[info] Metadata:
[info] title : Chapter 2
[info] Chapter #1:3: start 1714.280000, end 2108.640000
[info] Metadata:
[info] title : Commercial 2
[info] Chapter #1:4: start 2108.640000, end 3704.560000
[info] Metadata:
[info] title : Chapter 3
[info] Chapter #1:5: start 3704.560000, end 4033.720000
[info] Metadata:
[info] title : Commercial 3
[info] Chapter #1:6: start 4033.720000, end 5288.200000
[info] Metadata:
[info] title : Chapter 4
[info] Chapter #1:7: start 5288.200000, end 5653.160000
[info] Metadata:
[info] title : Commercial 4
[info] Chapter #1:8: start 5653.160000, end 7077.960000
[info] Metadata:
[info] title : Chapter 5
[info] Chapter #1:9: start 7077.960000, end 7149.840000
[info] Metadata:
[info] title : Commercial 5
[info] Chapter #1:10: start 7149.840000, end 7671.710000
[info] Metadata:
[info] title : Chapter 6
[info] Output #0, matroska, to 'out.mkv':
[info] Metadata:
[info] encoder : Lavf58.29.100
[info] Chapter #0:0: start 0.000000, end 7078.153000
[info] Chapter #0:1: start 7078.153000, end 7671.713000
[info] Stream #0:0: Video: mpeg2video (Main), 1 reference frame (mpg2 / 0x3267706D), yuv420p(tv, top first, left), 720x576 (0x0) [SAR 64:45 DAR 16:9], q=2-31, 25 fps, 25 tbr, 1k tbn, 1k tbc (default)
[info] Stream #0:1: Audio: mp2 (P[0][0][0] / 0x0050), 48000 Hz, stereo, s16p, 192 kb/s (default)
[info] Stream #0:2: Subtitle: subrip (default)
[info] Stream mapping:
[info] Stream #0:0 -> #0:0 (copy)
[info] Stream #0:1 -> #0:1 (copy)
[info] Stream #0:2 -> #0:2 (copy)
[info] Press [q] to stop, [?] for help
[verbose] No more output streams to write to, finishing.=02:02:39.35 bitrate=4007.6kbits/s speed= 340x
[info] frame=191782 fps=8681 q=-1.0 Lsize= 3724679kB time=02:07:51.55 bitrate=3977.4kbits/s speed= 347x
[info] video:3540681kB audio:179799kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.112847%
[verbose] Input file #0 (in.mkv):
[verbose] Input stream #0:0 (video): 191782 packets read (3625657706 bytes);
[verbose] Input stream #0:1 (audio): 319643 packets read (184114368 bytes);
[verbose] Input stream #0:2 (subtitle): 0 packets read (0 bytes);
[verbose] Total: 511425 packets (3809772074 bytes) demuxed
[verbose] Input file #1 (in.ffmeta):
[verbose] Total: 0 packets (0 bytes) demuxed
[verbose] Output file #0 (out.mkv):
[verbose] Output stream #0:0 (video): 191782 packets muxed (3625657706 bytes);
[verbose] Output stream #0:1 (audio): 319643 packets muxed (184114368 bytes);
[verbose] Output stream #0:2 (subtitle): 0 packets muxed (0 bytes);
[verbose] Total: 511425 packets (3809772074 bytes) muxed
[AVIOContext @ 0x3d4b200] [verbose] Statistics: 8 seeks, 21586 writeouts
[AVIOContext @ 0x3d41500] [verbose] Statistics: 3813725254 bytes read, 1 seeks
[AVIOContext @ 0x3d5eec0] [verbose] Statistics: 766 bytes read, 0 seeks
MediaPC:~/temp #
Alles anzeigen
Die Kapiteldaten werden offenbar korrekt erkannt, aber leider nicht ins Outputfile übernommen:
Code
MediaPC:~/temp # ffprobe -show_chapters out.mkv
ffprobe version 4.2.1 Copyright (c) 2007-2019 the FFmpeg developers
built with gcc 8.3.0 (GCC)
configuration: --enable-ffmpeg --disable-ffplay --enable-ffprobe --enable-static --disable-shared --enable-gpl --disable-doc --enable-encoder=h264_vaapi --enable-encoder=hevc_vaapi --enable-encoder=mjpeg_vaapi --enable-encoder=mpeg2_vaapi --enable-encoder=vp8_vaapi --enable-encoder=vp9_vaapi --disable-encoder=h264_nvenc --disable-encoder=hevc_nvenc --enable-hwaccel=h263_vaapi --enable-hwaccel=h264_vaapi --enable-hwaccel=hevc_vaapi --enable-hwaccel=mjpeg_vaapi --enable-hwaccel=mpeg2_vaapi --enable-hwaccel=mpeg4_vaapi --enable-hwaccel=vc1_vaapi --enable-hwaccel=vp8_vaapi --enable-hwaccel=vp9_vaapi --enable-hwaccel=wmv3_vaapi --enable-avresample --disable-lzma --disable-alsa --enable-libxcb --enable-libxcb-shm --enable-libxcb-xfixes --enable-libxcb-shape --arch=x86_64 --cpu=x86-64 --cross-prefix=/var/lib/jenkins/LE/build4/workspace/Addons/All_Add-ons/build.LibreELEC-Generic.x86_64-9.1-devel/toolchain/bin/x86_64-libreelec-linux-gnu- --enable-cross-compile --sysroot=/var/lib/jenkins/LE/build4/workspace/Addons/All_Add-ons/build.LibreELEC-Generic.x86_64-9.1-devel/toolchain/x86_64-libreelec-linux-gnu/sysroot --sysinclude=/var/lib/jenkins/LE/build4/workspace/Addons/All_Add-ons/build.LibreELEC-Generic.x86_64-9.1-devel/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/include --target-os=linux --nm=/var/lib/jenkins/LE/build4/workspace/Addons/All_Add-ons/build.LibreELEC-Generic.x86_64-9.1-devel/toolchain/bin/x86_64-libreelec-linux-gnu-nm --ar=/var/lib/jenkins/LE/build4/workspace/Addons/All_Add-ons/build.LibreELEC-Generic.x86_64-9.1-devel/toolchain/bin/x86_64-libreelec-linux-gnu-ar --as=/var/lib/jenkins/LE/build4/workspace/Addons/All_Add-ons/build.LibreELEC-Generic.x86_64-9.1-devel/toolchain/bin/x86_64-libreelec-linux-gnu-gcc --cc=/var/lib/jenkins/LE/build4/workspace/Addons/All_Add-ons/build.LibreELEC-Generic.x86_64-9.1-devel/toolchain/bin/x86_64-libreelec-linux-gnu-gcc --ld=/var/lib/jenkins/LE/build4/workspace/Addons/All_Add-ons/build.LibreELEC-Generic.x86_64-9.1-devel/toolchain/bin/x86_64-libreelec-linux-gnu-gcc --pkg-config=/var/lib/jenkins/LE/build4/workspace/Addons/All_Add-ons/build.LibreELEC-Generic.x86_64-9.1-devel/toolchain/bin/pkg-config --host-cc=/var/lib/jenkins/LE/build4/workspace/Addons/All_Add-ons/build.LibreELEC-Generic.x86_64-9.1-devel/toolchain/bin/host-gcc --host-cflags='-march=native -O2 -Wall -pipe -I/var/lib/jenkins/LE/build4/workspace/Addons/All_Add-ons/build.LibreELEC-Generic.x86_64-9.1-devel/toolchain/include -Wno-format-security' --host-ldflags='-Wl,-rpath,/var/lib/jenkins/LE/build4/workspace/Addons/All_Add-ons/build.LibreELEC-Generic.x86_64-9.1-devel/toolchain/lib -L/var/lib/jenkins/LE/build4/workspace/Addons/All_Add-ons/build.LibreELEC-Generic.x86_64-9.1-devel/toolchain/lib' --host-extralibs=-lm --extra-cflags='-march=x86-64 -m64 -mmmx -msse -msse2 -mfpmath=sse -fomit-frame-pointer -Wall -pipe -Os -I/var/lib/jenkins/LE/build4/workspace/Addons/All_Add-ons/build.LibreELEC-Generic.x86_64-9.1-devel/gnutls-3.6.10/.INSTALL_PKG/usr/include' --extra-ldflags='-march=x86-64 -m64 -Wl,--as-needed -L/var/lib/jenkins/LE/build4/workspace/Addons/All_Add-ons/build.LibreELEC-Generic.x86_64-9.1-devel/gnutls-3.6.10/.INSTALL_PKG/usr/lib' --extra-libs=' -lX11' --enable-pic --enable-gnutls --disable-openssl --disable-hardcoded-tables
libavutil 56. 31.100 / 56. 31.100
libavcodec 58. 54.100 / 58. 54.100
libavformat 58. 29.100 / 58. 29.100
libavdevice 58. 8.100 / 58. 8.100
libavfilter 7. 57.100 / 7. 57.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 5.100 / 5. 5.100
libswresample 3. 5.100 / 3. 5.100
libpostproc 55. 5.100 / 55. 5.100
Input #0, matroska,webm, from 'out.mkv':
Metadata:
ENCODER : Lavf58.29.100
Duration: 02:07:51.71, start: 0.000000, bitrate: 3977 kb/s
Chapter #0:0: start 0.000000, end 7078.153000
Chapter #0:1: start 7078.153000, end 7671.713000
Stream #0:0: Video: mpeg2video (Main), yuv420p(tv, top first), 720x576 [SAR 64:45 DAR 16:9], 25 fps, 25 tbr, 1k tbn, 50 tbc (default)
Metadata:
DURATION : 02:07:51.713000000
Stream #0:1: Audio: mp2, 48000 Hz, stereo, s16p, 192 kb/s (default)
Metadata:
DURATION : 02:07:51.432000000
Stream #0:2: Subtitle: subrip (default)
Metadata:
DURATION : 00:00:00.000000000
[CHAPTER]
id=1
time_base=1/1000000000
start=0
start_time=0.000000
end=7078153000000
end_time=7078.153000
[/CHAPTER]
[CHAPTER]
id=2
time_base=1/1000000000
start=7078153000000
start_time=7078.153000
end=7671713000000
end_time=7671.713000
[/CHAPTER]
MediaPC:~/temp #
Alles anzeigen
Eine Fehlermeldung konnte ich auch nicht entdecken - Hat jemand eine Idee, warum das nicht funktioniert?
Vielen Dank & Schönen Sonntag!
Thomas