Selur / hybrid-vapoursynth-addon

Adding Vapoursynth and plugins to Hybrid
10 stars 4 forks source link

Building on Docker ubuntu-22.04 #5

Closed ViRb3 closed 9 months ago

ViRb3 commented 9 months ago

Hello. I'm trying to get Hybrid running on a M1 Mac using Docker x64 emulation via Rosetta2, with the GUI piped over XQuartz. This works great for me with other complex programs, and the performance is near-native. Here's my progress so far:

FROM --platform=linux/amd64 ubuntu:22.04

ENV DEBIAN_FRONTEND noninteractive

RUN apt update && apt install -y \
    # used by build-vapoursynth.sh
    git \
    wget \
    # used by Hybrid itself
    libasound2 \
    qtbase5-dev \
    lib32stdc++6 \
    pciutils 

RUN git clone https://github.com/Selur/hybrid-vapoursynth-addon && \
    cd hybrid-vapoursynth-addon && \
    sed -i 's/sudo //g' ./build-vapoursynth.sh && \
    sed -i 's/apt update//g' ./build-vapoursynth.sh && \
    sed -i 's/apt upgrade//g' ./build-vapoursynth.sh && \
    sed -i 's/apt install/apt install -y/g' ./build-vapoursynth.sh && \
    # Needed to build zimg, see https://github.com/cdgriffith/pi_streaming_setup/issues/27
    sed -i 's/git clone/git clone --recurse-submodules/g' ./build-vapoursynth.sh && \
    ./build-vapoursynth.sh

RUN apt clean && \
    rm -rf /var/lib/apt/lists/* /var/cache/apt/archives /tmp/* /var/tmp/*

COPY ./entrypoint.sh /entrypoint.sh

# bootstrapper for XQuartz on Mac, irrelevant to Hybrid
ENTRYPOINT ["/entrypoint.sh"]

I pair this with the prebuilt binaries from https://www.selur.de/sites/default/files/hybrid_downloads/Hybrid_20230317_Linux.7z.

I also add this as per the instructions (~ should be replaced with $HOME):

{
    echo 'export LD_LIBRARY_PATH="$HOME/opt/vapoursynth/lib"'
    echo 'export PYTHONPATH="$HOME/opt/vapoursynth/lib/python3.6/site-packages"'
    echo 'export PATH="$HOME/opt/vapoursynth/bin:$PATH"'
    echo 'export PATH="$HOME/.local/bin:$PATH"'
} >>~/.profile

All great! Hybrid runs without issues and detects all tools. Only issue is that whenever I try to process a video, it crashes. Debug logs attached below. Any thoughts?

HybridDebugOutput.txt test_2023-11-27@21_15_07_4110_Report.txt

Thanks!

Selur commented 9 months ago

This seems to be directly related to: https://github.com/Selur/hybrid-vapoursynth-addon/issues/4 In short: lsmash does not get build since I don't know how and switching to ffms2 should work as a workaround. But since I can't get lsmash works to build, I would recommend to not use Hybrid, since I'm planning to drop all support for Linux because of it this next weekend. I will also close: https://github.com/Selur/hybrid-vapoursynth-addon and https://github.com/Selur/HybridDeploy because of it.

Cu Selur

ViRb3 commented 9 months ago

Is lsmash your only concern? I can look into getting it to build, if that would help.

Selur commented 9 months ago

lsmash is the main concern.. neo_Vague_Denoiser would also be nice, since https://github.com/HomeOfVapourSynthEvolution/VapourSynth-VagueDenoiser doesn't exist any more, but lsmash is the main problem since there isn't really an alternative to it. bestsource is still experimental, ffms2 often isn't frame accurate, dgdecnv only works on nvidia gpus (+ I never tried to get it working on linux).

So it would be really cool if you can figure out how to adjust the current build script to build current lsmash again.

ViRb3 commented 9 months ago

A quick look around seems to suggest that the currently maintained version of lsmash is https://github.com/HomeOfAviSynthPlusEvolution/L-SMASH-Works. They have a workflow that builds specifically for Linux and passes as of 3 weeks ago:

The only caveat here is that they use their own patched version of ffmpeg6:

Would you be OK if we use this version? Should be just a drop in replacement. Happy to send PRs once I confirm and get it working.

Selur commented 9 months ago

Yeah, should be okay no issues from my end with that.

ViRb3 commented 9 months ago

Awesome, will give it a go and let you know. Also seems like VagueDenoiser was reworked under the "neo" repo here: https://github.com/HomeOfAviSynthPlusEvolution/neo_Vague_Denoiser, still provide VapourSynth support. Would you like me to try and get that working as well? Any easy way I can test it?

Selur commented 9 months ago

Sure if you have the time. :) Calling it in a Vapoursynths script clip = core.neo_vd.VagueDenoiser(clip=clip) is probably the easiest way to test it.

ViRb3 commented 9 months ago

Sure, will try. What's the difference between build-and-install-vapoursynth.sh and build-vapoursynth.sh? The former is last updated 2 years ago, so I suppose it's unused?

Selur commented 9 months ago

Yeah, first one probably can be removed since it's not really needed anymore.

Selur commented 9 months ago

the plugins should build now again

ViRb3 commented 9 months ago

Wow thanks a lot for that @Selur and people who made this possible! I got halfway there 3 weeks ago, but got very busy and didn't find the time to continue. I just ran ./build-vapoursynth.sh && ./build-plugins.sh and they worked flawlessly! However, when I tried the same test as in my first post, I still get the same error: FFmpeg output: fd:: Invalid argument. Any thoughts? Thanks!

Selur commented 9 months ago

echo 'export PYTHONPATH="$HOME/opt/vapoursynth/lib/python3.6/site-packages"' seems wrong, since nowadays Vapoursynth requires a newer python version. side note: I did release a new Linux build of Hybrid an the tools, maybe that helps,.. Does the Vapoursynth Preview work in Hybrid?

ViRb3 commented 9 months ago

Tried the new Hybrid build, while loading it says: Found no activationattributeNameFilter for key ()! (let Selur know) a few times and then dies...

With the old build from March, I set PYTHONPATH to the correct one (3.10):

ls $HOME/opt/vapoursynth/lib/python3.10/site-packages
vapoursynth.la  vapoursynth.so

But still doesn't work. The VS preview shows for a split second and then disappears, or it shows but is blank. To sanity check, I tried import vapoursynth from a python3 shell, and it can't find such a module. find / -name vapoursynth.py returns nothing. Is there anything I'm missing?

Selur commented 9 months ago

iirc. python 3.11 is needed for Vapoursynth R65. does vspipe --version work? There is no 'vapoursynth.py', so that is normal.

ViRb3 commented 9 months ago

Wops, ignore me, I forgot to recreate the container after fixing PYTHONPATH. It works!!! Thanks a lot for the help.

Any thoughts about the fatal error on December build?

I will do benchmarks soon and report back. Will also spin up some CI/CD to build Docker container.

Selur commented 9 months ago

You mean the 'activationAttributnameFilter' message, try resetting the defaults. I got idea what is causing this. There should be no reason for it to be empty. => will try to look into this tomorrow some more.

Selur commented 9 months ago

I can reproduce the issue here. Will look for a fix tomorrow.

Selur commented 9 months ago

Working on it, seems like theres a mixup in my build environment since Ubuntu 22.04 now supports qt 6.6.1 => working on it.

Selur commented 9 months ago

released a new version which should fix the 'activationAttributnameFilter' PopUps

ViRb3 commented 9 months ago

Can confirm it works, thank you! I will try to release the Docker project this holiday and get back to you in case you want to check it out.

Wado729 commented 4 months ago

Can confirm it works, thank you! I will try to release the Docker project this holiday and get back to you in case you want to check it out.

Were you able to create the docker project?

ViRb3 commented 4 months ago

Yes, but unfortunately still haven't found the time to polish it and publish it.

Wado729 commented 3 months ago

Yes, but unfortunately still haven't found the time to polish it and publish it.

I'd be interested when you do.