[FFmpeg-user] Naming chapters in Matroska video

Ulf Zibis Ulf.Zibis at CoSoCo.de
Wed Feb 17 00:45:29 EET 2021


Am 16.02.21 um 23:20 schrieb Paul B Mahol:
>> , ... I still don't see the named chapters.
>>
>> How to correctly add chapter names?
>>
> I used .ffmeta as extension for metadata and it worked fine.

With .ffmeta I get this:

$ ffmpeg -i INPUT.mkv -i INPUT.ffmeta -map_metadata 1 -c copy OUTPUT.mkv
ffmpeg version 4.3.1-static https://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2020 the FFmpeg developers
   built with gcc 8 (Debian 8.3.0-6)
   configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg
   libavutil      56. 51.100 / 56. 51.100
   libavcodec     58. 91.100 / 58. 91.100
   libavformat    58. 45.100 / 58. 45.100
   libavdevice    58. 10.100 / 58. 10.100
   libavfilter     7. 85.100 /  7. 85.100
   libswscale      5.  7.100 /  5.  7.100
   libswresample   3.  7.100 /  3.  7.100
   libpostproc    55.  7.100 / 55.  7.100
Input #0, matroska,webm, from 'INPUT.mkv':
   Metadata:
     SOURCE_TYPE     : dvd
     ENCODER         : Lavf58.12.100
   Duration: 01:31:56.24, start: 0.110000, bitrate: 3011 kb/s
     Chapter #0:0: start 0.000000, end 11.021556
     Chapter #0:1: start 11.021556, end 819.335778
     Chapter #0:2: start 819.335778, end 1839.479956
     Chapter #0:3: start 1839.479956, end 2689.600133
     Chapter #0:4: start 2689.600133, end 3289.684978
     Chapter #0:5: start 3289.684978, end 4584.868089
     Chapter #0:6: start 4584.868089, end 5516.129689
     Stream #0:0: Video: h264 (High), yuv420p(progressive), 720x576 [SAR 16:15 DAR 4:3], 25 fps, 25 tbr, 1k tbn, 50 tbc (default)
     Metadata:
       ENCODER         : Lavc58.18.100 libx264
       DURATION        : 01:31:56.240000000
     Stream #0:1(deu): Audio: vorbis, 48000 Hz, stereo, fltp (default)
     Metadata:
       LANGUAGE-ISO639_2: deu
       LANGUAGE-SIMPLE : Deutsch
       LANGUAGE-DESCRIPTION: Deutsch
       ENCODER         : Lavc58.18.100 libvorbis
       DURATION        : 01:31:56.241000000
Input #1, ffmetadata, from 'INPUT.ffmeta':
   Metadata:
     SOURCE_TYPE     : dvd
     encoder         : Lavf58.45.100
   Duration: 01:31:56.02, start: 0.000000, bitrate: 0 kb/s
     Chapter #1:0: start 0.000000, end 10.911556
     Chapter #1:1: start 10.911556, end 819.225778
     Metadata:
       title           : 1 - Intro
     Chapter #1:2: start 819.225778, end 1839.369956
     Metadata:
       title           : 2 - Restaurant
     Chapter #1:3: start 1839.369956, end 2689.490133
     Metadata:
       title           : 3 - At home
     Chapter #1:4: start 2689.490133, end 3289.574978
     Chapter #1:5: start 3289.574978, end 4584.758089
     Chapter #1:6: start 4584.758089, end 5516.019689
Output #0, matroska, to 'OUTPUTr.mkv':
   Metadata:
     SOURCE_TYPE     : dvd
     encoder         : Lavf58.45.100
     Chapter #0:0: start 0.000000, end 10.911556
     Chapter #0:1: start 10.911556, end 819.225778
     Chapter #0:2: start 819.225778, end 1839.369956
     Chapter #0:3: start 1839.369956, end 2689.490133
     Chapter #0:4: start 2689.490133, end 3289.574978
     Chapter #0:5: start 3289.574978, end 4584.758089
     Chapter #0:6: start 4584.758089, end 5516.019689
     Stream #0:0: Video: h264 (High) (H264 / 0x34363248), yuv420p(progressive), 720x576 [SAR 16:15 DAR 4:3], q=2-31, 25 fps, 25 tbr, 1k tbn, 1k tbc (default)
     Metadata:
       ENCODER         : Lavc58.18.100 libx264
       DURATION        : 01:31:56.240000000
     Stream #0:1(deu): Audio: vorbis (oV[0][0] / 0x566F), 48000 Hz, stereo, fltp (default)
     Metadata:
       LANGUAGE-ISO639_2: deu
       LANGUAGE-SIMPLE : Deutsch
       LANGUAGE-DESCRIPTION: Deutsch
       ENCODER         : Lavc58.18.100 libvorbis
       DURATION        : 01:31:56.241000000
Stream mapping:
   Stream #0:0 -> #0:0 (copy)
   Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame=137903 fps=879 q=-1.0 Lsize= 2027570kB time=01:31:56.12 bitrate=3011.1kbits/s speed=35.1x
video:1952414kB audio:71785kB subtitle:0kB other streams:0kB global headers:4kB muxing overhead: 0.166525%

$ ffprobe OUTPUT.mkv
ffprobe version 4.3.1-static https://johnvansickle.com/ffmpeg/ Copyright (c) 2007-2020 the FFmpeg developers
   built with gcc 8 (Debian 8.3.0-6)
   configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg
   libavutil      56. 51.100 / 56. 51.100
   libavcodec     58. 91.100 / 58. 91.100
   libavformat    58. 45.100 / 58. 45.100
   libavdevice    58. 10.100 / 58. 10.100
   libavfilter     7. 85.100 /  7. 85.100
   libswscale      5.  7.100 /  5.  7.100
   libswresample   3.  7.100 /  3.  7.100
   libpostproc    55.  7.100 / 55.  7.100
Input #0, matroska,webm, from 'OUTPUT.mkv':
   Metadata:
     SOURCE_TYPE     : dvd
     ENCODER         : Lavf58.45.100
   Duration: 01:31:56.13, start: 0.000000, bitrate: 3011 kb/s
     Chapter #0:0: start 0.000000, end 10.911556
     Chapter #0:1: start 10.911556, end 819.225778
     Chapter #0:2: start 819.225778, end 1839.369956
     Chapter #0:3: start 1839.369956, end 2689.490133
     Chapter #0:4: start 2689.490133, end 3289.574978
     Chapter #0:5: start 3289.574978, end 4584.758089
     Chapter #0:6: start 4584.758089, end 5516.019689
     Stream #0:0: Video: h264 (High), yuv420p(progressive), 720x576 [SAR 16:15 DAR 4:3], 25 fps, 25 tbr, 1k tbn, 50 tbc (default)
     Metadata:
       ENCODER         : Lavc58.18.100 libx264
       DURATION        : 01:31:56.130000000
     Stream #0:1(deu): Audio: vorbis, 48000 Hz, stereo, fltp (default)
     Metadata:
       LANGUAGE-ISO639_2: deu
       LANGUAGE-SIMPLE : Deutsch
       LANGUAGE-DESCRIPTION: Deutsch
       ENCODER         : Lavc58.18.100 libvorbis
       DURATION        : 01:31:56.130000000

Also with VLC media player I only see:
Chapter 1
Chapter 2
......

-Ulf




More information about the ffmpeg-user mailing list