studiorack / studiorack-site

Audio plugin site with searchable plugin list, tools and documentation
https://studiorack.github.io/studiorack-site
MIT License
13 stars 3 forks source link

Reducing Required File Sizes #4

Closed ryukau closed 2 years ago

ryukau commented 2 years ago

Hi.

With the increasing number of plugins, releasing on GitHub starts taking too much time for uploading required files for StudioRack.

Allowing audio formats other than wav greatly helps here. Opus seems good, mp3 is okay. Also, is it possible to provide links rather than file? Once published, audio demos rarely changes between releases.

Another point is to allow using same *.zip file for Linux, Mac, and Windows. Perhaps it's already working like this, but it's not clear from docs. I'd like to have a clarification.

kmturley commented 2 years ago

Hello!

Audio formats 100% agree. I already investigated alternative audio formats other than .wav files. I landed on using: .flac for lossless audio .ogg for lossy audio

If you look at the registry feed, you can see I have already started converting existing .wav files to .flac https://studiorack.github.io/studiorack-registry/

I wanted to keep the audio preview different for each release, allowing plugins to evolve their sound over time. But this should greately reduce the audio filesize/transfer time.

Zip files It is possible to share the same .zip file for Linux, Mac, Windows. However it means:

  1. Users will download unnecessary extra bytes
  2. Plugins will be installed, even though they may not be compatible

I prefer separating them into separate .zip files as this also allows separate download buttons on the site:

Screen Shot 2022-05-29 at 3 01 59 PM

CI pipelines Potentially there could be an optimization in your pipeline steps. Is this the correct location? https://github.com/ryukau/VSTPlugins/actions

It appears the majority of time is spent in the build stage, not the upload stage?

Screen Shot 2022-05-29 at 3 08 19 PM

One potential thing you could try is to remove: git clone --recursive https://github.com/steinbergmedia/vst3sdk.git

As this is is running every time, and not cached. You can add the code as a git submodule instead. On the repo locally do git submodule add https://github.com/steinbergmedia/vst3sdk.git

This will add as a git submodule and version to the exact commit you are testing against. Then in your GitHub CI code add the following:

      - name: Checkout code
        uses: actions/checkout@v2
        with:
          submodules: recursive

This will ensure the dependent code is checked out, but also will be cached if the VST3 commit doesn't change. Check out my automated plugin build here: https://github.com/studiorack/studiorack-workflows/blob/main/.github/workflows/steinberg.yml

I have a template example using it here: https://github.com/studiorack/studiorack-template-steinberg

ryukau commented 2 years ago

Ogg is a container format. Do you mean ogg vorbis, or is it allowed to use any codec that works with ogg container? For example, I can rename .opus to .ogg and they works fine on my environment.


On CI, I download artifacts, locally run packaging scripts, then only upload added or changed plugins through GitHub release page on browser. I started wondering what would happen if the internet connection is cut off by a moment.

I'm pretty sure the above releasing process can be automated with GitHub Actions. I was being lazy on CI, but this is good time to improve it. Thank you for the information!

kmturley commented 2 years ago

Ogg I am using Ogg Vorbis as it has 80% browser compatibility vs Ogg Theora which only as 35% so far. https://caniuse.com/?search=ogg

It is also the default settings for ffmpeg (converting files quickly between formats):

$ ffmpeg -i adlplug.flac -b:a 128k adlplug.ogg
Input #0, flac, from 'adlplug.flac':
  Metadata:
    encoder         : Lavf58.76.100
  Duration: 00:00:02.00, start: 0.000000, bitrate: 242 kb/s
  Stream #0:0: Audio: flac, 44100 Hz, stereo, s16
Stream mapping:
  Stream #0:0 -> #0:0 (flac (native) -> vorbis (libvorbis))
Press [q] to stop, [?] for help
Output #0, ogg, to 'adlplug.ogg':
  Metadata:
    encoder         : Lavf58.76.100
  Stream #0:0: Audio: vorbis, 44100 Hz, stereo, fltp (16 bit), 128 kb/s
    Metadata:
      encoder         : Lavc58.134.100 libvorbis
size=      27kB time=00:00:01.98 bitrate= 113.1kbits/s speed=54.4x    
video:0kB audio:23kB subtitle:0kB other streams:0kB global headers:4kB muxing overhead: 19.199627%

Opus could potentially be another option, but I haven't looked into it yet: https://caniuse.com/?search=opus

Definitely check out my CI templates. You could have the whole process automated. I have it setup so the CI process only runs tests for git commit, but for git tag it will run the entire pipeline and build the artifacts into a release

ryukau commented 2 years ago

Thanks for the answers! It helps a lot.