[Libav-user] Remuxing an MP4 to an AVI

Jim Carroll jimfcarroll at gmail.com
Tue Feb 21 03:26:36 EET 2023


I'm getting an error when remuxing an mp4 to an avi file. I'm dropping all
packets except those coming from the first video stream from the input and
writing the output with the following code:

https://github.com/KognitionAI/pilecv4j/blob/master/native-ffmpeg/src/main/cpp/api/Muxer.cpp#L61

The writeFinalPacket is just an av_interleaved_write_frame with error
handling.

I can remux to mp4 or mpegts with this code but when I try to remux to an
avi I get a series of message like:
"[avi @ 0x7fae085a9b80] H.264 bitstream error, startcode missing, size 4343
data 000010F3"

The final file kinda-plays but starts gray, then after some frames play,
turns gray again.

The command line works fine: ffmpeg -i input.mp4 -map 0:v -c:v copy
output.avi

Any suggestions for correcting this and more robust muxing in general?

Thanks in advance.

Jim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20230220/9e835c2b/attachment.htm>


More information about the Libav-user mailing list