VideoHelp Forum
+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 30 of 35
Thread
  1. I am starting with an MP4 that has: no titles, no chapters, one audio track, one video track, no subtitle tracks, no data streams

    When I view this file in VLC (ver 3.0.12), everything looks and works like I think it should. Then, I execute this command (ffmpeg version is: N-101923-gc012f9b265)
    Code:
    ffmpeg -i input.mp4 -f ffmetadata chapters.txt

    The contents of chapters.txt is:

    ;FFMETADATA1
    major_brand=isom
    minor_version=512
    compatible_brands=isomiso2avc1mp41
    encoder=Lavf58.78.100


    Then, I add this information to the bottom of chapters.txt:

    [CHAPTER]
    TIMEBASE=1/1
    START=00
    END=999
    title=This is chapter 1

    [CHAPTER]
    TIMEBASE=1/1
    START=1000
    END=1999
    title=This is chapter 2

    [CHAPTER]
    TIMEBASE=1/1
    START=2000
    END=2999
    title=This is chapter 3

    I save chapters.txt and then run this command:
    Code:
    ffmpeg -i input.mp4 -i chapters.txt -map_metadata 1 -map_chapters 1 -c copy out.mp4
    The ffmpeg console output looks like what I think it should: the chapters appear in the input #1 chapters section, the chapters appear in the output chapters section, and, there is no evidence of a data stream in the output file. Then, I go and view out.mp4 in VLC. I see the chapter names under "Playback > Chapter" and clicking on a chapter name takes me to the correct place in the video. But, when I go to "Subtitle > Sub Track", there is a new track #1 with the name "Track 1 - [English]". When I click on that track name to activate it, it displays the chapter name as a subtitle. When I do this command
    Code:
    ffmpeg -i out.mp4
    there is now this at the end of the console output:

    Stream #0:2(eng): Data: bin_data (text / 0x74786574)
    Metadata:
    handler_name: SubtitleHandler

    Then, I execute this command:
    Code:
    ffmpeg -i out.mp4 -c copy -dn -map_metadata:c -1 out2.mp4
    When I look at the ffmpeg console output of out2.mp4, the data stream is not there. When I view out2.mp4 in VLC, the chapters exist, but, the names have been changed to a generic name like: "Chapter 1". When I look at "Subtitle > Sub track", that subtitle track does not exist any more. So, the chapter names were removed when the data stream was removed, but, the chapter times remain.

    I have another MP4 (let's call it "foo.mp4") that has functioning chapter names in VLC, but, no subtitle track and the ffmpeg console output shows no data stream.

    This is confusing to me and leads me to ask several questions:

    1) why would ffmpeg put the chapter names into a data stream?
    2) if that is where chapter names are supposed to go, how did foo.mp4 get created with chapter names but no data stream?
    3) why is VLC showing information in a data stream as a subtitle track?
    4) it seems like chapter times are in metadata, but, chapter names are in a data stream (sometimes). What is the reason for that?
    Quote Quote  
  2. Clicking on some similar links at the bottom of this thread, it seems that either there isn't a standard for how MP4 handles/stores chapter information and/or many people don't follow the recommended/mandated standard. But, there seems to be two main ways to store and process chapter information in an MP4. Can somebody provide a site/sites that can tell me more about these two main ways of doing things? It would seem that one reason for the differences is to allow/help different playback devices to (at least try to) execute chapters properly. If that is the case, I would like to know how and where to store and/or remove the chapter information in these two different places in the MP4.
    Quote Quote  
  3. Have you tried without the '-map_metadata 1'?
    when I use:
    Code:
    ffmpeg -y  -r 25/1 -itsoffset 00:00:00.017 -i "E:\Output\erst_mitChapter_2021-06-05@21_10_23_7810_02.mkv" -i "E:\Output\iId_3_aid_0_DELAY_17ms_2021-06-05@21_10_23_7810_01.mp2" -i "E:\Output\2021-06-05@21_10_23_7810__04.chp" -map_chapters 1 -vcodec copy -acodec copy -map 0:0 -map 1:0  -aspect 177833:100000 -r 25/1 "E:\Output\erst_mitChapter.mp4"
    I get a file without an additional subtitle stream.
    My chapter file looked like this:
    Code:
    ;FFMETADATA1
    [CHAPTER]
    TIMEBASE=1/1000
    START=0
    END=4
    title=Chapter 1
    [CHAPTER]
    TIMEBASE=1/1000
    START=5
    END=19
    title=Chapter 2
    [CHAPTER]
    TIMEBASE=1/1000
    START=20
    END=49
    title=Chapter 3
    [CHAPTER]
    TIMEBASE=1/1000
    START=50
    END=59
    title=Chapter 4
    [CHAPTER]
    TIMEBASE=1/1000
    START=60
    END=63000
    title=Chapter 5
    Cu Selur
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  4. Originally Posted by Selur View Post
    Have you tried without the '-map_metadata 1'?
    Changing my statement to this does not make a difference:
    Code:
    ffmpeg -i input.mp4 -i chapters.txt -map_chapters 1 -c copy out.mp4
    does not make a difference

    And, when I change it to this:
    Code:
    ffmpeg -i input.mp4 -i chapters.txt -map_metadata -1 -map_chapters 1 -c copy out.mp4
    it results in the data stream not created, the chapter times imported, but, my chapter names are not imported (that is, there is the default "Chapter 0" names).
    Quote Quote  
  5. Using
    Code:
    MP4box -add "path to mp4" -chap "chapters.txt" -new "path to output mp4"
    with a chapter file like:
    Code:
    CHAPTER01=00:00:00.000
    CHAPTER01NAME=Chapter 1
    CHAPTER02=00:00:05.000
    CHAPTER02NAME=Chapter 2
    CHAPTER03=00:00:20.000
    CHAPTER03NAME=Chapter 3
    CHAPTER04=00:00:50.000
    CHAPTER04NAME=Chapter 4
    CHAPTER05=00:01:00.000
    CHAPTER05NAME=Chapter 5
    works fine, so that might be an alternative.




    But back to ffmpeg:
    -------------------------------------
    • using
      Code:
      -i video -i chapters -map_metadata 1:c:0
      • one menu entry (no chapters) according to mediainfo
        Code:
        Menu
        Count                                    : 94
        Count of stream of this kind             : 1
        Kind of stream                           : Menu
        Kind of stream                           : Menu
        Stream identifier                        : 0
        Chapters_Pos_Begin                       : 94
        Chapters_Pos_End                         : 94
      • 'mp4box -info' reports chapters without titles
        Code:
        Chapters:
                Chapter #1 - 00:00:00.000 - ""
                Chapter #2 - 00:00:00.005 - ""
                Chapter #3 - 00:00:00.020 - ""
                Chapter #4 - 00:00:00.050 - ""
                Chapter #5 - 00:00:00.060 - ""
      • 'ffmpeg -i' reports: chapters without titles too
        Code:
          Chapters:
            Chapter #0:0: start 0.000000, end 0.005000
              Metadata:
                title           :
            Chapter #0:1: start 0.005000, end 0.020000
              Metadata:
                title           :
            Chapter #0:2: start 0.020000, end 0.050000
              Metadata:
                title           :
            Chapter #0:3: start 0.050000, end 0.060000
              Metadata:
                title           :
            Chapter #0:4: start 0.060000, end 61.635031
              Metadata:
                title           :
    • using:
      Code:
      -i video -i chapters -map_chapters 1
      • mediaInfo reports:two menu entries with chapters
        Code:
        Menu #1
        Count                                    : 102
        Count of stream of this kind             : 2
        Kind of stream                           : Menu
        Kind of stream                           : Menu
        Stream identifier                        : 0
        Stream identifier                        : 1
        StreamOrder                              : 1
        ID                                       : 2
        ID                                       : 2
        Format                                   : Timed Text
        Format                                   : Timed Text
        Commercial name                          : Timed Text
        Codec ID                                 : text
        Duration                                 : 63000
        Duration                                 : 1 min 3 s
        Duration                                 : 1 min 3 s 0 ms
        Duration                                 : 1 min 3 s
        Duration                                 : 00:01:03.000
        Duration                                 : 00:01:03.000
        Language                                 : en
        Language                                 : English
        Language                                 : English
        Language                                 : en
        Language                                 : eng
        Language                                 : en
        Chapters_Pos_Begin                       : 94
        Chapters_Pos_End                         : 99
        Bit rate mode                            : CBR
        Menu For                                 : 1
        00:00:00.000                             : Chapter 1
        00:00:00.005                             : Chapter 2
        00:00:00.020                             : Chapter 3
        00:00:00.050                             : Chapter 4
        00:00:00.060                             : Chapter 5
        Bit rate mode                            : Constant
        
        Menu #2
        Count                                    : 99
        Count of stream of this kind             : 2
        Kind of stream                           : Menu
        Kind of stream                           : Menu
        Stream identifier                        : 1
        Stream identifier                        : 2
        Chapters_Pos_Begin                       : 94
        Chapters_Pos_End                         : 99
        00:00:00.000                             : Chapter 1
        00:00:00.005                             : Chapter 2
        00:00:00.020                             : Chapter 3
        00:00:00.050                             : Chapter 4
        00:00:00.060                             : Chapter 5
      • mp4box reports: a broken file
        Code:
        [iso file] Unknown box type trt00 in parent text
        [iso file] Box "text" (start 3083254) has 11 extra bytes
        [iso file] Box "stbl" (start 3083230) has 124 extra bytes
        [iso file] Box "moov" (start 3075932) has 205 extra bytes
        [iso file] Incomplete box moov - start 3075932 size 7730
        [iso file] Incomplete file while reading for dump - aborting parsing
        [iso file] Unknown box type trt00 in parent text
        [iso file] Box "text" (start 3083254) has 11 extra bytes
        [iso file] Box "stbl" (start 3083230) has 124 extra bytes
        [iso file] Box "moov" (start 3075932) has 205 extra bytes
        Truncated file - missing 7730 bytes
      • ffmpeg reports: proper chapters
        Code:
          Chapters:
            Chapter #0:0: start 0.000000, end 0.005000
              Metadata:
                title           : Chapter 1
            Chapter #0:1: start 0.005000, end 0.020000
              Metadata:
                title           : Chapter 2
            Chapter #0:2: start 0.020000, end 0.050000
              Metadata:
                title           : Chapter 3
            Chapter #0:3: start 0.050000, end 0.060000
              Metadata:
                title           : Chapter 4
            Chapter #0:4: start 0.060000, end 63.000000
              Metadata:
                title           : Chapter 5
    • using '-map_metadata 1' or '-map_chapters 1 -map_metadata 1' is reporting the same as when using the above '-map_chapters 1'

    -> looks to me like ffmpeg is either broken atm. or they changed something I'm not aware of (I'm pretty sure '-map_chapters 1' worked fine at one point in time.

    My recommendation would be to either use MP4Box instead of ffmpeg for muxing to mp4 or report the issue to the ffmpeg developers over at https://trac.ffmpeg.org/
    If you report it and get a useful reply please let me know too.

    Cu Selur
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  6. okay,...
    Code:
    -map_chapters 1 -movflags +faststart
    seems to not produce a broken file, MP4Box and ffmpeg seem to be fine, but MediaInfo still reports two menus with chapters.

    Code:
    -map_chapters 1 -movflags +faststart -movflags disable_chpl
    does get rid of the additional menu in MediaInfo, but it produces a broken file according to mp4box, may be that
    Code:
    -map_chapters 1 -movflags disable_chpl
    has the same effect, but may be that already works for you.

    Cu Selur
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  7. Member Budman1's Avatar
    Join Date
    Jul 2012
    Location
    NORTHWEST ILLINOIS, USA
    Search Comp PM
    if you have timebase set to 1/1000 then your times have to be in thousands:

    Entry =
    Image
    [Attachment 59282 - Click to enlarge]


    Results in a file named Metadata:
    ;FFMETADATA1
    title="Wham_Last Christmas.mp4"
    artist=Test

    [CHAPTER]
    TIMEBASE=1/1000
    START=0
    END=10000
    TITLE=Chapter 1

    [CHAPTER]
    TIMEBASE=1/1000
    START=10000
    END=20000
    TITLE=Chapter 2

    [CHAPTER]
    TIMEBASE=1/1000
    START=20000
    END=30000
    TITLE=Chapter 3

    [CHAPTER]
    TIMEBASE=1/1000
    START=30000
    END=40000
    TITLE=Chapter 4

    [CHAPTER]
    TIMEBASE=1/1000
    START=40000
    END=50000
    TITLE=Chapter 5

    [CHAPTER]
    TIMEBASE=1/1000
    START=50000
    END=60000
    TITLE=Chapter 6
    Output string is:
    "C:\Users\Bud\Desktop\TrimNMerge\TrimNMerge\bin\De bug\work\ffmpeg" -i "C:\Users\Bud\Desktop\Wham_Last Christmas.mp4" -i metadata -map_metadata 1 -codec copy "C:\Users\Bud\Desktop\TrimNMerge\TrimNMerge\bin\De bug\work\Wham_Last Christmas_Chapters.mp4"
    Results in Video with Chapter Marks:
    Image
    [Attachment 59283 - Click to enlarge]
    Quote Quote  
  8. if you have timebase set to 1/1000 then your times have to be in thousands:
    To get seconds, I know. (but thanks for the reminder)

    Question is what does "MediaInfo --full <PATH to File>", "Mp4Box --info <PATH to file>" and "ffmpeg -i <Path to file>" report about the output.

    The 'problem' I see is that MP4Box report the the files created with just -map_chapters X as broken
    Code:
    [iso file] Unknown box type trt00 in parent text
    [iso file] Box "text" (start 3083242) has 11 extra bytes
    [iso file] Box "stbl" (start 3083218) has 124 extra bytes
    [iso file] Box "moov" (start 3075932) has 213 extra bytes
    [iso file] Incomplete box moov - start 3075932 size 7726
    [iso file] Incomplete file while reading for dump - aborting parsing
    [iso file] Unknown box type trt00 in parent text
    [iso file] Box "text" (start 3083242) has 11 extra bytes
    [iso file] Box "stbl" (start 3083218) has 124 extra bytes
    [iso file] Box "moov" (start 3075932) has 213 extra bytes
    Truncated file - missing 7726 bytes
    Error opening file e:\Output\erst_mitChapter.mp4: IsoMedia File is truncated
    which makes me feed uneasy.
    Last edited by Selur; 6th Jun 2021 at 02:20.
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  9. Originally Posted by Budman1 View Post
    if you have timebase set to 1/1000 then your times have to be in thousands:

    :
    :
    more stuff
    :
    :
    I don't understand what you are trying to tell me. My timebase is set to 1/1 and my times are in seconds.
    Quote Quote  
  10. that was related to my post since I used 1/1000 (since I usually add chapter at specific frames and not roughly at a given second)
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  11. Member Budman1's Avatar
    Join Date
    Jul 2012
    Location
    NORTHWEST ILLINOIS, USA
    Search Comp PM
    Yes 1/1 will work for seconds, 1/100 will work for milliseconds.
    MediaInfo Reports: (Truncated with only pertinent info)
    General
    Complete name : Wham_Last Christmas_Chapters.mp4
    Format : MPEG-4
    Format profile : Base Media
    Codec ID : isom (isom/iso2/avc1/mp41)
    File size : 313 MiB
    Duration : 4 min 37 s
    Overall bit rate : 9 441 kb/s
    Movie name : Wham_Last Christmas.mp4
    Performer : Test
    Writing application : Lavf58.49.100

    Video
    ID : 1
    Format : AVC
    Format/Info : Advanced Video Codec
    Format profile : High@L3


    Audio
    ID : 2
    Format : AAC LC
    Format/Info : Advanced Audio Codec Low Complexity
    Codec ID : mp4a-40-2

    Alternate group : 1
    Menus : 3

    Menu #1
    ID : 3
    Codec ID : text
    Duration : 1 min 0 s
    Language : English
    Bit rate mode : CBR
    Menu For : 1,2
    00:00:00.000 : Chapter 1
    00:00:10.000 : Chapter 2
    00:00:20.000 : Chapter 3
    00:00:30.000 : Chapter 4
    00:00:40.000 : Chapter 5
    00:00:50.000 : Chapter 6
    Bit rate mode : Constant

    Menu #2
    00:00:00.000 : Chapter 1
    00:00:10.000 : Chapter 2
    00:00:20.000 : Chapter 3
    00:00:30.000 : Chapter 4
    00:00:40.000 : Chapter 5
    00:00:50.000 : Chapter 6
    Quote Quote  
  12. And there are the two menu entries.
    One from ttxt chapters and one from itunes chapters, later one can be omitted by using '-movflags disable_chpl', what worries me is what MP4Box reports that those files the way ffmpeg creates them seem to be truncated.
    -> Do you know a way to add chapter to mp4 using ffmpeg in a way that Mp4Box, ffmpeg and MediaInfo all three report the file as correct (= not broken/truncated)?

    Cu Selur
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  13. Originally Posted by Budman1 View Post
    Yes 1/1 will work for seconds, 1/100 will work for milliseconds.
    MediaInfo Reports: (Truncated with only pertinent info)
    General
    Complete name : Wham_Last Christmas_Chapters.mp4
    Format : MPEG-4
    Format profile : Base Media
    Codec ID : isom (isom/iso2/avc1/mp41)
    File size : 313 MiB
    Duration : 4 min 37 s
    Overall bit rate : 9 441 kb/s
    Movie name : Wham_Last Christmas.mp4
    Performer : Test
    Writing application : Lavf58.49.100

    Video
    ID : 1
    Format : AVC
    Format/Info : Advanced Video Codec
    Format profile : High@L3


    Audio
    ID : 2
    Format : AAC LC
    Format/Info : Advanced Audio Codec Low Complexity
    Codec ID : mp4a-40-2

    Alternate group : 1
    Menus : 3

    Menu #1
    ID : 3
    Codec ID : text
    Duration : 1 min 0 s
    Language : English
    Bit rate mode : CBR
    Menu For : 1,2
    00:00:00.000 : Chapter 1
    00:00:10.000 : Chapter 2
    00:00:20.000 : Chapter 3
    00:00:30.000 : Chapter 4
    00:00:40.000 : Chapter 5
    00:00:50.000 : Chapter 6
    Bit rate mode : Constant

    Menu #2
    00:00:00.000 : Chapter 1
    00:00:10.000 : Chapter 2
    00:00:20.000 : Chapter 3
    00:00:30.000 : Chapter 4
    00:00:40.000 : Chapter 5
    00:00:50.000 : Chapter 6

    Again, I don't understand what you are trying to tell me. Instead of just posting app output, tell me what you are trying to tell me.
    Quote Quote  
  14. @the_steve_randolph: using:
    Code:
    -map_chapters 1 -movflags disable_chpl
    will remove the Menu#2 info.

    Cu Selur
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  15. **** the original message here has been edited/deleted because of numerous corrections. The corrected version is now post #16
    Last edited by the_steve_randolph; 6th Jun 2021 at 16:20. Reason: Multiple corrections shown in a separate message
    Quote Quote  
  16. *** This is the second posting this message - to correct and clarify various pieces of information.

    OK, now I have found something even more bizarre.

    I start with a DVD that has chapters and it has several non-English subtitle tracks. I use HandBrake to convert to an MP4 - let's call it X.mp4 Since I have not found any English audio tracks, I tell HandBrake to remove the original subtitle tracks and to import a subtitle file, and, tell it to burn-in those subtitles. When I view X in VLC, the original DVD subtitle tracks are gone, the imported English subtitles file is shown as a subtitle track available for selection, and, the English subtitles are burned-in. Viewing ffmpeg console output on X.mp4, there is that data stream that we have learned contains the chapter names in addition to the chapter names showing up in the "Chapters" section. That data stream looks like this:
    Code:
    Stream #0:2(eng): Data: bin_data (text / 0x74786574)
    Metadata:
    creations time: 2021-06-05T02:03:09.000000Z
    handler_name: SubtitleHandler
    Next, I do this command:
    Code:
    ffmpeg -i X.mp4 -c copy Y.mp4
    When I view the console output for Y.mp4, everything looks the same when comparing Y.mp4 to X.mp4. Now comes the weird part. When I look at Y.mp4 in VLC, there are now 3 subtitle tracks! There is the original English subtitles track that was imported during the conversion from the DVD, a subtitle track from a different MP4 in the same folder, and, a subtitle track from another different MP4 in the same folder. When I view X.mp4 in the Windows Movie & TV app, the imported subtitle track is the only one available for selection. But, when I view Y.mp4 in the Windows Movie & TV app, there are zero subtitle tracks available for selection. In fact, it shows "Choose subtitle file" and clicking on that opens up a window for me to find/select an O/S file. HUH?

    So, upon further investigation, in this folder I have X.mp4, Y.mp4, several other MP4's, as well as a subfolder of the name "Subtitles". In that "Subtitles" subfolder, I have an SRT file for each of the MP4's in the file name format of: "X - English.srt", "Y - English.srt", etc. Now, we know from the previous paragraph that viewing Y in VLC lists the imported subtitle track, it also lists two subtitle tracks from that "Subtitles" subfolder that are NOT X or Y. Just for grins, I renamed the "Subtitles" subfolder to "something else" (that is, it does not have the word "subtitle" in it). Now when I view Y in VLC, there are NO subtitle tracks listed - it is even missing the original DVD subtitle track!

    To (try to) recap converting X to Y (doing nothing except "-c copy"). When there is a "Subtitles" subfolder containing multiple SRT files, viewing Y in VLC shows 3 subtitle tracks and Movies & TV shows 1 subtitle tracks. When there is no "Subtitles" subfolder, viewing Y in VLC shows 0 subtitle tracks and Movies and TV shows 0 subtitle tracks. Nowhere in this folder or subfolders are any files with the name format of "Z.srt" that any viewing app would find by default. The name of that subfolder has seemingly no effect on the available subtitle tracks when viewing X. The ffmpeg console output for X and Y are the same, showing a single data stream.

    Y'all try to figure that out while I go have several beers.

    **** EDIT: The reasons for only using VLC and Windows Movies & TV to view the MP4s is two-folder. First, I am trying to limit the number of variables in this testing to try to hone in on one thing at a time. Second, I have been unable to figure out how to see or select a subtitle track in these apps: Zoom Player MAX ver. Giveaway v14 build 1400, PowerDVD 19, and, Nero Showtime 4. When I use Windows Media Player to view X, under the menu option "Lyrics, captions, and subtitles", I have "On if available" clicked on, but, it is not showing subtitles from a subtitle track during playback. VLC shows the imported DVD subtitle track when viewing X and the subtitles from that track are displayed when selected.

    **** SECOND EDIT: After a couple of beers, it occurs to me that the issue involved here is using ffmpeg in two different modes: default stream selection/processing versus mapping. Maybe after a few more beers and/or a very long nap, I will run a couple more tests to compare those two different modes.
    Last edited by the_steve_randolph; 6th Jun 2021 at 16:28.
    Quote Quote  
  17. Originally Posted by Selur View Post
    @the_steve_randolph: using:
    Code:
    -map_chapters 1 -movflags disable_chpl
    will remove the Menu#2 info.

    Cu Selur
    That "Menu #2" info came from "Budman 1" not me. And, I don't know what he is trying to tell me with showing output but not commenting on it.
    Quote Quote  
  18. Member Budman1's Avatar
    Join Date
    Jul 2012
    Location
    NORTHWEST ILLINOIS, USA
    Search Comp PM
    That "Menu #2" info came from "Budman 1" not me. And, I don't know what he is trying to tell me with showing output but not commenting on it.
    Okay, I guess I should read better or comprehend better late night,early morning.

    I first posted the changing from 1/1 to 1/1000 because I thought it gave better accuracy, as Selur mentioned.
    Then I posted a method that will add successfully add Chapter marks, without realizing the 2nd menu was a problem. (Should have read slower).

    After a little research, I found the second menu is located in the 'CHPL' atom and if you remove,disable, or zero it out, you can eliminate the 2nd menu.
    Sorry for my confusion.
    Quote Quote  
  19. as a side note: when using vlc, make sure you don't have subtitles names the same as the original file you are playing next to the file, otherwise those files will be listed as subtitles and might cause confusion
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  20. Originally Posted by Budman1 View Post
    That "Menu #2" info came from "Budman 1" not me. And, I don't know what he is trying to tell me with showing output but not commenting on it.
    Okay, I guess I should read better or comprehend better late night,early morning.

    I first posted the changing from 1/1 to 1/1000 because I thought it gave better accuracy, as Selur mentioned.
    Then I posted a method that will add successfully add Chapter marks, without realizing the 2nd menu was a problem. (Should have read slower).

    After a little research, I found the second menu is located in the 'CHPL' atom and if you remove,disable, or zero it out, you can eliminate the 2nd menu.
    Sorry for my confusion.
    Since I am relatively new to video conversion, what is " 'CHPL' atom "? And, perhaps just as important, what are "Chapter marks" compared to my usage of the term of just "chapters"?
    Quote Quote  
  21. Originally Posted by Selur View Post
    as a side note: when using vlc, make sure you don't have subtitles names the same as the original file you are playing next to the file, otherwise those files will be listed as subtitles and might cause confusion
    Yes, I have learned that. Which is why I specifically said that those SRT files in that "Subtitles" subfolder are in the file name form of "X-English.srt" when I am playing X.mp4 in VLC.
    Quote Quote  
  22. Inside the mp4 container data is stored in atoms. The 'chpl' atom is an entry recognized by itunes/Apple to store chapter data.
    And, perhaps just as important, what are "Chapter marks" compared to my usage of the term of just "chapters"?
    Same thing. There are always multiple ways to express the same thing in video editing, simple because different tools and documentations/standards use different nomenclature for the same thing. So depending on what users read first or adapted first the use different names to describe the same thing.
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  23. Originally Posted by Selur View Post
    Inside the mp4 container data is stored in atoms. The 'chpl' atom is an entry recognized by itunes/Apple to store chapter data.
    And, perhaps just as important, what are "Chapter marks" compared to my usage of the term of just "chapters"?
    Same thing. There are always multiple ways to express the same thing in video editing, simple because different tools and documentations/standards use different nomenclature for the same thing. So depending on what users read first or adapted first the use different names to describe the same thing.
    OK, so, if I want to look for " 'CHPT' atom" in ffmpeg console output, am I looking at the "Chapters:" section?
    Quote Quote  
  24. OK, I have started over with a new test for this issue. The explanation for it is quite long and thorough, hoping that my tests/results can be replicated and understood. So, I have posted it here

    Any comments, corrections, or, suggested tests would be appreciated.
    Quote Quote  
  25. Member Budman1's Avatar
    Join Date
    Jul 2012
    Location
    NORTHWEST ILLINOIS, USA
    Search Comp PM
    OK, so, if I want to look for " 'CHPT' atom" in ffmpeg console output, am I looking at the "Chapters:" section?
    Actually the atom is CHPL. If you download atomicparsley and enter 'Atomicparsley <mp4 file path) -T' you will see all the atoms of the MP4 file. The chpL should be the last listed.
    Quote Quote  
  26. Originally Posted by Budman1 View Post
    OK, so, if I want to look for " 'CHPT' atom" in ffmpeg console output, am I looking at the "Chapters:" section?
    Actually the atom is CHPL. If you download atomicparsley and enter 'Atomicparsley <mp4 file path) -T' you will see all the atoms of the MP4 file. The chpL should be the last listed.
    In my testing (and Selur can tell you this), I am trying to reduce the number of apps so that I don't introduce more variables in the testing. Since I am using ffmpeg to execute the conversion commands, and, ffmpeg can show me lotsa information, I prefer to at least start with ffmpeg. So, can ffmpeg show me the " 'CHPL' atom" information?
    Quote Quote  
  27. Looking back on this thread to see if I missed something, I have a few questions.

    Selur said to use this command:
    Code:
    -map_chapters 1 -movflags disable_chpl
    But, I don't know what you mean for the rest of the ffmpeg command. But, you are responding to a situation/command where I was importing a chapters file. That has sorta been left behind as we pursued the conversion using HandBrake and the resulting MP4 having chapter names in the data stream. But, to try to use that info, I executed this command:
    Code:
    ffmpeg -i X.mp4 -i chapters.txt -map_metadata 1 -map_chapters 1 -movflags disable_chpl -c copy Z.mp4
    When I view Z.mp4 with VLC, it does not show any chapters and there is no selectable subtitle track. So, either I am not using the full ffmpeg command that you intended for me, or, it doesn't resolve my overall problem.


    Looking at "Budman 1"s posts, I still don't understand what you are trying to tell me. You seem to be saying that there is extra information in this " 'CHPL' atom" that is not shown in ffmpeg console output, and, you are recommending additional apps that will reveal that information.

    OK, let's say that is true. But, you have failed to say what I am supposed to do with that information. What would that information tell me? What will I look for or see that will tell me what is wrong? And, most importantly, what will I do with that information to create a ffmpeg command that will resolve my overall problem? Do you have a recommended ffmpeg command?
    Quote Quote  
  28. Member Budman1's Avatar
    Join Date
    Jul 2012
    Location
    NORTHWEST ILLINOIS, USA
    Search Comp PM
    Ok... Not sure what was the starting goal was any more but to take an existing MP4 and add Chapters to it and/or subtitles (as a track) and assuming you have a valid "Metadata" file:

    Code:
    "ffmpeg" -i "C:\Users\Bud\Desktop\Wham_Last Christmas.mp4" -i "C:\Users\Bud\Desktop\metadata" -i "C:\Users\Bud\Desktop\Subtitles.srt" -c copy -c:s mov_text -map_metadata 1 -movflags disable_chpl  "C:\Users\Bud\Desktop\Wham_Last Christmas_Chapterssubs.mp4"
    If you want chapters but do not want a subtitle track:

    Code:
    "ffmpeg" -i "C:\Users\Bud\Desktop\Wham_Last Christmas.mp4" -i "C:\Users\Bud\Desktop\metadata" -map_metadata 1 -movflags disable_chpl  -c copy "C:\Users\Bud\Desktop\Wham_Last Christmas_Chaptersnosubs.mp4"
    As far as I can find the resulting videoes play in Potplayer, MPC-BE and VLC as they should with one set of selectable chapters. They also show in Mediainfo correctly.
    Quote Quote  
  29. Originally Posted by Budman1 View Post
    Ok... Not sure what was the starting goal was any more but to take an existing MP4 and add Chapters to it and/or subtitles (as a track) and assuming you have a valid "Metadata" file:

    Code:
    "ffmpeg" -i "C:\Users\Bud\Desktop\Wham_Last Christmas.mp4" -i "C:\Users\Bud\Desktop\metadata" -i "C:\Users\Bud\Desktop\Subtitles.srt" -c copy -c:s mov_text -map_metadata 1 -movflags disable_chpl  "C:\Users\Bud\Desktop\Wham_Last Christmas_Chapterssubs.mp4"
    If you want chapters but do not want a subtitle track:

    Code:
    "ffmpeg" -i "C:\Users\Bud\Desktop\Wham_Last Christmas.mp4" -i "C:\Users\Bud\Desktop\metadata" -map_metadata 1 -movflags disable_chpl  -c copy "C:\Users\Bud\Desktop\Wham_Last Christmas_Chaptersnosubs.mp4"
    As far as I can find the resulting videoes play in Potplayer, MPC-BE and VLC as they should with one set of selectable chapters. They also show in Mediainfo correctly.
    The issue is that I have multiple MP4 files that have chapters, but, the names are in a data stream, which shows up in VLC as a subtitle track. But, that subtitle track only shows the chapter names. So, I want to get rid of the data stream without losing the chapter names. Your ffmpeg commands have already been tried and they don't resolve the issue.
    Quote Quote  
  30. OK, as part of this project and thread, I have now tried to play my MP4 files on the disc player connected to my TV. The player is "LG UP870", which is a 4K Blu-ray player and these MP4s have chapter names (and in the MP4 data stream). The files played fine, but, there was no indication that there are chapters in the MP4 and I don't have the ability to skip ahead to a specific chapter time. I don't know if this is a "failure" of the player or the fact that the chapter names are also in the data stream. Since the chapter times exist in the MP4, I suspect that my player cannot figure out that there are chapters - for whatever reason. Obviously it would be nice to have functioning chapters to be able to skip ahead to a desired scene, and, that is actually part of the "desired results". There are other options for me to try (i.e. convert to a MKV that has chapters) that I have to test. While I understand that everybody's situation may be different, any feedback from others would be appreciated.

    I am kinda torn as to what to do right now. My HDD is running out of space and I need to burn these files and move on to other videos/projects. For the time being, I will burn them to DVD-RW discs, hoping that I can find a resolution to this chapter/data stream issue and "fix" these MP4s in the future. I guess that having the data stream and VLC being a bit confused is acceptable, but, I really want to be able to view these videos on my 55" TV in the future. I can tell Windows that I have 2 monitors and drag the VLC app to the TV to view it. But, I would really like to have a resolution to this chapter/data stream issue so that I can deal with future files/projects. How much are others "worrying" about this situation?
    Last edited by the_steve_randolph; 7th Jun 2021 at 22:37.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!