[Libav-user] Invalid Handle was specified - av_guess_format /avformat_alloc_context

Matthew Einhorn moiein2000 at gmail.com
Fri Sep 23 16:43:55 CEST 2011


On Fri, Sep 23, 2011 at 1:58 AM, Marlon Reid <Marlon at scansoft.co.za> wrote:

> **
> Hi Matt,
>
> Thanks for your response.  Yes I did call av_register_all();.  I also used
> my C extern braces around <avcodec.h> and <avformat.h>.
>
> What does avcodec_register_all() do?  Should this be called as well?
>
>
>
av_register calls avcodec_register so you don't have to call it. The
av_register functions registers the codec etc so that you can use it.

I don't know why you're having trouble. I ran the following code in MSVC++
2010 using the Zeranoe built dlls without any trouble. Where did you get the
dlls that you're using, did you compile it? Can you run just the following
code and see if you still get an error? Btw, I ran it in debug 64 bit
project.

av_register_all();
AVOutputFormat* m_Outfmt = av_guess_format ( "mp3", NULL, NULL);
if( !m_Outfmt )
    return false;
AVFormatContext* m_OutFmtContext = avformat_alloc_context ();

Matt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20110923/e9164889/attachment.html>


More information about the Libav-user mailing list