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

Alexander Strasser eclipse7 at gmx.net
Sun Feb 3 18:41:58 CET 2013


Hi Nicolas,

Alexander Strasser wrote:
> 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 :(

  Ping?

  I think Clément's last patch minus the removals in the attached
patch would be ready for commit. Did you think about this specific
use case again? Converting text sub encoding prior decoding in lavc?
The changes I suggest just remove the mode stuff for now. Maybe we
will not need it. Seems to brittle to me at this point. Also if it
is only meant to be used internally we could add it again once we
need it.

  The functionality would only be exposed via API so far. Integrating
in ffmpeg tools would still have to be discussed.

  I would suggest further changes, but I think they could go on
top later.

  I tested as it is now it allows API users to recode e.g. subs in
mkv files that have been stored in say UTF-16. I know this is against
Matroska spec but it might happen and the container format is not the
point of this functionality anway. I am just using it as an example,
the container could well be something completely different.

  I am not suggesting to immediately commit or something, I just want
to know if you agree to this route in princinple and would not have
concerns about the mentioned code going into git master at some point.

  Alexander
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-subitles-charenc-Remove-mode-stuff-for-now.patch
Type: text/x-diff
Size: 3414 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130203/9cb90d24/attachment.bin>


More information about the ffmpeg-devel mailing list