[FFmpeg-devel] [PATCH] dvbsub fix transcoding

Wim Vander Schelden lists at fixnum.org
Thu May 22 14:59:09 CEST 2014


The entire DVB subtitle encoder is conceptually wrong and broken in ffmpeg,
so fixing this little issue will achieve very little anyway.

The protocol of a DVB subtitle stream is describe in very high level terms
at http://trac.ffmpeg.org/ticket/2024#comment:8 - the way ffmpeg currently
encodes them is as follows:

For every AVSubtitle:

   - Emit a packet containing the subtitle data at PTS
   - Emit a packet containing no data at PTS + duration of subtitle
   - Move on to the next subtitle

This fails the strict ordering of PTS timestamps when a subtitle disappears
after a new one disappears, as the encoder will have written out the
"clear" packet already when handling the disappearing subtitle.

However, as described in comment #8, these "clears" are not strictly
necessary when a new subtitle already occurs in the same region as the
older one. If not, an empty region should be sent with a PTS at which the
region should be cleared.

The current implementation also adds the ultimately unnecessary nb-loop to
the do_subtitle_out. The proper solution is to fix the DVB subtitle
encoder, and remove the loop from ffmpeg.c.

I have no idea how dvbsubenc defines regions, I'd have to take a deeper
look at the encoder to find out.

Hope this makes sense,

Wim


On Thu, May 22, 2014 at 2:12 PM, Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:

> anshul <anshul.ffmpeg <at> gmail.com> writes:
>
> > > I tested your patch with the first sample from
> > > ticket #2024 (Starship_Troopers.vob) and as far
> > > as I can tell, it breaks the output. Does it work
> > > for you?
>
> > Yes,its work for me for 1st Video also
>
> Please run:
> $ ffplay Starship_Troopers.vob
> and
> $ ffplay test.ts
>
> and compare carefully.
>
> Carl Eugen
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>


More information about the ffmpeg-devel mailing list