]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/flvenc.c
Merge commit '869fc416f7c78ed4e397e0208acd1545771c0502'
[ffmpeg] / libavformat / flvenc.c
index cebc25a5ada52bf471d09dc4d1d1bc23bb5f3af0..dd74d4c4dac8c68ece33337fc924511d62339fec 100644 (file)
@@ -221,6 +221,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:
             if (audio_enc) {
@@ -292,7 +304,7 @@ static int flv_write_header(AVFormatContext *s)
     /* mixed array (hash) with size and string/type/data tuples */
     avio_w8(pb, AMF_DATA_TYPE_MIXEDARRAY);
     metadata_count_pos = avio_tell(pb);
-    metadata_count = 5 * !!video_enc +
+    metadata_count = 4 * !!video_enc +
                      5 * !!audio_enc +
                      1 * !!data_enc  +
                      2; // +2 for duration and file size
@@ -318,6 +330,7 @@ static int flv_write_header(AVFormatContext *s)
         if (framerate != 0.0) {
             put_amf_string(pb, "framerate");
             put_amf_double(pb, framerate);
+            metadata_count++;
         }
 
         put_amf_string(pb, "videocodecid");