[Ffmpeg-devel] Visual studio .net problem

Lucio Marcenaro lucio.marcenaro
Mon Sep 26 19:05:49 CEST 2005


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

- 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

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.

This is getting me insane....
Any idea?

	Lucio





More information about the ffmpeg-devel mailing list