Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid Chapters_Pos_Begin #1993

Open
zoriya opened this issue Apr 7, 2024 · 2 comments
Open

Invalid Chapters_Pos_Begin #1993

zoriya opened this issue Apr 7, 2024 · 2 comments

Comments

@zoriya
Copy link

zoriya commented Apr 7, 2024

With some files, Chapters_Pos_Begin point to an extra menu track that is not a chapter.

Here is the result of mediainfo --Output=JSON video/spirited_away\(1\).mp4 | jq '.media.track.[] | select(."@type" == "Menu")' for reference

{
  "@type": "Menu",
  "StreamOrder": "2",
  "ID": "3",
  "Format": "Timed Text",
  "CodecID": "text",
  "Duration": "7476.552",
  "Language": "en",
  "extra": {
    "Encoded_Date": "2021-06-18 01:48:09 UTC",
    "Tagged_Date": "2021-06-18 01:48:09 UTC",
    "Menu_For": "1,2",
    "_00_00_00_000": "Chapter 1",
    "_00_12_29_916": "Chapter 2",
    "_00_20_18_843": "Chapter 3",
    "_00_30_05_804": "Chapter 4",
    "_00_41_08_633": "Chapter 5",
    "_00_51_34_508": "Chapter 6",
    "_01_06_37_952": "Chapter 7",
    "_01_16_39_553": "Chapter 8",
    "_01_24_54_339": "Chapter 9",
    "_01_31_15_261": "Chapter 10",
    "_01_37_45_651": "Chapter 11",
    "_01_41_06_018": "Chapter 12",
    "_01_45_19_104": "Chapter 13",
    "_01_52_50_389": "Chapter 14",
    "_01_55_12_239": "Chapter 15",
    "_02_00_53_580": "Chapter 16",
    "_02_04_34_717": "Chapter 17"
  }
}

Here is an example code and what it outputs:

chapters_begin := mi.Parameter(mediainfo.StreamMenu, 0, "Chapters_Pos_Begin")
chapters_end := mi.Parameter(mediainfo.StreamMenu, 0, "Chapters_Pos_End")
printf("Chapters %d %d\n", chapters_begin, chapters_end)
for i := chapters_begin; i < chatpers_end; i++ {
	printf("Chapter %d: %s\n", i, mi.GetI(mediainfo.StreamMenu, 0, i, mediainfo.InfoName))
}
Chapters: 101 118
Chapter 101: Encoded_Date
Chapter 102: Tagged_Date
Chapter 103: Menu For
Chapter 104: 00:00:00.000
Chapter 105: 00:12:29.916
Chapter 106: 00:20:18.843
Chapter 107: 00:30:05.804
Chapter 108: 00:41:08.633
Chapter 109: 00:51:34.508
Chapter 110: 01:06:37.952
Chapter 111: 01:16:39.553
Chapter 112: 01:24:54.339
Chapter 113: 01:31:15.261
Chapter 114: 01:37:45.651
Chapter 115: 01:41:06.018
Chapter 116: 01:45:19.104

There is the right number of chapters, but the start/end is offset by 3. Is there something I did wrong on my end?

@JeromeMartinez
Copy link
Member

Please share a file with "offset by 3", easier for debugging. here or link to be sent at [email protected] if it can not be publicly shared.

@JeromeMartinez JeromeMartinez transferred this issue from MediaArea/MediaInfo Apr 8, 2024
@zoriya
Copy link
Author

zoriya commented Apr 8, 2024

I just did, thanks for the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants