[FFmpeg-devel] [PATCH] avformat/avienc: add check bitstream method

Hendrik Leppkes h.leppkes at gmail.com
Fri Jan 5 11:00:47 EET 2018

On Fri, Jan 5, 2018 at 9:13 AM, Steven Liu <lq at chinaffmpeg.org> wrote:
> rename mpegts_check_bitstream to ff_check_bitstream
> fix problem: remux from mp4(AVC Codec) to avi(AVC Codec)
> error message:
> [avi @ 0x7fac97003c00] H.264 bitstream malformed, no startcode found,
> use the video bitstream filter 'h264_mp4toannexb' to fix
> it ('-bsf:v h264_mp4toannexb' option with ffmpeg)

There are several issues with this patch -

The function naming and description is way too generic, it doesn't
indicate at all what it does - but lets skip that for now, since I
believe there are much bigger issues.
Secondly, avi and mpegts are very different formats, and probably
should not share such a function.

mpegts always needs AnnexB format, avi can actually "support" (and I
use that word losely, H264 in AVI is always a hack) both MP4-style and
AnnexB, which means AVI doesn't really need the BSF at all.
In AVI, you need to properly write a matching codec_tag however, H264
for AnnexB, and AVC1 for MP4-style  - if that is not being done, then
this should be fixed, and not a BSF being forced.

- Hendrik

More information about the ffmpeg-devel mailing list