c++ - How to force usage of specific codec with ffmpeg? -


i trying read video file using ffmpeg, , have run bit of trouble.

this code starts read it:

int _tmain(int argc, _tchar* argv[]) {     if (argc < 2)     {         fprintf( stderr, "filename needed argument\n" );           return 1;       }     /* register formats , codecs */     av_register_all();     avformatcontext* fmt_ctx = null;     /* open input file, , allocate format context */     const char *src_filename = argv[1];     if (avformat_open_input(&fmt_ctx, src_filename, null, null) < 0) {         fprintf(stderr, "could not open source file %s\n", src_filename);         abort();     }     /* retrieve stream information */     avdictionary *      options;     int res = avformat_find_stream_info(fmt_ctx, &options);     if (res < 0) {         fprintf(stderr, "could not find stream information\n");         abort();     }     ... } 

i consistently getting following message:

[avi @ 005f2fe0] not find codec parameters stream 0 (video: none (grey / 0x59455247), 1280x1024): unknown codec

consider increasing value 'analyzeduration' , 'probesize' options

i same message when run ffmpeg tool on same file.

however, know in video stream - raw video data yuv8 format. in fact, when pass ffmpeg via -c:v rawvideo option, there no problem. recoding, transforming etc - ffmpeg magic tool is.

now, question is: when using ffmpeg api, equivalent of option? desperately need access frames of file.

you can try passing second param in avformat_find_stream_info null. stream info read few packets information streams present in file. message not hamper decoding. if planning decode packets later should fine. decoding need call avcodec_find_decoder , avcodec_open2().


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -