View Full Version : Chrome OS and avisynth+
Ceppo
12th March 2022, 16:54
I brought a Chrome book, it has linux (beta) support. For future references I would like to know which one of these (https://avs-plus.net/) linux builds are compatible or if none of them are. I know nothing about linux, but I might port all the plugins I make for linux (or windows versions automatically works?).
qyot27
12th March 2022, 18:40
Chromebrew has AviSynth+ 3.7.0 in its repository, as well as FFmpeg 5.0. Not sure if Chromebrew is a separate thing from the Linux support, or if it's built on top of it somehow.
It looks like ChromeOS's Linux support is somewhat like WSL on Windows, where it hooks into an existing distribution's tools? If that's the case, it really depends on how it manages repositories (and which distro it uses; a cursory look implies that it's Debian, but that others might be added as a user-selectable choice later on). More specifically whether it allows adding third-party repos, or if you've already used Chromebrew to install things, if it causes conflicts.
Really, though, the build process and dependencies for AviSynth+ are very simple, so as long as you have the basic build tools, it's extremely straight-forward.
qyot27
12th March 2022, 19:06
At least according to the Google Support page (https://support.google.com/chromebook/answer/9145439?hl=en), it does appear to be a Debian 10 (Buster) environment, sandboxed so that Linux apps only affect other Linux apps (assuming that system libraries like libavisynth get counted as an 'app', of course).
Given that information, you should be able to easily build it yourself (the yuuki-deb repository looks like it only has 3.6.1 and is limited to amd64*, and deb-multimedia's package for Buster is 3.7.0; if you want to be up-to-date, building it yourself is kind of the only option).
*is the Chromebook x86(-64) or ARM?
Grab the dependencies:
sudo apt-get install build-essential cmake git libdevil-dev ninja-build
Download the source, create a new folder to build in, and enter that folder:
git clone https://github.com/AviSynth/AviSynthPlus && \
mkdir -p AviSynthPlus/avisynth-build && \
cd AviSynthPlus/avisynth-build
Configure the source (if you'd rather use GNU Make, leave off the -G Ninja part of the command):
cmake ../ -G Ninja
Build (if you decided to use GNU Make, it'd be 'make', not 'ninja'):
ninja
Install (again, if GNU Make, then 'sudo make install' instead):
sudo ninja install && \
sudo ldconfig
Ceppo
12th March 2022, 19:12
Thanks for the replay.
I tried installing using the link in your signature that lead me to this (https://github.com/AviSynth/AviSynthPlus/blob/master/distrib/docs/english/source/avisynthdoc/contributing/posix.rst) page.
However, every time I try, something is missing, I spend 15 min to figure out how to install the missing one and something else is missing. After a while, I gave up.
Could please show me all the commands to install the needed programs to compile the build? Those new Linux terminal commands are very new to me and if I don't find the answer on StackOverflow I'm basically stuck.
Also, I got the chrome book 3 hours ago. I just enabled the Linux support and looked online to get root access. I'm completely clueless about any Linux-related thing.
Also since we are there I will shamelessly ask if you can suggest an avisynth script editor and a video player for Linux. :D
EDIT: Ignore my post. I was late.
*is the Chromebook x86(-64) or ARM?
x86(64)
sudo apt-get install build-essential cmake git libdevil-dev ninja
It says "Package ninja is not avaible, ... " and says that I need another source.
qyot27
12th March 2022, 19:43
Oh yeah, it's ninja-build.
Ceppo
12th March 2022, 19:48
I started the no ninja route, It's compiling. Hope it's the same.
Also since we are there I will shamelessly ask if you can suggest an avisynth script editor and a video player for Linux.
Could you replay to this?
EDIT: I installed it without error.
qyot27
12th March 2022, 20:17
I generally just use a basic text editor (L3afpad, Featherpad, Mousepad, gedit, nano, 'echo'ing things directly into the script file from the Terminal), but Atom can run on ChromeOS (https://blog.atom.io/2018/10/02/running-atom-on-chome-os.html), and that has its own extensions for language-avisynth (https://atom.io/packages/language-avisynth) and autocomplete-avisynth (https://atom.io/packages/autocomplete-avisynth).
mpv for video player. For nearly everything, that should work fine, but if you want AviSynth support inside of it, that's going to be a more involved process, because it means having to rebuild both mpv as well as FFmpeg, and that's a more advanced task.
You can, however, pipe from avs2yuv into mpv. You won't get audio (and you also can't seek, because it's reading from a pipe), but you can confirm that the AviSynth+ install works.
git clone https://github.com/DJATOM/avs2yuv && \
mkdir -p avs2yuv/build && \
cd avs2yuv/build && \
cmake .. && \
make && \
sudo make install
avs2yuv test.avs -o - | mpv -
Ceppo
12th March 2022, 20:39
I run into trouble:
avs2you install says "none of the required 'avisynth>=3.5.0' found".
So my avisynth install is broken or I got an outdated one?
EDIT:
from messing with it, I think that it will detect only binaries, cuz atom, and MPV works. I can't find another explanation.
qyot27
12th March 2022, 22:59
Actually, it may mean that a different part of the process isn't finding it, even though it's there.
What are the outputs of the following commands:
cat /etc/os-release
pkg-config --version
echo $PKG_CONFIG_PATH
echo $LD_LIBRARY_PATH
Some distributions don't put /usr/local in the default search paths for both pkg-config (which should be installed, but if not, use sudo apt-get install pkgconf). I can't remember if Debian is one of those. There's also the chance that Google opts to adjust that for their purposes on Chromebooks.
Ceppo
13th March 2022, 13:51
https://i.ibb.co/SVSJ4Hm/Screenshot-2022-03-13-13-48-23.png
As you can see the echo command does not output anything. :confused:
qyot27
13th March 2022, 18:31
Did you try building avs2yuv again after installing pkgconf? It took several hours yesterday (I have no clue why) to get Debian 10 installed under a VM, and pkg-config doesn't get installed unless/until you explicitly install it.
And because I now have a Debian 10 installation to troubleshoot with, I can provide more precise instructions for the next steps: getting FFMS2, and builds of FFmpeg and mpv that can directly open AviSynth scripts.
Ceppo
13th March 2022, 19:48
Thanks again for your time.
I did install avs2yuv and
avs2yuv Test.avs -o - | mpv -
says it can't open the file cuz it doesn't know the format.
But it does not say that avs2yuv is a unkwnown command so the installation should be fine, (I guess).
qyot27
13th March 2022, 20:01
Was it this?
Error: unsupported colorspace.
You still can output any format in headerless mode. Use "-raw" option if you really need that.
avs2yuv pipes using the yuv4mpeg format, which as the name suggests, is YUV. A plain invocation of Version() outputs RGB (it can pipe this if you give the -raw parameter to avs2yuv, but that also requires giving the receiving application the resolution, framerate, and pixel format). So for something like Version(), in the script you'll need to either A) convert to one of the YUV formats or B) use Version's new configurable parameters to specify the pixel_type directly:
Version(pixel_type="YUV420P8")
Ceppo
13th March 2022, 20:15
It works now :O Maybe I did something wrong the first time :(
EDIT:
And because I now have a Debian 10 installation to troubleshoot with, I can provide more precise instructions for the next steps: getting FFMS2, and builds of FFmpeg and mpv that can directly open AviSynth scripts.
If you do, your help is very appreciated.
qyot27
14th March 2022, 01:57
We're going to need buster-backports, so for that, you'll need to add the repository to your sources.list.
Elevate to root:
sudo su
Append the buster-backports repository to sources.list:
echo "deb http://deb.debian.org/debian buster-backports main" >> /etc/apt/sources.list
De-elevate back to your normal user:
exit
Update the repository lists:
sudo apt-get update
Clone FFmpeg and set up the build directories to keep things organized:
git clone git://source.ffmpeg.org/ffmpeg.git && \
mkdir -p ffmpeg/ffmpeg-build/minimal ffmpeg/ffmpeg-build/full
Grab the extra dependencies for FFmpeg and FFMS2:
sudo apt-get install libdav1d-dev libbz2-dev zlib1g-dev nasm autoconf automake libtool m4
Build a minimal version of FFmpeg just for FFMS2 to use:
cd ffmpeg/ffmpeg-build/minimal && \
../../configure --prefix=/opt/ffmpeg_build_for_ffms2 --enable-gpl \
--disable-encoders --disable-muxers --disable-doc --disable-debug --disable-devices \
--disable-avdevice --enable-libdav1d && \
make -j$(nproc) && \
sudo make install
Clone and build FFMS2:
git clone https://github.com/FFMS/ffms2.git && \
cd ffms2 && \
PKG_CONFIG_PATH=/opt/ffmpeg_build_for_ffms2/lib/pkgconfig \
CPPFLAGS="-I/usr/local/include/avisynth" ./autogen.sh \
--prefix=$HOME/.local --enable-avisynth --enable-shared \
--with-pic && \
make -j$(nproc) && \
make install
Create a symbolic link to FFMS2 in one of AviSynth+'s autoload directories:
ln -s ~/.local/lib/libffms2.so ~/.local/lib/avisynth/libffms2.so
Go ahead and test an FFMS2-using script with avs2yuv if you want to make sure it's working.
qyot27
14th March 2022, 02:02
Now to build the full versions of FFmpeg and mpv:
Grab all the dependencies needed to build Debian's FFmpeg and mpv packages:
sudo apt-get build-dep ffmpeg
sudo apt-get build-dep --dry-run mpv
You would then take that list of mpv's dependencies in the 'new packages will be installed' section, remove the ones related to FFmpeg (libpostproc, libavutil, libavformat, libavcodec, libswscale, libswresample, libavfilter), and then apt-get install the rest.
To make that easier, that would look like this for a mostly out-of-the-box Debian 10 install:
sudo apt-get install python3-roman libarchive-dev sgml-base docutils-common intltool-debian \
libcdio-dev libvulkan-dev libarchive-zip-perl libpng-dev libva-dev libass-dev libharfbuzz-gobject0 \
wayland-protocols dwz libdvdnav-dev dh-autoreconf libslang2-dev libset-scalar-perl libfribidi-dev \
dh-strip-nondeterminism libcaca-dev libfile-stripnondeterminism-perl libfontconfig1-dev po-debconf \
libharfbuzz-dev xml-core libdvdread-dev libcdio-paranoia-dev libfreetype6-dev libvdpau-dev liblua5.2-dev \
python3-docutils libxml2-dev libcdio-cdda-dev librubberband-dev debhelper libgraphite2-dev \
gir1.2-harfbuzz-0.0 libncurses-dev libsmbclient-dev libicu-dev libgbm-dev autopoint libva-glx2 \
icu-devtools libreadline-dev gettext libuchardet-dev libbluray-dev
Build the full version of FFmpeg:
cd ffmpeg/ffmpeg-build/full && \
../../configure --progs-suffix=-avs --disable-doc --arch=amd64 --enable-gpl --disable-stripping --enable-avisynth \
--enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b \
--enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig \
--enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm \
--enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse \
--enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr \
--enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab \
--enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 \
--enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal \
--enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 \
--enable-chromaprint --enable-frei0r --enable-libx264 --enable-libdav1d && \
make -j$(nproc) && \
sudo make install
Since some of the options Debian used on FFmpeg 4.1 are no longer relevant for FFmpeg 5.0 or git (or like the --toolchain=hardened, for the more security-conscious that aren't doing casual builds), they've been excised from that command. We're installing this FFmpeg to the default area where user-built things go, /usr/local. Additionally, because this FFmpeg is built as static, it won't interfere with any of the other FFmpeg-using things Debian might install, all of which assume the shared libraries are in /usr/lib/x86_64-linux-gnu. Because there's a risk that just running 'ffmpeg' could call the wrong build if the Debian-provided one exists in /usr/bin, the --progs-suffix= option will append '-avs' to the end of the ffmpeg, ffplay, and ffprobe binaries, so that they become 'ffmpeg-avs', 'ffplay-avs', and 'ffprobe-avs'.
Build mpv:
git clone https://github.com/mpv-player/mpv && \
cd mpv && \
./bootstrap.py && \
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./waf configure --prefix=$HOME/.local \
--confdir=/etc/mpv --enable-cdda --enable-dvdnav \
--enable-sdl2 --enable-dvbin --enable-openal && \
./waf build && \
./waf install
Like FFmpeg, we've adjusted some of the build options because some of them in the Debian-provided mpv are no longer relevant. Unfortunately, some of the other things mpv can use aren't provided by even the buster-backports repository, and to keep this simple, I'm not going to go over how to build them from source. It's also getting installed to $HOME/.local, so that it's definitely out of the way of any system things. If a simple 'mpv' calls the wrong one, however, you can fix it by appending '-avs' to the one in ~/.local, like this:
mv ~/.local/bin/mpv ~/.local/bin/mpv-avs
Ceppo
14th March 2022, 03:20
ln -s ~/.local/lib/libffms2.so ~/.local/lib/avisynth/libffms2.so
This line failed, it says that there is no such file or directory :confused:
EDIT: I fixed it by creating manually the avisynth folder.
EDIT: it works I'm on the second post.
EDIT: I got this.
https://i.ibb.co/VvDrDrd/Screenshot-2022-03-14-03-47-34.png
And I don't know what it is talking about :D
qyot27
14th March 2022, 06:11
You'll need to enable source repositories (mine were seemingly enabled by default in the VM, probably a stray checkbox when I was installing it). While there are ways to do this through the GUI, it depends on stuff like what package management GUI frontend is being used, and that depends on which desktop environment you're using. So skipping that and using the Terminal,
sudo nano /etc/apt/sources.list
Will open up the relevant file for you to edit. The lines that say 'deb-src' are commented out, so remove the #s to make them active. When finished, press Ctrl+X to tell nano you want to exit, and tell it it's okay to save the changes. Then sudo apt-get update, and try the build-dep command again.
Ceppo
14th March 2022, 18:11
I installed nano since it seems there is nothing installed on this linux. I don't know if I'm doing wrong but I don't have any deb-src line commented out and if I add deb-src manually it says that it can't read the line (it couldn't be so easy of course).
https://i.ibb.co/9qSRhMK/Screenshot-2022-03-14-18-08-29.png
qyot27
14th March 2022, 19:27
Why is the backports line there three times? Anyway, that kind of really slim sources.list must be because the Debian install was set up as a Docker container rather than installed from the Debian ISOs. This is what my sources.list looks like:
#
# deb cdrom:[Debian GNU/Linux 10.11.0 _Buster_ - Official amd64 NETINST 20211009-16:11]/ buster main
#deb cdrom:[Debian GNU/Linux 10.11.0 _Buster_ - Official amd64 NETINST 20211009-16:11]/ buster main
deb http://deb.debian.org/debian/ buster main
deb-src http://deb.debian.org/debian/ buster main
deb http://security.debian.org/debian-security buster/updates main
deb-src http://security.debian.org/debian-security buster/updates main
# buster-updates, previously known as 'volatile'
deb http://deb.debian.org/debian/ buster-updates main
deb-src http://deb.debian.org/debian/ buster-updates main
# This system was installed using small removable media
# (e.g. netinst, live or single CD). The matching "deb cdrom"
# entries were disabled at the end of the installation process.
# For information about how to configure apt package sources,
# see the sources.list(5) manual.
deb http://deb.debian.org/debian buster-backports main
Ceppo
14th March 2022, 20:56
Coping the lines fixed it, however mpv seems not yet able to open directly the avs file (I got no exceptions while installing).
As you can see here:
https://i.ibb.co/1JWwvsh/Screenshot-2022-03-14-20-53-32.png
EDIT:
I have also a linux question, after the manual install these folders where created in the /home/ceppo/ folder. Are they leftover from the install, or are the actual installation folders? I don't know how linux thinks.
https://i.ibb.co/PTyg8Qs/Screenshot-2022-03-14-21-44-38.png
qyot27
15th March 2022, 02:39
which -a mpv
If it's what I fear it could be, it may be preferring the system mpv rather than the one you just built. The which command will show you which one it's homing in on, and the -a parameter will tell if it even sees the one installed to $HOME/.local/bin. If the system one is getting used first for whatever reason, you can usually force the one you actually want by providing the absolute path to the binary:
~/.local/bin/mpv test.avs
Although after confirming that, I'd go with what I suggested a few posts ago and rename the mpv in ~/.local/bin to mpv-avs, since that would be a unique name and won't get confused with the system's version.
The AviSynthPlus, avs2yuv, ffmpeg, ffms2, and mpv directories can be deleted if you want. Those are just the clones of the source code; you could keep them around to periodically use git pull to update the source to the latest version and then rebuild, but aside from FFmpeg, it's not like re-downloading would take a long time (and even the FFmpeg source repo doesn't really take that long to download on most modern Internet connections).
Ceppo
15th March 2022, 03:07
It was as you said, so I uninstalled the system one cuz I'm lazy to write the -avs suffix, and now it works. Still, I stuck with the -avs suffix for ffmpeg because there it gets more complicated. I also managed to install RgTools from your post here (https://forum.doom9.org/showthread.php?t=182032) so I should be able to do the same with the other filters. :)
I have a question: is CodeBlock for linux a good replacement for Microsoft Visual Studio to write avisynth filters? :O
qyot27
15th March 2022, 03:39
I don't use Visual Studio, so I'm not the one to answer that. Visual Studio Code (i.e. just the IDE) is available for Linux and Mac, and hooks into GCC or Clang. (https://code.visualstudio.com/) So if you're just looking for roughly the same UX as Visual Studio, I would assume that that wouldn't feel any different than using it on Windows, apart from a different compiler being underneath it.
Ceppo
15th March 2022, 15:53
Thanks for all your help! We got avisynth+ on chrome os thanks to you! :D
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.