[Libav-user] Issue in opening the 8MP H264 Stream

Niraj Gandha niraj.gandha at einfochips.com
Wed Sep 5 16:07:17 EEST 2018


I am facing issue in opening the live encoded h264 stream of 8MP resolution over tcp server in Qt Application. To open the stream in ffplay, I give following command in terminal and it is able to play it:

ffplay -f h264 -codec:v h264 -probesize 32M <tcp://ipaddress:port>

But when I try to open the stream in Qt Application, avformat_open_input() gives error Invalid data found while processing input.

Below is the code I am using in Qt Application

AVFormatContext *refrenceFormatCtx = NULL;
SwsContext *img_convert_ctx;
AVIOContext *avio_ctx = NULL;
int video_stream_index = 0;
AVCodecContext* codec_ctx = NULL;
AVSampleFormat *fmt = NULL;
char errorsdef[100];

AVDictionary *options = NULL;
     av_dict_set(&options, "video_size","3264x2448",0);
     av_dict_set(&options, "f", "h264", 0);
     av_dict_set(&options, "codec:v", "h264", 0);
     av_dict_set(&options, "codec:a", "aac", 0);
     av_dict_set(&options, "probesize", "32M", 0);
int err = avformat_open_input(&refrenceFormatCtx,"tcp://<ipaddress:port>", NULL, &options);
qDebug() << "OPening Stream error: "<< err << " "<< errorsdef;

Is the path to set the options in avformat_open_input is correct?

Is the parameters set by me, are correct?

If any help, it will be grateful to me.

Thanks & Regards,
Niraj Gandha

************************************************************************************************************************************************************* eInfochips Business Disclaimer: This e-mail message and all attachments transmitted with it are intended solely for the use of the addressee and may contain legally privileged and confidential information. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution, copying, or other use of this message or its attachments is strictly prohibited. If you have received this message in error, please notify the sender immediately by replying to this message and please delete it from your computer. Any views expressed in this message are those of the individual sender unless otherwise stated. Company has taken enough precautions to prevent the spread of viruses. However the company accepts no liability for any damage caused by any virus transmitted by this email. *************************************************************************************************************************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20180905/381f6992/attachment.html>

More information about the Libav-user mailing list