Opened 17 years ago

Closed 16 years ago

#6753 closed defect (fixed)

Some DVB subtitles are delayed

Reported by: otto at kolsi dot fi Owned by: Janne Grunau
Priority: minor Milestone: 0.23
Component: MythTV - Video Playback Version: 0.22-fixes
Severity: medium Keywords:
Cc: Ticket locked: yes

Description

Probably because of the ffmpeg sync, current trunk shows some DVB subtitles delayed. When the delay happens, it is something like 1-3 secs.

Sample file can be downloaded from here (you need couple of annoying clicks and some waiting): http://www.zshare.net/video/62954529d73feefb/

In sample, when there is a cut in the program and the camera turns, the first subtitles should be displayed immediately when guy starts to speak. Correct timing can be verified with e.g. VLC (linux/win).

I've used "mythtv" to play the sample file but the same problem can be seen with mythfrontend also.

Attachments (3)

avfd_packet_queues_v1.diff (14.7 KB ) - added by Janne Grunau 17 years ago.
implements packet queues for avformatdecoder
dvb_subtiles_workaround.patch (49.1 KB ) - added by anonymous 17 years ago.
A temporary solution is to revert to an older version of mpegts.{h,c}. Attaced patch works for me.
ticket_6753_fix_dvb_subtitle_delay.diff (749 bytes ) - added by Janne Grunau 16 years ago.

Download all attachments as: .zip

Change History (21)

comment:1 by Janne Grunau, 17 years ago

Milestone: unknown0.22
Owner: changed from Isaac Richards to Janne Grunau
Status: newaccepted

comment:2 by otto at kolsi dot fi, 17 years ago

Here is another sample for DVB subtitle problem. When this one is played with "mythtv", the subtitles are shown only very briefly (some tens of milliseconds?). The delay problem described earlier in this ticket happens to all(?) programs while this millisecond problem is quite rare.

I've seen this happening already before ffmpeg sync so it might not be related to that. Again tested with VLC and it can show the subs correctly for this sample.

http://www.zshare.net/video/63044735cc35c7d6/

comment:3 by jheikkal@…, 17 years ago

Same problem here. Subtitle appearance duration is really annoying because it happens constantly on some channels. Another sample : Subtitle Duration sample

Subtitle delay problem sample : Subtitle Sync sample

Both play nicely with vlc.

by Janne Grunau, 17 years ago

Attachment: avfd_packet_queues_v1.diff added

implements packet queues for avformatdecoder

comment:4 by jheikkal@…, 17 years ago

Patch breaks seeking. Crashes when trying to fast forward or skip or anything...

comment:5 by jheikkal@…, 17 years ago

Did a bit more digging and testing because some channels are useless because of this bug(damn wife doesn't understand english well ;)

That patch fixes subtitle displaying duration but delay is still there. One problem is that patch breaks back/ff skipping.

Skipping backards log http://mythtv.pastebin.ca/1579286

Skipping backwards crash log http://mythtv.pastebin.ca/1579287

Skpping forwards log http://mythtv.pastebin.ca/1579288

comment:6 by Janne Grunau, 17 years ago

(In [22320]) try to fix timestamps of delayed subtitles. Refs #6753

this should ensure that the subtiltes have a resonable display time it does not fix the cause, the subtitle packets are returned very late from the mpeg ts demuxer. It's a regression of the ffmpeg sync in [20797] the upstream demuxer behaves in the same way. I intend to make the demuxing independent of the GetFrame for 0.23 so that we handle improperly interleaved streams better

comment:7 by Janne Grunau, 17 years ago

Milestone: 0.220.23

comment:8 by Martin R Mortensen <martin.rene.mortensen@…>, 17 years ago

After upgrading to 0.22 I seem to problem also. in DK DVB channels DR1, DR2 have fine subtitles, but TV2 has consistently delayed subtitles. I checked both 22-fixes and trunk. This makes one channel unwatchable so far. Was there a temporary fix for this? It seems that 22320 didnt make it better.

by anonymous, 17 years ago

A temporary solution is to revert to an older version of mpegts.{h,c}. Attaced patch works for me.

comment:9 by Martin R Mortensen <martin.rene.mortensen@…>, 17 years ago

patch is rejected partially when patching 22-fixes(22864m): root@darkmedia:/usr/local/src/22-fixes/mythtv# patch -p0 <dvb_subtiles_workaround.patch patching file libs/libavformat/mpegts.c Hunk #2 FAILED at 19. 1 out of 80 hunks FAILED -- saving rejects to file libs/libavformat/mpegts.c.rej patching file libs/libavformat/mpegts.h

And I think reverting to before the ffmpeg sync will break the LATM AAC patch, which I need for sound. I'm a bit at a loss here.

comment:10 by Klavs Klavsen <kl@…>, 17 years ago

Subscribing - bitten by same bug :(

comment:11 by anonymous, 17 years ago

Does anybody know when this patch (or other) will be added to the 22-fixes tree?

comment:12 by mlgim, 17 years ago

Same problem here - I also need the ffmpeg sync patched level AND I'm bitten by this bug :0(

comment:13 by stuartm, 17 years ago

Ticket locked: set

Discussion belongs on the mailing lists NOT in trac.

comment:14 by Janne Grunau, 16 years ago

Milestone: 0.230.24

comment:15 by Janne Grunau, 16 years ago

(In [24242]) libav: emit pes packets from the mpeg-ts demuxer on completion

Emitting the packets on the start of the next pes packet causes delayed DVB subtitles. Refs #6753

comment:16 by Janne Grunau, 16 years ago

(In [24243]) libav: update [24242] to the version sent to ffmpeg-devel, Refs #6753

comment:17 by Janne Grunau, 16 years ago

(In [24251]) backports [24242:24243] from trunk

libav: emit pes packets from the mpeg-ts demuxer on completion Emitting the packets on the start of the next pes packet causes delayed DVB subtitles. Refs #6753

by Janne Grunau, 16 years ago

comment:18 by Janne Grunau, 16 years ago

Milestone: 0.240.23
Resolution: fixed
Status: acceptedclosed
Version: head0.22-fixes

closing as fixed, if anyone still using 0.22-fixes reports success with ticket_6753_fix_dvb_subtitle_delay.diff, I'll commit it to 0.22-fixes.

Note: See TracTickets for help on using tickets.