[FFmpeg-user] Naming chapters in Matroska video

Ulf Zibis Ulf.Zibis at CoSoCo.de
Fri Feb 19 00:59:49 EET 2021


Am 18.02.21 um 19:45 schrieb Paul B Mahol:
> On Thu, Feb 18, 2021 at 7:30 PM Paul B Mahol <onemda at gmail.com> wrote:
>
>>
>> On Thu, Feb 18, 2021 at 7:26 PM Ulf Zibis <Ulf.Zibis at cosoco.de> wrote:
>>
>>> Am 18.02.21 um 01:20 schrieb Ulf Zibis:
>>>> I have croped the file to decrease it's size and uploaded it to:
>>>> www.jugkoeln.de/Videos/INPUT_croped.mkv
>>>> www.jugkoeln.de/Videos/INPUT_test.ffmeta
>>>>
>>>> ffmpeg -i INPUT_croped.mkv -i INPUT_test.ffmeta -map_metadata 1 -c copy
>>> OUTPUT_croped.mkv
>>>
> ffmpeg -i INPUT_croped.mkv -i INPUT_test.ffmeta.txt -map_chapters 1 -c copy
> OUTPUT_croped.mkv

Hey, this works fine, thanks.

Now there is only a little problem with the video title. My metadata is:
;FFMETADATA1
title=Experiment
[STREAM]
title=Experiment
[CHAPTER]
TIMEBASE=1/1000000000
START=0
END=10911555556
[CHAPTER]
TIMEBASE=1/1000000000
START=10911555556
END=819225777778
title=1 - Intro
[CHAPTER]
TIMEBASE=1/1000000000
START=819225777778
END=1839369955556
title=2 - Restaurant
[CHAPTER]
TIMEBASE=1/1000000000
START=1839369955556
END=2689490133333
title=3 - At home
[CHAPTER]
TIMEBASE=1/1000000000
START=2689490133333
END=3289574977778
[CHAPTER]
TIMEBASE=1/1000000000
START=3289574977778
END=4584758088889
[CHAPTER]
TIMEBASE=1/1000000000
START=4584758088889
END=5516019688889

My command line is:
$ ffmpeg -i INPUT_croped.mkv -i INPUT_test.ffmeta -map_metadata 0 -map_metadata 1 -map_metadata:s:v 0:s:v -map_metadata:s:a 0:s:a -map_metadata:s 1:s -map_chapters 1 -c copy OUTPUT_croped.mkv
ffmpeg version N-101141-g8331eb058d Copyright (c) 2000-2021 the FFmpeg developers
   built with gcc 9 (Ubuntu 9.3.0-17ubuntu1~20.04)
   configuration: --enable-libvorbis
   libavutil      56. 65.100 / 56. 65.100
   libavcodec     58.123.100 / 58.123.100
   libavformat    58. 67.100 / 58. 67.100
   libavdevice    58. 12.100 / 58. 12.100
   libavfilter     7.107.100 /  7.107.100
   libswscale      5.  8.100 /  5.  8.100
   libswresample   3.  8.100 /  3.  8.100
Input #0, matroska,webm, from 'INPUT_croped.mkv':
   Metadata:
     SOURCE_TYPE     : dvd
     ENCODER         : Lavf58.67.100
   Duration: 01:31:56.12, start: -0.007000, bitrate: 110 kb/s
   Chapters:
     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: mpeg4 (Simple Profile), yuv420p(progressive), 16x16 [SAR 16:15 DAR 16:15], 25 fps, 25 tbr, 1k tbn, 25 tbc (default)
     Metadata:
       ENCODER         : Lavc58.123.100 mpeg4
       DURATION        : 01:31:56.120000000
   Stream #0:1(eng): Audio: opus, 48000 Hz, stereo, fltp (default)
     Metadata:
       DURATION        : 01:31:56.121000000
Input #1, ffmetadata, from 'INPUT_test.ffmeta':
   Metadata:
     title           : Experiment
   Duration: 01:31:56.02, start: 0.000000, bitrate: N/A
   Chapters:
     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
Codec 0x21000 is not in the full list.
   Stream #1:0: Data: unknown_codec
     Metadata:
       title           : Experiment
File 'OUTPUT_croped.mkv' already exists. Overwrite? [y/N] y
Output #0, matroska, to 'OUTPUT_croped.mkv':
   Metadata:
     SOURCE_TYPE     : dvd
     title           : Experiment
     encoder         : Lavf58.67.100
   Chapters:
     Chapter #0:0: start 0.000000, end 10.911556
     Chapter #0:1: start 10.911556, end 819.225778
       Metadata:
         title           : 1 - Intro
     Chapter #0:2: start 819.225778, end 1839.369956
       Metadata:
         title           : 2 - Restaurant
     Chapter #0:3: start 1839.369956, end 2689.490133
       Metadata:
         title           : 3 - At home
     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: mpeg4 (Simple Profile) (FMP4 / 0x34504D46), yuv420p(progressive), 16x16 [SAR 16:15 DAR 16:15], q=2-31, 25 fps, 25 tbr, 1k tbn, 1k tbc (default)
     Metadata:
       ENCODER         : Lavc58.123.100 mpeg4
       DURATION        : 01:31:56.120000000
       title           : Experiment
   Stream #0:1(eng): Audio: opus ([255][255][255][255] / 0xFFFFFFFF), 48000 Hz, stereo, fltp (default)
     Metadata:
       DURATION        : 01:31:56.121000000
       title           : Experiment
Stream mapping:
   Stream #0:0 -> #0:0 (copy)
   Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame=137903 fps=19050 q=-1.0 Lsize=   74660kB time=01:31:56.10 bitrate= 110.9kbits/s speed= 762x
video:1498kB audio:70033kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 4.375388%

But I don't see the video title in VLC media player (but chapters are correct), see attached screen shot.

Also the global metadata seems little "unusual":
   Metadata:
     SOURCE_TYPE     : dvd
     title           : Experiment
     encoder         : Lavf58.67.100
I would expect (capitalized and other order):
   Metadata:
     SOURCE_TYPE     : dvd
     ENCODER         : Lavf58.67.100
     title           : Experiment

-Ulf

-------------- next part --------------
A non-text attachment was scrubbed...
Name: VLC title & chapters.png
Type: image/png
Size: 60127 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-user/attachments/20210218/09e8812a/attachment.png>


More information about the ffmpeg-user mailing list