I'm trying to read https video link using the function av_format_open_input() but the function return a negative value. Here is my code:
av_register_all();
avcodec_register_all();
avformat_network_init();
const char * url = "https://r1---sn ...";
AVFormatContext * pFormatCtx = avformat_alloc_context();
int ret = avformat_open_input(&pFormatCtx, url, NULL, NULL);
This code worked with a local file as url but as soon as I give a https url it doesnt work anymore.
thanks
[edit]
I found only this: ffserver.c
But it uses a .ffm file as input. Any exemple or help on how to implement HttpContext (if HttpContext is needed here) would be great.
[update]
I ended using libvlc which seems to be much easier but the way to do it using ffmpeg could still be interesting. See my other post if interested: Get frame from video with libvlc smem and convert it to opencv Mat. (c++)