<div dir="ltr"><div>I suspect this may be what I am running into as well. Good to see that I am not the only one with RTSP issues. <br></div><div><br></div><div>In my case I am using MPD and though MPD can take many different string URLs and just play them, the rtsp one I found does not play through MPD though I can play it from CLI without issue.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jul 30, 2020 at 6:25 PM Carlos Esponda <<a href="mailto:esponda.carlos9@gmail.com">esponda.carlos9@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I am currently trying to read an RTSP stream with FFMPEG and can't get past avformat_open_input. <br><br>Any help would be appreciated!<div><br></div><div>thank you.<br><br>  #include <iostream><br><br>extern "C"<br>{<br>#include <libavformat/avformat.h><br>#include <libavcodec/avcodec.h><br>#include <libavcodec/codec.h><br>#include "libswscale/swscale.h"<br>#include "libavutil/avutil.h"<br>#include "libavutil/frame.h"<br>#include "libavcodec/codec_id.h"<br>#include "libavutil/pixfmt.h"<br>#include "libavutil/imgutils.h"<br>}<br><br><br>int decode_interrupt(void*);<br><br>int main()<br>{<br>    AVFrame* frame = NULL;<br>    AVFormatContext* formatc = NULL;<br>    const AVIOInterruptCB int_cb = { decode_interrupt, NULL };<br>    AVCodec* codec = NULL;<br>    AVCodecContext* codecc = NULL;<br>    char* error = new char[255];<br><br>    if (!(frame = av_frame_alloc())) {<br>        std::cout << " failed to alloc frame";<br>        return -1;<br>    }<br>    formatc = avformat_alloc_context();<br>    formatc->interrupt_callback = int_cb;<br><br>    codec = avcodec_find_decoder(AV_CODEC_ID_H264);<br>    codecc = avcodec_alloc_context3(codec);<br>    int result = avcodec_open2(codecc, codec, NULL);<br>    if (result != 0) {<br>        std::cout << "failed to open codec";<br>    }<br><br>    result = avformat_open_input(&formatc, "rtsp://:8554/testStream", NULL, NULL);<br>    if (result != 0) {<br>        av_strerror(result, error, 255);<br>        std::cout << "couldnt open input " << error<< std::endl;<br>        avformat_close_input(&formatc);<br>        return -1;<br>    }<br><br>    result = avformat_find_stream_info(formatc, NULL);<br>    if (result != 0) {<br>        std::cout << "could not find stream information\n";<br>        return -1;<br>    }<br><br>    return 0;<br>}<br><br>int decode_interrupt(void * ctx) {<br>    std::cout << "interupted\n";<br>    return -1;<br>}<div></div><div><br></div></div></div>
_______________________________________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org" target="_blank">Libav-user@ffmpeg.org</a><br>
<a href="https://ffmpeg.org/mailman/listinfo/libav-user" rel="noreferrer" target="_blank">https://ffmpeg.org/mailman/listinfo/libav-user</a><br>
<br>
To unsubscribe, visit link above, or email<br>
<a href="mailto:libav-user-request@ffmpeg.org" target="_blank">libav-user-request@ffmpeg.org</a> with subject "unsubscribe".</blockquote></div>