[Ffmpeg-devel] Re: Visual studio .net problem
Michel Bardiaux
mbardiaux
Mon Oct 17 11:36:09 CEST 2005
Scott Field wrote:
> Ian McIntosh <ianm <at> cat.co.za> writes:
>
>
>>>Hey everyone,
>>>
>>>I just wanted to join because I have the same exact problem. I can link
>>
>>and
>>
>>>execute, but when it comes to avcodec_find_encoder or avcodec_find_decoder
>>
>>they
>>
>>>return NULL.
>>>
>>>If anyone has made any finding I would love to hear them.
>>>
>>> I am working with:
>>>
>>>Visual Studio .NET 7.1.3088
>>>Windows XP Pro SP2
>>>minGW 3.2.3
>>>
>>>FFMPEG.exe Info:
>>>ffmpeg version CVS, build 3276800, Copyright (c) 2000-2004 Fabrice Bellard
>>> configuration: --enable-memalign-hack --enable-mingw32 --enable-mp3lame
>>>--extra-cflags=-I/local/include --extra-ldflags=-L/local/lib
>>> built on Oct 4 2005 13:54:56, gcc: 3.2.3 (mingw special 20030504-1)
>>>
>>>./configure settings for libraries:
>>>--enable-memalign-hack --enable-mingw32 --enable-mp3lame --enable-shared
>>>--extra-cflags=-I/local/include --extra-ldflags=-L/local/lib
>>>
>>>Scott
>>>
>>
>>Hi
>>
>>On the 3rd of october Ahmad Zaidee bin Abu sent a mail (subject: Problem
>>with returned AVCodecContext)
>>that hinted at a possible solution to this problem.
>>
>>Here's the gist of what was said (thats relevant, I think):
>>"
>>// Register all formats and codecs
>>
>>av_register_all();
>>
>>avcodec_init();
>>
>>avcodec_register_all();
>>
>>(have to do avcodec_init & avcodec_register_all, otherwise codec not found)
>>"
>>
>>Possibly try this out and see if it resolves your problem. If so, then maybe
>>this
>>is a bug with the Windows implementation??
>>
>>Ian
>>
>>(new to ffmpeg)
>>
>
>
> Ian,
>
> Thanks for the suggestion. I did a lot of av_log likes like Michael suggested
That's Michel. I dont mind, but there is *really* a Michael on the list
(Niedermayer) and he's a major league player, so better avoid the confusion.
> and this is what I discovered. This all has something to do with the variables
> declared as 'extern', i.e. first_avcodec, first_oformat, first_iformat, ... The
> avformat.dll is referencing a different version of the extern variables then my
> application. The reason that a call to avcodec_find_decoder returns NULL is
> because there is no codec list in the first_avcodec variable. The call to
> av_register_all() initializes the extern variables for itself. By your
> suggestion, avcodec_init() and avcodec_register_all() initialize the codec list
> for my application.
>
> So by adding those function calls fixes one problem but not all of them. Now if
> my application calls a function that references first_oformat through the
> avcodec.dll, again the refernce is not initialized.
>
> I am new to compiling with minGW so I am not sure how to resolve the issue of
> getting everything to properly reference the same instance of the 'extern'
> variables.
>
> Scott
Sounds related to the auto-import and enable-runtime-reloc problems. I
suggest a 'make clean' then make then post the whole compilation output,
zipped. (This is for the output, it wont fix your problem!) Then we can
look whether there are relevant gcc/ld warnings.
HaND,
--
Michel Bardiaux
R&D Director
T +32 [0] 2 790 29 41
F +32 [0] 2 790 29 02
E mailto:mbardiaux at mediaxim.be
Mediaxim NV/SA
Vorstlaan 191 Boulevard du Souverain
Brussel 1160 Bruxelles
http://www.mediaxim.com/
More information about the ffmpeg-devel
mailing list