1

I have implemented a video streaming server (video: MPEG1, network: UDP), which seem to be working (I can watch the videos using VLC).

I want to implement a client for decoding and I'm using this code: FFmpeg decode raw buffer with avcodec_decode_video2

The problem is, that I always get -22 for nres and 0 for framefinished. I also had a client, that I implemented earlier, and it had the very same problem. The code for calling my method:

uint8_t inbuf[65500];
memset(inbuf, 0, size + FF_INPUT_BUFFER_PADDING_SIZE);
memcpy(inbuf, recv_buffer->data(), size);
decoder2.decodeStreamData(inbuf, size + FF_INPUT_BUFFER_PADDING_SIZE);

Any hints for the cause of the problem? Or can I find the description of this magical -22?

Community
  • 1
  • 1
AteszDude
  • 161
  • 2
  • 15
  • Did you read the documentation? – Lightness Races in Orbit Mar 15 '16 at 22:56
  • 1
    This Q seems to give you the error codes if you don't find them in the headers. http://stackoverflow.com/questions/22944133/how-can-i-find-out-what-this-ffmpeg-error-code-means. Also, you have this that should help you figure it out http://ffmpeg.org/doxygen/trunk/error_8h_source.html – grenangen Mar 15 '16 at 22:57
  • Seems like -22 is not included anywhere, as well as -135 according to this post: http://stackoverflow.com/questions/29832097/ffmpeg-error-with-avformat-open-input-returning-135 – AteszDude Mar 16 '16 at 09:08
  • Could it be a reference to this? http://www.virtsync.com/c-error-codes-include-errno #define EINVAL 22 /* Invalid argument */ – AteszDude Mar 31 '16 at 16:51

0 Answers0