Skip to content

Commit

Permalink
Version 5.8.0 (#593)
Browse files Browse the repository at this point in the history
* Adding #283 support for experimental DTS (dca) audio by adding -strict -2 (thanks to Sub7)
* Adding #354 M1 support (thanks to Nhunz and Anton)
* Adding #536 Improve Profiles - save advanced options (thanks to CelticTaonga and DCNerds)
* Adding #568 center app on startup (thanks to Viet-Duc Le)
* Adding #589 support for pydantic 2.x (thanks to dmo marillat)
* Adding #592 Add alpha channel for VP9 (thjanks to subof)
* Fixing #185 audio channels not being set properly and resetting on encoder change (thanks to Tupsi)
* Fixing #522 add file fails - fixed as of 5.7.0 (thanks to pcl5x2008)
* Fixing #531 list limitation in readme that FFmpeg must support the software encoders listed (thanks to brunoais)
* Fixing #567 Profiles for WebP did not work (nor GIF dither) (thanks to jpert)
* Fixing #582 BT.2020-10 Color transfer not maintained (thanks to Ryushin)
* Fixing #585 error when trying to return a video from queue that has the video track after audio or subtitiles (thanks to Hankuu)
* Fixing #586 audio channels being set incorrectly (thanks to Hankuu)
* Fixing #588 audio and subtitle dispositions were not set from source (thanks to GeZorTenPlotZ)
  • Loading branch information
cdgriffith authored Aug 9, 2024
1 parent 72dcbe1 commit f3cfc88
Show file tree
Hide file tree
Showing 48 changed files with 700 additions and 347 deletions.
39 changes: 26 additions & 13 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,22 @@ jobs:
build-nix:
strategy:
matrix:
os: [ ubuntu-20.04, ubuntu-22.04, macos-12 ]
os: [ ubuntu-20.04, ubuntu-22.04, macos-12, macos-14 ]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

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

- name: Gather build version (*nix)
run: |
mkdir dist
echo "::set-env name=VERSION::$(python scripts/get_version.py)"
echo "Building branch ${{env.GITHUB_REF}} - version ${{env.VERSION}}"
echo "::set-env name=ARCH::$(python scripts/get_arch.py)"
echo Building branch ${{ env.GITHUB_REF }} - version ${{ env.VERSION }} - on ${{ env.ARCH }}
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true

Expand Down Expand Up @@ -57,22 +58,34 @@ jobs:
dist/FastFlix --version
dist/FastFlix --test
- name: Upload standalone executable artifact
uses: actions/upload-artifact@v3
- name: Archive excutables
run: |
pushd dist
7z a -mm=Deflate -mfb=258 -mpass=15 FastFlix_${{ env.VERSION }}_${{ matrix.os }}_${{ env.ARCH }}.zip *
popd
- name: Build Mac App
if : ${{ startsWith(matrix.os, 'macos') }}
run: |
python scripts/build_mac_app.py ${{ matrix.os }}
pushd dist
7z a -mm=Deflate -mfb=258 -mpass=15 FastFlix_${{ env.VERSION }}_appbundle_${{ matrix.os }}_${{ env.ARCH }}.zip FastFlix.app
popd
- name: Upload executable artifacts
uses: actions/upload-artifact@v4
with:
name: FastFlix_${{ env.VERSION }}_${{ matrix.os }}_x86_64
path: |
dist/FastFlix
dist/LICENSE
name: FastFlix_${{ env.VERSION }}_OUTER_DO_NOT_UPLOAD_${{ matrix.os }}_${{ env.ARCH }}
path: dist/*.zip


build-windows-2022:

runs-on: windows-2022

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"

Expand Down Expand Up @@ -145,7 +158,7 @@ jobs:
move docs\build-licenses.txt LICENSE
- name: Upload standalone executable artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: FastFlix_${{ env.VERSION }}_win64
path: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.12'

Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@ jobs:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

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

- run: pip install black==23.7.0
- run: pip install black==24.8.0
- run: python -m black --check .

test:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

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

Expand Down
10 changes: 7 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.6.0
hooks:
- id: mixed-line-ending
- id: trailing-whitespace
Expand All @@ -12,14 +12,18 @@ repos:
- id: check-byte-order-marker
- id: debug-statements
- id: check-added-large-files
exclude: tests/media/.+
exclude: |
(?x)^(
tests/media/.+|
^fastflix/data/icon.icns
)$
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-toml
- id: detect-private-key
- id: end-of-file-fixer
- repo: https://github.com/psf/black
rev: 23.7.0
rev: 24.8.0
hooks:
- id: black
# - repo: https://github.com/pre-commit/mirrors-mypy
Expand Down
18 changes: 18 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Changelog

## Version 5.8.0

* Adding #283 support for experimental DTS (dca) audio by adding -strict -2 (thanks to Sub7)
* Adding #354 M1 support (thanks to Nhunz and Anton)
* Adding #536 Improve Profiles - save advanced options (thanks to CelticTaonga and DCNerds)
* Adding #568 center app on startup (thanks to Viet-Duc Le)
* Adding #587 Distribute a mac app bundle (thanks to Ivan Novokhatski)
* Adding #589 support for pydantic 2.x (thanks to dmo marillat)
* Adding #592 Add alpha channel for VP9 (thjanks to subof)
* Fixing #185 audio channels not being set properly and resetting on encoder change (thanks to Tupsi)
* Fixing #522 add file fails - fixed as of 5.7.0 (thanks to pcl5x2008)
* Fixing #531 list limitation in readme that FFmpeg must support the software encoders listed (thanks to brunoais)
* Fixing #567 Profiles for WebP did not work (nor GIF dither) (thanks to jpert)
* Fixing #582 BT.2020-10 Color transfer not maintained (thanks to Ryushin)
* Fixing #585 error when trying to return a video from queue that has the video track after audio or subtitiles (thanks to Hankuu)
* Fixing #586 audio channels being set incorrectly (thanks to Hankuu)
* Fixing #588 audio and subtitle dispositions were not set from source (thanks to GeZorTenPlotZ)

## Version 5.7.4

* Fixing #579 Missing Infos and no Mouse-Over info in Subs-Panel since 5.7 (thanks to GeZorTenPlotZ)
Expand Down
8 changes: 7 additions & 1 deletion FastFlix_Nix_OneFile.spec
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# -*- mode: python ; coding: utf-8 -*-
from PyInstaller.utils.hooks import collect_submodules
import toml
import os
import platform

block_cipher = None

Expand Down Expand Up @@ -37,6 +39,7 @@ a = Analysis(['fastflix/__main__.py'],
noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)

exe = EXE(pyz,
a.scripts,
a.binaries,
Expand All @@ -50,4 +53,7 @@ exe = EXE(pyz,
upx=False,
upx_exclude=[],
runtime_tmpdir=None,
console=True , icon='fastflix/data/icon.ico')
target_arch='arm64' if 'arm64' in platform.platform() else 'x86_64',
console=True,
icon='fastflix/data/icon.ico'
)
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ Check out [the FastFlix github wiki](https://github.com/cdgriffith/FastFlix/wiki
| Covers |||||| ||
| bt.2020 ||||||||

If one of the above software encoders is not listed, it is due to your version of FFmpeg not having that encoder compiled in.

## Hardware Encoders

These will require the appropriate hardware. Nvidia GPU for NVEnc, Intel GPU/CPU for QSVEnc, and AMD GPU for VCEEnc.
Expand Down
2 changes: 2 additions & 0 deletions fastflix/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ def app_setup(
container = Container(app)
container.show()

container.move(QtGui.QGuiApplication.primaryScreen().availableGeometry().center() - container.rect().center())

if not app.fastflix.config.disable_version_check:
latest_fastflix(app=app, show_new_dialog=False)

Expand Down
7 changes: 4 additions & 3 deletions fastflix/command_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,10 @@ def change_priority(
logger.exception(f"Could not set process priority to {new_priority}")

def read_output(self):
with open(self.output_file, "r", encoding="utf-8", errors="ignore") as out_file, open(
self.error_output_file, "r", encoding="utf-8", errors="ignore"
) as err_file:
with (
open(self.output_file, "r", encoding="utf-8", errors="ignore") as out_file,
open(self.error_output_file, "r", encoding="utf-8", errors="ignore") as err_file,
):
while True:
time.sleep(0.01)
if not self.is_alive():
Expand Down
32 changes: 32 additions & 0 deletions fastflix/data/Info.plist.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>FastFlix</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleIconFile</key>
<string>icon.icns</string>
<key>CFBundleIdentifier</key>
<string>com.github.cdgriffith.FastFlix</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>PURE</string>
<key>CFBundleVersion</key>
<string>{version}</string>
<key>CFBundleName</key>
<string>FastFlix</string>
<key>CSResourcesFileMapped</key>
<true/>
<key>NSHighResolutionCapable</key>
<true/>
<key>NSDisablePersistence</key>
<true/>
<key>LSMinimumSystemVersion</key>
<string>{mac_version}</string>
</dict>
</plist>
Binary file added fastflix/data/icon.icns
Binary file not shown.
60 changes: 15 additions & 45 deletions fastflix/data/languages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8696,51 +8696,6 @@ Bitrate Mode:
ukr: Режим бітрейту
kor: 비트레이트 모드
ron: Mod Bitrate
VCEEncC AV1 Encoder is untested!:
eng: VCEEncC AV1 Encoder is untested!
deu: VCEEncC AV1 Encoder ist ungetestet!
fra: VCEEncC AV1 Encoder n'est pas testé !
ita: VCEEncC AV1 Encoder non è stato testato!
spa: El codificador VCEEncC AV1 no ha sido probado.
chs: VCEEncC AV1编码器未经测试!
jpn: VCEEncC AV1エンコーダは未検証です!
rus: VCEEncC AV1 Encoder не тестировался!
por: O codificador VCEEncC AV1 não foi testado!
swe: VCEEncC AV1 Encoder är otestad!
pol: VCEEncC AV1 Encoder nie jest testowany!
ukr: Кодер VCEEncC AV1 неперевірений!
kor: VCEEncC AV1 인코더는 테스트되지 않았습니다!
ron: VCEEncC AV1 Encoder nu a fost testat!
QSVEncC AV1 Encoder is untested!:
eng: QSVEncC AV1 Encoder is untested!
deu: QSVEncC AV1 Encoder ist ungetestet!
fra: QSVEncC AV1 Encoder n'est pas testé !
ita: Il codificatore QSVEncC AV1 non è stato testato!
spa: El codificador QSVEncC AV1 no ha sido probado.
chs: QSVEncC AV1编码器未经测试!
jpn: QSVEncC AV1 Encoderは未検証です。
rus: Кодировщик QSVEncC AV1 не тестировался!
por: O codificador QSVEncC AV1 não foi testado!
swe: QSVEncC AV1 Encoder är otestad!
pol: QSVEncC AV1 Encoder nie jest testowany!
ukr: Кодер QSVEncC AV1 неперевірений!
kor: QSVEncC AV1 인코더는 테스트되지 않았습니다!
ron: QSVEncC AV1 Encoder nu a fost testat!
NVEncC AV1 Encoder is untested!:
eng: NVEncC AV1 Encoder is untested!
deu: NVEncC AV1 Encoder ist ungetestet!
fra: L'encodeur NVEncC AV1 n'est pas testé !
ita: Il codificatore NVEncC AV1 non è stato testato!
spa: El codificador NVEncC AV1 no ha sido probado.
chs: NVEncC AV1编码器未经测试!
jpn: NVEncC AV1 Encoderは未検証です。
rus: NVEncC AV1 Encoder не тестировался!
por: O codificador NVEncC AV1 não foi testado!
swe: NVEncC AV1 Encoder är otestad!
pol: NVEncC AV1 Encoder nie jest testowany!
ukr: Кодер NVEncC AV1 неперевірений!
kor: NVEncC AV1 인코더는 테스트되지 않았습니다!
ron: NVEncC AV1 Encoder nu este testat!
Load Directory:
eng: Load Directory
deu: Verzeichnis laden
Expand Down Expand Up @@ -10730,3 +10685,18 @@ Subtitle Type:
ukr: Тип субтитрів
kor: 자막 유형
ron: Tip subtitrare
Pattern Match:
eng: Pattern Match
deu: Mustervergleich
fra: Correspondance des motifs
ita: Corrispondenza dei modelli
spa: Coincidencia de patrones
jpn: パターン・マッチ
rus: Соответствие шаблону
por: Correspondência de padrões
swe: Mönstermatchning
pol: Dopasowanie wzorca
chs: 模式匹配
ukr: Збіг за зразком
kor: 패턴 일치
ron: Potrivire model
16 changes: 9 additions & 7 deletions fastflix/encoders/common/audio.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging

logger = logging.getLogger("fastflix")

channel_list = {
"mono": 1,
Expand Down Expand Up @@ -67,13 +70,12 @@ def build_audio(audio_tracks, audio_file_index=0):
cl = track.downmix if track.downmix and track.downmix != "No Downmix" else track.raw_info.channel_layout
except (AssertionError, KeyError):
cl = "stereo"
logger.warning("Could not determine channel layout, defaulting to stereo, please manually specify")

downmix = (
f"-ac:{track.outdex} {channel_list[cl]} -filter:{track.outdex} aformat=channel_layouts={cl}"
if track.downmix and track.downmix != "No Downmix"
else ""
f"-ac:{track.outdex} {channel_list[cl]}" if track.downmix and track.downmix != "No Downmix" else ""
)
channel_layout = f'-filter:{track.outdex} aformat=channel_layouts="{channel_list[cl]}"'
channel_layout = f'-filter:{track.outdex} "aformat=channel_layouts={cl}"'

bitrate = ""
if track.conversion_codec not in lossless:
Expand All @@ -84,13 +86,13 @@ def build_audio(audio_tracks, audio_file_index=0):
else f"{track.conversion_bitrate}k"
)

bitrate = f"-b:{track.outdex} {conversion_bitrate} {channel_layout}"
bitrate = f"-b:{track.outdex} {conversion_bitrate}"
else:
bitrate = audio_quality_converter(
track.conversion_aq, track.conversion_codec, track.raw_info.get("channels"), track.outdex
)

command_list.append(f"-c:{track.outdex} {track.conversion_codec} {bitrate} {downmix}")
command_list.append(f"-c:{track.outdex} {track.conversion_codec} {bitrate} {downmix} {channel_layout}")

if getattr(track, "dispositions", None):
added = ""
Expand All @@ -103,6 +105,6 @@ def build_audio(audio_tracks, audio_file_index=0):
command_list.append(f"-disposition:{track.outdex} 0")

end_command = " ".join(command_list)
if " truehd " or " opus " in end_command:
if " truehd " in end_command or " opus " in end_command or " dca " in end_command:
end_command += " -strict -2 "
return end_command
Loading

0 comments on commit f3cfc88

Please sign in to comment.