Skip to content

Commit 14b61a3

Browse files
author
Steffen Roller
committed
new stuff over the recent weeks
1 parent 95f7757 commit 14b61a3

File tree

3 files changed

+236
-0
lines changed

3 files changed

+236
-0
lines changed

build_ffmpeg_from_scratch

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
#!/bin/bash
2+
#
3+
# compile ffmpeg from the sources on Raspberry Pi 5
4+
#
5+
6+
set -x
7+
8+
# from https://amperecomputing.com/tuning-guides/FFmpeg-Tuning-Guide
9+
export CFLAGS="-mtune=native" && export CXXFLAGS="-mtune=native"
10+
11+
sudo apt-get update -qq && sudo apt-get -y install \
12+
autoconf \
13+
automake \
14+
build-essential \
15+
cmake \
16+
git \
17+
libass-dev \
18+
libfreetype6-dev \
19+
libgnutls28-dev \
20+
libmp3lame-dev \
21+
libsdl2-dev \
22+
libtool \
23+
libva-dev \
24+
libvdpau-dev \
25+
libvorbis-dev \
26+
libxcb1-dev \
27+
libxcb-shm0-dev \
28+
libxcb-xfixes0-dev \
29+
meson \
30+
ninja-build \
31+
pkg-config \
32+
texinfo \
33+
wget \
34+
yasm \
35+
zlib1g-dev \
36+
nasm libnuma-dev
37+
38+
# libfdk-aac-dev libopus-dev libsvtav1-dev libsvtav1enc-dev libsvtav1dec-dev libdav1d-dev libunistring-dev python3-pip
39+
40+
mkdir -p ~/ffmpeg_sources ~/bin
41+
42+
# install x264 support
43+
cd ~/ffmpeg_sources
44+
git -C x264 pull 2> /dev/null || git clone --depth 1 https://code.videolan.org/videolan/x264.git
45+
cd x264
46+
PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" --enable-static --enable-pic
47+
PATH="$HOME/bin:$PATH" make
48+
make install
49+
50+
# install x265 support
51+
52+
cd ~/ffmpeg_sources
53+
wget -O x265.tar.bz2 https://bitbucket.org/multicoreware/x265_git/get/master.tar.bz2
54+
tar xjvf x265.tar.bz2
55+
cd multicoreware*/build/linux
56+
PATH="$HOME/bin:$PATH" cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$HOME/ffmpeg_build" -DENABLE_SHARED=off ../../source
57+
PATH="$HOME/bin:$PATH" make
58+
make install
59+
60+
# install vpx support
61+
cd ~/ffmpeg_sources
62+
git -C libvpx pull 2> /dev/null || git clone --depth 1 https://chromium.googlesource.com/webm/libvpx.git
63+
cd libvpx
64+
PATH="$HOME/bin:$PATH" ./configure --prefix="$HOME/ffmpeg_build" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm
65+
PATH="$HOME/bin:$PATH" make
66+
make install
67+
68+
# install AV1 support
69+
cd ~/ffmpeg_sources
70+
git -C SVT-AV1 pull 2> /dev/null || git clone https://gitlab.com/AOMediaCodec/SVT-AV1.git
71+
mkdir -p SVT-AV1/build
72+
cd SVT-AV1/build
73+
PATH="$HOME/bin:$PATH" cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$HOME/ffmpeg_build" -DCMAKE_BUILD_TYPE=Release -DBUILD_DEC=OFF -DBUILD_SHARED_LIBS=OFF ..
74+
PATH="$HOME/bin:$PATH" make
75+
make install
76+
77+
# libdav1 support
78+
pip3 install --user meson
79+
cd ~/ffmpeg_sources
80+
git -C dav1d pull 2> /dev/null || git clone --depth 1 https://code.videolan.org/videolan/dav1d.git
81+
mkdir -p dav1d/build
82+
cd dav1d/build
83+
meson setup -Denable_tools=false -Denable_tests=false --default-library=static .. --prefix "$HOME/ffmpeg_build" --libdir="$HOME/ffmpeg_build/lib"
84+
ninja
85+
ninja install
86+
87+
88+
# Opus support
89+
cd ~/ffmpeg_sources
90+
git -C opus pull 2> /dev/null || git clone --depth 1 https://github.com/xiph/opus.git
91+
cd opus
92+
./autogen.sh
93+
./configure --prefix="$HOME/ffmpeg_build" --disable-shared
94+
make
95+
make install
96+
97+
# aac support
98+
cd ~/ffmpeg_sources
99+
git -C fdk-aac pull 2> /dev/null || git clone --depth 1 https://github.com/mstorsjo/fdk-aac
100+
cd fdk-aac
101+
autoreconf -fiv
102+
./configure --prefix="$HOME/ffmpeg_build" --disable-shared
103+
make
104+
make install
105+
106+
107+
# netflix
108+
cd ~/ffmpeg_sources
109+
wget https://github.com/Netflix/vmaf/archive/v3.0.0.tar.gz
110+
tar xvf v3.0.0.tar.gz
111+
mkdir -p vmaf-3.0.0/libvmaf/build
112+
cd vmaf-3.0.0/libvmaf/build
113+
meson setup -Denable_tests=false -Denable_docs=false --buildtype=release --default-library=static .. --prefix "$HOME/ffmpeg_build" --bindir="$HOME/bin" --libdir="$HOME/ffmpeg_build/lib"
114+
ninja
115+
ninja install
116+
117+
cd ~/ffmpeg_sources
118+
git -C aom pull 2> /dev/null || git clone --depth 1 https://aomedia.googlesource.com/aom
119+
mkdir -p aom_build
120+
cd aom_build
121+
PATH="$HOME/bin:$PATH" cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$HOME/ffmpeg_build" -DENABLE_TESTS=OFF -DENABLE_NASM=on ../aom
122+
PATH="$HOME/bin:$PATH" make
123+
make install
124+
125+
cd ~/ffmpeg_sources
126+
wget -O ffmpeg-snapshot.tar.bz2 https://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2
127+
tar xjvf ffmpeg-snapshot.tar.bz2
128+
git clone https://git.ffmpeg.org/ffmpeg.git
129+
cd ffmpeg
130+
131+
PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure \
132+
--prefix="$HOME/ffmpeg_build" \
133+
--pkg-config-flags="--static" \
134+
--extra-cflags="-I$HOME/ffmpeg_build/include" \
135+
--extra-ldflags="-L$HOME/ffmpeg_build/lib" \
136+
--extra-libs="-lpthread -lm" \
137+
--ld="g++" \
138+
--bindir="$HOME/bin" \
139+
--enable-gpl \
140+
--enable-gnutls \
141+
--enable-libaom \
142+
--enable-libass \
143+
--enable-libfdk-aac \
144+
--enable-libfreetype \
145+
--enable-libmp3lame \
146+
--enable-libopus \
147+
--enable-libsvtav1 \
148+
--enable-libdav1d \
149+
--enable-libvorbis \
150+
--enable-libvpx \
151+
--enable-libx264 \
152+
--enable-libx265 \
153+
--enable-nonfree && \
154+
PATH="$HOME/bin:$PATH" make && \
155+
make install && \
156+
hash -r
157+

monthly

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
#!/bin/bash
2+
3+
set -x
4+
5+
TIMEFORMAT='Script finished after %lR'
6+
time {
7+
8+
# MOVIES=${MOVIES:-~/movies}
9+
MONTH=$(date -d last-month +"%m")
10+
YEAR=$(date -d -last-month +"%Y")
11+
MONTH_DIR=$(date -d last-month +"%m-%B")
12+
WEATHER_DATA_FILE=/var/lib/weather/goc/weather-$YEAR-$MONTH.csv
13+
14+
get_weather_data fetch -v $MONTH $YEAR
15+
16+
if [ ! -f $WEATHER_DATA_FILE ]; then
17+
echo $WEATHER_DATA_FILE not found
18+
exit
19+
fi
20+
21+
WEATHER_DATA=$(tail -1 $WEATHER_DATA_FILE | awk -F';' '{ print $2 }')
22+
23+
# last list in weather data file is empty
24+
# data wasn't - yet - read from Environment Canada
25+
if [ -z "$WEATHER_DATA" ]; then
26+
echo weather data for month $MONTH not complete
27+
echo try again later
28+
exit
29+
fi
30+
31+
32+
cd ~/timelapse/river
33+
RIVER=~timelapse/archive/pictures/river/$YEAR/$MONTH_DIR
34+
mkdir -p $RIVER
35+
STREET=~timelapse/archive/pictures/street/$YEAR/$MONTH_DIR
36+
mkdir -p $STREET
37+
38+
cd ~/timelapse/river
39+
tar c $YEAR$MONTH* | tar -C $RIVER -xv
40+
41+
cd ~/timelapse/street
42+
tar c $YEAR$MONTH* | tar -C $STREET -xv
43+
44+
cd $RIVER
45+
find -maxdepth 1 -type d -name "$YEAR$MONTH*" | xargs -l create-archive
46+
47+
cd ~timelapse/archive/movies/webm/river/$YEAR/$MONTH_DIR
48+
concat-daily-movies
49+
cd ~timelapse/archive/movies/x265/river/$YEAR/$MONTH_DIR
50+
concat-daily-movies
51+
52+
53+
# cd $STREET
54+
# find -maxdepth 1 -type d -name "$YEAR$MONTH*" | xargs -l create-archive
55+
56+
# cd ~/archive/movies/webm/street/$YEAR/$MONTH_DIR
57+
# concat-daily-movies
58+
# cd ~/archive/movies/x265/street/$YEAR/$MONTH_DIR
59+
# concat-daily-movies
60+
61+
echo done!
62+
echo you can probably delete directories under $(realpath ~timelapse/timelapse/river)/$YEAR$MONTH\*
63+
echo and $(realpath ~timelapse/timelapse/street/)/$YEAR$MONTH\*
64+
65+
}
66+

update-all-machines

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
# tmux new -d -s "update-all"
4+
for node in europa.local io.local ganymede.local callisto.local titan.local phobos.local [email protected]
5+
do
6+
echo '************************************'
7+
echo " $node"
8+
echo '************************************'
9+
echo connecting ...
10+
ssh $node "uname -a ; sudo apt-get update ; sudo apt-get -y upgrade ; sudo apt-get -y dist-upgrade ; sudo apt-get -y autoremove"
11+
done
12+
13+
ssh [email protected] "pihole -up"

0 commit comments

Comments
 (0)