Skip to content

Commit

Permalink
Version 5.7.0 (#551)
Browse files Browse the repository at this point in the history
* Adding new audio encoding panel
* Adding support for audio quality targeting instead of bitrate
* Fixing that audio and subtitles would be reset on change of encoder
* Fixing #543 systems with more than one opencl device would break thumbnails and some encodings (thanks to swadomlic)
* Fixing #505 (maybe) trying new methods to clean file paths for subtitles (thanks to Maddie Davis)
  • Loading branch information
cdgriffith authored Jun 16, 2024
1 parent 8523fcf commit 07fc0c7
Show file tree
Hide file tree
Showing 52 changed files with 1,007 additions and 559 deletions.
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ assignees: ''

---

<!-- DO NOT POST COPYRIGHTED SCREENSHOTS -->
<!-- DO NOT TALK ABOUT COPYRIGHTED CONTENT -->
<!-- DO NOT POST LOGS WITH COPYRIGHTED CONTENT -->

<!-- FastFlix is not intended to be used with copyrighted content -->

<!-- Any discussion or information posted with illegal information will result in the issue being reported and removed -->

**FastFlix Version:**

**Operating System:**
Expand Down
9 changes: 9 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ assignees: ''

---

<!-- DO NOT POST COPYRIGHTED SCREENSHOTS -->
<!-- DO NOT TALK ABOUT COPYRIGHTED CONTENT -->
<!-- DO NOT POST LOGS WITH COPYRIGHTED CONTENT -->

<!-- FastFlix is not intended to be used with copyrighted content -->

<!-- Any discussion or information posted with illegal information will result in the issue being reported and removed -->


Please use Discussions for new Features! They can be voted upon, and that way I can work in the most demanded features first.

Don't forget to first search for the feature you want, as well as upvote others you would like to see!
4 changes: 2 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

- uses: actions/setup-python@v4
with:
python-version: "3.11"
python-version: "3.12"

- name: Gather build version (*nix)
run: |
Expand Down Expand Up @@ -74,7 +74,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.11"
python-version: "3.12"

- name: Gather build version
shell: powershell
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
python-version: '3.12'

- name: Install Dependencies
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

- uses: actions/setup-python@v3
with:
python-version: "3.11"
python-version: "3.12"

- run: pip install black==23.7.0
- run: python -m black --check .
Expand All @@ -29,7 +29,7 @@ jobs:

- uses: actions/setup-python@v3
with:
python-version: "3.11"
python-version: "3.12"

- name: Install PySide6 requirements
run: |
Expand Down
8 changes: 8 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## Version 5.7.0

* Adding new audio encoding panel
* Adding support for audio quality targeting instead of bitrate
* Fixing that audio and subtitles would be reset on change of encoder
* Fixing #543 systems with more than one opencl device would break thumbnails and some encodings (thanks to swadomlic)
* Fixing #505 (maybe) trying new methods to clean file paths for subtitles (thanks to Maddie Davis)

## Version 5.6.0

* Adding Passes option for bitrate mode in x265 and x264 (thanks to Chriss)
Expand Down
2 changes: 1 addition & 1 deletion FastFlix.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ InstallDirRegKey HKLM "Software\FastFlix" "Install_Dir"
Function .onInit
ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\FastFlix" "UninstallString"
${If} $0 != ""
Messagebox MB_OK|MB_ICONINFORMATION "You will now be prompted to first uninstall the previous version of FastFlix"
Messagebox MB_OK|MB_ICONINFORMATION "You will now be prompted to first uninstall the previous version of FastFlix. Please ensure it is not currently running!"
ExecWait '$0 _?=$INSTDIR'
${EndIf}
FunctionEnd
Expand Down
5 changes: 5 additions & 0 deletions FastFlix_Nix_OneFile.spec
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ with open("pyproject.toml") as f:
if package not in ("pyinstaller"):
all_imports.append(package)

all_imports.remove("iso639-lang")
all_imports.remove("python-box")
all_imports.append("box")
all_imports.append("iso639")

a = Analysis(['fastflix/__main__.py'],
binaries=[],
datas=[('iso-639-3.tab', 'iso639'), ('iso-639-3.json', 'iso639'), ('CHANGES', 'fastflix/.'), ('docs/build-licenses.txt', 'docs')] + all_fastflix_files,
Expand Down
5 changes: 5 additions & 0 deletions FastFlix_Windows_Installer.spec
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ with open("pyproject.toml") as f:
if package not in ("pyinstaller"):
all_imports.append(package)

all_imports.remove("iso639-lang")
all_imports.remove("python-box")
all_imports.append("box")
all_imports.append("iso639")

a = Analysis(['fastflix\\__main__.py'],
binaries=[],
datas=[('iso-639-3.tab', 'iso639'), ('iso-639-3.json', 'iso639'), ('CHANGES', 'fastflix\\.'), ('docs\\build-licenses.txt', 'docs')] + all_fastflix_files,
Expand Down
5 changes: 5 additions & 0 deletions FastFlix_Windows_OneFile.spec
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ with open("pyproject.toml") as f:
if package not in ("pyinstaller"):
all_imports.append(package)

all_imports.remove("iso639-lang")
all_imports.remove("python-box")
all_imports.append("box")
all_imports.append("iso639")

portable_file = "fastflix\\portable.py"
with open(portable_file, "w") as portable:
portable.write(" ")
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License

Copyright (c) 2019-2023 Chris Griffith
Copyright (c) 2019-2024 Chris Griffith

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ Special thanks to [leonardyan](https://github.com/leonardyan) for numerous Chine

# License

Copyright (C) 2019-2023 Chris Griffith
Copyright (C) 2019-2024 Chris Griffith

The code itself is licensed under the MIT which you can read in the `LICENSE` file. <br>
Read more about the release licensing in the [docs](docs/README.md) folder. <br>
Expand Down
120 changes: 120 additions & 0 deletions fastflix/data/languages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10595,3 +10595,123 @@ Custom:
ukr: Нестандартний
kor: 사용자 지정
ron: Personalizat
Codec:
eng: Codec
deu: Codec
fra: Codec
ita: Codec
spa: Códec
jpn: コーデック
rus: Кодек
por: Codec
swe: Kodning
pol: Kodek
chs: 编解码器
ukr: Кодек
kor: 코덱
ron: Codec
Near Lossless:
eng: Near Lossless
deu: Fast verlustfrei
fra: Presque sans perte
ita: Quasi senza perdita
spa: Casi sin pérdidas
jpn: ニア・ロスレス
rus: Почти без потерь
por: Quase sem perdas
swe: Nära förlustfri
pol: Near Lossless
chs: 近乎无损
ukr: Майже без втрат
kor: 거의 무손실
ron: Aproape fără pierderi
High Quality:
eng: High Quality
deu: Hohe Qualität
fra: Haute qualité
ita: Alta qualità
spa: Alta calidad
jpn: 高品質
rus: Высокое качество
por: Alta qualidade
swe: Hög kvalitet
pol: Wysoka jakość
chs: 高质量
ukr: Висока якість
kor: 고품질
ron: De înaltă calitate
Medium Quality:
eng: Medium Quality
deu: Mittlere Qualität
fra: Qualité moyenne
ita: Qualità media
spa: Calidad media
jpn: ミディアム・クオリティ
rus: Среднее качество
por: Qualidade média
swe: Medelhög kvalitet
pol: Średnia jakość
chs: 中等质量
ukr: Середня якість
kor: 중간 품질
ron: Calitate medie
Low Quality:
eng: Low Quality
deu: Geringe Qualität
fra: Faible qualité
ita: Bassa qualità
spa: Baja calidad
jpn: 低品質
rus: Низкое качество
por: Baixa qualidade
swe: Låg kvalitet
pol: Niska jakość
chs: 低质量
ukr: Низька якість
kor: 낮은 품질
ron: Calitate scăzută
Custom Bitrate:
eng: Custom Bitrate
deu: Benutzerdefinierte Bitrate
fra: Bitrate personnalisé
ita: Bitrate personalizzato
spa: Velocidad de bits personalizada
jpn: カスタム・ビットレート
rus: Пользовательский битрейт
por: Taxa de bits personalizada
swe: Anpassad bitrate
pol: Niestandardowa szybkość transmisji
chs: 自定义比特率
ukr: Користувацький бітрейт
kor: 사용자 지정 비트레이트
ron: Bitrate personalizat
Audio Quality:
eng: Audio Quality
deu: Audio-Qualität
fra: Qualité audio
ita: Qualità audio
spa: Calidad de audio
jpn: オーディオ品質
rus: Качество звука
por: Qualidade áudio
swe: Ljudkvalitet
pol: Jakość dźwięku
chs: 音频质量
ukr: Якість звуку
kor: 오디오 품질
ron: Calitatea audio
Channel Layout:
eng: Channel Layout
deu: Kanal-Layout
fra: Disposition des canaux
ita: Layout del canale
spa: Disposición de los canales
jpn: チャンネルレイアウト
rus: Расположение каналов
por: Disposição dos canais
swe: Kanalens layout
pol: Układ kanałów
chs: 通道布局
ukr: Розташування каналів
kor: 채널 레이아웃
ron: Canal Layout
9 changes: 7 additions & 2 deletions fastflix/encoders/common/audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"quad(side)": 4,
"5.0": 5,
"5.1": 6,
"5.1(side)": 6,
"6.0": 6,
"6.0(front)": 6,
"hexagonal": 6,
Expand All @@ -30,6 +31,8 @@
def build_audio(audio_tracks, audio_file_index=0):
command_list = []
for track in audio_tracks:
if not track.enabled:
continue
command_list.append(
f"-map {audio_file_index}:{track.index} "
f'-metadata:s:{track.outdex} title="{track.title}" '
Expand All @@ -40,14 +43,16 @@ def build_audio(audio_tracks, audio_file_index=0):
if not track.conversion_codec or track.conversion_codec == "none":
command_list.append(f"-c:{track.outdex} copy")
elif track.conversion_codec:
cl = track.downmix if "downmix" in track and track.downmix else track.raw_info.channel_layout
downmix = (
f"-ac:{track.outdex} {channel_list[track.downmix]} -filter:{track.outdex} aformat=channel_layouts={track.downmix}"
f"-ac:{track.outdex} {channel_list[cl]} -filter:{track.outdex} aformat=channel_layouts={cl}"
if track.downmix
else ""
)
bitrate = ""
if track.conversion_codec not in lossless:
bitrate = f"-b:{track.outdex} {track.conversion_bitrate} "
channel_layout = f'-filter:{track.outdex} aformat=channel_layouts="{track.raw_info.channel_layout}"'
bitrate = f"-b:{track.outdex} {track.conversion_bitrate} {channel_layout}"
command_list.append(f"-c:{track.outdex} {track.conversion_codec} {bitrate} {downmix}")

if getattr(track, "dispositions", None):
Expand Down
9 changes: 8 additions & 1 deletion fastflix/encoders/common/encc_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ def build_audio(audio_tracks: list[AudioTrack], audio_streams):
stream_ids = get_stream_pos(audio_streams)

for track in sorted(audio_tracks, key=lambda x: x.outdex):
if not track.enabled:
continue
if track.index in track_ids:
logger.warning("*EncC does not support copy and duplicate of audio tracks!")
track_ids.add(track.index)
Expand All @@ -98,7 +100,10 @@ def build_audio(audio_tracks: list[AudioTrack], audio_streams):
downmix = f"--audio-stream {audio_id}?:{track.downmix}" if track.downmix else ""
bitrate = ""
if track.conversion_codec not in lossless:
bitrate = f"--audio-bitrate {audio_id}?{track.conversion_bitrate.rstrip('k')} "
if track.conversion_bitrate:
bitrate = f"--audio-bitrate {audio_id}?{track.conversion_bitrate} "
else:
bitrate = f"--audio-quality {audio_id}?{track.conversion_aq} "
command_list.append(
f"{downmix} --audio-codec {audio_id}?{track.conversion_codec} {bitrate} "
f"--audio-metadata {audio_id}?clear"
Expand Down Expand Up @@ -130,6 +135,8 @@ def build_subtitle(subtitle_tracks: list[SubtitleTrack], subtitle_streams, video
scale = ",scale=2.0" if video_height > 1800 else ""

for track in sorted(subtitle_tracks, key=lambda x: x.outdex):
if not track.enabled:
continue
sub_id = stream_ids[track.index]
if track.burn_in:
command_list.append(f"--vpp-subburn track={sub_id}{scale}")
Expand Down
8 changes: 4 additions & 4 deletions fastflix/encoders/common/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def generate_ffmpeg_start(
[
f'"{ffmpeg}"',
start_extra,
("-init_hw_device opencl=ocl -filter_hw_device ocl " if enable_opencl and remove_hdr else ""),
("-init_hw_device opencl:0.0=ocl -filter_hw_device ocl " if enable_opencl and remove_hdr else ""),
"-y",
time_one,
incoming_fps,
Expand Down Expand Up @@ -250,18 +250,18 @@ def generate_all(
) -> Tuple[str, str, str]:
settings = fastflix.current_video.video_settings.video_encoder_settings

audio = build_audio(fastflix.current_video.video_settings.audio_tracks) if audio else ""
audio = build_audio(fastflix.current_video.audio_tracks) if audio else ""

subtitles, burn_in_track, burn_in_type = "", None, None
if subs:
subtitles, burn_in_track, burn_in_type = build_subtitle(fastflix.current_video.video_settings.subtitle_tracks)
subtitles, burn_in_track, burn_in_type = build_subtitle(fastflix.current_video.subtitle_tracks)
if burn_in_type == "text":
for i, x in enumerate(fastflix.current_video.streams["subtitle"]):
if x["index"] == burn_in_track:
burn_in_track = i
break

attachments = build_attachments(fastflix.current_video.video_settings.attachment_tracks)
attachments = build_attachments(fastflix.current_video.attachment_tracks)

enable_opencl = fastflix.opencl_support
if "enable_opencl" in filters_extra:
Expand Down
2 changes: 2 additions & 0 deletions fastflix/encoders/common/subtitles.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ def build_subtitle(
burn_in_type = None
subs_enabled = False
for track in subtitle_tracks:
if not track.enabled:
continue
if track.burn_in:
burn_in_track = track.index
burn_in_type = track.subtitle_type
Expand Down
2 changes: 2 additions & 0 deletions fastflix/encoders/copy/command_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ def build(fastflix: FastFlix):
rotation = abs(int(fastflix.current_video.current_video_stream.side_data_list[0].rotation))

rot = ""
# if fastflix.current_video.video_settings.rotate != 0:
# rot = f"-display_rotation:s:v {rotation + (fastflix.current_video.video_settings.rotate * 90)}"
if fastflix.current_video.video_settings.output_path.name.lower().endswith("mp4"):
rot = f"-metadata:s:v rotate={rotation + (fastflix.current_video.video_settings.rotate * 90)}"

Expand Down
Loading

0 comments on commit 07fc0c7

Please sign in to comment.