diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-06-07 12:03:31 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-06-23 15:14:41 +0200 |
commit | 8935e2390074cbf189ad1ab9c8f3388781d05317 (patch) | |
tree | a9861f38f03a3811c7a3752bd85514abec2e5709 | |
parent | a116f16e5dc76f648b87fd245f9d68c27b9ce5d2 (diff) | |
download | ffmpeg-8935e2390074cbf189ad1ab9c8f3388781d05317.tar.gz |
avformat/flvenc: Do not allow creating h263/mpeg4 in flv without unofficial format extensions being enabled.
Found-by: Jean-Baptiste Kempf <jb@videolan.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 74760883fcb4443d105814ed246b3cf51d7e9dca)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/flvenc.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c index 5447840b2a..6131bef17c 100644 --- a/libavformat/flvenc.c +++ b/libavformat/flvenc.c @@ -218,6 +218,18 @@ static int flv_write_header(AVFormatContext *s) avcodec_get_name(enc->codec_id), i); return AVERROR(EINVAL); } + if (enc->codec_id == AV_CODEC_ID_MPEG4 || + enc->codec_id == AV_CODEC_ID_H263) { + int error = enc->strict_std_compliance > FF_COMPLIANCE_UNOFFICIAL; + av_log(s, error ? AV_LOG_ERROR : AV_LOG_WARNING, + "Codec %s is not supported in the official FLV specification,\n", avcodec_get_name(enc->codec_id)); + + if (error) { + av_log(s, AV_LOG_ERROR, + "use vstrict=-1 / -strict -1 to use it anyway.\n"); + return AVERROR(EINVAL); + } + } break; case AVMEDIA_TYPE_AUDIO: audio_enc = enc; |