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?