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

Nicolas George nicolas.george at normalesup.org
Mon Dec 31 12:52:37 CET 2012

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.

For example, for muxed subtitles, the recoding must be done by the decoder
(or at least the decoder must be encoding-aware), but we must prevent the
generic code from doing the recoding a second time. Therefore, the proposed
API is not sufficient.

> Yes; this is relatively inefficient currently. A possible way of doing
> this is to avctx->conv_ctx = malloc(sizeof(iconv_t)), but I went for the
> simplest solution at first.

Making things more efficient can wait.


  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20121231/a84d7265/attachment.asc>

More information about the ffmpeg-devel mailing list