[Ffmpeg-devel] Visual studio .net problem

Lucio Marcenaro lucio.marcenaro
Tue Sep 27 16:59:19 CEST 2005

Martin, thanks for your answer
I've just read the document you sent and double checked the procedure.

The problem seems to be extremely strange to me as well...
However here we go:
- created project and sln for output_example (see attach)
- compiled with visual studio linking with avcodec.lib avformat.lib
avutil.lib -> compiles and executes (command line: output_example.exe
output.mpeg) but returns NULL at avcodec_find_encoder(c->codec_id);
- compiled with visual studio linking with libavcodec.a libavformat.a
libavutil.a libgcc.a -> compiles and works fine
- compiled with mingw (with static or shared libs) -> compiles and works

I'm trying to install Visual C++ 2005 Express Edition Beta 2 now
At the moment i am using Microsoft Visual C++ .NET 7.1.3088


Martin Boehme wrote:
> 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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: rename_to_zip
Type: application/octet-stream
Size: 7040 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20050927/c566909e/attachment.obj>

More information about the ffmpeg-devel mailing list