Skip to content

Commit 7948262

Browse files
author
arch
committed
add option to download ffmpeg
1 parent 2c5a44f commit 7948262

File tree

4 files changed

+33
-10
lines changed

4 files changed

+33
-10
lines changed

docs/app/docs/user-guide/build.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,32 @@ This create the Windows executable in `./dist`.
1818

1919
Finally you can remove the build environment with `conda env remove -n build`
2020

21-
## Ubuntu 20.04 LTS
21+
## Ubuntu 20.04 LTS, Ubuntu 21.04, Debian
2222

2323
The OpenCV Package in Ubuntu use the GTK Backend for the preview window. This will cause freezes of the UI, because i use Qt threads in my code. The Arch Linux OpenCV library was compiled with QT (see `python3 -c "import cv2; print(cv2.getBuildInformation())"` output) so no problem here. To use the Application on Ubuntu you have to compile `OpenCV + OpenCV contrib` with `-D WITH_QT=ON` flag from source. Or simply use [miniconda](https://docs.conda.io/en/latest/miniconda.html). They include OpenCV compiled with Qt support.
2424

2525
**NOTE:** I have also test this setup on Ubuntu 21.04 with Wayland desktop. You can use the setup instructions from Ubuntu 20.04 LTS. The application work with XWayland on the Wayland desktop!
2626

2727
### Miniconda
2828

29-
After you have setup [miniconda](https://docs.conda.io/en/latest/miniconda.html) on your Ubuntu machine simply type the following commands to use Python-Funscript-Editor on Ubuntu:
29+
After you have setup [miniconda](https://docs.conda.io/en/latest/miniconda.html) on your machine simply type the following commands to use Python-Funscript-Editor:
3030

3131
```bash
3232
sudo apt install -y make git gcc g++ libmpv-dev libatlas-base-dev
33-
sudo add-apt-repository ppa:savoury1/ffmpeg4
34-
sudo apt install -y ffmpeg
3533
git clone https://github.com/michael-mueller-git/Python-Funscript-Editor.git
3634
cd Python-Funscript-Editor
3735
conda env create -f environment_ubuntu.yaml
3836
```
3937

40-
**NOTE:** The ffmpeg in the Ubuntu 20.04 LTS ppa package is too old, which means that the package does not contain the `v360` filter for VR videos. Therefore we install ffmpeg from savoury1 ppa.
38+
On some distributions e.g. Ubuntu 20.04 LTS, the FFmpeg package does not contain the required `v360` filter. Therefore you can download a static linked FFmpeg package for this application with `bash download_ffmpeg.sh` from project root directory. (Perform this step if you are not sure if your FFmpeg version is sufficient!).
39+
40+
Ubuntu user can alternatively use the `savoury1` ppa:
41+
42+
```bash
43+
sudo add-apt-repository ppa:savoury1/ffmpeg4
44+
sudo apt install -y ffmpeg
45+
46+
```
4147

4248
Now you can run the program direct from source code with:
4349

download_ffmpeg.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
echo "[INFO] Download ffmpeg..."
4+
rm -f /tmp/ffmpeg-git-amd64-static.tar.xz
5+
wget --show-progress -O /tmp/ffmpeg-git-amd64-static.tar.xz "https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-amd64-static.tar.xz"
6+
7+
echo "[INFO] Extract ffmpeg..."
8+
tmpDir=$(mktemp -d)
9+
tar -xf /tmp/ffmpeg-git-amd64-static.tar.xz -C ${tmpDir}
10+
mv -fv ${tmpDir}/ffmpeg-git*/ffmpeg ./funscript_editor/data
11+
if [ "$?" = "0" ]; then
12+
echo "[INFO] FFmpeg is now successfully setup"
13+
fi
14+
rm -rf ${tmpDir}
15+
rm -f /tmp/ffmpeg-git-amd64-static.tar.xz

funscript_editor/algorithms/funscriptgenerator.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -727,12 +727,13 @@ def tracking(self) -> str:
727727
if last_frame is not None:
728728
# Process data from last step while the next tracking points get predicted.
729729
# This should improve the whole processing speed, because the tracker run in a seperate thread
730-
bboxes['Woman'][frame_num-1] = bbox_woman
731-
last_frame = self.draw_box(last_frame, bboxes['Woman'][frame_num-1], color=(0,255,0))
732-
if self.params.supervised_tracking:
733-
last_frame = self.draw_box(last_frame, tracking_area_woman, color=(0,255,0))
730+
if bbox_woman is not None:
731+
bboxes['Woman'][frame_num-1] = bbox_woman
732+
last_frame = self.draw_box(last_frame, bboxes['Woman'][frame_num-1], color=(0,255,0))
733+
if self.params.supervised_tracking:
734+
last_frame = self.draw_box(last_frame, tracking_area_woman, color=(0,255,0))
734735

735-
if self.params.track_men:
736+
if self.params.track_men and bbox_men is not None:
736737
bboxes['Men'][frame_num-1] = bbox_men
737738
last_frame = self.draw_box(last_frame, bboxes['Men'][frame_num-1], color=(255,0,255))
738739
if self.params.supervised_tracking:

funscript_editor/data/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ffmpeg

0 commit comments

Comments
 (0)