- Get the frame rate of your source video (assuming you have 30fps and the video is called input.mp4 for later steps)
- Calculate Timebase value
- Timestamp fps*1000 => Timestamp 30000
- Timebase 1/Timestamp => Timebase 1/30000
- Calculate all start and end timestamps:
- Note: timestamp 02:03:04.005 => 2 hours, 3 minutes, 4 seconds, 5 millisecond
- timestamp = (hours*60^2 + minutes*60^1 + seconds*60^0 + millisecond*10^-3) * timebase
- END Timestamp = Starting Timestamp of the following chapter - 1
- Timestamp for this example: 221520150
- And if this is the timestamp for chapter n, the end timestamp of chapter n-1 is: 221520149
- Use the following template to create a text file named meta.txt
- Use ffmpeg to combine the metadata and source video:
- Open output.mp4 using vlc and verify that all timestamps are correct.