2014-10-31 12:19 GMT+03:00 Carl Eugen Hoyos <[email protected]>:

> Dmitry Adjiev <adjiev.dmitry@...> 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
> [email protected]
> 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
_______________________________________________
Libav-user mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/libav-user

Reply via email to