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

  • SEARCH
  • Home
  • 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 8635419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:58:13+00:00 2026-06-12T09:58:13+00:00

In my program I’m trying to decode an MPEG4 stream from a certain url

  • 0

In my program I’m trying to decode an MPEG4 stream from a certain url and the decoding fails. Strangely, MPEG4 streams from other urls are decoded fine, so it’s not a problem of the absence of the codec.

Here’s how I decode:

1) Find the decoder:

   AVCodec* codec = avcodec_find_decoder(CODEC_ID_MPEG4);

2) Allocate a context

 ACodecContext* ctx = avcodec_alloc_context3(0);

3) Open the codec

avcodec_open2(ctx, codec, 0) // it returns > 0, fine 

4) Decoding a packet (which I have)

   avcodec_decode_video2(ctx, frame, &decoded, &packet);

Now avcodec_decode_video2 fails returning -1 and FFMPEG log prints:

Picture size 0x0 is invalid
get_buffer() failed (-1 0 0x0)

If I manually set up ctx->width and ctx->height before decoding to the correct values (I know the dimensions of the picture) then it decodes fine.

But I can not be sure of the dimensions all the time, therefore I would like to know if I can overcome the -1 error.

By seeing the FFMPEG log output can anyone suggest something for me to do?

  • 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-12T09:58:14+00:00Added an answer on June 12, 2026 at 9:58 am

    Does the file have a correct VOL header? You will face this problem if it does not. The VOL header has the height and width.

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

Sidebar

Related Questions

My program interfaces with servers in other countries and regularly needs to handle URLs
(C PROGRAM) I'm trying to compile a main.c that uses a header but I'm
The program I am trying to do is to simulate the mouse event of
I program in Java and have been trying to understand exactly what operator overloading
Example program: list links This example program demonstrates how to fetch a page from
My program requires the result from inside an loop to be displayed or outputted
program reads the following data from a .txt file: f 3.40 f 4.00 m
/* Program that reads a sequence of words from keyboard and prints the list
My program uses QtNetwork to download stuff from internet. in int main() I call
This program is supposed to store each word given in standard input stream and

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.