mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-02-15 05:26:07 +00:00
[BUG] DVB subtitles timing issue #504
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jakubvojacek on GitHub (Sep 3, 2019).
CCExtractor version (using the --version parameter preferably) : 0.88 (
724d756aa6)In raising this issue, I confirm the following (please check boxes, eg [X] - and delete unchecked ones):
My familiarity with the project is as follows (check one, eg [X] - and delete unchecked ones):
Necessary information
ccextractor -in=ts -ocrlang por -quant 0 -datapid 0x1448 telecine.tsVideo links (replace text below with your links)
https://bit.ly/2kczK9X
Additional information
The subtitles are parsed out perfectly, the only issue is that whenever there is silence (nobody speaking), the last subtitle is always shown, until someone starts to speak. You can easily test this in VLC, turn on DVB subs on for example on 0:46, there is a pause in the subtitles (none are showing in VLC).
In the extracted subtitles, there is no pause, each subtitle is always 1ms after the previous ends - see below:
Is there a configuration option that we can use to fix this? Or is this an issue in the ccextractor?
Thank you
Jakub
@NilsIrl commented on GitHub (Dec 22, 2019):
None of the arguments are relevant to the problem.
@NilsIrl commented on GitHub (Dec 22, 2019):
mpv gives the same output as ccextractor. (There aren't any pause between the subtitles)I couldn't test on VLC as it doesn't want to open the file@NilsIrl commented on GitHub (Dec 22, 2019):
There are 2 subtitle stream in the file. Stream 2 seems to correspond with the output given by CCExtractor and has no pauses between the subtitles.@NilsIrl commented on GitHub (Dec 22, 2019):
To me, there is no bug here@NilsIrl commented on GitHub (Dec 22, 2019):
If the timestamps are supposed to be in sync with the video, the timestamps aren't in sync with the ones given by mpv.
The problem is not only that there are gaps between the timestamps but that the timestamps are wrong
@NilsIrl commented on GitHub (Dec 22, 2019):
This line seems to be the origin of the problem:
c1c0627dab/src/lib_ccx/dvb_subtitle_decoder.c (L1689)@NilsIrl commented on GitHub (Dec 23, 2019):
@cfsmp3 @jakubvojacek is there any possibility this could be a regression?
@NilsIrl commented on GitHub (Dec 23, 2019):
May or may not be the function that collects the timings
c1c0627dab/src/lib_ccx/ts_functions.c (L741)@jakubvojacek commented on GitHub (Dec 23, 2019):
Hello @NilsIrl , thank you for looking into this.
I tested the file on VLC again, selected the first track (
DVB Subtitles - [Portuguese]) and it was showing pauses in between subtitles, unlike the generated srt file by ccextractor. I can provide a recorded video of the VLC player if necessary.Please let me know if you need any further clarification/
Once again, thank you
Jakub
@NilsIrl commented on GitHub (Dec 23, 2019):
No, don't worry, as you can see, I have striked-through my comments, I accidentally used ccextractor's output as subtitles for mpv which is why I was confused.
@cfsmp3 commented on GitHub (Dec 27, 2019):
Very likely.
@NilsIrl commented on GitHub (Jan 10, 2020):
After bisecting I found the commit that made timing look sensible for the first time:
016674b0ebIt's not perfect though (first timestamp is at 0):
This is what it looked like before:
@NilsIrl commented on GitHub (Jan 11, 2020):
a5dcf9242dis the commit that made all subtitles one next to the other.@cfsmp3 commented on GitHub (Jan 11, 2020):
I think that was Anshul's original work on DVB, but that specific issue (as
well was many related to times) were fixed in 2017.
So there must be another commit that reintroduced the problem.
On Fri, Jan 10, 2020 at 4:13 PM Nils ANDRÉ-CHANG notifications@github.com
wrote:
@NilsIrl commented on GitHub (Jan 11, 2020):
So it's a double regression?
@cfsmp3 commented on GitHub (Jan 11, 2020):
I'd call it a regression :-) The first implementation did DVB but
timing was broken (completely).
Then it was fixed, by a GCI winner by the way I think in 2016, and
clearly seems to be broken again.
I haven't looked at the code at all but if you're looking into this
some background:
In DVB subtitles are replaced by subtitles- they don't have a
duration, and there isn't a clear screen command. This means that if
you write something it stays there until something else replaces
it(*). However, that "something else" can be "nothing" (as in empty).
My guess is that we are now filtering that and when there's an empty
string we're not passing it to the encoder. So this is a case of being
to clever optimizing stuff.
(*) Actually the specs mention a timeout of I think 30 seconds, but
let's ignore that case for now.
On Fri, Jan 10, 2020 at 4:18 PM Nils ANDRÉ-CHANG
notifications@github.com wrote:
@NilsIrl commented on GitHub (Jan 11, 2020):
Please keep in mind that it isn't the only problem. The other one is that all the subtitles are at the wrong "offset".
For the given input file (telecine.ts), it is exactly (at least what my eyes would qualify as such), 6600 millisecond early.
@cfsmp3 commented on GitHub (Jan 12, 2020):
@NilsIrl compare it with
0.85 (2017-01-23)
Fix: DVB timing is finally good.
Let's use 0.85 as the "known good version" for DVB timing reference.
How are the results on that one?
@NilsIrl commented on GitHub (Jan 12, 2020):
0.85 doesn't compile on my computer 😄
@NilsIrl commented on GitHub (Jan 12, 2020):
It doesn't work with cmake or the linux build script
@NilsIrl commented on GitHub (Jan 12, 2020):
0.85 doesn't look good to me. It gives the same result as master.
@cfsmp3 commented on GitHub (Jan 12, 2020):
Try a different input file. Maybe that telecine.ts is not great.
https://drive.google.com/drive/folders/0B_61ywKPmI0TUUk5LXJPeG1feFE
I remember I used EastEnders to test and the sync for absolutely perfect.
Remember that you need to compare with the output of the subtitles as
displayed for example with VLC, not the audio. The DVB subtitles
might be off-sync with the audio and that's not our problem.
On Sun, Jan 12, 2020 at 12:47 PM Nils ANDRÉ-CHANG
notifications@github.com wrote:
@NilsIrl commented on GitHub (Jan 12, 2020):
The results with EastEnders are perfect on master.
So the problem is specific to telecine.ts
@cfsmp3 commented on GitHub (Jan 12, 2020):
Play telecine.is in VLC as well, and enable DVB subtitles. Do they look as
bad as in CCExtractor, or are they in sync? If VLC and CCExtractor do the
same thing I'd say it's safe to say the problem is with that file.
If VLC plays it correctly and we don't, then we have a job to do :-)
On Sun, Jan 12, 2020 at 1:11 PM Nils ANDRÉ-CHANG notifications@github.com
wrote:
@NilsIrl commented on GitHub (Jan 12, 2020):
What I do to debug is:
End result:
@cfsmp3 commented on GitHub (Jan 12, 2020):
OK but what about the output of mpv relative to audio? Is it in sync, or a
disaster?
If there isn't any player that can play that file correctly, we can forget
about that file, even if the output is different to CCExtractor's (because
we don't know which one is correct). However if mpv plays it correctly
(subtitles and audio are in sync) then we have a problem.
On Sun, Jan 12, 2020 at 1:33 PM Nils ANDRÉ-CHANG notifications@github.com
wrote:
@NilsIrl commented on GitHub (Jan 12, 2020):
Yeah MPV (like VLC I assume) gives subtitles that are in sync with the audio (for east enders + telecine).
So the problem is with ccextractor in this specific case.
@cfsmp3 commented on GitHub (Jan 12, 2020):
Can you fix it? :-)
On Sun, Jan 12, 2020 at 1:45 PM Nils ANDRÉ-CHANG
notifications@github.com wrote:
@NilsIrl commented on GitHub (Jan 13, 2020):
I wish. It doesn't look straightforward at all.
@NilsIrl commented on GitHub (Jan 18, 2020):
Is there a tool I can use so that I can visualise the difference in program flow between two runs (in this case, compare eastenders and telecine)?
@NilsIrl commented on GitHub (Jan 19, 2020):
For those who want to analyze the flow here is the callgrind output for the command:
and
the only difference is the input file. (one works eastenders, and the other has wrong timestamps telecine)
callgrind.zip
I'm posting this here becaues it takes 1+ hour for the commands to run
@wojtekw commented on GitHub (Feb 3, 2020):
I have similiar problem with ts file.Trying output to spupng but always start of the subtitles is:
<spu start="0.000" end="4.239"
The very weird for me is that ccx shows in output:
Min PTS: 00:00:38:220
Max PTS: 01:53:39:940
So why the first subtitle is 00:00:00 not 00:00:38 ?
Can anyone help? Lost few days for this issue :(
@NilsIrl commented on GitHub (Feb 3, 2020):
Could you make the
.tsfile accessible? That would help a lot.@wojtekw commented on GitHub (Feb 3, 2020):
Unfortunately can't upload this file anywhere. It's movie from one of the majors.
This what I checked that all times are differented of this Min PTS. If I add to every time this Min PTS all would be correct
@cfsmp3 commented on GitHub (Feb 3, 2020):
We can't help without access to the file.
You can just share a link with us privately by email - of course we deal
with this kind of content all the time.
If that's not an option we really can't help you.
On Mon, Feb 3, 2020 at 1:00 PM wojtekw notifications@github.com wrote:
@wojtekw commented on GitHub (Feb 4, 2020):
@cfsmp3 I understand but really can't share this movie.
First what I see in this file is that it can't play in VLC but plays in QuickTime
Is that normal when Min PTS: 00:00:38:220 and first line of subtitles is <spu start="0.000" end="4.239" ?
I expected <spu start="0.000" end="38.220...
@wojtekw commented on GitHub (Feb 16, 2020):
Still have this problem, I see that CCX uses FTS timing instead PTS and I can't find which param can change it.
-nogt doesn't work
@wojtekw commented on GitHub (Feb 17, 2020):
@NilsIrl Can You help without TS file ? I'm afraid that there is some parameter that can fix this problem.
@NilsIrl commented on GitHub (Feb 17, 2020):
As far as I'm aware, this is a bug and there aren't any ways to fix it apart from actually fixing it.
I'd love to fix it unfortunately I've only worked on the encoders (and this involves decoders) and I'm really lost as to what could fix the problem.
@cfsmp3 commented on GitHub (Feb 17, 2020):
If you can't trust us with your file then there's nothing we can do for you I'm afraid.
Well, unless you actually sponsor the research and then we can spend time trying to blindly solve your problem.
But being blunt, we're not going to do it on our own free time. Sorry.