Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8586697
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:22:23+00:00 2026-06-11T22:22:23+00:00

I’m trying to use the FFmpeg dll’s using Visual Studio 2012 and I’m getting

  • 0

I’m trying to use the FFmpeg dll’s using Visual Studio 2012 and I’m getting a run time access violation when I call avcodec_find_encoder. Here is the code:

// TestFFmpeg.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"

extern "C" {
#include "libavcodec\avcodec.h"
#include "libavformat\avformat.h"
}

#define INBUF_SIZE 4096

int _tmain(int argc, _TCHAR* argv[])
{
    AVCodec *codec;

    const char *videoFilename = "C:\\Users\\Public\\Videos\\Sample Videos\\Wildlife.wmv";

    av_register_all(); // This works; however, no parameters or return values.

    codec = avcodec_find_encoder(CODEC_ID_WMV3);  // Run time Access Violation HERE
    if (!codec) {
    fprintf(stderr, "Codec not found\n");
        exit(1);
    }

    return 0;
}

Here is the error message:

Unhandled exception at 0x75C18B60 (msvcrt.dll) in TestFFmpeg.exe: 0xC0000005: Access violation reading location 0x00000049.

The stack trace is:

    msvcrt.dll!_strcmp()    Unknown
    avcodec-54.dll!6a56caac()   Unknown
    [Frames below may be incorrect and/or missing, no symbols loaded for avcodec-54.dll]    
>   TestFFmpeg.exe!wmain(int argc, wchar_t * * argv) Line 23    C++
    TestFFmpeg.exe!__tmainCRTStartup() Line 533 C
    TestFFmpeg.exe!wmainCRTStartup() Line 377   C
    kernel32.dll!@BaseThreadInitThunk@12()  Unknown
    ntdll.dll!___RtlUserThreadStart@8() Unknown
    ntdll.dll!__RtlUserThreadStart@8()  Unknown

I’m guessing there’s a problem with returning the codec pointer, but I’m new to C++ and have no idea how to correct it. I tried the cdecl, stdcall, and fastcall calling conventions — none corrected the issue. I’m using the latest 32-bit DLL from Zeranoe. Any suggestions?

EDIT:
I’ve called other functions in the DLL and they work. For example, avformat_open_input works properly. I can pass parameters and the function returns a successful return value (0) and populates the format context structure. av_find_stream_info works as well. I still can’t figure out why avcodec_find_decoder creates an access violation.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T22:22:25+00:00Added an answer on June 11, 2026 at 10:22 pm

    Finally, fixed it. I did two steps and I’m not sure which one worked (heh):

    1. Added the ‘.lib’ files as linker input dependencies
    2. I picked up the Sept 7 build and made sure I have all the same build-date for the dll’s, libraries, and include files.

    Everything appears to work fine now.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I am trying to render a haml file in a javascript response like so:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.