From 23451d436c2ce54d5eadb7e4f230b91973d6b2f8 Mon Sep 17 00:00:00 2001 From: 0tkl <118708188+0tkl@users.noreply.github.com> Date: Fri, 28 Jul 2023 00:40:52 +0800 Subject: [PATCH] substitute BestAudioSource with BestSource --- README.md | 2 +- automation/vapoursynth/aegisub_vs.py | 8 ++++---- packages/win_installer/fragment_codecs.iss | 2 +- .../win_installer/portable/create-portable.ps1 | 2 +- src/libresrc/default_config.json | 4 ++-- src/libresrc/osx/default_config.json | 4 ++-- tools/win-installer-setup.ps1 | 18 +++++++++--------- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index da928b0201..f207637d29 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,7 @@ Apart from the dependencies for the TSTools version, there are some additional d The following VapourSynth plugins are used by the default scripts set in the default configuration: - [`lsmas`](https://github.com/AkarinVS/L-SMASH-Works): For LWLibavSource - - [`bas`](https://github.com/vapoursynth/bestaudiosource): For BestAudioSource + - [`bs`](https://github.com/vapoursynth/bestsource): For BestSource - [`wwxd`](https://github.com/dubhater/vapoursynth-wwxd) and [`scxvid`](https://github.com/dubhater/vapoursynth-scxvid) (depending on settings): For keyframe generation diff --git a/automation/vapoursynth/aegisub_vs.py b/automation/vapoursynth/aegisub_vs.py index 6ccd7b9b95..248a5fb0dd 100644 --- a/automation/vapoursynth/aegisub_vs.py +++ b/automation/vapoursynth/aegisub_vs.py @@ -258,13 +258,13 @@ def get_keyframes(filename: str, clip: vs.VideoNode, fallback: str | List[int], def check_audio(filename: str, **kwargs: Any) -> bool: """ Checks whether the given file has an audio track by trying to open it with - BestAudioSource. Requires the `bas` plugin to return correct results, but + BestSource. Requires the `bs` plugin to return correct results, but won't crash if it's not installed. - Additional keyword arguments are passed on to BestAudioSource. + Additional keyword arguments are passed on to BestSource. """ try: - ensure_plugin("bas", "BestAudioSource", "") - vs.core.bas.Source(source=filename, **kwargs) + ensure_plugin("bs", "BestSource", "") + vs.core.bs.Source(source=filename, **kwargs) return True except AttributeError: pass diff --git a/packages/win_installer/fragment_codecs.iss b/packages/win_installer/fragment_codecs.iss index 14d4f503d5..60e947ac43 100644 --- a/packages/win_installer/fragment_codecs.iss +++ b/packages/win_installer/fragment_codecs.iss @@ -7,6 +7,6 @@ DestDir: {app}; Source: {#DEPS_DIR}\AvisynthPlus64\x64\Output\plugins\DirectShow DestDir: {app}\csri; Source: {#DEPS_DIR}\VSFilter\x64\VSFilter.dll; Flags: ignoreversion; Components: main ; VapourSynth DestDir: {app}\vapoursynth; Source: {#DEPS_DIR}\L-SMASH-Works\libvslsmashsource.dll; Flags: ignoreversion; Components: vapoursynth -DestDir: {app}\vapoursynth; Source: {#DEPS_DIR}\bestaudiosource\win64\BestAudioSource.dll; Flags: ignoreversion; Components: vapoursynth +DestDir: {app}\vapoursynth; Source: {#DEPS_DIR}\bestsource\win64\BestSource.dll; Flags: ignoreversion; Components: vapoursynth DestDir: {app}\vapoursynth; Source: {#DEPS_DIR}\SCXVid\libscxvid.dll; Flags: ignoreversion; Components: vapoursynth DestDir: {app}\vapoursynth; Source: {#DEPS_DIR}\WWXD\libwwxd64.dll; Flags: ignoreversion; Components: vapoursynth diff --git a/packages/win_installer/portable/create-portable.ps1 b/packages/win_installer/portable/create-portable.ps1 index e8b6162665..73ed683583 100644 --- a/packages/win_installer/portable/create-portable.ps1 +++ b/packages/win_installer/portable/create-portable.ps1 @@ -61,7 +61,7 @@ Copy-New-Item $InstallerDepsDir\AvisynthPlus64\x64\AviSynth.dll $PortableOutput Copy-New-Item $InstallerDepsDir\AvisynthPlus64\x64\plugins\DirectShowSource.dll $PortableOutputDir Write-Output 'Copying - codecs\VapourSynth' Copy-New-Item $InstallerDepsDir\L-SMASH-Works\libvslsmashsource.dll $PortableOutputDir\vapoursynth -Copy-New-Item $InstallerDepsDir\bestaudiosource\win64\BestAudioSource.dll $PortableOutputDir\vapoursynth +Copy-New-Item $InstallerDepsDir\bestsource\win64\BestSource.dll $PortableOutputDir\vapoursynth Copy-New-Item $InstallerDepsDir\SCXVid\libscxvid.dll $PortableOutputDir\vapoursynth Copy-New-Item $InstallerDepsDir\WWXD\libwwxd64.dll $PortableOutputDir\vapoursynth Write-Output 'Copying - codecs\VSFilter' diff --git a/src/libresrc/default_config.json b/src/libresrc/default_config.json index bafd52eb69..ef4c9d2b40 100644 --- a/src/libresrc/default_config.json +++ b/src/libresrc/default_config.json @@ -351,7 +351,7 @@ "Aegisub Cache" : true }, "VapourSynth" : { - "Default Script" : "# This default script will load an audio file using BestAudioSource.\n# It requires the `bas` plugin.\n\nimport vapoursynth as vs\nimport aegisub_vs as a\na.set_paths(locals())\n\na.ensure_plugin(\"bas\", \"BestAudioSource\", \"To use Aegisub's default audio loader, the `bas` plugin for VapourSynth must be installed\")\nvs.core.bas.Source(source=filename).set_output()" + "Default Script" : "# This default script will load an audio file using BestSource.\n# It requires the `bs` plugin.\n\nimport vapoursynth as vs\nimport aegisub_vs as a\na.set_paths(locals())\n\na.ensure_plugin(\"bs\", \"BestSource\", \"To use Aegisub's default audio loader, the `bs` plugin for VapourSynth must be installed\")\nvs.core.bs.Source(source=filename).set_output()" } }, "Avisynth" : { @@ -392,7 +392,7 @@ }, "VapourSynth" : { "Log Level": "Information", - "Default Script" : "# This default script will load a video file using LWLibavSource.\n# It requires the `lsmas` plugin.\n# See ?data/automation/vapoursynth/aegisub_vs.py for more information.\n\nimport vapoursynth as vs\nimport time\nimport aegisub_vs as a\na.set_paths(locals())\n\nclip, videoinfo = a.wrap_lwlibavsource(filename)\nclip.set_output()\n__aegi_timecodes = videoinfo[\"timecodes\"]\n__aegi_keyframes = videoinfo[\"keyframes\"]\n\n# Uncomment this line to make Aegisub look for a keyframes file for the video, or ask to detect keyframes on scene changes if no file was found.\n# You can also change the GenKeyframesMode. Valid values are NEVER, ALWAYS, and ASK.\n#__aegi_keyframes = a.get_keyframes(filename, clip, __aegi_keyframes, generate=a.GenKeyframesMode.ASK)\n\n# Check if the file has an audio track. This requires the `bas` plugin.\n__aegi_hasaudio = 1 if a.check_audio(filename) else 0" + "Default Script" : "# This default script will load a video file using LWLibavSource.\n# It requires the `lsmas` plugin.\n# See ?data/automation/vapoursynth/aegisub_vs.py for more information.\n\nimport vapoursynth as vs\nimport time\nimport aegisub_vs as a\na.set_paths(locals())\n\nclip, videoinfo = a.wrap_lwlibavsource(filename)\nclip.set_output()\n__aegi_timecodes = videoinfo[\"timecodes\"]\n__aegi_keyframes = videoinfo[\"keyframes\"]\n\n# Uncomment this line to make Aegisub look for a keyframes file for the video, or ask to detect keyframes on scene changes if no file was found.\n# You can also change the GenKeyframesMode. Valid values are NEVER, ALWAYS, and ASK.\n#__aegi_keyframes = a.get_keyframes(filename, clip, __aegi_keyframes, generate=a.GenKeyframesMode.ASK)\n\n# Check if the file has an audio track. This requires the `bs` plugin.\n__aegi_hasaudio = 1 if a.check_audio(filename) else 0" } } }, diff --git a/src/libresrc/osx/default_config.json b/src/libresrc/osx/default_config.json index bcf3c42d41..fc9e3c4b9f 100644 --- a/src/libresrc/osx/default_config.json +++ b/src/libresrc/osx/default_config.json @@ -351,7 +351,7 @@ "Aegisub Cache" : true }, "VapourSynth" : { - "Default Script" : "# This default script will load an audio file using BestAudioSource.\n# It requires the `bas` plugin.\n\nimport vapoursynth as vs\nimport aegisub_vs as a\na.set_paths(globals())\n\na.ensure_plugin(\"bas\", \"BestAudioSource\", \"To use Aegisub's default audio loader, the `bas` plugin for VapourSynth must be installed\")\nvs.core.bas.Source(source=filename).set_output()" + "Default Script" : "# This default script will load an audio file using BestSource.\n# It requires the `bs` plugin.\n\nimport vapoursynth as vs\nimport aegisub_vs as a\na.set_paths(globals())\n\na.ensure_plugin(\"bs\", \"BestSource\", \"To use Aegisub's default audio loader, the `bs` plugin for VapourSynth must be installed\")\nvs.core.bs.Source(source=filename).set_output()" } }, "Avisynth" : { @@ -392,7 +392,7 @@ }, "VapourSynth" : { "Log Level": "Information", - "Default Script" : "# This default script will load a video file using LWLibavSource.\n# It requires the `lsmas` plugin.\n# See ?data/automation/vapoursynth/aegisub_vs.py for more information.\n\nimport vapoursynth as vs\nimport time\nimport aegisub_vs as a\na.set_paths(locals())\n\nclip, videoinfo = a.wrap_lwlibavsource(filename)\nclip.set_output()\n__aegi_timecodes = videoinfo[\"timecodes\"]\n__aegi_keyframes = videoinfo[\"keyframes\"]\n\n# Uncomment this line to make Aegisub look for a keyframes file for the video, or ask to detect keyframes on scene changes if no file was found.\n# You can also change the GenKeyframesMode. Valid values are NEVER, ALWAYS, and ASK.\n#__aegi_keyframes = a.get_keyframes(filename, clip, __aegi_keyframes, generate=a.GenKeyframesMode.ASK)\n\n# Check if the file has an audio track. This requires the `bas` plugin.\n__aegi_hasaudio = 1 if a.check_audio(filename) else 0" + "Default Script" : "# This default script will load a video file using LWLibavSource.\n# It requires the `lsmas` plugin.\n# See ?data/automation/vapoursynth/aegisub_vs.py for more information.\n\nimport vapoursynth as vs\nimport time\nimport aegisub_vs as a\na.set_paths(locals())\n\nclip, videoinfo = a.wrap_lwlibavsource(filename)\nclip.set_output()\n__aegi_timecodes = videoinfo[\"timecodes\"]\n__aegi_keyframes = videoinfo[\"keyframes\"]\n\n# Uncomment this line to make Aegisub look for a keyframes file for the video, or ask to detect keyframes on scene changes if no file was found.\n# You can also change the GenKeyframesMode. Valid values are NEVER, ALWAYS, and ASK.\n#__aegi_keyframes = a.get_keyframes(filename, clip, __aegi_keyframes, generate=a.GenKeyframesMode.ASK)\n\n# Check if the file has an audio track. This requires the `bs` plugin.\n__aegi_hasaudio = 1 if a.check_audio(filename) else 0" } } }, diff --git a/tools/win-installer-setup.ps1 b/tools/win-installer-setup.ps1 index 2938faa786..91e5231742 100644 --- a/tools/win-installer-setup.ps1 +++ b/tools/win-installer-setup.ps1 @@ -75,15 +75,15 @@ if (!(Test-Path L-SMASH-Works)) { Remove-Item release-x86_64-cachedir-cwd.zip } -# bestaudiosource -if (!(Test-Path bestaudiosource)) { - $basDir = New-Item -ItemType Directory bestaudiosource - Set-Location $basDir - $basReleases = Invoke-WebRequest "https://api.github.com/repos/vapoursynth/bestaudiosource/releases/latest" -Headers $GitHeaders -UseBasicParsing | ConvertFrom-Json - $basUrl = $basReleases.assets[0].browser_download_url - Invoke-WebRequest $basUrl -OutFile bas-r1.7z -UseBasicParsing - 7z x bas-r1.7z - Remove-Item bas-r1.7z +# bestsource +if (!(Test-Path bestsource)) { + $bsDir = New-Item -ItemType Directory bestsource + Set-Location $bsDir + # $bsReleases = Invoke-WebRequest "https://api.github.com/repos/vapoursynth/bestsource/git/trees/ba1249c" -Headers $GitHeaders -UseBasicParsing | ConvertFrom-Json + $bsUrl = "https://github.com/vapoursynth/bestsource/archive/ba1249c1f5443be6d0ec2be32490af5bbc96bf99.zip" + Invoke-WebRequest $bsUrl -OutFile bestsource.zip -UseBasicParsing + Expand-Archive -LiteralPath bestsource.zip -DestinationPath bestsource + Remove-Item bestsource.zip Set-Location $DepsDir }