Improve instruction to build ssimulacra2
Closed this issue · 2 comments
I don't have the technology literacy to understand the instruction and what I need to do. The instruction provided was not sufficient for me and I don't wish for anyone to go through the pain.
I managed to compile and run it after many trial runs. If anyone want to check out how I did this, here's the step. It's mostly for Windows, sorry for anyone who's looking to do this in Linux, I failed to do it on Ubuntu
- Enter this link http://www.vapoursynth.com/doc/installation.html#linux-installation,
- Follow the prerequisites to download the required python
- Enter the VapourSynth installer link and download the .exe file
- Then download the latest release-x86_64-cachedir-cwd.zip from https://github.com/AkarinVS/L-SMASH-Works/releases/tag/vA.3j
- Run the exe file, don't modify or change any setting if you are not familar with it
- After Vapoursynth is installed, find the path, typically C:\Users<username>\AppData\Local\Programs\VapourSynth\sdk\lib64 (REPLACE THE username WITH YOUR!!)
- decompress the .zip folder, and copy and paste the libvslsmashsource.dll to C:\Users<username>\AppData\Local\Programs\VapourSynth\plugins
- (I only attempted this on Powershell), There are different command shell to use. Use the command below according to what shell you're using. DON'T FORGET TO REPLACE USERNAME OR PATH FROM STEP 6.
- Powershell: $env:LIB="C:\Users<username>\vapoursynth-portable\sdk\lib64;$env:LIB"
- CMD: set LIB=C:\Users<username>\vapoursynth-portable\sdk\lib64;%LIB%
- Bash: export LIB="C:/Users//vapoursynth-portable/sdk/lib64:$LIB"
- If you have rust installed, attempt "cargo install ssimulacra2_rs" on your cli.
- If it fail because it require Visual Studio or Visual studio tool, download them. I downloaded Visual
10_1. You can download on https://visualstudio.microsoft.com/downloads/ Find the "Tools for Visual Studio" bar and download the "Remote Tools for Visual Studio 2022". Run it
10_2. Make sure Desktop Development with C++ is checked, leave the optional check installation alone and download it.
10_3. Retry step 8 again after you reboot your PC. - Run ssimulacra2_rs -h to check if it's running.
- You're done!
I'll put this on my todo list for when I have a bit more time. I can't help with documentation for Windows, so contributions would be appreciated.
For anyone interested.
I tried running this project on Fedora linux, but couldn't install the needed libraries because they weren't available in my repository. So I decided to run it with a docker file instead of installing arch linux.
Here is the .dockerignore
.idea
.github
target
And the Dockerfile
FROM archlinux AS builder
RUN pacman -Syu --disable-sandbox --noconfirm && pacman -Sy vapoursynth gcc make cmake pkg-config ttf-bitstream-vera fontconfig --disable-sandbox --noconfirm
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
COPY . /usr/local/src/ssimulacra2_bin
WORKDIR /usr/local/src/ssimulacra2_bin
RUN source "$HOME/.cargo/env" && cargo build --release
FROM archlinux
RUN pacman -Syu --disable-sandbox --noconfirm && pacman -Sy vapoursynth gcc make cmake pkg-config ttf-bitstream-vera fontconfig meson l-smash ffmpeg --disable-sandbox --noconfirm \
&& pacman -S --needed base-devel git --noconfirm\
&& useradd -m builder \
&& echo "builder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers \
&& mkdir -p /usr/local/src/vapoursynth-plugin-lsmashsource-git \
&& cd /usr/local/src/vapoursynth-plugin-lsmashsource-git \
&& chmod 777 . \
&& sudo -u builder git clone --depth=1 https://aur.archlinux.org/foosynth-plugin-lsmashsource-git.git\
&& cd /usr/local/src/vapoursynth-plugin-lsmashsource-git/foosynth-plugin-lsmashsource-git \
&& sudo -u builder makepkg -S --noconfirm \
&& sudo -u builder makepkg -i --noconfirm \
&& rm -rf /usr/local/src/vapoursynth-plugin-lsmashsource-git \
&& userdel builder
COPY --from=builder /usr/local/src/ssimulacra2_bin/target/release/ssimulacra2_rs /usr/local/bin
WORKDIR /mnt
ENTRYPOINT ["ssimulacra2_rs"]
You can then build it using:
docker build -t ssimulacra2_rs .
And run it using:
docker run -it --rm -v ./:/mnt ssimulacra2_rs video ./video-source.mp4 ./video-distorted.mp4