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

Clément Bœsch ubitux at gmail.com
Wed Jan 2 10:25:03 CET 2013

On Mon, Dec 31, 2012 at 12:52:37PM +0100, Nicolas George wrote:
> Le primidi 11 nivôse, an CCXXI, Clement Boesch a écrit :
> > Yes, the UTF-16 is not supported; I assumed ASCII compatible input,
> > because the current text subtitles decoder only support that. If we want
> > to support UTF-16 in some decoders, shouldn't we just change ff_get_line()
> > (and the manual read_chunk function) to support a convert from UTF-16 to
> > UTF-8? That way, anything related to text subtitles will just work with
> > classic strings. And this patch as well.
> Well, my point is to avoid public API changes when we will want to implement
> ASCII-incompatible encodings. For that, I think we need to take some time to
> think about the various situations: text files, muxed subtitles, etc.

I was considering the UTF-16 to UTF-8 as part of the demuxing: all the
text decoders are currently designed to deal with text only (and I don't
think that's a good idea to change this); they deal with a simple ASCII
text string, because that's pretty straightforward.

We must IMO just make the demuxers output ASCII-compliant charset in all
the cases, which will be sent to the different text decoders, and then
converted to UTF-8 is necessary (like proposed in the patch).

Now to make life easy for demuxers, we need to propose a few helpers to
transform UTF-16 input into UTF-8. The main problem I see currently is the
format detection of such encoding; it might require some tweaking in the
probing. Any idea welcome.

If that way of solving the problem is fine with you, do you see any other
major problem with the current "charset" patch?


Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130102/0af72794/attachment.asc>

More information about the ffmpeg-devel mailing list