[FFmpeg-devel] [PATCH] lavc: support subtitles charset conversion.

Alexander Strasser eclipse7 at gmx.net
Fri Jan 11 00:38:04 CET 2013


Nicolas George wrote:
> Le primidi 21 nivôse, an CCXXI, Alexander Strasser a écrit :
> >     if (codec is a text subtitle codec && sub_charenc != UTF-8) {
                       ^^^^
> >       recode packet from sub_charenc to UTF-8
> >     }
> >     // decode (as usual)
> 
> That will not work if the codec mixes binary and text data for example.

  As highlighted above I wanted to do this only for text only subtitle
codecs. If the packet contains mixed binary and text data it is not a
good idea to touch it at all before it enters the codec. So I think in
that case clearly the decoder should tackle the problem.

  What am I missing :(

> >   IMHO the next important problem is to fix some of the text
> > subtitle pseudo-demuxers that assume that the input is encoded
> > in an ASCII-like encoding like UTF-8. Currently I believe the
> > solution is to share some common routines that allow to read the
> > stream and do the recoding to UTF-8. This would avoid more serious
> > rewriting of affected demuxers.
> 
> Yes, that is the best solution. But what should the demuxers do after that?
> Recode the packets back to their original encoding? Ugly and mostly useless.
> Leave them in UTF-8 and discard the encoding information? Discarding
> information is evil.

  Yes, sorry. Thanks for reminding me of that problem! As I mentioned
in my previous mail we should consider discussing thins in a new thread.

[...]

  Alexander


More information about the ffmpeg-devel mailing list