c2play icon indicating copy to clipboard operation
c2play copied to clipboard

subtitle multiplication

Open clinty opened this issue 8 years ago • 7 comments

Sometimes after hitting the left arrow key to go back, subtitles will be doubled or tripled for some time.

clinty avatar Nov 10 '16 04:11 clinty

Sounds like a flushing issue. I will investigate it.

OtherCrashOverride avatar Nov 11 '16 07:11 OtherCrashOverride

I am not able to reproduce this so I will need a sample stream that demonstrates the issue.

OtherCrashOverride avatar Nov 13 '16 22:11 OtherCrashOverride

This isn't the best example, but if you download http://ftp.nluug.nl/pub/graphics/blender/demo/movies/Sintel.2010.720p.mkv and convert the subtitles from subrip (srt) to subrip (native) as in

ffmpeg -i /tmp/Sintel.2010.720p.mkv -c:v copy -c:a copy -c:s subrip /tmp/sintel.mkv

then play until there's actual dialog, then hit left arrow, you should see the subtitles doubled the second time around.

clinty avatar Nov 22 '16 02:11 clinty

Can you provide a specific time index in h:mm:ss format to seek to? This will ensure I am seeing what is being reported.

OtherCrashOverride avatar Nov 22 '16 11:11 OtherCrashOverride

--time 00:02:24.00 --subtitle 0

The timing of keypresses seems to be pretty significant, but if you hit <Left><Right><Left><Right> somewhat quickly you should get to see 2x subtitles and then 3x subtitles.

If you start at 2:04 or 2:05 or so, a single <Right> can induce the doubling.

clinty avatar Nov 27 '16 18:11 clinty

I think I have finally been able to reproduce this. I triggered it using the right arrow (forward) instead of the left arrow. The subtitles were repeated for several lines.

C2play does not handle the layout of subtitles. It only presents what it is told to where it is told to. This means the bug likely is in libass. C2play is being instructed by the libass decoder to produce all the repeating subtitles:

The following log output shows this behavior. One line of subtitle text causes libass to produce several subtitle rectangles:

Subtitle: pts=148.850000 duration=2.900000
Subtitle: format=1, start_display_time=0, end_display_time=2900, num_rects=1, pts=148850000
Subtitle: Rect - x=0, y=0, w=0, h=0, nb_colors=0, text=(nil), ass=0x7f6c31fd60
Subtitle:       SSA/ASSA: Dialogue: 0,0:00:00.00,0:00:00.00,Default,,0,0,0,,Ein gefährliches Unterfangen für eine\Neinsame Jägerin.

replacing bogus timestamp
Start Time=0:02:28.85
End Time=0:02:31.75
New string=Dialogue: 0,00:02:28.85,0:02:31.75,Default,,0,0,0,,Ein gefährliches Unterfangen für eine\Neinsame Jägerin.

ass_render_frame OK
ASS_Image: w=903, h=75, stride=928, bitmap=0x7f6c064ee0, color=0x00000000, dst_x=516, dst_y=926, next=0x7f6c31fa80, type=1
ass_render_frame OK
ASS_Image: w=416, h=74, stride=416, bitmap=0x7f6c0c1c60, color=0x00000000, dst_x=752, dst_y=987, next=0x7f6c31f930, type=1
ass_render_frame OK
ASS_Image: w=887, h=59, stride=896, bitmap=0x7f6c058020, color=0xffffff00, dst_x=519, dst_y=930, next=0x7f6c213050, type=0
ass_render_frame OK
ASS_Image: w=415, h=58, stride=416, bitmap=0x7f6c0bbde0, color=0xffffff00, dst_x=755, dst_y=991, next=0x7f6c31ffa0, type=0
ass_render_frame OK
ASS_Image: w=903, h=75, stride=928, bitmap=0x7f6c064ee0, color=0x00000000, dst_x=516, dst_y=806, next=0x7f6c31f750, type=1
ass_render_frame OK
ASS_Image: w=416, h=74, stride=416, bitmap=0x7f6c0c1c60, color=0x00000000, dst_x=752, dst_y=867, next=0x7f6c3260b0, type=1
ass_render_frame OK
ASS_Image: w=887, h=59, stride=896, bitmap=0x7f6c058020, color=0xffffff00, dst_x=519, dst_y=810, next=0x7f6c330d20, type=0
ass_render_frame OK
ASS_Image: w=415, h=58, stride=416, bitmap=0x7f6c0bbde0, color=0xffffff00, dst_x=755, dst_y=871, next=0x7f6c4c7e80, type=0
ass_render_frame OK
ASS_Image: w=903, h=75, stride=928, bitmap=0x7f6c064ee0, color=0x00000000, dst_x=516, dst_y=686, next=0x7f6c4c7ec0, type=1
ass_render_frame OK
ASS_Image: w=416, h=74, stride=416, bitmap=0x7f6c0c1c60, color=0x00000000, dst_x=752, dst_y=747, next=0x7f6c330270, type=1
ass_render_frame OK
ASS_Image: w=887, h=59, stride=896, bitmap=0x7f6c058020, color=0xffffff00, dst_x=519, dst_y=690, next=0x7f6c3302b0, type=0
ass_render_frame OK
ASS_Image: w=415, h=58, stride=416, bitmap=0x7f6c0bbde0, color=0xffffff00, dst_x=755, dst_y=751, next=(nil), type=0
SubtitleRenderElement::ProcessBuffer - Added (StartTime=148.850000 StopTime=151.750000 Sprite=0x7f64005c60)
SubtitleRenderElement::ProcessBuffer - Added (StartTime=148.850000 StopTime=151.750000 Sprite=0x7f64005cf0)
SubtitleRenderElement::ProcessBuffer - Added (StartTime=148.850000 StopTime=151.750000 Sprite=0x7f64005d80)
SubtitleRenderElement::ProcessBuffer - Added (StartTime=148.850000 StopTime=151.750000 Sprite=0x7f64005e10)
SubtitleRenderElement::ProcessBuffer - Added (StartTime=148.850000 StopTime=151.750000 Sprite=0x7f64005ea0)
SubtitleRenderElement::ProcessBuffer - Added (StartTime=148.850000 StopTime=151.750000 Sprite=0x7f64005f30)
SubtitleRenderElement::ProcessBuffer - Added (StartTime=148.850000 StopTime=151.750000 Sprite=0x7f64005fc0)
SubtitleRenderElement::ProcessBuffer - Added (StartTime=148.850000 StopTime=151.750000 Sprite=0x7f64006050)
SubtitleRenderElement::ProcessBuffer - Added (StartTime=148.850000 StopTime=151.750000 Sprite=0x7f640060e0)
SubtitleRenderElement::ProcessBuffer - Added (StartTime=148.850000 StopTime=151.750000 Sprite=0x7f64006170)
SubtitleRenderElement::ProcessBuffer - Added (StartTime=148.850000 StopTime=151.750000 Sprite=0x7f64006200)
SubtitleRenderElement::ProcessBuffer - Added (StartTime=148.850000 StopTime=151.750000 Sprite=0x7f64006290)

OtherCrashOverride avatar Nov 30 '16 18:11 OtherCrashOverride

I don't know if this is related: at some point in time subtitles stop being displayed and then they never come back regardless of seeking.

clinty avatar Jan 08 '17 05:01 clinty