ffmpeg | branch: master | Michael Niedermayer <michae...@gmx.at> | Wed May 27 
01:42:23 2015 +0200| [023040ed0d26339d39151d4850eff6dde1716b6d] | committer: 
Michael Niedermayer

avformat/movenc: Allow muxing mp3 with samplerate < 16khz if the user sets 
strict to -1

Fixes Ticket4267

Approved-by: Baptiste Coudurier <baptiste.coudur...@gmail.com>
Signed-off-by: Michael Niedermayer <michae...@gmx.at>

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

 libavformat/movenc.c |   13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 0942a11..6a4e16a 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -5154,10 +5154,15 @@ static int mov_write_header(AVFormatContext *s)
             }
             if (track->mode != MODE_MOV &&
                 track->enc->codec_id == AV_CODEC_ID_MP3 && track->timescale < 
16000) {
-                av_log(s, AV_LOG_ERROR, "track %d: muxing mp3 at %dhz is not 
supported\n",
-                       i, track->enc->sample_rate);
-                ret = AVERROR(EINVAL);
-                goto error;
+                if (track->enc->strict_std_compliance >= FF_COMPLIANCE_NORMAL) 
{
+                    av_log(s, AV_LOG_ERROR, "track %d: muxing mp3 at %dhz is 
not standard, to mux anyway set strict to -1\n",
+                        i, track->enc->sample_rate);
+                    ret = AVERROR(EINVAL);
+                    goto error;
+                } else {
+                    av_log(s, AV_LOG_WARNING, "track %d: muxing mp3 at %dhz is 
not standard in MP4\n",
+                           i, track->enc->sample_rate);
+                }
             }
         } else if (st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE) {
             track->timescale = st->time_base.den;

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

Reply via email to