I'm writing a BlackBerry 10 application which decodes an H264 video stream (from a Parrot AR Drone) using ffmpeg and libx264. These libraries have both been compiled for BlackBerry QNX.
Here's my code:
av_register_all();
avcodec_register_all();
avformat_network_init();
printf("AV setup complete\n");
const char* drone_addr = "http://192.168.1.1:5555";
AVFormatContext* pFormatCtx = NULL;
AVInputFormat* pInputFormat = av_find_input_format("H264");
printf("Opening video feed from drone\n");
//THIS LINE FAILS
int result = avformat_open_input(&pFormatCtx, drone_addr, pInputFormat, NULL);
The last line fails with the error:
Malloc Check Failed: :../../dlist.c:1168
How can I fix this error or debug it further?
Update: The error only occurs when I supply pInputFormat
to avformat_open_input
. If I supply NULL I don't get an error. But for my app I must supply this parameter since it is not possible for ffmpeg to determine the video format from the feed alone.