[FFmpeg-devel] [PATCH 2/2] lavc/dvdsub_parser: parse start and end times.

Nicolas George george at nsup.org
Mon Jan 27 13:07:44 CET 2014

Le septidi 7 pluviôse, an CCXXII, Derek Buitenhuis a écrit :
> [04:20] < fundies> [greg at greg-desktop 15]$ mkvextract tracks dvd.mkv 2:vobsub
> [04:20] < fundies> Error: Track 2 with the CodecID 'S_VOBSUB' is missing the "codec private" element and cannot be extracted.
> [04:20] < fundies> any way to extract the vobsubs?
> [...]
> [09:39] < Mosu> fundies: Not with mkvextract, no.
> [09:40] < Mosu> You could simply patch that part out and re-compile, of course.
> [...]
> [20:08] < fundies> Mosu, cant you just fix it upstream? Shouldn't it really be a warning not an abort mission?
> [20:11] < Mosu> fundies: Well, it's not VobSub without the CodecPrivate stuff. That's the whole .idx file of the .idx/.sub pair.
> [20:13] < Mosu> Though I wouldn't reject patches that turn this into a warning and skip writing the .idx. The warning would have to be clear why the .idx isn't created.
> [20:17] < fundies> you must be able to generate an idx from just the .sub somehow as players know what time to display the subs without them
> [20:22] < Mosu> That's not the problem; the timestamps are indeed part of the Matroska cluster/block structure. They're therefore not stored in CodecPrivate. So creating the .sub without CodecPrivate is perfectly possible. But the .idx part contains information that simply is not available in the .sub part, and if it's not present in CodecPrivate then it cannot be created. If you look at an .idx file then everything but the "timestamp:" lines is what's unique to ...
> [20:22] < Mosu> ... the .idx file, and that information is simply not recreatable. Yes, you can play the .sub without the palette information etc. But I haven't seen one legitimate file that does this.
> [20:22] < Mosu> Anyway, like I said, I'm open to patches. I just won't do it myself as I have no such files and currently no interest in spending the time on it. Sorry.
> [20:23] < fundies> I'm not a programmer so I couldn't fix it
> [20:24] < fundies> also ffmpeg always generates files like this
> [20:24] < Mosu> Then don't use ffmpeg.
> [20:24] < fundies> I have to
> [20:25] < fundies> dgindex causes desync
> [20:25] < Mosu> I've already spent eight hours coding today, and I seriously am not in the business of granting everybody's wishes. So I'm sorry, but no.
> [20:43] < Rodeo> someone should really fix ffmpeg then
> [20:43] < Daemon404> ... or even report it
> [20:43] < Rodeo> if it actually doesn't write CodecPrivate for VobSub
> [20:43] < Rodeo> yeah, that too
> [20:43] < fundies> it is reported and theres a patch
> [20:43] < Rodeo> fundies: surely you can do that, if you have a reproducible test case?
> [20:43] < fundies> but is been ignored
> [20:43] < Daemon404> fundies, link
> [20:43] < Daemon404> i will try and push it through
> [20:43] < Rodeo> ah, where is the report please
> [20:44] < fundies> h/o lemme find it
> [20:44] < wm4> ffmpeg generates what?
> [20:44] < wm4> vobsubs without codec private?
> [20:44] < Daemon404> apparently
> [20:44] < fundies> http://trac.ffmpeg.org/ticket/2035
> [20:44] < wm4> how evil
> [20:45] < wm4> oh I see
> [20:45] < wm4> remuxing from VOB
> [20:45] < Daemon404> fundies, added to my TODO for tomorrow
> [20:45] < wm4> I don't know much about this stuff, but I'm not sure if ffmpeg can even get the "codec private" from this?
> [20:45] < wm4> e.g. libdvdread returns this information separately from the mpeg stream

Thanks for the excerpt. I suspect this is unrelated to this patch, though.
This discussion is about the IDX file / codec extradata. IIRC, FFmpeg
handles it correctly, but the required information is frequently not
present: dvdsub come from MPEG-PS VOB streams, but the palette information
and the rest of the IDX file are in the IFO file of DVD-video structures. As
long as FFmpeg does not support libdvdread / libdvdnav, there is not much
that can be done.

This patch addresses the packet duration problem: packet in MPEG-PS VOB have
no duration, parsing the packets is necessary to determine it. Duration is
mandatory on Matroska subtitles packets.


  Nicolas George

More information about the ffmpeg-devel mailing list