Hi,

Thank you for your reply.

Normally when you open a media file with the av_open_input_file function you 
must find in the format context structure for each stream, the codec data 
(codec->codec_type.) (without av_find_stream_info).
As I explained in my previous message, I did not get the same result with two 
projects.
- With my new "MyFFmpegWrapper" project, impossible to obtain the codec_type.
- With my "FFmpeg and SDL" sample (Spawning thread), no problem. With 
av_open_input_file I can obtain for each strean, the codec data.
common data between the two projects :
- Compiled with Visual Studio 2005 
The difference:
- "FFmpeg and SDL": the configuration properties of VS project have been filled 
by myself.
- "MyFFmpegWrapper": the configuration properties of VS project have been 
informed by my company's template project.
- "FFmpeg and SDL" sample don't use MFC.
- "MyFFmpegWrapper" project use MFC.

- "MyFFmpegWrapper" project use "Commun language Runtime (CLR)".

I could solve the problem changing the options below:
Don't use CLR ""Commun language Runtime"
Enable C++ exceptions (Yes (/EHsc)
Now when I use av_input_open_file with MyFFmpegWrapper, I obtain for each 
stream all codec data.

Thanks,
Sylvain
> Message du 15/09/09 03:05
> De : "Amol Gandigude" 
> A : "Libav* user questions and discussions" 
> Copie à : 
> Objet : Re: [libav-user] Cannot obtain codec_type with av_open_input_file
>
> 
> 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
> 
> 




Cordialement,

PASTOR Sylvain
Tel: 06.86.72.05.23
[email protected]

---------------------------------------------------------------------------- 
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

Reply via email to