Skip to content

Commit

Permalink
Version 5.4.0 (#458)
Browse files Browse the repository at this point in the history
* Adding #389 unlock GPU encoders by checking for supported codec (thanks to F.O.R.A.R.T.)
* Adding #430 Minimise to tray (thanks to ProFire)
* Adding #452 way to unselect all audio in a profile (thanks to HannesJo0139)
* Changing rigaya encoders end time would use --trim instead of --seekto
* Changing #450 -vsync to -fps_mode as -vsync is deprecated (thanks to GT500org)
* Fixing #441 outdated SVT-AV1 Encoding Guide link (thanks to Yuzbashi)
* Fixing #455 source FPS was not applied to rigaya encoders (thanks to F.O.R.A.R.T.)
* Removing Windows toast notification due to prone to errors and incompatibility with tray minimize
  • Loading branch information
cdgriffith authored Apr 17, 2023
1 parent 0e8e2ea commit ad86c4b
Show file tree
Hide file tree
Showing 48 changed files with 1,414 additions and 378 deletions.
16 changes: 10 additions & 6 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
---
name: Bug report
about: Create a report to help us improve
about: Create a report to help us improve FastFlix
title: ''
labels: bug
assignees: ''

---

**FastFlix Version:**

**Operating System:**

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
Steps to reproduce the behavior

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Logs** (If applicable) In FastFlix you can go to Help > Open Log Directory and sort by latest to find the newest log file to add here.

Please make sure to remove any personal information or video names in the screenshots and logs!
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Lint and Tests
name: Lint

on:
push:
Expand Down
11 changes: 11 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## Version 5.4.0

* Adding #389 unlock GPU encoders by checking for supported codec (thanks to F.O.R.A.R.T.)
* Adding #430 Minimise to tray (thanks to ProFire)
* Adding #452 way to unselect all audio in a profile (thanks to HannesJo0139)
* Changing rigaya encoders end time would use --trim instead of --seekto
* Changing #450 -vsync to -fps_mode as -vsync is deprecated (thanks to GT500org)
* Fixing #441 outdated SVT-AV1 Encoding Guide link (thanks to Yuzbashi)
* Fixing #455 source FPS was not applied to rigaya encoders (thanks to F.O.R.A.R.T.)
* Removing Windows toast notification due to prone to errors and incompatibility with tray minimize

## Version 5.3.0

* Adding profile select in Load Directory window
Expand Down
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,13 @@

![preview](./docs/gui_preview.png)

FastFlix is a simple and friendly GUI for encoding videos.
FastFlix is a handy GUI for encoding videos.

[Download latest release from Github](https://github.com/cdgriffith/FastFlix/releases/latest)

FastFlix keeps HDR10 metadata for x265, NVEncC HEVC, and VCEEncC HEVC, which will also be expanded to AV1 libraries when available.

It needs `FFmpeg` (version 4.3 or greater required, 5.0+ recommended) under the hood for the heavy lifting, and can work with a variety of encoders.

Join us on [discord](https://discord.gg/GUBFP6f)!

Check out [the FastFlix github wiki](https://github.com/cdgriffith/FastFlix/wiki) for help or more details, and please report bugs or ideas in the [github issue tracker](https://github.com/cdgriffith/FastFlix/issues)!
Check out [the FastFlix github wiki](https://github.com/cdgriffith/FastFlix/wiki) for help or more details, and please report bugs in the [github issue tracker](https://github.com/cdgriffith/FastFlix/issues)!

# Encoders

Expand Down Expand Up @@ -136,7 +132,7 @@ FastFlix is machine translated using DeepL into Spanish (español), French (Fran
Italian (Italiano), Chinese (中文), Japanese (日本語), Portuguese (Português), Swedish (svenska), Ukrainian (Українська),
Russian (русский), Polish (polskie) and Korean (한국어).

If something sounds wrong in your language, please open an issue or ping me on the [discord](https://discord.gg/GUBFP6f) channel with which line in
If something sounds wrong in your language, please open an issue with which line in
[the language file](https://github.com/cdgriffith/FastFlix/blob/master/fastflix/data/languages.yaml) needs fixed!

Special thanks to [leonardyan](https://github.com/leonardyan) for numerous Chinese corrections!
Expand Down
80 changes: 52 additions & 28 deletions fastflix/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@
from fastflix.models.fastflix import FastFlix
from fastflix.models.fastflix_app import FastFlixApp
from fastflix.program_downloads import ask_for_ffmpeg, latest_ffmpeg
from fastflix.resources import main_icon, breeze_styles_path, get_bool_env
from fastflix.shared import file_date, message, latest_fastflix
from fastflix.version import __version__
from fastflix.resources import main_icon, breeze_styles_path
from fastflix.shared import file_date, message, latest_fastflix, DEVMODE
from fastflix.widgets.container import Container
from fastflix.widgets.progress_bar import ProgressBar, Task

Expand Down Expand Up @@ -96,22 +95,41 @@ def init_encoders(app: FastFlixApp, **_):
copy_plugin,
]

if app.fastflix.config.qsvencc:
if DEVMODE:
encoders.insert(1, qsvencc_plugin)
encoders.insert(encoders.index(av1_plugin), qsvencc_av1_plugin)
encoders.insert(encoders.index(avc_plugin), qsvencc_avc_plugin)

if app.fastflix.config.nvencc:
encoders.insert(1, nvencc_plugin)
encoders.insert(encoders.index(av1_plugin), nvencc_av1_plugin)
encoders.insert(encoders.index(avc_plugin), nvencc_avc_plugin)

if app.fastflix.config.vceencc:
if reusables.win_based:
# HEVC AMF support only works on windows currently
encoders.insert(1, vceencc_hevc_plugin)
encoders.insert(1, vceencc_hevc_plugin)
encoders.insert(encoders.index(av1_plugin), vceencc_av1_plugin)
encoders.insert(encoders.index(avc_plugin), vceencc_avc_plugin)
else:
if app.fastflix.config.qsvencc:
if "H.265/HEVC" in app.fastflix.config.qsvencc_encoders:
encoders.insert(1, qsvencc_plugin)
if "AV1" in app.fastflix.config.qsvencc_encoders:
encoders.insert(encoders.index(av1_plugin), qsvencc_av1_plugin)
if "H.264/AVC" in app.fastflix.config.qsvencc_encoders:
encoders.insert(encoders.index(avc_plugin), qsvencc_avc_plugin)

if app.fastflix.config.nvencc:
if "H.265/HEVC" in app.fastflix.config.nvencc_encoders:
encoders.insert(1, nvencc_plugin)
if "AV1" in app.fastflix.config.nvencc_encoders:
encoders.insert(encoders.index(av1_plugin), nvencc_av1_plugin)
if "H.264/AVC" in app.fastflix.config.nvencc_encoders:
encoders.insert(encoders.index(avc_plugin), nvencc_avc_plugin)

if app.fastflix.config.vceencc:
if reusables.win_based and "H.265/HEVC" in app.fastflix.config.vceencc_encoders:
# HEVC AMF support only works on windows currently
encoders.insert(1, vceencc_hevc_plugin)
if "AV1" in app.fastflix.config.vceencc_encoders:
encoders.insert(encoders.index(av1_plugin), vceencc_av1_plugin)
if "H.264/AVC" in app.fastflix.config.vceencc_encoders:
encoders.insert(encoders.index(avc_plugin), vceencc_avc_plugin)

app.fastflix.encoders = {
encoder.name: encoder
Expand All @@ -125,22 +143,15 @@ def init_fastflix_directories(app: FastFlixApp):
app.fastflix.log_path.mkdir(parents=True, exist_ok=True)


def register_app():
"""
On Windows you have to set the AppUser Model ID or else the
taskbar icon will not appear as expected.
"""
if reusables.win_based:
try:
import ctypes

app_id = f"cdgriffith.fastflix.{__version__}".encode("utf-8")
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(app_id)
except Exception:
logger.exception("Could not set application ID for Windows, please raise issue in github with above error")


def start_app(worker_queue, status_queue, log_queue, queue_list, queue_lock, portable_mode=False, enable_scaling=True):
def app_setup(
enable_scaling: bool = True,
portable_mode: bool = False,
queue_list: list = None,
queue_lock=None,
status_queue=None,
log_queue=None,
worker_queue=None,
):
app = create_app(enable_scaling=enable_scaling)
app.fastflix = FastFlix(queue=queue_list, queue_lock=queue_lock)
app.fastflix.log_queue = log_queue
Expand All @@ -150,7 +161,6 @@ def start_app(worker_queue, status_queue, log_queue, queue_list, queue_lock, por
app.fastflix.config = Config()
init_fastflix_directories(app)
init_logging(app)
register_app()
upgraded = app.fastflix.config.upgrade_check()
if upgraded:
# No translation will be possible in this case
Expand Down Expand Up @@ -218,6 +228,20 @@ def start_app(worker_queue, status_queue, log_queue, queue_list, queue_lock, por
if not app.fastflix.config.disable_version_check:
latest_fastflix(app=app, show_new_dialog=False)

return app


def start_app(worker_queue, status_queue, log_queue, queue_list, queue_lock, portable_mode=False, enable_scaling=True):
app = app_setup(
enable_scaling=enable_scaling,
portable_mode=portable_mode,
queue_list=queue_list,
queue_lock=queue_lock,
status_queue=status_queue,
log_queue=log_queue,
worker_queue=worker_queue,
)

try:
app.exec_()
except Exception:
Expand Down
4 changes: 3 additions & 1 deletion fastflix/audio_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@


def apply_audio_filters(
audio_filters: list[AudioMatch] | None,
audio_filters: list[AudioMatch] | bool | None,
original_tracks: list[Box],
):
"""
The goal of this function is to take a set of audio_filters and figure out which tracks
apply and what conversions to set.
"""
if not audio_filters:
return []

original_tracks = deepcopy(original_tracks)

Expand Down
56 changes: 56 additions & 0 deletions fastflix/data/languages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8479,3 +8479,59 @@ Loading Videos:
pol: Ładowanie filmów
ukr: Завантаження відео
kor: 동영상 로드 중
Open FastFlix:
eng: Open FastFlix
deu: FastFlix öffnen
fra: Ouvrir FastFlix
ita: Aprire FastFlix
spa: Abrir FastFlix
zho: 打开FastFlix
jpn: FastFlixを開く
rus: Открыть FastFlix
por: Abrir FastFlix
swe: Öppna FastFlix
pol: Otwórz FastFlix
ukr: Відкрийте FastFlix
kor: FastFlix 열기
Minimize to Tray:
eng: Minimize to Tray
deu: In Ablage minimieren
fra: Réduire au plateau
ita: Riduci a icona nel vassoio
spa: Minimizar a bandeja
zho: 最小化到托盘
jpn: トレイに最小化する
rus: Свернуть в лоток
por: Minimizar para bandeja
swe: Minimera till facket
pol: Minimalizuj do tacki
ukr: Мінімізувати до лотка
kor: 트레이로 최소화
Device:
eng: Device
deu: Gerät
fra: Dispositif
ita: Dispositivo
spa: Dispositivo
zho: 器材
jpn: デバイス
rus: Устройство
por: Dispositivo
swe: Enhet
pol: Urządzenie
ukr: Пристрій
kor: 장치
Don't Select Any Audio:
eng: Don't Select Any Audio
deu: Wählen Sie kein Audio aus
fra: Ne pas sélectionner d'audio
ita: Non selezionare alcun audio
spa: No seleccione ningún audio
zho: 不要选择任何音频
jpn: 任意のオーディオを選択しない
rus: Не выбирайте аудио
por: Não seleccione nenhum áudio
swe: Välj inte något ljud
pol: Nie wybieraj żadnego dźwięku
ukr: Не вибирайте жодного аудіо
kor: 오디오 선택 안 함
13 changes: 12 additions & 1 deletion fastflix/encoders/common/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def generate_ffmpeg_start(
ffmpeg,
encoder,
selected_track,
ffmpeg_version,
start_time=0,
end_time=None,
pix_fmt="yuv420p10le",
Expand All @@ -52,7 +53,16 @@ def generate_ffmpeg_start(
time_one = time_settings if fast_seek else ""
time_two = time_settings if not fast_seek else ""
incoming_fps = f"-r {source_fps}" if source_fps else ""
vsync_text = f"-vsync {vsync}" if vsync else ""

vsync_type = "vsync"
try:
if ffmpeg_version.startswith("n") and int(ffmpeg_version[1:].split(".")[0]) >= 5:
vsync_type = "fps_mode"
except Exception:
pass

vsync_text = f"-{vsync_type} {vsync}" if vsync else ""

if video_title:
video_title.replace('"', '\\"')
title = f'-metadata title="{video_title}"' if video_title else ""
Expand Down Expand Up @@ -260,6 +270,7 @@ def generate_all(
filters=filters,
concat=fastflix.current_video.concat,
enable_opencl=fastflix.opencl_support,
ffmpeg_version=fastflix.ffmpeg_version,
**fastflix.current_video.video_settings.dict(),
**settings.dict(),
)
Expand Down
4 changes: 4 additions & 0 deletions fastflix/encoders/common/setting_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ def _add_text_box(
tooltip="",
validator=None,
width=None,
placeholder=None,
):
layout = QtWidgets.QHBoxLayout()
self.labels[widget_name] = QtWidgets.QLabel(t(label))
Expand All @@ -142,6 +143,9 @@ def _add_text_box(

self.widgets[widget_name] = QtWidgets.QLineEdit()

if placeholder:
self.widgets[widget_name].setPlaceholderText(placeholder)

if opt:
default = str(self.app.fastflix.config.encoder_opt(self.profile_name, opt)) or default
self.opts[widget_name] = opt
Expand Down
3 changes: 3 additions & 0 deletions fastflix/encoders/hevc_x265/command_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ def build(fastflix: FastFlix):
if settings.profile and settings.profile != "default":
beginning += f"-profile:v {settings.profile} "

# if settings.gop_size:
# beginning += f"-g {settings.gop_size}"

x265_params = settings.x265_params.copy() or []

x265_params.append(f"aq-mode={settings.aq_mode}")
Expand Down
15 changes: 15 additions & 0 deletions fastflix/encoders/hevc_x265/settings_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@
"12-bit 444: yuv444p12le",
]

# fmt: off
gop_sizes = [t("Auto"), "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17",
"18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34",
"35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51",
"52", "53", "54", "55", "56", "57", "58", "59", "60", "70", "80", "90", "100", "110", "120", "140", "160",
"180", "200", "220", "240", "260", "280", "300", "400", "500", "600", "700", "800", "900", "1000"]
# fmt: on


def get_breaker():
breaker_line = QtWidgets.QWidget()
Expand Down Expand Up @@ -105,6 +113,7 @@ def __init__(self, parent, main, app: FastFlixApp):
grid.addLayout(self.init_aq_mode(), 6, 0, 1, 2)
grid.addLayout(self.init_frame_threads(), 7, 0, 1, 2)
grid.addLayout(self.init_max_mux(), 8, 0, 1, 2)
# grid.addLayout(self.init_gop(), 9, 0, 1, 2)
grid.addLayout(self.init_x265_row(), 6, 2, 1, 4)
grid.addLayout(self.init_x265_row_two(), 7, 2, 1, 4)
# grid.addLayout(self.init_hdr10_opt(), 5, 2, 1, 1)
Expand Down Expand Up @@ -459,6 +468,11 @@ def init_max_mux(self):
opt="max_muxing_queue_size",
)

def init_gop(self):
return self._add_combo_box(
label="Gop Size", tooltip="GOP Size", widget_name="gop_size", opt="gop_size", options=gop_sizes
)

def init_modes(self):
return self._add_modes(recommended_bitrates, recommended_crfs, qp_name="crf")

Expand Down Expand Up @@ -594,6 +608,7 @@ def update_video_encoder_settings(self):
lossless=self.widgets.lossless.isChecked(),
extra=self.ffmpeg_extras,
extra_both_passes=self.widgets.extra_both_passes.isChecked(),
# gop_size=int(self.widgets.gop_size.currentText()) if self.widgets.gop_size.currentIndex() > 0 else 0,
)

encode_type, q_value = self.get_mode_settings()
Expand Down
Loading

0 comments on commit ad86c4b

Please sign in to comment.