Hi:
I am new to the libavcodec and is following the tuts to get some basic things
working for my research project.
On my Ununtu machine I had libfaac, libfaad, libmp3lame plus their dev files
installed. Then I compiled and installed ffmpeg from SVN source with those libs
enabled (--enable-libfaad etc..)
My ffplay compiles & works fine and can decode an AC3 stream without any
problem, but when I try to decode the same file with my own code I get NULL
returned by avcodec_find_decoder() .
When I dump_format with ffplay I get:
Stream #0.0[0x1021]: Video: vc1, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9],
23.98 tbr, 90k tbn, 23.98 tbc
Stream #0.1[0x1025](eng): Audio: ac3, 48000 Hz, 5.1, s16, 640 kb/s
And from my own code:
Stream #0.0[0x1021]: Video: vc1, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9],
23.98 tbr, 90k tbn, 23.98 tbc
Stream #0.1[0x1025](eng): Audio: 0x0000, 48000 Hz, 5.1, s16, 640 kb/s
Unsupported Audio codec! ID: 0x15003 // Printer by my own program
I don't know why my simple program can't detect the audio format & locate its
decoder, have I missed something?
My code for init avcodec & find_decoder:
avcodec_init();
avcodec_register_all();
avdevice_register_all();
av_register_all();
// open file, find stream info, find video/audio stream id
aCodec = avcodec_find_decoder(aCodecCtx->codec_id);
if(!aCodec ) {
fprintf(stderr, "Unsupported Audio codec! ID:%x \n",aCodecCtx->codec_id);
return -1;
}
-----------------
Compiled using gcc -o tut3 tut3.c $(ALL_LIBS)
-----------------
John(Yi-Chen) Li
NICTA
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user