MP4 question about chapter list to txt

Started by andy95, October 11, 2020, 09:55:20 AM

Previous topic - Next topic

andy95

Hello. My question is very simple but sorry I found not a answer...
How I can extract and import chapter from a mp4 file with exiftool?

If I make: exiftool.exe test.mp4
I see "Chapter List" but how can I extract this simple tag to a txt file and than modified back to the mp4?

Example:
with ffmpeg: ffmpeg.exe" -i "test.mp4" -f ffmetadata "test.txt"
with mp4box: mp4box.exe "test.mp4" -dump-chap-ogg
with drax: drax.exe" /export:"test.txt" /file:"test.mp4"

I have tested ffmpeg, mp4box and drax but all tools are OK for extract but not for the import.
Drax and mp4box crash, ffmpeg metadata too complex for post-processing.

I hope soo that ExifTool can help me.
Thanks and Regards.

StarGeek

I don't have any files that have a ChapterList to test for extraction, but if you check on the Quicktime tags page, you'll see that exiftool cannot write ChapterList.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

andy95

It is very strange. Chapter List is displayed by "ExifTool"...
Many of my mp4 files have this option (Encoding with ShanaEncoder).

StarGeek

I didn't deny that the ChapterList tag doesn't exist.  It's just I have no samples that include it so I can't help on the extraction side. 
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

andy95

Thank's StarGeek for your Info and help.

I have make a example file (see attachment).
Please can you test it?

I could find out if I have a .mkv file with chapter and copy the stream from mkv to mp4 with Shanaencoder
than I have the chapter list (Chapterlist) Option into the mp4 file.

StarGeek

Ok, so I see this value in that file
[0:00:00.000] 1 | Chapter*[0:01:00.000] 2 | Chapter*[0:02:00.000] 3 | Chapter*[0:03:00.000] 4 | Chapter*[0:04:00.000] 5 | Chapter

What is it you want to do with it?  As I said, exiftool can't edit this info.

When you mentioned mkv, I realized I had some dvds ripped to mkv and they have chapter info, but in a completely different format. In those, it shows as
---- Chapter1 ----
ChapterTimeStart                : 0 s
ChapterTimeEnd                  : 0:02:01
ChapterString                   : Chapter 01
ChapterLanguage                 : eng
---- Chapter2 ----
ChapterTimeStart                : 0:02:01
ChapterTimeEnd                  : 0:04:06
ChapterString                   : Chapter 02
ChapterLanguage                 : eng
---- Chapter3 ----
ChapterTimeStart                : 0:04:06
ChapterTimeEnd                  : 0:06:11
ChapterString                   : Chapter 03
ChapterLanguage                 : eng


But exiftool has no ability to edit mkv files.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

andy95

Thanks again StarGeek

Quote from: StarGeek on October 12, 2020, 10:43:14 AM
Ok, so I see this value in that file
[0:00:00.000] 1 | Chapter*[0:01:00.000] 2 | Chapter*[0:02:00.000] 3 | Chapter*[0:03:00.000] 4 | Chapter*[0:04:00.000] 5 | Chapter

What is it you want to do with it? 

I will extract the chapter list to txt and rename to (example):
[0:00:00.000] 1 | New Title *[0:01:00.000] 2 | Again*[0:02:00.000] 3 | xxxx*[0:03:00.000] 4 | OK*[0:04:00.000] 5 | test

The file is not a mkv! - It's a mp4 file.

OK. I make it with drax:
drax.exe /export:"test.txt" /file:"xy.mp4"
The txt content can I manuell rename.

Than with mp4box back to mp4 file:
mp4box.exe -chap "test.txt" "xy.mp4"

I had hoped that exiftool can extract and import the chapter it (only mp4 files).

StarGeek

Quote from: andy95 on October 12, 2020, 11:30:11 AM
I will extract the chapter list to txt and rename to (example):
[0:00:00.000] 1 | New Title *[0:01:00.000] 2 | Again*[0:02:00.000] 3 | xxxx*[0:03:00.000] 4 | OK*[0:04:00.000] 5 | test
You could use this command.  It will make a text file with the contents of the ChapterList tag for every file it processes.
exiftool -ChapterList -s3 -w txt /path/to/files/

QuoteThe file is not a mkv! - It's a mp4 file.
You brought up mkv files.  I was only commenting on what you said.

QuoteI had hoped that exiftool can extract and import the chapter it (only mp4 files).
As I said, exiftool cannot write this data.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype