[FFmpeg-devel] [PATCH] Enable parser in FLV demuxer for H264 codec

Michael Niedermayer michaelni at gmx.at
Fri Dec 13 03:09:29 CET 2013


On Thu, Dec 12, 2013 at 03:10:10PM -0800, Alex Sukhanov wrote:
> ---
>  libavformat/flvdec.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
> index 1024001..4401652 100644
> --- a/libavformat/flvdec.c
> +++ b/libavformat/flvdec.c
> @@ -256,6 +256,7 @@ static int flv_set_video_codec(AVFormatContext *s, AVStream *vstream,
>          return 1;     // 1 byte body size adjustment for flv_read_packet()
>      case FLV_CODECID_H264:
>          vcodec->codec_id = AV_CODEC_ID_H264;
> +        vstream->need_parsing = AVSTREAM_PARSE_HEADERS;
>          return 3;     // not 4, reading packet type will consume one byte
>      case FLV_CODECID_MPEG4:
>          vcodec->codec_id = AV_CODEC_ID_MPEG4;

breaks
ffmpeg -i Enigma_Principles_of_Lust.flv test.flv

before the patch:
frame= 6300 fps=1441 q=31.0 Lsize=    7266kB time=00:03:30.65 bitrate= 282.6kbits/s
after the patch
frame= 4531 fps=1180 q=9.8 Lsize=    6987kB time=00:03:30.65 bitrate= 271.7kbits/s dup=0 drop=1769

[....]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The misfortune of the wise is better than the prosperity of the fool.
-- Epicurus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20131213/d337066c/attachment.asc>


More information about the ffmpeg-devel mailing list