How to decode MPEG4 using libavcodec
-
04-08-2022 - |
Domanda
I am using codec_id=AV_CODEC_ID_MPEG4 and am calling avcodec_encode_video2() with a video buffer received from a webcam and converted into yuv420p format. This works without issue and I get output each time I run it through the encoder.
How do I take the output of encoder and VOS data (context->extradata) and create a packet suitable to call avcodec_decode_video2????
I was able to make this work when using codec_id=AV_CODEC_ID_H264 by copying extradata to a buffer and then copying the output of the decoder to the end of that buffer. This does not work for MPEG4. I have also tried copying the extradata into the decoder's context (i.e., c->extradata) and this also does not work.
How to process raw UDP packets so that they can be decoded by a decoder filter in a directshow source filter really seems to explain it but I am still not able to make it work.
Nessuna soluzione corretta