Skip to content

Commit a233f51

Browse files
authored
Version 4.5.1 (cdgriffith#463)
* Fixing cdgriffith#460 QSVEncC not listed as encoder with FastFlix 5.4.0 (thanks to zedfreak) * Fixing cdgriffith#451 x265 presets and tunes not being applied properly (thanks to HannesJo0139) * Fixing cdgriffith#442 improper options passed to rigaya's encoders for non libavformat readers (thanks to Joet73) * Fixing poetry issues by using setuptools instead
1 parent ad86c4b commit a233f51

34 files changed

+924
-221
lines changed

.github/workflows/build.yaml

+7-19
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,14 @@ jobs:
3030
- name: Install PySide6 apt Requirements
3131
run: |
3232
sudo apt update
33-
sudo apt install libopengl0 freeglut3 freeglut3-dev libxcb-icccm4 libxkbcommon-x11-0 libxcb-xkb1 libxcb-render-util0 libxcb-randr0 libxcb-keysyms1 libxcb-image0 libxcb-shape0-dev -y
33+
sudo apt install libopengl0 freeglut3 freeglut3-dev libxcb-icccm4 libxkbcommon-x11-0 libxcb-xkb1 libxcb-render-util0 libxcb-randr0 libxcb-keysyms1 libxcb-image0 libxcb-shape0-dev libxcb-cursor-dev -y
3434
if: ${{ startsWith(matrix.os, 'ubuntu') }}
3535

3636
- name: Install Python Dependencies
3737
run: |
38-
python -m pip install --upgrade pip setuptools poetry --ignore-installed
39-
poetry config virtualenvs.create false --local
40-
41-
- name: Poetry Install
42-
run: poetry install --with dev --with test
43-
continue-on-error: true
44-
45-
- name: Poetry Install 2
46-
run: poetry install --with dev --with test
38+
python -m pip install --upgrade pip setuptools --ignore-installed
39+
pip install .
40+
pip install .[develop]
4741
4842
- name: Grab iso-639 lists
4943
run: |
@@ -94,15 +88,9 @@ jobs:
9488

9589
- name: Install Python Dependencies
9690
run: |
97-
python -m pip install --upgrade pip setuptools poetry --ignore-installed
98-
poetry config virtualenvs.create false --local
99-
100-
- name: Poetry Install
101-
run: poetry install --with dev
102-
continue-on-error: true
103-
104-
- name: Poetry Install 2
105-
run: poetry install --with dev
91+
python -m pip install --upgrade pip setuptools --ignore-installed
92+
pip install .
93+
pip install .[develop]
10694
10795
10896
- name: Grab iso-639 lists

.github/workflows/pythonpublish.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# This workflow will upload a Python Package using Twine when a release is created
2+
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3+
4+
name: Upload Python Package
5+
6+
on:
7+
release:
8+
types: [ created ]
9+
10+
jobs:
11+
deploy-generic:
12+
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v3
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@v4
20+
with:
21+
python-version: '3.11'
22+
23+
- name: Install Dependencies
24+
run: |
25+
python -m pip install --upgrade pip
26+
pip install setuptools wheel twine --upgrade
27+
28+
29+
- name: Build and Publish
30+
env:
31+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
32+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
33+
34+
run: |
35+
pip install -q build
36+
python -m build --wheel
37+
twine upload dist/*.whl

.github/workflows/test.yaml

+3-9
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,9 @@ jobs:
3838
3939
- name: Install requirements
4040
run: |
41-
python -m pip install --upgrade pip setuptools poetry
42-
poetry config virtualenvs.create false --local
43-
44-
- name: Poetry Install
45-
run: poetry install --with dev
46-
continue-on-error: true
47-
48-
- name: Poetry Install 2
49-
run: poetry install --with dev
41+
python -m pip install --upgrade pip setuptools
42+
pip install .
43+
pip install .[develop]
5044
5145
- name: Run tests
5246
env:

CHANGES

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## Version 5.4.1
4+
5+
* Fixing #460 QSVEncC not listed as encoder with FastFlix 5.4.0 (thanks to zedfreak)
6+
* Fixing #451 x265 presets and tunes not being applied properly (thanks to HannesJo0139)
7+
* Fixing #442 improper options passed to rigaya's encoders for non libavformat readers (thanks to Joet73)
8+
* Fixing poetry issues by using setuptools instead
9+
310
## Version 5.4.0
411

512
* Adding #389 unlock GPU encoders by checking for supported codec (thanks to F.O.R.A.R.T.)

FastFlix_Nix_OneFile.spec

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# -*- mode: python ; coding: utf-8 -*-
22
from PyInstaller.utils.hooks import collect_submodules
3+
import toml
34

45
block_cipher = None
56

@@ -12,10 +13,10 @@ for root, dirs, files in os.walk('fastflix'):
1213
all_fastflix_files.append((os.path.join(root,file), root))
1314

1415
all_imports = collect_submodules('pydantic') + ['dataclasses', 'colorsys', 'typing_extensions', 'box']
15-
with open("requirements.txt", "r") as reqs:
16-
for line in reqs:
17-
package = line.split("[")[0].split("=")[0].split(">")[0].split("<")[0].replace('"', '').replace("'", '').rstrip("~").strip()
18-
if package not in ("pyinstaller", "pypiwin32"):
16+
with open("pyproject.toml") as f:
17+
for line in toml.load(f)["project"]["dependencies"]:
18+
package = line.split("[")[0].split("=")[0].split(">")[0].split("<")[0].replace('"', '').replace("'",'').rstrip("~").strip()
19+
if package not in ("pyinstaller"):
1920
all_imports.append(package)
2021

2122
a = Analysis(['fastflix/__main__.py'],

FastFlix_Windows_Installer.spec

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# -*- mode: python ; coding: utf-8 -*-
22
from PyInstaller.utils.hooks import collect_submodules
3+
import toml
34

45
block_cipher = None
56

@@ -12,10 +13,10 @@ for root, dirs, files in os.walk('fastflix'):
1213
all_fastflix_files.append((os.path.join(root,file), root))
1314

1415
all_imports = collect_submodules('pydantic') + ['dataclasses', 'colorsys', 'typing_extensions', 'box']
15-
with open("requirements.txt", "r") as reqs:
16-
for line in reqs:
17-
package = line.split("[")[0].split("=")[0].split(">")[0].split("<")[0].replace('"', '').replace("'", '').rstrip("~").strip()
18-
if package not in ("pyinstaller", "pypiwin32"):
16+
with open("pyproject.toml") as f:
17+
for line in toml.load(f)["project"]["dependencies"]:
18+
package = line.split("[")[0].split("=")[0].split(">")[0].split("<")[0].replace('"', '').replace("'",'').rstrip("~").strip()
19+
if package not in ("pyinstaller"):
1920
all_imports.append(package)
2021

2122
a = Analysis(['fastflix\\__main__.py'],

FastFlix_Windows_OneFile.spec

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# -*- mode: python ; coding: utf-8 -*-
22
import os
3+
import toml
34

45
from PyInstaller.utils.hooks import collect_submodules
56

@@ -14,9 +15,10 @@ for root, dirs, files in os.walk('fastflix'):
1415
all_fastflix_files.append((os.path.join(root,file), root))
1516

1617
all_imports = collect_submodules('pydantic') + ['dataclasses', 'colorsys', 'typing_extensions', 'box']
17-
with open("requirements.txt", "r") as reqs:
18-
for line in reqs:
19-
package = line.split("[")[0].split("=")[0].split(">")[0].split("<")[0].replace('"', '').replace("'", '').rstrip("~").strip()
18+
19+
with open("pyproject.toml") as f:
20+
for line in toml.load(f)["project"]["dependencies"]:
21+
package = line.split("[")[0].split("=")[0].split(">")[0].split("<")[0].replace('"', '').replace("'",'').rstrip("~").strip()
2022
if package not in ("pyinstaller"):
2123
all_imports.append(package)
2224

build.py

-10
This file was deleted.

fastflix/encoders/common/encc_helpers.py

+42-1
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,52 @@
33

44
from fastflix.models.video import SubtitleTrack, AudioTrack
55
from fastflix.encoders.common.audio import lossless
6-
6+
from fastflix.models.fastflix import FastFlix
77

88
logger = logging.getLogger("fastflix")
99

1010

11+
def rigaya_avformat_reader(fastflix: FastFlix) -> str:
12+
# Avisynth reader avs
13+
# VapourSynth reader vpy
14+
# avi reader avi
15+
# y4m reader y4m
16+
# raw reader yuv
17+
# avhw/avsw reader others
18+
ending = fastflix.current_video.source.suffix
19+
if fastflix.current_video.video_settings.video_encoder_settings.decoder not in ("Hardware", "Software"):
20+
if ending.lower() in (".avs", ".vpy", ".avi", ".y4m", ".yuv"):
21+
return ""
22+
return "--avhw" if fastflix.current_video.video_settings.video_encoder_settings.decoder == "Hardware" else "--avsw"
23+
24+
25+
def rigaya_auto_options(fastflix: FastFlix) -> str:
26+
reader_format = rigaya_avformat_reader(fastflix)
27+
if not reader_format:
28+
output = ""
29+
if fastflix.current_video.video_settings.color_space:
30+
output += f"--colormatrix {fastflix.current_video.video_settings.color_space} "
31+
if fastflix.current_video.video_settings.color_transfer:
32+
output += f"--transfer {fastflix.current_video.video_settings.color_transfer} "
33+
if fastflix.current_video.video_settings.color_primaries:
34+
output += f"--colorprim {fastflix.current_video.video_settings.color_primaries} "
35+
return output
36+
37+
return " ".join(
38+
[
39+
reader_format,
40+
"--chromaloc auto",
41+
"--colorrange auto",
42+
"--colormatrix",
43+
(fastflix.current_video.video_settings.color_space or "auto"),
44+
"--transfer",
45+
(fastflix.current_video.video_settings.color_transfer or "auto"),
46+
"--colorprim",
47+
(fastflix.current_video.video_settings.color_primaries or "auto"),
48+
]
49+
)
50+
51+
1152
def get_stream_pos(streams) -> dict:
1253
return {x.index: i for i, x in enumerate(streams, start=1)}
1354

fastflix/encoders/hevc_x265/settings_panel.py

+90-2
Original file line numberDiff line numberDiff line change
@@ -402,21 +402,109 @@ def init_preset(self):
402402
"preset: The slower the preset, the better the compression and quality\n"
403403
"Slow is highest personal recommenced, as past that is much smaller gains"
404404
),
405-
connect="default",
405+
connect=self.preset_update,
406406
opt="preset",
407407
)
408408
return layout
409409

410+
def preset_update(self):
411+
def set_aq(num):
412+
if self.widgets.tune.currentIndex() == 0:
413+
self.widgets.aq_mode.setCurrentIndex(num)
414+
if self.widgets["tune"].currentText() == "animation":
415+
bframes = 5
416+
if self.widgets.preset.currentIndex() >= 2:
417+
bframes = 6
418+
if self.widgets.preset.currentIndex() >= 7:
419+
bframes = 10
420+
self.widgets.bframes.setCurrentIndex(bframes)
421+
422+
if self.widgets["preset"].currentText() == "ultrafast":
423+
self.widgets.bframes.setCurrentIndex(3)
424+
self.widgets.b_adapt.setCurrentIndex(0)
425+
set_aq(0)
426+
elif self.widgets["preset"].currentText() == "superfast":
427+
self.widgets.bframes.setCurrentIndex(3)
428+
self.widgets.b_adapt.setCurrentIndex(0)
429+
set_aq(0)
430+
elif self.widgets["preset"].currentText() == "veryfast":
431+
self.widgets.bframes.setCurrentIndex(4)
432+
self.widgets.b_adapt.setCurrentIndex(0)
433+
set_aq(2)
434+
elif self.widgets["preset"].currentText() == "faster":
435+
self.widgets.bframes.setCurrentIndex(4)
436+
self.widgets.b_adapt.setCurrentIndex(0)
437+
set_aq(2)
438+
elif self.widgets["preset"].currentText() == "fast":
439+
self.widgets.bframes.setCurrentIndex(4)
440+
self.widgets.b_adapt.setCurrentIndex(0)
441+
set_aq(2)
442+
elif self.widgets["preset"].currentText() == "medium":
443+
self.widgets.bframes.setCurrentIndex(4)
444+
self.widgets.b_adapt.setCurrentIndex(2)
445+
set_aq(2)
446+
elif self.widgets["preset"].currentText() == "slow":
447+
self.widgets.bframes.setCurrentIndex(4)
448+
self.widgets.b_adapt.setCurrentIndex(2)
449+
set_aq(2)
450+
elif self.widgets["preset"].currentText() == "slower":
451+
self.widgets.bframes.setCurrentIndex(8)
452+
self.widgets.b_adapt.setCurrentIndex(2)
453+
set_aq(2)
454+
elif self.widgets["preset"].currentText() == "veryslow":
455+
self.widgets.bframes.setCurrentIndex(8)
456+
self.widgets.b_adapt.setCurrentIndex(2)
457+
set_aq(2)
458+
elif self.widgets["preset"].currentText() == "placebo":
459+
self.widgets.bframes.setCurrentIndex(8)
460+
self.widgets.b_adapt.setCurrentIndex(2)
461+
set_aq(2)
462+
410463
def init_tune(self):
411464
return self._add_combo_box(
412465
label="Tune",
413466
widget_name="tune",
414467
options=["default", "psnr", "ssim", "grain", "zerolatency", "fastdecode", "animation"],
415468
tooltip="tune: Tune the settings for a particular type of source or situation",
416-
connect="default",
469+
connect=self.tune_update,
417470
opt="tune",
418471
)
419472

473+
def tune_update(self):
474+
self.widgets.aq_mode.setEnabled(True)
475+
self.widgets.bframes.setEnabled(True)
476+
self.widgets.b_adapt.setEnabled(True)
477+
self.widgets.frame_threads.setEnabled(True)
478+
self.widgets.aq_mode.setCurrentIndex(2)
479+
self.widgets.bframes.setCurrentIndex(4)
480+
self.widgets.b_adapt.setCurrentIndex(2)
481+
self.widgets.frame_threads.setCurrentIndex(0)
482+
483+
if self.widgets["tune"].currentText() == "grain":
484+
self.widgets.aq_mode.setCurrentIndex(0)
485+
self.widgets.aq_mode.setEnabled(False)
486+
self.widgets.bframes.setCurrentIndex(4)
487+
self.widgets.b_adapt.setCurrentIndex(2)
488+
elif self.widgets["tune"].currentText() == "psnr":
489+
self.widgets.aq_mode.setCurrentIndex(0)
490+
self.widgets.aq_mode.setEnabled(False)
491+
self.widgets.bframes.setCurrentIndex(4)
492+
self.widgets.b_adapt.setCurrentIndex(2)
493+
elif self.widgets["tune"].currentText() == "zerolatency":
494+
self.widgets.bframes.setCurrentIndex(0)
495+
self.widgets.b_adapt.setCurrentIndex(0)
496+
self.widgets.frame_treahds.setCurrentIndex(1)
497+
self.widgets.bframes.setEnabled(False)
498+
self.widgets.b_adapt.setEnabled(False)
499+
self.widgets.frame_threads.setEnabled(False)
500+
elif self.widgets["tune"].currentText() == "animation":
501+
bframes = 5
502+
if self.widgets.preset.currentIndex() >= 2:
503+
bframes = 6
504+
if self.widgets.preset.currentIndex() >= 7:
505+
bframes = 10
506+
self.widgets.bframes.setCurrentIndex(bframes)
507+
420508
def init_profile(self):
421509
return self._add_combo_box(
422510
label="Profile_encoderopt",

0 commit comments

Comments
 (0)