GNOME Bugzilla – Bug 357503
[suparse] wrong timing with microdvd subtitles
Last modified: 2007-02-17 14:40:55 UTC
I have some videos with microdvd subtitles. Totem (Gstreamer backend) plays the videos but does not seem to time the subtitles correctly. The subtitles have the extension .sub and look like this: {1}{1}23.976 {2852}{2907}- Hi, Eddie.|- Hiya, Scotty. {2911}{2994}- Cold enough for you?|- Well, I'm only faintly alive. It's 25 below. MPlayer plays and times the subtitles correctly.
Solid subtitle support is one of the things still keeping me from playing all my videos with GStreamer, so is there something I can do to debug this further? If my understanding of microdvd subtitles are correct, they are timed using the framerate of the video. How can I make sure this is being correctly identified?
It would be helpful if you could - attach an example .sub file - give (rough) timings in seconds for the first few subtitles of that particular file (mplayer will show the seconds at the bottom somewhere). Haven't actually looked into this, might just be something trivial. When you say "does not time the subtitles correctly", what do you mean exactly? Is it a constant delay? Or is the delay increasing over time?
Hi, I think I have parts of it figured out. There is not a delay, but GStreamer display the subtitles too early. MPlayer displays the second subtitle (see above) at about 119 seconds, Totem at about 78 seconds. It doesn't seem to be any delay between two subtitles, both MPlayer and Totem have the same timings. The reason for GStreamer being off seems to be this line: state->start_time = (start_frame - 1000) / frames_per_sec * GST_SECOND; I don't know why 1000 frames are subtracted, but if I remove that, Totem display the subtitles with correct timings. As for my inital guess about framerates being calculated wrong, GStreamer is hardcoded to use 23.976 fps: const double frames_per_sec = 24000 / 1001.; This means one of my videos (25 fps) still doesn't display with microdvd subtitles correctly, but I guess I will file that as a seperate request.
I was looking at the code earlier as well, and I have no idea where the -1000 comes from or what it's supposed to be fore. Seems to have been there since the very beginning. Probably a debugging phase leftover. About the framerate: it should read that from the first line if it is available, and otherwise assume something. Does the subtitle file that's still off say 25.000 in the first line?
No, it doesn't. But adding it doesn't seem to make any difference either.
> No, it doesn't. But adding it doesn't seem to make any difference either. Not surprising, since the code doesn't look for a framerate in the first line yet :) I've committed this now: 2007-01-08 Tim-Philipp Müller <tim at centricular dot net> * gst/subparse/gstsubparse.c: (parse_mdvdsub): * gst/subparse/gstsubparse.h: Remove spurious 1000 subtrahend when calculating the timestamp from the frame number and the frame rate . Also, use the frames/second value specified in the first line of the file, if one is specified there. Should fix #357503. * tests/check/elements/subparse.c: (do_test), (test_tmplayer_do_test), (test_microdvd_do_test), (GST_START_TEST), (subparse_suite): Add some basic unit tests for the microdvd subtitle format. Please file new bugs if you find any further issues.
*** Bug 408012 has been marked as a duplicate of this bug. ***
I try newest gstreamer-plugins-base-0.10.11 but subtitles still wrong. Did subtitles framerate should be get from movie framerate ? Why gstreamer still can't play subtitles? Other players support all type of subtitles.
> I try newest gstreamer-plugins-base-0.10.11 but subtitles still wrong. It's not fixed in 0.10.11, it's only fixed in CVS. > Did subtitles framerate should be get from movie framerate? No, that doesn't make sense IMHO. If no frame rate is specified, assuming one is just as good as using a random move framerate, I think. You can specify the framerate in the first line if you like.
(In reply to comment #9) > > I try newest gstreamer-plugins-base-0.10.11 but subtitles still wrong. > > It's not fixed in 0.10.11, it's only fixed in CVS. Yes, CVS version of gstsubparse works :) > > Did subtitles framerate should be get from movie framerate? > > No, that doesn't make sense IMHO. If no frame rate is specified, assuming one > is just as good as using a random move framerate, I think. You can specify the > framerate in the first line if you like. Did framerate of subtitles is not the same as movie?