Jump to content
  • Advertisement
Sign in to follow this  
forum_girish

AV Codec

This topic is 3791 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
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!