Opened 7 years ago

Closed 7 years ago

#3737 closed defect (fixed)

Reencoding dvdsub to dvbsub produces subtitles that do not disappear correctly

Reported by: Carl Eugen Hoyos Owned by: Anshul
Priority: normal Component: avcodec
Version: git-master Keywords: dvbsub
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

http://samples.ffmpeg.org/MPEG-VOB/ClosedCaptions/Starship_Troopers.vob
Reencoding this sample to a vob file produces subtitles with correct timings (subtitles that do disappear) very similar to the original file, reencoding to transport streams and dvbsub produces an output file with subtitles that do not disappear as for the original file.

$ ffmpeg -i Starship_Troopers.vob -qscale 2 -mbd 2 -scodec dvbsub -t 30 -r 24000/1001 out.ts
ffmpeg version N-64138-g7e6cf36 Copyright (c) 2000-2014 the FFmpeg developers
  built on Jun 22 2014 21:44:20 with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl
  libavutil      52. 90.100 / 52. 90.100
  libavcodec     55. 68.100 / 55. 68.100
  libavformat    55. 44.100 / 55. 44.100
  libavdevice    55. 13.101 / 55. 13.101
  libavfilter     4.  9.100 /  4.  9.100
  libswscale      2.  6.100 /  2.  6.100
  libswresample   0. 19.100 /  0. 19.100
  libpostproc    52.  3.100 / 52.  3.100
Input #0, mpeg, from 'Starship_Troopers.vob':
  Duration: 00:00:51.30, start: 1986.626100, bitrate: 4618 kb/s
    Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p(tv), 720x480 [SAR 32:27 DAR 16:9], max. 9800 kb/s, 29.97 fps, 59.94 tbr, 90k tbn, 59.94 tbc
    Stream #0:1[0x83]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
    Stream #0:2[0x82]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
    Stream #0:3[0x80]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
    Stream #0:4[0x81]: Audio: ac3, 48000 Hz, 5.1(side), fltp, 384 kb/s
    Stream #0:5[0x20]: Subtitle: dvd_subtitle
    Stream #0:6[0x22]: Subtitle: dvd_subtitle
Please use -q:a or -q:v, -qscale is ambiguous
[mpegts @ 0x2f09a60] Using AVStream.codec.time_base as a timebase hint to the muxer is deprecated. Set AVStream.time_base instead.
    Last message repeated 2 times
Output #0, mpegts, to 'out.ts':
  Metadata:
    encoder         : Lavf55.44.100
    Stream #0:0: Video: mpeg2video, yuv420p, 720x480 [SAR 32:27 DAR 16:9], q=2-31, 200 kb/s, 23.98 fps, 90k tbn, 23.98 tbc
    Metadata:
      encoder         : Lavc55.68.100 mpeg2video
    Stream #0:1: Audio: mp2, 48000 Hz, stereo, s16, 384 kb/s
    Metadata:
      encoder         : Lavc55.68.100 mp2
    Stream #0:2: Subtitle: dvb_subtitle (dvbsub)
    Metadata:
      encoder         : Lavc55.68.100 dvbsub
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg2video (native) -> mpeg2video (native))
  Stream #0:4 -> #0:1 (ac3 (native) -> mp2 (native))
  Stream #0:5 -> #0:2 (dvd_subtitle (dvdsub) -> dvb_subtitle (dvbsub))
Press [q] to stop, [?] for help
[ac3 @ 0x2eea2c0] frame sync error
Error while decoding stream #0:4: Invalid data found when processing input
[mpegts @ 0x2f09a60] Non-monotonous DTS in output stream 0:1; previous: 4804, current: 4084; changing to 4805. This may result in incorrect timestamps in the output file.
[mpeg @ 0x2e3cd60] New subtitle stream 0:7 at pos:8497166 and DTS:1999.51s
frame=  720 fps=496 q=2.0 Lsize=   24976kB time=00:00:29.99 bitrate=6820.6kbits/s
video:21609kB audio:1406kB subtitle:9kB other streams:0kB global headers:0kB muxing overhead: 8.476558%

Attachments (1)

0001-quick-fix-for-3737.patch (1.4 KB ) - added by Anshul 7 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 by Anshul, 7 years ago

Analyzed by developer: set
Owner: set to Anshul
Reproduced by developer: set
Status: newopen

comment:2 by Carl Eugen Hoyos, 7 years ago

Analyzed by developer: unset

"Analyzed by developer" means that you posted all information necessary to fix the issue here in the ticket. If you plan to work on a ticket yourself, it is not necessary to post this information here, it is useful if you know how to fix it but do not plan to fix it yourself.

comment:3 by Anshul, 7 years ago

This is regression bug which was introduced while fixing ticket #2024.
subtitles with 0 rectangles were stoped, I have attached a quick fix here.

I don't want this fix to be in mainstream, IMO proper solution would be to correct end time for transcoding and give blank subtitle->num_rect for decoding

by Anshul, 7 years ago

comment:4 by Anshul, 7 years ago

Component: undeterminedavcodec

comment:5 by Anshul, 7 years ago

Resolution: fixed
Status: openclosed
Note: See TracTickets for help on using tickets.