simon-fu / mp4v2

Automatically exported from code.google.com/p/mp4v2
Other
0 stars 0 forks source link

add text (subtitles) support #5

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
add CLI support for subtitles; spec 14496-17

Original issue reported on code.google.com by Kona8l...@gmail.com on 3 Dec 2008 at 12:01

GoogleCodeExporter commented 9 years ago

Original comment by Kona8l...@gmail.com on 3 Dec 2008 at 12:01

GoogleCodeExporter commented 9 years ago
I have implemented mp4subtitle to support import/export of srt files. 

I had to make to changes to the library that are probably wrong. The text 
entered by the srt file seems to be more appropriate to be handled by a "text" 
track than a "subtl" track, but the functionality I needed was in the 
MP4AddSubtitleTrack function.

The resulting files are playable in VLC so I believe it is a good starting point

Original comment by sergio.g...@gmail.com on 23 May 2011 at 3:25

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by Kona8l...@gmail.com on 23 May 2011 at 5:02

GoogleCodeExporter commented 9 years ago
any feedback on this issue?

Original comment by sergio.g...@gmail.com on 5 Sep 2011 at 11:15

GoogleCodeExporter commented 9 years ago
Sorry, missed this.  I'm just glancing over the changes, and since MP4Subtitle 
is pretty much undone at the moment I don't see any reason not to accept the 
patch.  A few questions though.

1. Why change from MP4_SUBTITLE_TRACK_TYPE to MP4_TEXT_TRACK_TYPE?
2. What is an "srt" file, and what is the character encoding used?

Thanks

Original comment by kid...@gmail.com on 5 Sep 2011 at 6:26

GoogleCodeExporter commented 9 years ago
Hi,

I didn't know what was the best track type to use, any hint where are they 
defined? 
I just copied an example file that worked with vlc.

You can check the srt file format here: http://en.wikipedia.org/wiki/SubRip

As you said, the MP4Subtitle was empty, so I wanted to implement something 
simple to start with.

BR
Sergio

Original comment by sergio.g...@gmail.com on 5 Sep 2011 at 8:15

GoogleCodeExporter commented 9 years ago
What happens if you use a subtitle track?  does it still work in VLC?

Original comment by kid...@gmail.com on 6 Sep 2011 at 1:48

GoogleCodeExporter commented 9 years ago
I have not tried to play a file with the subtitle instead of the text track.

I have checked it, and I have only found this reference for "sbtl" in the TS 
24.245

"The sample table box ('stbl') contains sample descriptions for the text track. 
 Each entry is a sample entry box of type ‘tx3g’.  This name defines the 
format both of the sample description and the samples associated with that 
sample description." 

But the "text" handler is registered here.

http://www.mp4ra.org/handler.html

BR
Sergio

Original comment by sergio.g...@gmail.com on 6 Sep 2011 at 8:15

GoogleCodeExporter commented 9 years ago
something buggy about the loop that reads the SRT text--the part that slurps in 
the next chunk doesn't always get the boundaries right. i added the statement 
"printf("text:\n---------\n%s\n---------\n",text);" at 
util/mp4subtitle.cpp:291, and the attached test SRT gave the attached output on 
an --import command (which failed with "mp4subtitle: wrong srt format at 
sample:0").

note how sample 22 is the last one that's handled correctly; the next sample 
starts off a few characters earlier than it should, causing the atoi() call to 
get the sample number to fail.

Original comment by aaron.da...@gmail.com on 1 Jan 2013 at 8:38

Attachments: