Skip to content

Commit eedd71b

Browse files
Merge pull request #4 from michael-mueller-git/feature/appimage
Feature/appimage
2 parents 7b5f4c7 + 9490fdf commit eedd71b

File tree

7 files changed

+426
-10
lines changed

7 files changed

+426
-10
lines changed

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,11 @@ build
44
dist
55
debug*
66
funscript-editor.spec
7+
AppDir
8+
AppDir2
9+
linuxdeploy*.AppImage
10+
Miniconda3-latest*.sh
11+
__pycache__
12+
funscript-editor*.AppImage
13+
ffmpeg
14+
ffmpeg-git*.tar.xz

build_appimage.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
3+
if [ ! -f ./linuxdeploy-x86_64.AppImage ]; then
4+
wget -c "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage"
5+
fi
6+
7+
if [ ! -f ffmpeg-git-amd64-static.tar.xz ]; then
8+
wget -c "https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-amd64-static.tar.xz"
9+
fi
10+
11+
rm -f ./funscript-editor-*.AppImage
12+
13+
chmod +x linuxdeploy-x86_64.AppImage
14+
chmod +x linuxdeploy-plugin-conda.sh
15+
16+
echo "extract ffmpeg..."
17+
mkdir -p tmp
18+
tar -xf ffmpeg-git-amd64-static.tar.xz -C tmp
19+
mv -f tmp/ffmpeg-git*/ffmpeg .
20+
rm -rf tmp
21+
22+
ARCH=x86_64 \
23+
./linuxdeploy-x86_64.AppImage \
24+
--appdir AppDir \
25+
--plugin conda \
26+
--output appimage \
27+
--icon-file icon.png \
28+
--desktop-file funscript-editor.desktop

environment_appimage.yaml

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
name: base
2+
channels:
3+
- conda-forge
4+
- defaults
5+
dependencies:
6+
- _libgcc_mutex=0.1=main
7+
- _openmp_mutex=4.5=1_gnu
8+
- alabaster=0.7.12=pyhd3eb1b0_0
9+
- alsa-lib=1.2.3=h516909a_0
10+
- babel=2.9.1=pyhd3eb1b0_0
11+
- blas=1.0=mkl
12+
- brotlipy=0.7.0=py38h27cfd23_1003
13+
- bzip2=1.0.8=h7f98852_4
14+
- c-ares=1.17.1=h7f98852_1
15+
- ca-certificates=2021.7.5=h06a4308_1
16+
- cairo=1.16.0=hf32fb01_1
17+
- certifi=2021.5.30=py38h06a4308_0
18+
- cffi=1.14.6=py38h400218f_0
19+
- chardet=4.0.0=py38h06a4308_1003
20+
- cryptography=3.4.7=py38hd23ed53_0
21+
- dbus=1.13.18=hb2f20db_0
22+
- expat=2.4.1=h2531618_2
23+
- ffmpeg=4.3.1=hca11adc_2
24+
- fontconfig=2.13.1=h6c09931_0
25+
- freetype=2.10.4=h5ab3b9f_0
26+
- gettext=0.19.8.1=h0b5b191_1005
27+
- gitdb=4.0.7=pyhd3eb1b0_0
28+
- gitpython=3.1.18=pyhd3eb1b0_1
29+
- glib=2.68.3=h9c3ff4c_0
30+
- glib-tools=2.68.3=h9c3ff4c_0
31+
- gmp=6.2.1=h58526e2_0
32+
- gnutls=3.6.13=h85f3911_1
33+
- graphite2=1.3.13=h58526e2_1001
34+
- gst-plugins-base=1.18.4=hf529b03_2
35+
- gstreamer=1.18.4=h76c114f_2
36+
- harfbuzz=2.8.2=h83ec7ef_0
37+
- hdf5=1.10.6=nompi_h7c3c948_1111
38+
- icu=68.1=h58526e2_0
39+
- idna=2.10=pyhd3eb1b0_0
40+
- imagesize=1.2.0=pyhd3eb1b0_0
41+
- intel-openmp=2021.2.0=h06a4308_610
42+
- jasper=1.900.1=h07fcdf6_1006
43+
- jinja2=3.0.1=pyhd3eb1b0_0
44+
- jpeg=9d=h36c2ea0_0
45+
- krb5=1.19.1=hcc1bbae_0
46+
- lame=3.100=h7f98852_1001
47+
- lcms2=2.12=h3be6417_0
48+
- ld_impl_linux-64=2.35.1=h7274673_9
49+
- libblas=3.9.0=9_mkl
50+
- libcblas=3.9.0=9_mkl
51+
- libclang=11.1.0=default_ha53f305_1
52+
- libcurl=7.77.0=h2574ce0_0
53+
- libedit=3.1.20191231=he28a2e2_2
54+
- libev=4.33=h516909a_1
55+
- libevent=2.1.10=hcdb4288_3
56+
- libffi=3.3=he6710b0_2
57+
- libgcc-ng=9.3.0=h5101ec6_17
58+
- libgfortran-ng=7.5.0=ha8ba4b0_17
59+
- libgfortran4=7.5.0=ha8ba4b0_17
60+
- libglib=2.68.3=h3e27bee_0
61+
- libgomp=9.3.0=h5101ec6_17
62+
- libiconv=1.16=h516909a_0
63+
- liblapack=3.9.0=9_mkl
64+
- liblapacke=3.9.0=9_mkl
65+
- libllvm11=11.1.0=hf817b99_2
66+
- libnghttp2=1.43.0=h812cca2_0
67+
- libogg=1.3.4=h7f98852_1
68+
- libopencv=4.5.2=py38hcdf9bf1_0
69+
- libopus=1.3.1=h7f98852_1
70+
- libpng=1.6.37=hbc83047_0
71+
- libpq=13.3=hd57d9b9_0
72+
- libprotobuf=3.15.8=h780b84a_0
73+
- libssh2=1.9.0=ha56f1ee_6
74+
- libstdcxx-ng=9.3.0=hd4cf53a_17
75+
- libtiff=4.2.0=h85742a9_0
76+
- libuuid=1.0.3=h1bed415_2
77+
- libvorbis=1.3.7=h9c3ff4c_0
78+
- libwebp-base=1.2.0=h27cfd23_0
79+
- libxcb=1.14=h7b6447c_0
80+
- libxkbcommon=1.0.3=he3ba5ed_0
81+
- libxml2=2.9.12=h72842e0_0
82+
- lz4-c=1.9.3=h2531618_0
83+
- markupsafe=2.0.1=py38h27cfd23_0
84+
- mkl=2021.2.0=h06a4308_296
85+
- mkl-service=2.3.0=py38h27cfd23_1
86+
- mkl_fft=1.3.0=py38h42c9631_2
87+
- mkl_random=1.2.1=py38ha9443f7_2
88+
- mysql-common=8.0.25=ha770c72_0
89+
- mysql-libs=8.0.25=h935591d_0
90+
- ncurses=6.2=he6710b0_1
91+
- nettle=3.6=he412f7d_0
92+
- nspr=4.30=h9c3ff4c_0
93+
- nss=3.67=hb5efdd6_0
94+
- numpy=1.20.2=py38h2d18471_0
95+
- numpy-base=1.20.2=py38hfae3a4d_0
96+
- olefile=0.46=py_0
97+
- opencv=4.5.2=py38h578d9bd_0
98+
- openh264=2.1.1=h780b84a_0
99+
- openjpeg=2.3.0=h05c96fa_1
100+
- openssl=1.1.1k=h27cfd23_0
101+
- packaging=21.0=pyhd3eb1b0_0
102+
- pcre=8.45=h295c915_0
103+
- pillow=8.3.1=py38h2c7a002_0
104+
- pip=21.1.3=py38h06a4308_0
105+
- pixman=0.40.0=h36c2ea0_0
106+
- py-opencv=4.5.2=py38hd0cf306_0
107+
- pycparser=2.20=py_2
108+
- pygments=2.9.0=pyhd3eb1b0_0
109+
- pyopenssl=20.0.1=pyhd3eb1b0_1
110+
- pyparsing=2.4.7=pyhd3eb1b0_0
111+
- pyqt=5.12.3=py38h578d9bd_7
112+
- pyqt-impl=5.12.3=py38h7400c14_7
113+
- pyqt5-sip=4.19.18=py38h709712a_7
114+
- pyqtchart=5.12=py38h7400c14_7
115+
- pyqtwebengine=5.12.1=py38h7400c14_7
116+
- pysocks=1.7.1=py38h06a4308_0
117+
- python=3.8.10=h12debd9_8
118+
- python_abi=3.8=2_cp38
119+
- pytz=2021.1=pyhd3eb1b0_0
120+
- pyyaml=5.4.1=py38h27cfd23_1
121+
- qt=5.12.9=hda022c4_4
122+
- readline=8.1=h27cfd23_0
123+
- requests=2.25.1=pyhd3eb1b0_0
124+
- scipy=1.6.2=py38had2a1c9_1
125+
- setuptools=52.0.0=py38h06a4308_0
126+
- sip=4.19.13=py38he6710b0_0
127+
- six=1.16.0=pyhd3eb1b0_0
128+
- smmap=4.0.0=pyhd3eb1b0_0
129+
- snowballstemmer=2.1.0=pyhd3eb1b0_0
130+
- sphinx=4.0.2=pyhd3eb1b0_0
131+
- sphinxcontrib-applehelp=1.0.2=pyhd3eb1b0_0
132+
- sphinxcontrib-devhelp=1.0.2=pyhd3eb1b0_0
133+
- sphinxcontrib-htmlhelp=2.0.0=pyhd3eb1b0_0
134+
- sphinxcontrib-jsmath=1.0.1=pyhd3eb1b0_0
135+
- sphinxcontrib-qthelp=1.0.3=pyhd3eb1b0_0
136+
- sphinxcontrib-serializinghtml=1.1.5=pyhd3eb1b0_0
137+
- sqlite=3.36.0=hc218d9a_0
138+
- tk=8.6.10=hbc83047_0
139+
- typing-extensions=3.10.0.0=hd3eb1b0_0
140+
- typing_extensions=3.10.0.0=pyh06a4308_0
141+
- urllib3=1.26.6=pyhd3eb1b0_1
142+
- wheel=0.36.2=pyhd3eb1b0_0
143+
- x264=1!161.3030=h7f98852_1
144+
- xz=5.2.5=h7b6447c_0
145+
- yaml=0.2.5=h7b6447c_0
146+
- zlib=1.2.11=h7b6447c_3
147+
- zstd=1.4.9=haebb681_0
148+
- pip:
149+
- altgraph==0.17
150+
- click==8.0.1
151+
- coloredlogs==15.0.1
152+
- cycler==0.10.0
153+
- docutils==0.16
154+
- evdev==1.4.0
155+
- ghp-import==2.0.1
156+
- humanfriendly==9.2
157+
- importlib-metadata==4.6.1
158+
- kiwisolver==1.3.1
159+
- markdown==3.3.4
160+
- matplotlib==3.4.2
161+
- mergedeep==1.3.4
162+
- mkdocs==1.2.1
163+
- pyinstaller==4.3
164+
- pyinstaller-hooks-contrib==2021.2
165+
- pynput==1.7.3
166+
- python-dateutil==2.8.1
167+
- python-mpv==0.5.2
168+
- python-xlib==0.31
169+
- pyyaml-env-tag==0.1
170+
- screeninfo==0.6.7
171+
- sphinx-rtd-theme==0.5.2
172+
- watchdog==2.1.3
173+
- zipp==3.5.0
174+
prefix: /home/ubuntu/miniconda3

funscript_editor/api.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ def generate_funscript(
3636
"""
3737
setup_logging()
3838
logging.info("Python Funscript Generator %s", VERSION)
39+
logging.info("Startup Path: %s", str(os.getcwd()))
40+
logging.info("Args: video_file=%s, start_time=%s, end_time=%s, output_file=%s", \
41+
str(video_file), str(start_time), str(end_time), str(output_file))
3942
app = QtWidgets.QApplication(sys.argv)
4043
generator = MinimalFunscriptGenerator(video_file, start_time, end_time, output_file)
4144
generator.run()

funscript_editor/data/ffmpegstream.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,22 @@ def get_frame(
101101
return frame
102102

103103

104+
@staticmethod
105+
def get_ffmpeg_command() -> str:
106+
""" Get FFmpeg binary command string
107+
108+
Returns:
109+
str: FFmpeg command
110+
"""
111+
ffmpeg = os.path.join(os.path.dirname(os.path.abspath(__file__)), "ffmpeg")
112+
if os.path.exists(ffmpeg):
113+
# use local ffmpeg
114+
return ffmpeg
115+
else:
116+
# use ffmpeg in $PATH
117+
return "ffmpeg"
118+
119+
104120
@staticmethod
105121
def get_projection(
106122
frame :np.ndarray,
@@ -121,7 +137,7 @@ def get_projection(
121137
video_filter = video_filter.replace('${' + k + '}', str(v))
122138

123139
command = [
124-
'ffmpeg',
140+
FFmpegStream.get_ffmpeg_command(),
125141
'-hide_banner',
126142
'-loglevel', 'warning',
127143
'-y',
@@ -264,7 +280,7 @@ def run(self) -> None:
264280
seek = FFmpegStream.frame_to_timestamp(self.start_frame, self.video_info.fps)
265281

266282
command = [
267-
'ffmpeg',
283+
FFmpegStream.get_ffmpeg_command(),
268284
'-hide_banner',
269285
'-loglevel', 'warning',
270286
'-ss', str(seek),

funscript_editor/ui/minimal.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ def __init__(self,
3838
if os.path.exists(output_file):
3939
os.remove(output_file)
4040

41+
if video_file is None or video_file == "":
42+
self.__show_message("Video file was not specified!", error=True)
43+
sys.exit()
44+
45+
if not os.path.exists(video_file):
46+
self.__show_message("Video file not found ({})".format(video_file), error=True)
47+
sys.exit()
48+
4149
cap = cv2.VideoCapture(video_file)
4250
fps = cap.get(cv2.CAP_PROP_FPS)
4351
cap.release()
@@ -53,14 +61,6 @@ def __init__(self,
5361
logging.info('Abort Funscript Generator')
5462
sys.exit()
5563

56-
if video_file is None or video_file == "":
57-
self.__show_message("Video file was not specified!", error=True)
58-
sys.exit()
59-
60-
if not os.path.exists(video_file):
61-
self.__show_message("Video file not found ({})".format(video_file), error=True)
62-
sys.exit()
63-
6464
reply = QtWidgets.QMessageBox.question(None, 'Track Men', 'Do you want to track the Men? ',
6565
QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No, QtWidgets.QMessageBox.No)
6666
trackMen = True if reply == QtWidgets.QMessageBox.Yes else False

0 commit comments

Comments
 (0)