[FFmpeg-user] Adding Chapters to MP4 (Timebase and Formatting)

Karen Norton nortok00 at gmail.com
Thu Apr 26 03:54:02 EEST 2018


Hello all,

After much testing I was finally able to get chapters added to an MP4 file
but I have a couple questions.

Firstly here's my environment:
Windows 10
FFMPEG version: N-85588-g6108805 built with gcc 6.3.0

The metadata file and command line is based on what I found here:
https://www.ffmpeg.org/ffmpeg-all.html#Metadata-1

The example from that page:
;FFMETADATA1
title=bike\\shed
;this is a comment
artist=FFmpeg troll team
[CHAPTER]
TIMEBASE=1/1000
START=0
#chapter ends at 0:01:00
END=60000
title=chapter \#1
[STREAM]
title=multi\
line

Command line: ffmpeg -i INPUT -i FFMETADATAFILE -map_metadata 1 -codec copy
OUTPUT

I found some posts where people used TIMEBASE=1/1 instead of 1/1000 which
seemed to be easier because it appears that the timecode (00:00:00) can be
used instead of having to convert to milliseconds. Ex:
TIMEBASE=1/1
START=00:02:05.500
END=00:06:35.500

The posts weren't related to the Timebase so I don't know whether it
actually worked for the people who posted but when I tried this it added
the chapters but they didn't work when I clicked on them. Ex: In VLC under
playback>chapters I can see the chapters but each chapter goes back to the
beginning of the video instead of going to their respective time markers.
When I convert to milliseconds and use 1/1000 it works.

Question 1: Does Timebase=1/1 work? Is this the correct syntax? I've been
converting DVDs to MP4s and I have a program that extracts the chapter
information from the DVDs so it's far easier to use that Timebase because I
already have the Start/End info from the extracted DVD chapters. It took me
awhile to convert that info to milliseconds so would prefer to use 1/1.

My next question is regarding formatting the global metadata info (the info
before the first [CHAPTER]). The "title" and "artist" info appears
differently in different players. For example in Windows Media Player this
data cycles between the two lines before disappearing.

I use VLC and this info appears as the video starts but it looks awful. In
my code I have:
;FFMETADATA1
title=Homecoming - Live In Ireland
artist=Celtic Woman

It looks like it's one line (although it separates into two lines after a
certain number of characters) but it has these weird square boxes where the
line should break and it adds a hyphen.

Here's a screenshot:

​
I thought maybe I would just try a multiline format in title= like it shows
under [STREAM] but this didn't work. I'm not sure if multiline doesn't work
in title= or whether I need something other than the backslash. I tried:
title=Homecoming - Live From Ireland\
Celtic Woman

It cutoff after the backslash.

Question 2: Is there anyway to alter the formatting for VLC? It's not such
a big deal given it disappears after about 30 seconds. It's just not pretty
to the eye. :-D

Thanks.


Karen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: celtic.jpg
Type: image/jpeg
Size: 25067 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-user/attachments/20180425/76552ad5/attachment.jpg>


More information about the ffmpeg-user mailing list