Skip to content

Commit

Permalink
substitute BestAudioSource with BestSource
Browse files Browse the repository at this point in the history
  • Loading branch information
0tkl committed Jul 27, 2023
1 parent 66127f8 commit 23451d4
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
8 changes: 4 additions & 4 deletions automation/vapoursynth/aegisub_vs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/win_installer/fragment_codecs.iss
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion packages/win_installer/portable/create-portable.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions src/libresrc/default_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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" : {
Expand Down Expand Up @@ -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"
}
}
},
Expand Down
4 changes: 2 additions & 2 deletions src/libresrc/osx/default_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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" : {
Expand Down Expand Up @@ -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"
}
}
},
Expand Down
18 changes: 9 additions & 9 deletions tools/win-installer-setup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 23451d4

Please sign in to comment.