Sign in to follow this  

AV Codec

This topic is 3626 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i am using avcodec libraries for decompression of mpeg files and play back it here my problem is i want to read the compressed file from buffer ,but i am now reading from the hard disk if we give buffer address for decompression it is not coming but if we give file name (which is in hard disk) which contains extension the it is executing since the buffer does't have any extension so it is not taking i want to take from buffer here my code int Decompression(char *inputfile) { const char *filename; AVOutputFormat *fmt; AVFormatContext *oc; AVStream *video_st; double video_pts; unsigned int i = 0; AVFormatContext *pFormatCtx; int videoStream = 0; AVCodecContext *pCodecCtx; AVFrame *pFrame; AVCodec *pCodec; AVPacket packet; int frameFinished; const char *filenamei; AVOutputFormat *fmt1; // initialize libavcodec, and register all codecs and formats */ av_register_all(); filename = "Girish1.YUV"; filenamei = inputfile; fmt1 = guess_format(NULL, filenamei, NULL); if (!fmt1) { printf("Could not deduce input format from file extension: using MPEG.\n"); fmt1 = guess_format("mpeg", NULL, NULL); } if (!fmt1) { fprintf(stderr, "Could not find suitable input format\n"); exit(1); } // Open video file input if(av_open_input_file(&pFormatCtx, filenamei, NULL, 0, NULL)!=0) { printf("Couldn't open input file\n"); return NULL; // Couldn't open file } }

Share this post


Link to post
Share on other sites

This topic is 3626 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this