AV Codec

Started by
-1 comments, last by forum_girish 16 years, 3 months ago
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 } }

This topic is closed to new replies.

Advertisement