Skip to content

Commit 61519a3

Browse files
authored
Version 4.7.1 (#305)
* Fixing #304 New profile Audio conversion downmix and bitrate issues (thanks to wynterca)
1 parent f1830f4 commit 61519a3

File tree

6 files changed

+77
-10
lines changed

6 files changed

+77
-10
lines changed

CHANGES

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## Version 4.7.1
4+
5+
* Fixing #304 New profile Audio conversion downmix and bitrate issues (thanks to wynterca)
6+
37
## Version 4.7.0
48

59
* Adding #164 audio matching in profiles (thanks to bmcassagne)
@@ -10,6 +14,7 @@
1014
* Adding OpenCL support for Remove HDR to speed it up
1115
* Changing FFmpeg download to look for latest master GPL builds
1216
* Fixing #296 low quality auto-crop due to high rounding, increasing accuracy from 16 to 2 pixels (thanks to Rayman24365)
17+
* Fixing #302 unclear when VBV is enabled (thanks to Paul Huckstepp)
1318
* Fixing concat builder behavior to work smoother
1419
* Fixing thumbnail generation for concat images
1520

fastflix/data/languages.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6106,3 +6106,27 @@ Please load in a video to configure a new profile:
61066106
por: Por favor, carregue em um vídeo para configurar um novo perfil
61076107
swe: Ladda in en video för att konfigurera en ny profil
61086108
pol: Wczytaj film, jak skonfigurować nowy profil
6109+
10-bit:
6110+
eng: 10-bit
6111+
deu: 10-bit
6112+
fra: 10-bit
6113+
ita: 10-bit
6114+
spa: 10-bit
6115+
zho: 10位
6116+
jpn: 10ビット
6117+
rus: 10-бит
6118+
por: 10 bit
6119+
swe: 10-bit
6120+
pol: 10-bit
6121+
This encoder does not support duplicating audio tracks, please remove copied tracks!:
6122+
eng: This encoder does not support duplicating audio tracks, please remove copied tracks!
6123+
deu: Dieser Encoder unterstützt das Duplizieren von Audiospuren nicht, bitte entfernen Sie die kopierten Spuren!
6124+
fra: Cet encodeur ne prend pas en charge la duplication des pistes audio, veuillez supprimer les pistes copiées !
6125+
ita: Questo encoder non supporta la duplicazione di tracce audio, per favore rimuovi le tracce copiate!
6126+
spa: Este codificador no admite la duplicación de pistas de audio, por favor, elimine las pistas copiadas.
6127+
zho: 此编码器不支持复制音轨,请删除已复制的音轨!
6128+
jpn: このエンコーダーはオーディオトラックの複製をサポートしていません。コピーしたトラックを削除してください。
6129+
rus: Этот кодер не поддерживает дублирование звуковых дорожек, пожалуйста, удалите скопированные дорожки!
6130+
por: Este codificador não suporta a duplicação de faixas de áudio, por favor remova as faixas copiadas!
6131+
swe: Den här kodaren stöder inte duplicering av ljudspår, ta bort kopierade spår!
6132+
pol: Ten koder nie obsługuje duplikowania ścieżek audio, usuń skopiowane ścieżki!

fastflix/models/profiles.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
VCEEncCSettings,
2525
)
2626

27+
from fastflix.encoders.common.audio import channel_list
28+
2729
__all__ = ["MatchItem", "MatchType", "AudioMatch", "Profile", "SubtitleMatch", "AdvancedOptions"]
2830

2931

@@ -47,7 +49,7 @@ class AudioMatch(BaseModel):
4749
match_input: str = "*"
4850
conversion: Optional[str] = None
4951
bitrate: Optional[str] = None
50-
downmix: Optional[int] = None
52+
downmix: Optional[Union[str, int]] = None
5153

5254
@validator("match_type")
5355
def match_type_must_be_enum(cls, v):
@@ -61,6 +63,23 @@ def match_item_must_be_enum(cls, v):
6163
return MatchType(v[0])
6264
return MatchItem(v)
6365

66+
@validator("downmix")
67+
def downmix_as_string(cls, v):
68+
fixed = {1: "monoo", 2: "stereo", 3: "2.1", 4: "3.1", 5: "5.0", 6: "5.1", 7: "6.1", 8: "7.1"}
69+
if isinstance(v, str) and v.isnumeric():
70+
v = int(v)
71+
if isinstance(v, int):
72+
if v in fixed:
73+
return fixed[v]
74+
return None
75+
return v
76+
77+
@validator("bitrate")
78+
def bitrate_k_end(cls, v):
79+
if v and not v.endswith("k"):
80+
return f"{v}k"
81+
return v
82+
6483

6584
class SubtitleMatch(BaseModel):
6685
match_type: Union[MatchType, List[MatchType]]

fastflix/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
3-
__version__ = "4.7.0"
3+
__version__ = "4.7.1"
44
__author__ = "Chris Griffith"

fastflix/widgets/panels/audio_panel.py

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -437,11 +437,21 @@ def gen_track(
437437
all_info=audio_track,
438438
disable_dup=disable_dups,
439439
)
440+
440441
if conversion:
441442
new_track.widgets.convert_to.setCurrentText(conversion)
442-
new_track.widgets.convert_bitrate.setCurrentText(bitrate)
443-
if downmix and downmix < audio_track.channels:
444-
new_track.widgets.downmix.setCurrentIndex(downmix)
443+
# Downmix must come first
444+
if downmix:
445+
new_track.widgets.downmix.setCurrentText(downmix)
446+
if conversion in lossless:
447+
new_track.widgets.convert_bitrate.setDisabled(True)
448+
else:
449+
if bitrate not in [
450+
new_track.widgets.convert_bitrate.itemText(i)
451+
for i in range(new_track.widgets.convert_bitrate.count())
452+
]:
453+
new_track.widgets.convert_bitrate.addItem(bitrate)
454+
new_track.widgets.convert_bitrate.setCurrentText(bitrate)
445455
return new_track
446456

447457
# First populate all original tracks and disable them
@@ -574,7 +584,15 @@ def reload(self, original_tracks: List[AudioTrack], audio_formats):
574584

575585
new_track.widgets.downmix.setCurrentText(track.downmix)
576586
new_track.widgets.convert_to.setCurrentText(track.conversion_codec)
577-
new_track.widgets.convert_bitrate.setCurrentText(track.conversion_bitrate)
587+
if track.conversion_codec in lossless:
588+
new_track.widgets.convert_bitrate.setDisabled(True)
589+
else:
590+
if track.conversion_bitrate not in [
591+
new_track.widgets.convert_bitrate.itemText(i)
592+
for i in range(new_track.widgets.convert_bitrate.count())
593+
]:
594+
new_track.widgets.convert_bitrate.addItem(track.conversion_bitrate)
595+
new_track.widgets.convert_bitrate.setCurrentText(track.conversion_bitrate)
578596
new_track.widgets.title.setText(track.title)
579597
if track.language:
580598
new_track.widgets.language.setCurrentText(Lang(track.language).name)

fastflix/widgets/windows/profile_window.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
)
3030
from fastflix.models.profiles import AudioMatch, Profile, MatchItem, MatchType, AdvancedOptions
3131
from fastflix.shared import error_message
32+
from fastflix.encoders.common.audio import channel_list
3233

3334
language_list = sorted((k for k, v in Lang._data["name"].items() if v["pt2B"] and v["pt1"]), key=lambda x: x.lower())
3435

@@ -96,7 +97,7 @@ def __init__(self, parent_list, app, main, parent, index):
9697
self.grid.addWidget(self.kill_myself, 0, 5, 1, 5)
9798

9899
self.downmix = QtWidgets.QComboBox()
99-
self.downmix.addItems(["No Downmix"] + [str(x) for x in range(1, 16)])
100+
self.downmix.addItems([t("No Downmix")] + list(channel_list.keys()))
100101
self.downmix.setCurrentIndex(0)
101102
self.downmix.view().setFixedWidth(self.downmix.minimumSizeHint().width() + 50)
102103

@@ -106,7 +107,7 @@ def __init__(self, parent_list, app, main, parent, index):
106107
self.convert_to.view().setFixedWidth(self.convert_to.minimumSizeHint().width() + 50)
107108

108109
self.bitrate = QtWidgets.QComboBox()
109-
self.bitrate.addItems([str(x) for x in range(32, 1024, 32)])
110+
self.bitrate.addItems([f"{x}k" for x in range(32, 1024, 32)])
110111
self.bitrate.view().setFixedWidth(self.bitrate.minimumSizeHint().width() + 50)
111112

112113
self.bitrate.setDisabled(True)
@@ -166,7 +167,7 @@ def get_settings(self):
166167
match_input=match_input_value,
167168
conversion=self.convert_to.currentText() if self.convert_to.currentIndex() > 0 else None,
168169
bitrate=self.bitrate.currentText(),
169-
downmix=self.downmix.currentIndex(),
170+
downmix=self.downmix.currentText(),
170171
)
171172

172173

@@ -343,7 +344,7 @@ def __init__(self, app: FastFlixApp, main, *args, **kwargs):
343344
self.main = main
344345
self.config_file = self.app.fastflix.config.config_path
345346
self.setWindowTitle(t("New Profile"))
346-
self.setMinimumSize(500, 450)
347+
self.setMinimumSize(500, 600)
347348
layout = QtWidgets.QGridLayout()
348349

349350
profile_name_label = QtWidgets.QLabel(t("Profile Name"))

0 commit comments

Comments
 (0)