From: Good Guy Date: Wed, 21 Jun 2017 01:20:30 +0000 (-0600) Subject: ffmpeg upgrade 3.3.2, ffmpeg audio segv fix, faststart mp4 X-Git-Url: https://git.cinelerra-gg.org/git/?a=commitdiff_plain;h=d077044be445c058142c2b92b981c53898a2c112;p=goodguy%2Fhistory.git ffmpeg upgrade 3.3.2, ffmpeg audio segv fix, faststart mp4 --- diff --git a/cinelerra-5.1/cinelerra/ffmpeg.C b/cinelerra-5.1/cinelerra/ffmpeg.C index 8e7e62ee..243c4e15 100644 --- a/cinelerra-5.1/cinelerra/ffmpeg.C +++ b/cinelerra-5.1/cinelerra/ffmpeg.C @@ -148,10 +148,13 @@ void FFAudioStream::reset_history() { inp = outp = bfr; hpos = 0; + memset(bfr, 0, lmt-bfr); } void FFAudioStream::iseek(int64_t ofs) { + if( ofs > hpos ) ofs = hpos; + if( ofs > sz ) ofs = sz; outp = inp - ofs*nch; if( outp < bfr ) outp += sz*nch; } @@ -505,6 +508,7 @@ int FFStream::seek(int64_t no, double rate) npkts = MAX_RETRY; } } + if( pos == curr_pos ) return 0; if( pos > 0 && st->time_base.num > 0 ) { double secs = pos / rate; tstmp = secs * st->time_base.den / st->time_base.num; @@ -521,7 +525,7 @@ int FFStream::seek(int64_t no, double rate) } int ret = avformat_seek_file(fmt_ctx, st->index, -INT64_MAX, seek, INT64_MAX, flags); #else - int ret = av_seek_frame(fmt_ctx, st->index, tstmp, AVSEEK_FLAG_ANY); + int ret = av_seek_frame(fmt_ctx, st->index, tstmp, AVSEEK_FLAG_ANY); #endif int retry = MAX_RETRY; while( ret >= 0 ) { diff --git a/cinelerra-5.1/configure.ac b/cinelerra-5.1/configure.ac index f85285ab..3016661a 100644 --- a/cinelerra-5.1/configure.ac +++ b/cinelerra-5.1/configure.ac @@ -125,7 +125,7 @@ PKG_3RD([fdk],[auto], [ libAACdec/include libAACenc/include libSYS/include ]) PKG_3RD([ffmpeg],[yes], - [ffmpeg-3.3], + [ffmpeg-3.3.2], [ libavutil/libavutil.a \ libavcodec/libavcodec.a \ libpostproc/libpostproc.a \ diff --git a/cinelerra-5.1/ffmpeg/audio/faststart_h264.mp4 b/cinelerra-5.1/ffmpeg/audio/faststart_h264.mp4 index 5b897a5f..d5db4f8b 100644 --- a/cinelerra-5.1/ffmpeg/audio/faststart_h264.mp4 +++ b/cinelerra-5.1/ffmpeg/audio/faststart_h264.mp4 @@ -1,2 +1,2 @@ -fqt libfdk_aac +fmp4 libfdk_aac strict -2 diff --git a/cinelerra-5.1/ffmpeg/audio/faststart_h264.qt b/cinelerra-5.1/ffmpeg/audio/faststart_h264.qt new file mode 100644 index 00000000..5b897a5f --- /dev/null +++ b/cinelerra-5.1/ffmpeg/audio/faststart_h264.qt @@ -0,0 +1,2 @@ +fqt libfdk_aac +strict -2 diff --git a/cinelerra-5.1/ffmpeg/format/fmp4 b/cinelerra-5.1/ffmpeg/format/fmp4 new file mode 100644 index 00000000..ea2ccf52 --- /dev/null +++ b/cinelerra-5.1/ffmpeg/format/fmp4 @@ -0,0 +1,2 @@ +mp4 +movflags=+faststart diff --git a/cinelerra-5.1/ffmpeg/video/faststart_h264.mp4 b/cinelerra-5.1/ffmpeg/video/faststart_h264.mp4 index 53f9b438..db06202b 100644 --- a/cinelerra-5.1/ffmpeg/video/faststart_h264.mp4 +++ b/cinelerra-5.1/ffmpeg/video/faststart_h264.mp4 @@ -1,4 +1,11 @@ -fqt libx264 +fmp4 libx264 +crf=28 +maxrate=20000000 +bufsize=20000000 +preset=veryslow +profile=high +level=41 +bf=8 +refs=4 # use framerate for 1 keyframe/sec, needed for seeks -keyint_min=25 -x264opts keyint=25 +x264opts cabac=1:me_range=24:bframes=8:keyint=60:keyint_min=25:qpmin=0:qpmax=69:qpstep=4 diff --git a/cinelerra-5.1/ffmpeg/video/faststart_h264.qt b/cinelerra-5.1/ffmpeg/video/faststart_h264.qt new file mode 100644 index 00000000..53f9b438 --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/faststart_h264.qt @@ -0,0 +1,4 @@ +fqt libx264 +# use framerate for 1 keyframe/sec, needed for seeks +keyint_min=25 +x264opts keyint=25 diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg-3.3.tar.xz b/cinelerra-5.1/thirdparty/src/ffmpeg-3.3.2.tar.xz similarity index 51% rename from cinelerra-5.1/thirdparty/src/ffmpeg-3.3.tar.xz rename to cinelerra-5.1/thirdparty/src/ffmpeg-3.3.2.tar.xz index 78567853..4192c0aa 100644 Binary files a/cinelerra-5.1/thirdparty/src/ffmpeg-3.3.tar.xz and b/cinelerra-5.1/thirdparty/src/ffmpeg-3.3.2.tar.xz differ