<div dir="ltr"><div>Hello.<br></div>Here is my code:<br><br>void RtpStream::stop()<br>{<br>    QMutexLocker guard(&mutex_);<br>    stopped_ = true;<br>}<br><br>void RtpStream::run()<br>{<br>    QMutexLocker guard(&mutex_);<br>
<br>    if (!ip_.isEmpty()) {<br>        QSharedPointer<AVInputFormat> fmt (av_find_input_format(ip_.scheme().toLatin1() ), av_free);<br><br>        if (!fmt) {<br>            qDebug() << "RtpStream: can't finfd format";<br>
            return;<br>        }<br><br>        stopped_ = false;<br>        AVFormatContext *ctx = avformat_alloc_context();<br>        ctx->interrupt_callback.callback = interruptHandler;<br>        ctx->interrupt_callback.opaque = this;<br>
        int ret = 0;<br><br>        if (!ctx) {<br>            qDebug() << "RtpStream: can't alloc context";<br>            ret = avformat_open_input(&ctx,  ip_.toString().toLatin1().constData(), NULL, NULL);<br>
        } else<br>            ret = avformat_open_input(&ctx,  ip_.toString().toLatin1().constData(), fmt.data(), NULL);<br><br>        if (ctx)<br>            sp_fmt_ctx_ = QSharedPointer<AVFormatContext> (ctx, avformat_free_context);<br>
<br>        qDebug() << "RtpStream  ret " << ret;<br><br>        if (ret < 0) {<br>            showErrorString(ret, "RtpStream: can't open file");<br>            return;<br>        }<br>
<br>        //av_format_inject_global_side_data(ctx);<br><br>        ret = avformat_find_stream_info(ctx, NULL);<br><br>        if (ret < 0) {<br>            showErrorString(ret, "could not find codec parameters");<br>
            return;<br>        }<br><br>        guard.unlock();<br><br>        while (!stopped_) {<br><br>            qDebug() << "RtpStream: I need to find decoder :-)";<br>        }<br>    }<br><br>    else<br>
        qDebug() << "RtpStream: ip number is empty!";<br>}<br><br clear="all"><div><div>avformat_find_stream_info always fails.<br></div><div>What I do wrong?<br></div><div><br>-- <br>Regards,<br>Dmitry
</div></div></div>