[Ffmpeg-devel] Visual studio .net problem

Martin Boehme boehme
Tue Sep 27 15:39:47 CEST 2005

Lucio Marcenaro wrote:
> I've got this problem while trying to use ffmpeg compiled as dll in a 
> visual studio project:
> - ffmpeg (cvs 23 sep 2005) is compiled as shared lib by using mingw
> resulting dll files are:
> avformat.dll 8.557.423 bytes
> avcodec.dll 7.662.795 bytes
> avutil.dll 43.399 bytes

Seems to be the same as what I get.

> - output_example compiled by mingw works fine
> - if i try to compile the output_example.c code by using visual studio 
> ide (standard console project, multithreaded dll) it compiles and runs 
> but it gives an erro for each ffmeg codec i might select.
> In particular in order to compile that code i had to change the suffix 
> to .cpp and make the following changes:
> 1) add a cast to lines 67 and 194 (see output_example.c for reference)
>     c->codec_id = (CodecID)codec_id;
> 2) add cast to the malloc calls at lines 103, 122, 237, 272 (i.e., 
> audio_outbuf = (uint8_t*)malloc(audio_outbuf_size);)
> If i run it, it gives me null pointer as result of
>     codec = avcodec_find_encoder(c->codec_id);
> at line 255
> So the program prints "could not open codec" and exits

Hm... works fine for me with Visual C++ 2005 Express Edition Beta 2 (see 
documentation patch I just posted). What command line argument are you 
calling output_example with?

> As i said the same code works if i compile by using mingw and also works 
> i link against static libs libavcodec.a libavformat.a libgcc.a by using 
> visual studio.

Sounds strange...


Martin B?hme
Inst. f. Neuro- and Bioinformatics
Ratzeburger Allee 160, D-23538 Luebeck
Phone: +49 451 500 5514
Fax:   +49 451 500 5502
boehme at inb.uni-luebeck.de

More information about the ffmpeg-devel mailing list