Hi,
I think after calling av_open_input_file(), you are supposed to call

*av_find_stream_info(pFormatCtx)*

and then you can get the codec type info.


Regards

Amol


On Tue, Sep 8, 2009 at 3:36 PM, [email protected] <
[email protected]> wrote:

>
> Hi Guys,
>
> I have the following problem:
> With this code, I cannot get the codec type.
> pFormatCtx->streams[0]->codec->codec_type => Cannot obtain the codec
> type!!!! // NORMALLY IS CODEC_TYPE_AUDIO
> pFormatCtx->streams[1]->codec->codec_type => Cannot obtain the codec
> type!!!! // NORMALLY IS CODEC_TYPE_VIDEO
> AvFormatContext* AvFormatContext::Open(const char* file)
> {
> int AvError;
> AVFormatContext *pFormatCtx = NULL;
> SingletonAvUtility::Initialize(); // av_register_all
> AvError = av_open_input_file(&pFormatCtx, file, NULL, 0, NULL);
> if(AvError !=0)
> {
> throw new AvException(AvError);
> }
> return new AvFormatContext(pFormatCtx);
> }
>
> I try with "Spawning thread" example (same media file) and I manage to get
> the codec type for each stream!!!!
>
> I compiled myself the FFmpeg (FFmpeg-0.5) shared libs!!!
> I do not understand the difference in results.
>
> Best regards,
>
> PASTOR Sylvain
>
>
> ----------------------------------------------------------------------------
> Laposte.net fête ses 10 ans !
>
> Gratuite, garantie à vie et déjà utilisée par des millions d'internautes...
> vous aussi, pour votre adresse e-mail, choisissez laposte.net.
>
> Laposte.net, bien + qu'une messagerie
>
> ----------------------------------------------------------------------------
> _______________________________________________
> libav-user mailing list
> [email protected]
> https://lists.mplayerhq.hu/mailman/listinfo/libav-user
>
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to