Skip to content

Commit 6fd37f2

Browse files
committed
* Adding #633 download for stable version of ffmpeg by default on Windows (thanks to Maddie Davis)
1 parent a67784c commit 6fd37f2

File tree

7 files changed

+102
-32
lines changed

7 files changed

+102
-32
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,3 +123,4 @@ icons.py
123123
test.html
124124
iso-639-3.*
125125
build-dir/
126+
benchmarking/

CHANGES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* Adding QP mode for FFmpeg Nvenc encoding
66
* Adding more preview positions
77
* Adding ultra high quality mode for ffmpeg nvenc encoder
8+
* Adding #633 download for stable version of ffmpeg by default on Windows (thanks to Maddie Davis)
89
* Fixing #611 Extension type not being selected properly from profiles if encoders isn't switched (thanks to Hankuu)
910
* Fixing #628 Custom QP/CRF saved in profile may not be restored correctly (thanks to Gregorio O. DeMojeca)
1011
* Fixing #631 VVC Level can't be set to 0 anymore (thanks to GT500org)

fastflix/data/languages.yaml

Lines changed: 60 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1677,21 +1677,6 @@ Download Cancelled:
16771677
ukr: Завантажити Скасовано
16781678
kor: 다운로드 취소
16791679
ron: Descărcați Anulat
1680-
Download Newest FFmpeg:
1681-
deu: Neuestes FFmpeg herunterladen
1682-
eng: Download Newest FFmpeg
1683-
fra: Télécharger le dernier FFmpeg
1684-
ita: Scarica il nuovo FFmpeg
1685-
spa: Descargar el nuevo FFmpeg
1686-
chs: 下载最新版FFmpeg
1687-
jpn: 最新のFFmpegをダウンロードする
1688-
rus: Скачать новейший FFmpeg
1689-
por: Fazer o download do FFmpeg mais recente
1690-
swe: Hämta Nyaste FFmpeg
1691-
pol: Pobierz Najnowszy FFmpeg
1692-
ukr: Завантажити останню версію FFmpeg
1693-
kor: 최신 FFmpeg 다운로드
1694-
ron: Descărcați cel mai nou FFmpeg
16951680
Downloading FFmpeg:
16961681
deu: Herunterladen von FFmpeg
16971682
eng: Downloading FFmpeg
@@ -7442,7 +7427,8 @@ Drag and Drop to reorder - All items need to be same dimensions:
74427427
eng: Drag and Drop to reorder - All items need to be same dimensions
74437428
fra: Glissez et déposez pour réorganiser - Tous les éléments doivent avoir les mêmes
74447429
dimensions.
7445-
ita: Per riordinare trascina e rilascia - tutti gli elementi devono avere le stesse dimensioni
7430+
ita: Per riordinare trascina e rilascia - tutti gli elementi devono avere le stesse
7431+
dimensioni
74467432
spa: Arrastrar y soltar para reordenar - Todos los elementos deben tener las mismas
74477433
dimensiones
74487434
chs: 拖放来重新排序 - 所有项目的尺寸都需要相同
@@ -8824,8 +8810,8 @@ Remove GUI logs and compress conversion logs older than 30 days at exit:
88248810
die älter als 30 Tage sind, beim Beenden
88258811
fra: Suppression des journaux de l'interface graphique et compression des journaux
88268812
de conversion de plus de 30 jours à la sortie.
8827-
ita: Rimuovi registri eventi GUI e comprimeri registri eventi conversione
8828-
più vecchi di 30 giorni all'uscita.
8813+
ita: Rimuovi registri eventi GUI e comprimeri registri eventi conversione più vecchi
8814+
di 30 giorni all'uscita.
88298815
spa: Elimina los registros GUI y comprime los registros de conversión de más de
88308816
30 días al salir.
88318817
chs: 在退出时删除GUI日志并压缩超过30天的转换日志
@@ -10685,3 +10671,59 @@ Pattern Match:
1068510671
ukr: Збіг за зразком
1068610672
kor: 패턴 일치
1068710673
ron: Potrivire model
10674+
Download Stable FFmpeg:
10675+
eng: Download Stable FFmpeg
10676+
deu: Stable FFmpeg herunterladen
10677+
fra: Télécharger Stable FFmpeg
10678+
ita: Scarica FFmpeg stabile
10679+
spa: Descargar FFmpeg estable
10680+
jpn: 安定したFFmpegをダウンロード
10681+
rus: Скачать стабильный FFmpeg
10682+
por: Descarregar o Stable FFmpeg
10683+
swe: Ladda ner stabil FFmpeg
10684+
pol: Pobierz Stable FFmpeg
10685+
chs: 下载稳定版 FFmpeg
10686+
ukr: Завантажити стабільний FFmpeg
10687+
kor: 안정적인 FFmpeg 다운로드
10688+
ron: Descarcă Stable FFmpeg
10689+
Download Nightly FFmpeg:
10690+
eng: Download Nightly FFmpeg
10691+
deu: Neuestes FFmpeg herunterladen
10692+
fra: Télécharger le dernier FFmpeg
10693+
ita: Scarica il nuovo FFmpeg
10694+
spa: Descargar el nuevo FFmpeg
10695+
chs: 下载最新版FFmpeg
10696+
jpn: 最新のFFmpegをダウンロードする
10697+
rus: Скачать новейший FFmpeg
10698+
por: Fazer o download do FFmpeg mais recente
10699+
swe: Hämta Nyaste FFmpeg
10700+
pol: Pobierz Najnowszy FFmpeg
10701+
ukr: Завантажити останню версію FFmpeg
10702+
kor: 최신 FFmpeg 다운로드
10703+
ron: Descărcați cel mai nou FFmpeg
10704+
hq - High Quality, uhq - Ultra High Quality, ll - Low Latency, ull - Ultra Low Latency:
10705+
eng: hq - High Quality, uhq - Ultra High Quality, ll - Low Latency, ull - Ultra
10706+
Low Latency
10707+
deu: hq - Hohe Qualität, uhq - Ultrahohe Qualität, ll - Niedrige Latenzzeit, ull
10708+
- Ultra-niedrige Latenzzeit
10709+
fra: hq - Haute qualité, uhq - Ultra haute qualité, ll - Faible latence, ull - Ultra
10710+
faible latence
10711+
ita: hq - Alta qualità, uhq - Ultra alta qualità, ll - Bassa latenza, ull - Ultra
10712+
bassa latenza
10713+
spa: hq - Alta calidad, uhq - Calidad ultra alta, ll - Baja latencia, ull - Latencia
10714+
ultra baja
10715+
jpn: hq - 高画質、uhq - 超高画質、ll - 低遅延、ull - 超低遅延
10716+
rus: hq - высокое качество, uhq - сверхвысокое качество, ll - низкая задержка, ull
10717+
- сверхнизкая задержка
10718+
por: hq - Alta Qualidade, uhq - Ultra Alta Qualidade, ll - Baixa Latência, ull -
10719+
Ultra Baixa Latência
10720+
swe: hq - Hög kvalitet, uhq - Ultrahög kvalitet, ll - Låg latens, ull - Ultra låg
10721+
latens
10722+
pol: hq - wysoka jakość, uhq - bardzo wysoka jakość, ll - niskie opóźnienie, ull
10723+
- bardzo niskie opóźnienie
10724+
chs: hq - 高质量,uhq - 超高质量,ll - 低延迟,ull - 超低延迟
10725+
ukr: hq - висока якість, uhq - надвисока якість, ll - низька затримка, ull - наднизька
10726+
затримка
10727+
kor: hq - 고품질, uhq - 초고화질, ll - 저지연, ull - 초저지연
10728+
ron: hq - calitate înaltă, uhq - calitate ultra înaltă, ll - latență redusă, ull
10729+
- latență ultra redusă

fastflix/encoders/ffmpeg_hevc_nvenc/settings_panel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def init_tune(self):
134134
return self._add_combo_box(
135135
label="Tune",
136136
widget_name="tune",
137-
tooltip="Tune the settings for a particular type of source or situation\nhq - High Quality, uqh - Ultra High Quality, ll - Low Latency, ull - Ultra Low Latency",
137+
tooltip="Tune the settings for a particular type of source or situation\nhq - High Quality, uhq - Ultra High Quality, ll - Low Latency, ull - Ultra Low Latency",
138138
options=["hq", "uhq", "ll", "ull", "lossless"],
139139
opt="tune",
140140
)

fastflix/encoders/vvc/settings_panel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def init_levels(self):
121121
tooltip="Set the IDC level",
122122
widget_name="levelidc",
123123
options=[
124-
t("auto"),
124+
t("Auto"),
125125
"1",
126126
"2",
127127
"2.1",

fastflix/program_downloads.py

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import shutil
66
import sys
77
from pathlib import Path
8+
import re
89

910
import requests
1011
import reusables
@@ -43,8 +44,16 @@ def ask_for_ffmpeg():
4344
sys.exit(1)
4445

4546

46-
def latest_ffmpeg(signal, stop_signal, **_):
47+
ffmpeg_version_re = re.compile(r"ffmpeg-n(\d+\.\d+)-latest-win64-gpl-")
48+
49+
50+
def grab_stable_ffmpeg(signal, stop_signal, **_):
51+
return latest_ffmpeg(signal, stop_signal, ffmpeg_version="stable")
52+
53+
54+
def latest_ffmpeg(signal, stop_signal, ffmpeg_version="latest", **_):
4755
stop = False
56+
logger.debug(f"Downloading {ffmpeg_version} FFmpeg")
4857

4958
def stop_me():
5059
nonlocal stop
@@ -76,13 +85,18 @@ def stop_me():
7685
return
7786

7887
gpl_ffmpeg = None
79-
for asset in data["assets"]:
80-
if "master-latest-win64-gpl.zip" in asset["name"]:
81-
gpl_ffmpeg = asset
82-
break
83-
elif asset["name"].startswith("ffmpeg-N-") and asset["name"].endswith("win64-gpl.zip"):
84-
gpl_ffmpeg = asset
85-
break
88+
89+
if ffmpeg_version == "latest":
90+
for asset in data["assets"]:
91+
if "master-latest-win64-gpl.zip" in asset["name"]:
92+
gpl_ffmpeg = asset
93+
break
94+
else:
95+
versions = []
96+
for asset in data["assets"]:
97+
if ver_match := ffmpeg_version_re.search(asset["name"]):
98+
versions.append((float(ver_match.group(1)), asset))
99+
gpl_ffmpeg = sorted(versions, key=lambda x: x[0], reverse=True)[0][1]
86100

87101
if not gpl_ffmpeg:
88102
shutil.rmtree(extract_folder, ignore_errors=True)
@@ -93,6 +107,8 @@ def stop_me():
93107
)
94108
raise Exception()
95109

110+
logger.debug(f"Downloading version {gpl_ffmpeg['name']}")
111+
96112
req = requests.get(gpl_ffmpeg["browser_download_url"], stream=True)
97113

98114
filename = ffmpeg_folder / "ffmpeg-full.zip"

fastflix/widgets/container.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from fastflix.language import t
1717
from fastflix.models.config import setting_types, get_preset_defaults
1818
from fastflix.models.fastflix_app import FastFlixApp
19-
from fastflix.program_downloads import latest_ffmpeg
19+
from fastflix.program_downloads import latest_ffmpeg, grab_stable_ffmpeg
2020
from fastflix.resources import main_icon, get_icon, changes_file, local_changes_file, local_package_changes_file
2121
from fastflix.shared import clean_logs, error_message, latest_fastflix, message, yes_no_message
2222
from fastflix.widgets.about import About
@@ -244,7 +244,10 @@ def init_menu(self):
244244
)
245245
version_action.triggered.connect(lambda: latest_fastflix(show_new_dialog=True, app=self.app))
246246

247-
ffmpeg_update_action = QAction(self.si(QtWidgets.QStyle.SP_ArrowDown), t("Download Newest FFmpeg"), self)
247+
ffmpeg_update_stable_action = QAction(self.si(QtWidgets.QStyle.SP_ArrowDown), t("Download Stable FFmpeg"), self)
248+
ffmpeg_update_stable_action.triggered.connect(self.download_stable_ffmpeg)
249+
250+
ffmpeg_update_action = QAction(self.si(QtWidgets.QStyle.SP_ArrowDown), t("Download Nightly FFmpeg"), self)
248251
ffmpeg_update_action.triggered.connect(self.download_ffmpeg)
249252

250253
clean_logs_action = QAction(self.si(QtWidgets.QStyle.SP_DialogResetButton), t("Clean Old Logs"), self)
@@ -263,6 +266,7 @@ def init_menu(self):
263266
help_menu.addSeparator()
264267
help_menu.addAction(version_action)
265268
if reusables.win_based:
269+
help_menu.addAction(ffmpeg_update_stable_action)
266270
help_menu.addAction(ffmpeg_update_action)
267271
help_menu.addSeparator()
268272
help_menu.addAction(about_action)
@@ -331,13 +335,19 @@ def open_issues(self):
331335
def show_log_dir(self):
332336
OpenFolder(self, str(self.app.fastflix.log_path)).run()
333337

334-
def download_ffmpeg(self):
338+
def download_stable_ffmpeg(self):
339+
self.download_ffmpeg(ffmpeg_version="stable")
340+
341+
def download_ffmpeg(self, ffmpeg_version="latest"):
335342
ffmpeg_folder = Path(user_data_dir("FFmpeg", appauthor=False, roaming=True)) / "bin"
336343
ffmpeg = ffmpeg_folder / "ffmpeg.exe"
337344
ffprobe = ffmpeg_folder / "ffprobe.exe"
338345
try:
339346
self.pb = ProgressBar(
340-
self.app, [Task(t("Downloading FFmpeg"), latest_ffmpeg)], signal_task=True, can_cancel=True
347+
self.app,
348+
[Task(t("Downloading FFmpeg"), grab_stable_ffmpeg if ffmpeg_version == "stable" else latest_ffmpeg)],
349+
signal_task=True,
350+
can_cancel=True,
341351
)
342352
except FastFlixInternalException:
343353
pass

0 commit comments

Comments
 (0)