[Libav-user] avformat_find_stream_info fails with rtp

Dmitry Adjiev adjiev.dmitry at gmail.com
Sun Aug 17 07:20:01 CEST 2014


I found the reason, it happens because avformat_open_input  set nb_streams
to 0, but why? ....


2014-08-16 23:33 GMT+04:00 Dmitry Adjiev <adjiev.dmitry at gmail.com>:

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



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


More information about the Libav-user mailing list