sannies / mp4parser

A Java API to read, write and create MP4 files
Apache License 2.0
2.75k stars 566 forks source link

Adding chapter marks to mp4 as apart of the ISO/IEC 14496-17 spec with mp4parser #326

Open InlineData opened 6 years ago

InlineData commented 6 years ago

Hello I have been trying to use mp4parser to add timed text to an existing mp4 file to create chapter marks in said mp4 file.

Some background: Using Drax I have added chapter marks to files and observed in VLC that an additional stream was added to the file I was working with under Current Media Information -> Codec. This stream had a Codec of tx3g Type Subtitle. I would like to emulate adding chapters marks to an existing mp4 file using mp4parser since for a project I require to do this programmatically.

I have noticed looking through your project that there are a couple promising files: TextSampleEntry and QuicktimeTextTrackImpl. However, to my knowledge these only display the timed text. Also, trying to insert these into the metadata of a file with mp4parse as if they were a box structure didn't work either but made an "Unkown Box" with the tag tx3g (most definitely misusing your API I believe)

Please help me find the best way to this in your API. I would be most grateful for any help I could get!

Thank you so much

Sincerely, InlineData