From d251ea6d69b420be8bb2707ba012063d7616a834 Mon Sep 17 00:00:00 2001 From: Aline Gondim Santos <aline.gondimsantos@savoirfairelinux.com> Date: Thu, 2 Mar 2023 09:40:56 -0300 Subject: [PATCH] AudioFilter, GreenScreen, WaterMark: bump ffmpeg 6 Change-Id: I7b4f75f33f7a0a1b8c21cae2de96b05836e4c984 --- AudioFilter/FilterAudioSubscriber.cpp | 6 +++--- AudioFilter/build.sh | 2 +- AudioFilter/ffmpeg/package.json | 5 ++--- AudioFilter/ffmpeg/rules.mak | 19 ++----------------- AudioFilter/ffmpeg/windows-configure-make.sh | 11 ++--------- GreenScreen/build.sh | 2 -- GreenScreen/ffmpeg/package.json | 7 +++---- GreenScreen/ffmpeg/rules.mak | 2 +- WaterMark/build.sh | 2 -- WaterMark/ffmpeg/package.json | 7 +++---- WaterMark/ffmpeg/rules.mak | 2 +- WaterMark/testPreferences.yml | 2 +- build-plugin.py | 19 +------------------ contrib/freetype/package.json | 2 +- lib/AVFrameIO.h | 8 ++++---- lib/frameFilter.cpp | 4 ++-- lib/mediaStream.h | 4 ++-- 17 files changed, 29 insertions(+), 75 deletions(-) diff --git a/AudioFilter/FilterAudioSubscriber.cpp b/AudioFilter/FilterAudioSubscriber.cpp index 02c2555..a1e41c3 100644 --- a/AudioFilter/FilterAudioSubscriber.cpp +++ b/AudioFilter/FilterAudioSubscriber.cpp @@ -111,7 +111,7 @@ FilterAudioSubscriber::getIRAVFrameInfos() return rAudioFormat; } rAudioFormat = AudioFormat(pFormatCtx_->streams[audioStream_]->codecpar->sample_rate, - pFormatCtx_->streams[audioStream_]->codecpar->channels, + pFormatCtx_->streams[audioStream_]->codecpar->ch_layout.nb_channels, static_cast<AVSampleFormat>( pFormatCtx_->streams[audioStream_]->codecpar->format)); @@ -183,7 +183,7 @@ FilterAudioSubscriber::update(Observable<AVFrame*>*, AVFrame* const& pluginFrame if (firstRun) { setFilterDescription(pluginFrame->sample_rate, pluginFrame->nb_samples); AudioFormat afmt_ = AudioFormat(pluginFrame->sample_rate, - pluginFrame->channels, + pluginFrame->ch_layout.nb_channels, static_cast<AVSampleFormat>(pluginFrame->format)); AudioFormat irfmt_ = getIRAVFrameInfos(); MediaStream ms_ = MediaStream("input", afmt_); @@ -198,7 +198,7 @@ FilterAudioSubscriber::update(Observable<AVFrame*>*, AVFrame* const& pluginFrame if (reverbFilter_.feedInput(pluginFrame, "input") == 0) { AVFrame* filteredFrame = reverbFilter_.readOutput(); - if (filteredFrame) { + if (filteredFrame && filteredFrame->nb_samples == pluginFrame->nb_samples) { moveFrom(pluginFrame, filteredFrame); av_frame_unref(filteredFrame); av_frame_free(&filteredFrame); diff --git a/AudioFilter/build.sh b/AudioFilter/build.sh index e620f66..2fb1908 100755 --- a/AudioFilter/build.sh +++ b/AudioFilter/build.sh @@ -78,7 +78,7 @@ then if [ ${DEBUG} ]; then OUTPUT="${PLUGIN_NAME}" CLANG_OPTS="-g -fsanitize=address" - EXTRA_DEBUG_LIBRARIES="-lyaml-cpp -lvdpau -lX11 -lva-drm -lva-x11 -lmp3lame" + EXTRA_DEBUG_LIBRARIES="-lyaml-cpp -lvdpau -lX11 -lva-drm -lva-x11 -lmp3lame -llzma" EXTRA_DEFINES="-D__DEBUG__" else python3 ./../SDK/jplManipulation.py --preassemble --plugin=${PLUGIN_NAME} diff --git a/AudioFilter/ffmpeg/package.json b/AudioFilter/ffmpeg/package.json index ef1d754..e7071bb 100644 --- a/AudioFilter/ffmpeg/package.json +++ b/AudioFilter/ffmpeg/package.json @@ -1,6 +1,6 @@ { "name": "ffmpeg", - "version": "n5.0", + "version": "n6.0", "url": "https://git.ffmpeg.org/gitweb/ffmpeg.git/snapshot/__VERSION__.tar.gz", "deps": [ "mp3lame", @@ -17,13 +17,12 @@ "libopusdec-enable-FEC.patch", "windows-configure.patch", "windows-configure-ffnvcodec.patch", - "windows-configure-libmfx.patch", "windows-configure-mp3lame.patch" ], "win_patches": [ ], "project_paths": [], - "with_env" : "10.0.16299.0", + "with_env" : "", "custom_scripts": { "pre_build": [], "build": [ diff --git a/AudioFilter/ffmpeg/rules.mak b/AudioFilter/ffmpeg/rules.mak index eda60ec..4a6a458 100644 --- a/AudioFilter/ffmpeg/rules.mak +++ b/AudioFilter/ffmpeg/rules.mak @@ -1,4 +1,4 @@ -FFMPEG_HASH := n5.0 +FFMPEG_HASH := n6.0 FFMPEG_URL := https://git.ffmpeg.org/gitweb/ffmpeg.git/snapshot/$(FFMPEG_HASH).tar.gz PKGS+=ffmpeg @@ -157,21 +157,6 @@ FFMPEGCONF += \ --enable-decoder=pcm_u16be \ --enable-decoder=pcm_u16le -#encoders/decoders for images -FFMPEGCONF += \ - --enable-encoder=gif \ - --enable-decoder=gif \ - --enable-encoder=jpegls \ - --enable-decoder=jpegls \ - --enable-encoder=ljpeg \ - --enable-decoder=jpeg2000 \ - --enable-encoder=png \ - --enable-decoder=png \ - --enable-encoder=bmp \ - --enable-decoder=bmp \ - --enable-encoder=tiff \ - --enable-decoder=tiff - #filters FFMPEGCONF += \ --enable-filter=aresample \ @@ -343,7 +328,7 @@ $(TARBALLS)/ffmpeg-$(FFMPEG_HASH).tar.gz: ffmpeg: ffmpeg-$(FFMPEG_HASH).tar.gz rm -Rf $@ $@-$(FFMPEG_HASH) mkdir -p $@-$(FFMPEG_HASH) - (cd $@-$(FFMPEG_HASH) && tar x $(if ${BATCH_MODE},,-v) --strip-components=1 -f ../$<) + (cd $@-$(FFMPEG_HASH) && tar x $(if ${BATCH_MODE},,-v) --strip-components=1 -f $<) $(APPLY) $(SRC)/ffmpeg/remove-mjpeg-log.patch $(APPLY) $(SRC)/ffmpeg/change-RTCP-ratio.patch $(APPLY) $(SRC)/ffmpeg/rtp_ext_abs_send_time.patch diff --git a/AudioFilter/ffmpeg/windows-configure-make.sh b/AudioFilter/ffmpeg/windows-configure-make.sh index cf4fa01..af3a329 100644 --- a/AudioFilter/ffmpeg/windows-configure-make.sh +++ b/AudioFilter/ffmpeg/windows-configure-make.sh @@ -14,7 +14,8 @@ FFMPEGCONF+=' --disable-d3d11va --disable-dxva2 --disable-postproc - --disable-filters' + --disable-filters + --disable-zlib' FFMPEGCONF+=' --enable-cross-compile @@ -121,16 +122,8 @@ FFMPEGCONF+=' #filters FFMPEGCONF+=' - --enable-filter=scale - --enable-filter=overlay - --enable-filter=amix - --enable-filter=amerge --enable-filter=aresample - --enable-filter=format --enable-filter=aformat - --enable-filter=fps - --enable-filter=transpose - --enable-filter=pad --enable-filter=afir' if [ "$1" == "uwp" ]; then diff --git a/GreenScreen/build.sh b/GreenScreen/build.sh index 8df21c8..ec593f9 100755 --- a/GreenScreen/build.sh +++ b/GreenScreen/build.sh @@ -136,8 +136,6 @@ then -l:libavformat.a \ -l:libavcodec.a \ -l:libavutil.a \ - -l:libvpx.a \ - -l:libx264.a \ -lopencv_imgproc \ -lopencv_core \ -lvpx \ diff --git a/GreenScreen/ffmpeg/package.json b/GreenScreen/ffmpeg/package.json index 5740af3..b282355 100644 --- a/GreenScreen/ffmpeg/package.json +++ b/GreenScreen/ffmpeg/package.json @@ -1,6 +1,6 @@ { "name": "ffmpeg", - "version": "n5.0", + "version": "n6.0", "url": "https://git.ffmpeg.org/gitweb/ffmpeg.git/snapshot/__VERSION__.tar.gz", "deps": [ "zlib", @@ -16,13 +16,12 @@ "libopusenc-reload-packet-loss-at-encode.patch", "libopusdec-enable-FEC.patch", "windows-configure.patch", - "windows-configure-ffnvcodec.patch", - "windows-configure-libmfx.patch" + "windows-configure-ffnvcodec.patch" ], "win_patches": [ ], "project_paths": [], - "with_env" : "10.0.16299.0", + "with_env" : "", "custom_scripts": { "pre_build": [], "build": [ diff --git a/GreenScreen/ffmpeg/rules.mak b/GreenScreen/ffmpeg/rules.mak index 86b58a8..45e0205 100644 --- a/GreenScreen/ffmpeg/rules.mak +++ b/GreenScreen/ffmpeg/rules.mak @@ -1,4 +1,4 @@ -FFMPEG_HASH := n5.0 +FFMPEG_HASH := n6.0 FFMPEG_URL := https://git.ffmpeg.org/gitweb/ffmpeg.git/snapshot/$(FFMPEG_HASH).tar.gz PKGS+=ffmpeg diff --git a/WaterMark/build.sh b/WaterMark/build.sh index 7df63f2..4ad07d9 100755 --- a/WaterMark/build.sh +++ b/WaterMark/build.sh @@ -110,8 +110,6 @@ then -l:libavformat.a \ -l:libavcodec.a \ -l:libavutil.a \ - -l:libvpx.a \ - -l:libx264.a \ -lfreetype \ -lvpx \ -lx264 \ diff --git a/WaterMark/ffmpeg/package.json b/WaterMark/ffmpeg/package.json index 112a56e..646ef81 100644 --- a/WaterMark/ffmpeg/package.json +++ b/WaterMark/ffmpeg/package.json @@ -1,6 +1,6 @@ { "name": "ffmpeg", - "version": "n5.0", + "version": "n6.0", "url": "https://git.ffmpeg.org/gitweb/ffmpeg.git/snapshot/__VERSION__.tar.gz", "deps": [ "zlib", @@ -17,13 +17,12 @@ "libopusenc-reload-packet-loss-at-encode.patch", "libopusdec-enable-FEC.patch", "windows-configure.patch", - "windows-configure-ffnvcodec.patch", - "windows-configure-libmfx.patch" + "windows-configure-ffnvcodec.patch" ], "win_patches": [ ], "project_paths": [], - "with_env" : "10.0.16299.0", + "with_env" : "", "custom_scripts": { "pre_build": [], "build": [ diff --git a/WaterMark/ffmpeg/rules.mak b/WaterMark/ffmpeg/rules.mak index 52da737..dd3bc45 100644 --- a/WaterMark/ffmpeg/rules.mak +++ b/WaterMark/ffmpeg/rules.mak @@ -1,4 +1,4 @@ -FFMPEG_HASH := n5.0 +FFMPEG_HASH := n6.0 FFMPEG_URL := https://git.ffmpeg.org/gitweb/ffmpeg.git/snapshot/$(FFMPEG_HASH).tar.gz PKGS+=ffmpeg diff --git a/WaterMark/testPreferences.yml b/WaterMark/testPreferences.yml index 6e9e89a..ee33580 100644 --- a/WaterMark/testPreferences.yml +++ b/WaterMark/testPreferences.yml @@ -6,7 +6,7 @@ logosize: "0.25" markbackground: "black@0.0" showinfos: "1" showlogo: "1" -mark: "jamiwhite.png" +mark: "sample.gif" date: "1" dateformat: "%x" time: "1" diff --git a/build-plugin.py b/build-plugin.py index 36a70ef..f85cf33 100755 --- a/build-plugin.py +++ b/build-plugin.py @@ -38,11 +38,6 @@ ANDROID_DISTRIBUTION_NAME = "android" WIN32_DISTRIBUTION_NAME = "win32" UBUNTU_DISTRIBUTION_NAME = "ubuntu" -# vs vars -win_sdk_default = '10.0.16299.0' -win_toolset_default = 'v142' - - def parse(): parser = argparse.ArgumentParser(description='Builds Plugins projects') parser.add_argument('--projects', type=str, @@ -55,11 +50,6 @@ def parse(): dist = choose_distribution() - if dist == WIN32_DISTRIBUTION_NAME: - parser.add_argument('--toolset', default=win_toolset_default, type=str, - help='Windows use only, specify Visual Studio toolset version') - parser.add_argument('--sdk', default=win_sdk_default, type=str, - help='Windows use only, specify Windows SDK version') args = parser.parse_args() args.projects = args.projects.split(',') @@ -75,9 +65,6 @@ def parse(): validate_args(args) - if dist != WIN32_DISTRIBUTION_NAME: - args.toolset = '' - args.sdk = '' return args @@ -126,7 +113,7 @@ def choose_distribution(): return 'Unknown' -def buildPlugin(pluginPath, processor, distribution, toolset='', sdk='', buildOptions=''): +def buildPlugin(pluginPath, processor, distribution, buildOptions=''): if distribution == WIN32_DISTRIBUTION_NAME: if (buildOptions): with open(f"{pluginPath}/package.json") as f: @@ -143,8 +130,6 @@ def buildPlugin(pluginPath, processor, distribution, toolset='', sdk='', buildOp sys.executable, os.path.join( os.getcwd(), "../../daemon/compat/msvc/winmake.py"), "-P", - "--toolset", toolset, - "--sdk", sdk, "-fb", pluginPath.split('/')[-1] ], check=True) if (buildOptions): @@ -181,8 +166,6 @@ def main(): currentDir + "/" + plugin, args.processor[i], args.distribution, - args.toolset, - args.sdk, args.buildOptions) diff --git a/contrib/freetype/package.json b/contrib/freetype/package.json index 61dd4b9..10f2e49 100644 --- a/contrib/freetype/package.json +++ b/contrib/freetype/package.json @@ -6,7 +6,7 @@ "patches": [], "win_patches": [], "project_paths": ["builds/windows/vc2010/freetype.vcxproj"], - "with_env" : "10.0.16299.0", + "with_env" : "", "custom_scripts": { "pre_build": ["copy %cd%\\\\..\\\\..\\\\src\\\\freetype\\\\freetype.vcxproj %cd%\\\\builds\\\\windows\\\\vc2010\\\\freetype.vcxproj /Y"], "build": [], diff --git a/lib/AVFrameIO.h b/lib/AVFrameIO.h index 98b3dd5..85d17c0 100644 --- a/lib/AVFrameIO.h +++ b/lib/AVFrameIO.h @@ -121,9 +121,8 @@ openEncoder(AVCodecContext*& encCodecCtx, if (mediaType == AVMEDIA_TYPE_AUDIO) { encCodecCtx->sample_rate = decCodecCtx->sample_rate; - encCodecCtx->channel_layout = decCodecCtx->channel_layout; - encCodecCtx->channels = decCodecCtx->channels; - encCodecCtx->channels = av_get_channel_layout_nb_channels(encCodecCtx->channel_layout); + encCodecCtx->ch_layout = decCodecCtx->ch_layout; + encCodecCtx->ch_layout.nb_channels = decCodecCtx->ch_layout.nb_channels; encCodecCtx->sample_fmt = decCodecCtx->sample_fmt; encCodecCtx->time_base = AVRational{1, encCodecCtx->sample_rate}; } else if (mediaType == AVMEDIA_TYPE_VIDEO) { @@ -214,7 +213,8 @@ readAndNotifyAVFrame(const std::string& file, jami::PublishObservable<AVFrame*>* // Read frames from decoder while (avcodec_receive_frame(decCodecCtx, pFrame) == 0) { // Publish frames for the plugin subscriber - pFrame->time_base = decCodecCtx->time_base; + pFrame->time_base.num = decCodecCtx->framerate.den; + pFrame->time_base.den = decCodecCtx->framerate.num; subject->publish(pFrame); // Send frame to encoder diff --git a/lib/frameFilter.cpp b/lib/frameFilter.cpp index dc571d4..4a06914 100644 --- a/lib/frameFilter.cpp +++ b/lib/frameFilter.cpp @@ -187,7 +187,7 @@ FrameFilter::feedInput(AVFrame* frame, const std::string& inputName) if (ms.format != frame->format || (ms.isVideo && (ms.width != frame->width || ms.height != frame->height)) || (!ms.isVideo - && (ms.sampleRate != frame->sample_rate || ms.nbChannels != frame->channels))) { + && (ms.sampleRate != frame->sample_rate || ms.nbChannels != frame->ch_layout.nb_channels))) { ms.update(frame); if ((ret = reinitialize()) < 0) return fail("Failed to reinitialize filter with new input parameters", ret); @@ -283,7 +283,7 @@ FrameFilter::initInputFilter(AVFilterInOut* in, MediaStream msp) buffersrc = avfilter_get_by_name("buffer"); } else { params->sample_rate = msp.sampleRate; - params->channel_layout = av_get_default_channel_layout(msp.nbChannels); + av_channel_layout_default(&(params->ch_layout), msp.nbChannels); buffersrc = avfilter_get_by_name("abuffer"); } diff --git a/lib/mediaStream.h b/lib/mediaStream.h index d50295f..d764f53 100644 --- a/lib/mediaStream.h +++ b/lib/mediaStream.h @@ -113,7 +113,7 @@ struct MediaStream format = c->sample_fmt; isVideo = false; sampleRate = c->sample_rate; - nbChannels = c->channels; + nbChannels = c->ch_layout.nb_channels; frameSize = c->frame_size; break; default: @@ -141,7 +141,7 @@ struct MediaStream height = f->height; } else { sampleRate = f->sample_rate; - nbChannels = f->channels; + nbChannels = f->ch_layout.nb_channels; timeBase = rational<int>(1, f->sample_rate); if (!frameSize) frameSize = f->nb_samples; -- GitLab