Skip to content

0x7C0

RTFM your live

Recent Comments

  • Stefanie on Microsoft Best Practices for Securing Active Directory
  • Art on Microsoft Best Practices for Securing Active Directory
  • Elke on Microsoft Best Practices for Securing Active Directory
  • Huey on Microsoft Best Practices for Securing Active Directory
  • Jeannette on Microsoft Best Practices for Securing Active Directory

Recent Posts

  • Merging dictionaries within powershell 2020-09-01
  • Twitter hack lessons learned 2020-08-05
  • Oneline backup 2020-04-28
  • MSSQL on kubernetes (non azure) 2020-03-14
  • shadow compile error 2020-02-04

Archives

Categories

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
Privacy Policy

Tag: editing

Add chapters to mp4

    1. Get the frame rate of your source video (assuming you have 30fps and the video is called input.mp4 for later steps)
    2. Calculate Timebase value
      => Timestamp fps*1000 => Timestamp 30000
      => Timebase 1/Timestamp => Timebase 1/30000
    3. Calculate all start and end timestamps using the following formula
      The 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
    4. Use the following template to create a text file named meta.txt
      ;FFMETADATA1
      TITLE=ENTER_VIDEO_TITLE_HERE
      PRODUCER=ENTER_PRODUCER_HERE
      [CHAPTER]
      TIMEBASE=1/30000
      START=0
      END=221520149
      title=Chapter 01 - ENTER_TITLE_OF_CHAPTER_01
      [CHAPTER]
      TIMEBASE=1/30000
      START=221520150
      END=443020300
      title=Chapter 02 - ENTER_TITLE_OF_CHAPTER_02
      
    5. Use ffmpeg to combine the metadata and source video:
      ffmpeg -i input.mp4  -i meta.txt -c copy -map_metadata 1 output.mp4
    6. Open output.mp4 using vlc and verify that all timestamps are correct.
Posted on 2018-05-26Categories Video editingTags editing, metadata, videoLeave a comment on Add chapters to mp4
Privacy Policy Proudly powered by WordPress