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 6810767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:14:43+00:00 2026-05-26T20:14:43+00:00

I just cann’t seem to get the FFMpeg working with using the library. Everytime

  • 0

I just cann’t seem to get the FFMpeg working with using the library. Everytime I try to convert asf file to wmv. I get the following issue on run time:

[wmv1 @ 0x81ee000]error, slice code was 2
[wmv1 @ 0x81ee000]header damaged

This my code:

static void audio_decode_example(const char *outfilename, const char *filename)
{
    AVCodec *codec;
    AVCodecContext *c= NULL;
    int out_size, len, in_size;
    FILE *f, *outfile;
    uint8_t *outbuf;
    uint8_t inbuf[AUDIO_INBUF_SIZE + FF_INPUT_BUFFER_PADDING_SIZE];
    AVPacket avpkt;

    av_init_packet(&avpkt);

    printf("Audio decoding\n");

    /* find the mpeg audio decoder */
    codec = avcodec_find_decoder(CODEC_ID_WMV1);
    if (!codec) {
        fprintf(stderr, "codec not found\n");
        return;
    }

    c= avcodec_alloc_context2(CODEC_TYPE_AUDIO);

    /* open it */
    if (avcodec_open(c, codec) < 0) {
        fprintf(stderr, "could not open codec\n");
        return;
    }

    outbuf = malloc(AVCODEC_MAX_AUDIO_FRAME_SIZE);
    f = fopen(filename, "rb");
    if (!f) {
        fprintf(stderr, "could not open %s\n", filename);
        return;
    }
    outfile = fopen(outfilename, "wb");
    if (!outfile) {
        av_free(c);
        return;
    }

    /* decode until eof */
    avpkt.data = inbuf;
    len = avpkt.size = fread(inbuf, 1, INBUF_SIZE, f);
    NSLog(@"%d", avpkt.size); 

    while (avpkt.size > 0) {
        out_size = AVCODEC_MAX_AUDIO_FRAME_SIZE;
    len = avcodec_decode_audio2(c, (short *)outbuf, &out_size, inbuf,len);// avpkt.size);
    NSLog(@"%d", len);
    if (len < 0) {
        fprintf(stderr, "Error while decoding\n");
        fclose(outfile);
        return;
    }
    if (out_size > 0) {
        /* if a frame has been decoded, output it */
        fwrite(outbuf, 1, out_size, outfile);
    }
    avpkt.size -= len;
    avpkt.data += len;
    if (avpkt.size < AUDIO_REFILL_THRESH) {
        /* Refill the input buffer, to avoid trying to decode
         * incomplete frames. Instead of this, one could also use
         * a parser, or use a proper container format through
         * libavformat. */
        memmove(inbuf, avpkt.data, avpkt.size);
        avpkt.data = inbuf;
        len = fread(avpkt.data + avpkt.size, 1,
                    INBUF_SIZE - avpkt.size, f);
        if (len > 0)
            avpkt.size += len;
    }
}

fclose(outfile);
fclose(f);
free(outbuf);
avcodec_close(c);
av_free(c);
}

I have try the command line utilities and it successfully convert the file. Any help would be helpfully. thanks

  • 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-05-26T20:14:44+00:00Added an answer on May 26, 2026 at 8:14 pm

    Make the mistake of opening the wrong file

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

Sidebar

Related Questions

I experience the following problem while using legacy VC6. I just cann't switch to
Just installed the latest SDK for iPhone 2.1. When I go to File ->
just wondering if I should be using a 'redirector' type page or link directly
Just a thought, but would using an IFRAME over a DIV essentially make that
Just wanted to ask if there is any advantage for either using mouse click
Just as you can convert the following: var t; if(foo == bar) { t
Just wanted to know if it is possible to create a hidden window using
I have heard some terms about linux fonts,such as XFT, fontconfig etc.I just cann't
Just wondering if anyone has had any trouble using a BackgroundWorker Thread in a
Just for fun, I've been using python and gstreamer to create simple Linux audio

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.