[FFmpeg-cvslog] avformat/flvenc: Do not allow creating h263/ mpeg4 in flv without unofficial format extensions being enabled.

Michael Niedermayer git at videolan.org
Wed Jun 25 23:35:19 CEST 2014


ffmpeg | branch: release/1.1 | Michael Niedermayer <michaelni at gmx.at> | Sat Jun  7 12:03:31 2014 +0200| [80588930fffbc6f26cbd8c534e63b507b6f2075c] | committer: Michael Niedermayer

avformat/flvenc: Do not allow creating h263/mpeg4 in flv without unofficial format extensions being enabled.

Found-by: Jean-Baptiste Kempf <jb at videolan.org>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 74760883fcb4443d105814ed246b3cf51d7e9dca)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=80588930fffbc6f26cbd8c534e63b507b6f2075c
---

 libavformat/flvenc.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
index e1dd43f..c5ed800a 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;



More information about the ffmpeg-cvslog mailing list