VideoHelp Forum

+ Reply to Thread
Results 1 to 5 of 5
Thread
  1. Member
    Join Date
    Dec 2003
    Location
    north america
    Search Comp PM
    I've just gone through a process of adding chapters to a file using ffmpeg. Works great but, the way I found to do it required converting the marker placements to milliseconds from the original timecode. Since my editing software will display my files with framecounts, it occurred to me that it might be possible to save some conversion effort by telling ffmpeg where to place the chapter markers using these framecounts.

    Here's an example of a chapter marker I placed:

    Code:
    [CHAPTER]
    TIMEBASE=1/1000
    START=7000
    END=291199
    title=Chapter marker
    I see that the TIMEBASE is set to 1/1000. That means that the START time for this chapter is 7 seconds (210 frames). To what extent will ffmpeg accept a formula as its TIMEBASE? Can I put in something like:

    Code:
    [CHAPTER]
    TIMEBASE=1/30
    START=210
    END=8736
    title=Chapter marker
    or

    Code:
    [CHAPTER]
    TIMEBASE=100/2997
    START=210
    END=8736
    title=Chapter marker
    thanks.
    Quote Quote  
  2. Member
    Join Date
    Feb 2006
    Location
    United States
    Search Comp PM
    Originally Posted by BabaG View Post
    I've just gone through a process of adding chapters to a file using ffmpeg. Works great but, the way I found to do it required converting the marker placements to milliseconds from the original timecode. Since my editing software will display my files with framecounts, it occurred to me that it might be possible to save some conversion effort by telling ffmpeg where to place the chapter markers using these framecounts.

    Here's an example of a chapter marker I placed:

    Code:
    [CHAPTER]
    TIMEBASE=1/1000
    START=7000
    END=291199
    title=Chapter marker
    I see that the TIMEBASE is set to 1/1000. That means that the START time for this chapter is 7 seconds (210 frames). To what extent will ffmpeg accept a formula as its TIMEBASE? Can I put in something like:

    Code:
    [CHAPTER]
    TIMEBASE=1/30
    START=210
    END=8736
    title=Chapter marker
    or

    Code:
    [CHAPTER]
    TIMEBASE=100/2997
    START=210
    END=8736
    title=Chapter marker
    thanks.
    try this here - https://www.trekview.org/blog/2022/choosing-right-frame-extraction-rate-ffmpeg/
    Quote Quote  
  3. Member
    Join Date
    Dec 2003
    Location
    north america
    Search Comp PM
    Not sure how to read the content in that link but, without a clear (to me) answer, I tested. I'd been nervous about the possibility of breaking something but, as it turned out, both of the formula i posted (1/30 and 100/2997) worked. They both allowed me to input my chapter start times in frames, one for 30fps content, the other for 29.97fps content.

    This should make it unnecessary to convert to ms before creating a chapters.txt file for ffmpeg and allow reading frame counts directly from an editing timeline that has the ability to display in frames.

    thanks,
    babag
    Quote Quote  
  4. Using the frame duration as the time base so you can enter frame numbers was a good/novel idea!

    Note that a duration of 1001/30000 may be more accurate than 100/2997. 29.97 is usually shorthand (rounded) from 29.9700299700299700... (30000/1001).
    Quote Quote  
  5. Member
    Join Date
    Dec 2003
    Location
    north america
    Search Comp PM
    thanks, jagabo! will include that in my notes and scripts.

    thanks again,
    babag
    Quote Quote  



Similar Threads