[Libav-user] Does ffmpeg support tx3g eubtitles in mp4?

Dmitry Adjiev adjiev.dmitry at gmail.com
Sun Nov 2 08:25:34 CET 2014


2014-10-31 12:19 GMT+03:00 Carl Eugen Hoyos <cehoyos at ag.or.at>:

> Dmitry Adjiev <adjiev.dmitry at ...> writes:
>
> > Does ffmpeg support tx3g eubtitles in mp4?
>
> I believe so.
> If you find a problem, please provide a sample.
>
> Carl Eugen
>
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user
>

Thanks a lot for your answer!
Here the code:

        else if (packet.stream_index == current_subtitle_stream_) {
            //qDebug() << "subtitle";
            AVSubtitle subtitle;
            memset(&subtitle, 0, sizeof (AVSubtitle));
            int ok;
            int res =
avcodec_decode_subtitle2(fmt_ctx_->streams[current_subtitle_stream_]->codec,
&subtitle, &ok, &packet);
            qDebug() << "Res == " << res << "codec " <<
fmt_ctx_->streams[current_subtitle_stream_]->codec->codec->name;

            if (ok) {

                for (unsigned i = 0; i < subtitle.num_rects; i++) {
                    AVSubtitleRect *rec = subtitle.rects[i];
                    qDebug() << " text == " << QString::fromUtf8(rec->text);
                    av_free(rec);
                }
            }
        }

Here is output:

Res ==  45 codec  mov_text
 text ==  ""
Res ==  45 codec  mov_text
 text ==  ""
Res ==  45 codec  mov_text
 text ==  ""
Res ==  45 codec  mov_text
 text ==  ""
Res ==  45 codec  mov_text
 text ==  ""
Res ==  45 codec  mov_text
 text ==  ""
Res ==  45 codec  mov_text
 text ==  ""
Res ==  45 codec  mov_text
 text ==  ""
Res ==  45 codec  mov_text
 text ==  ""
Res ==  45 codec  mov_text
 text ==  ""
Res ==  45 codec  mov_text
 text ==  ""
Res ==  45 codec  mov_text

Text is always empty, what I do wrong?


-- 
Regards,
Dmitry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20141102/96a4ef00/attachment.html>


More information about the Libav-user mailing list