Skip to content

Commit

Permalink
Version 4.2.0 (#211)
Browse files Browse the repository at this point in the history
* Adding #109 NVENC HEVC support based on FFmpeg (thanks to Zeid164)
* Adding NVEenC encoder for HEVC and AVC
* Adding #166 More robust queue that is recoverable
* Adding ability to extract HDR10+ metadata if hdr10plus_parser is detected on path
* Adding #178 selector for number of autocrop positions throughout video (thanks to bmcassagne)
* Adding Windows 10 notification for queue complete success
* Adding #194 fast two pass encoding (thanks to Ugurtan)
* Adding Confirm dialogue for cancel encode and replace currently working on video
* Changing AVC defaults and recommendations for CRF to higher values
* Changing VP9 to default to mkv instead of webm format to support more audio codecs
* Fixing German translations (thanks to SMESH)
* Fixing #171 Be able to select encoder before selecting video
* Fixing #176 Unable to change queue order or delete task from queue since 4.1.0 (thanks to Etz)
* Fixing #185 need to specify channel layout when downmixing (thanks to Ugurtan)
* Fixing #187 cleaning up partial download of FFmpeg (thanks to Todd Wilkinson)
* Fixing #190 add missing chromaloc parameter for x265 (thanks to Etz)
* Fixing #209 Double spaces were removed in incoming filenames, causing no file found (thanks to stilicrafter)
* Fixing that deinterlace detection could crash program due to CPython bug issue #43423 (thanks to macx)
* Fixing that returning item back from queue of a different encoder type would crash Fastflix
* Fixing HDR10 details to be track specific (thanks to Harybo)
* Fixing returning from queue works with duplicated audio tracks

Co-authored-by: SMESH <4199206+smesh109@users.noreply.github.com>
Co-authored-by: TGMais <2453844+tgmais@users.noreply.github.com>
  • Loading branch information
3 people authored Apr 13, 2021
1 parent b49cbf9 commit 070e4b8
Show file tree
Hide file tree
Showing 76 changed files with 4,493 additions and 1,089 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Insatll requirements
run: |
python -m pip install --upgrade pip setuptools --ignore-installed
python -m pip install --upgrade wheel
python -m pip install --upgrade wheel typing_extensions
python -m pip install -r requirements-build.txt
python -m pip install --upgrade pyqt5-tools
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_linux_legacy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Insatll requirements
run: |
python -m pip install --upgrade pip setuptools --ignore-installed
python -m pip install --upgrade wheel
python -m pip install --upgrade wheel typing_extensions
python -m pip install -r requirements-build.txt
python -m pip install --upgrade pyqt5-tools
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_mac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Insatll requirements
run: |
python -m pip install --upgrade pip setuptools --ignore-installed
python -m pip install --upgrade wheel
python -m pip install --upgrade wheel typing_extensions
python -m pip install -r requirements-build.txt
- name: Grab iso-639 lists
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
shell: cmd
run: |
python -m pip install --upgrade pip setuptools --ignore-installed
python -m pip install --upgrade pypiwin32 wheel
python -m pip install --upgrade pypiwin32 wheel typing_extensions
python -m pip install -r requirements-build.txt
- name: Grab iso-639 lists
Expand Down
24 changes: 24 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# Changelog

## Version 4.2.0

* Adding #109 NVENC HEVC support based on FFmpeg (thanks to Zeid164)
* Adding NVEenC encoder for HEVC and AVC
* Adding #166 More robust queue that is recoverable
* Adding ability to extract HDR10+ metadata if hdr10plus_parser is detected on path
* Adding #178 selector for number of autocrop positions throughout video (thanks to bmcassagne)
* Adding Windows 10 notification for queue complete success
* Adding #194 fast two pass encoding (thanks to Ugurtan)
* Adding Confirm dialogue for cancel encode and replace currently working on video
* Changing AVC defaults and recommendations for CRF to higher values
* Changing VP9 to default to mkv instead of webm format to support more audio codecs
* Fixing German translations (thanks to SMESH)
* Fixing #171 Be able to select encoder before selecting video
* Fixing #176 Unable to change queue order or delete task from queue since 4.1.0 (thanks to Etz)
* Fixing #185 need to specify channel layout when downmixing (thanks to Ugurtan)
* Fixing #187 cleaning up partial download of FFmpeg (thanks to Todd Wilkinson)
* Fixing #190 add missing chromaloc parameter for x265 (thanks to Etz)
* Fixing #209 Double spaces were removed in incoming filenames, causing no file found (thanks to stilicrafter)
* Fixing that deinterlace detection could crash program due to CPython bug issue #43423 (thanks to macx)
* Fixing that returning item back from queue of a different encoder type would crash Fastflix
* Fixing HDR10 details to be track specific (thanks to Harybo)
* Fixing returning from queue works with duplicated audio tracks

## Version 4.1.2

* Fixing #180 Minor UI glitch, custom bitrate retains "k" when edited from queue (thanks to Etz)
Expand Down
4 changes: 2 additions & 2 deletions FastFlix_Nix_OneFile.spec
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ for root, dirs, files in os.walk('fastflix'):
for file in files:
all_fastflix_files.append((os.path.join(root,file), root))

all_imports = collect_submodules('pydantic') + ['dataclasses', 'colorsys']
all_imports = collect_submodules('pydantic') + ['dataclasses', 'colorsys', 'typing_extensions']
with open("requirements-build.txt", "r") as reqs:
for line in reqs:
package = line.split("=")[0].split(">")[0].split("<")[0].replace('"', '').replace("'", '').strip()
Expand Down Expand Up @@ -41,7 +41,7 @@ exe = EXE(pyz,
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx=False,
upx_exclude=[],
runtime_tmpdir=None,
console=True , icon='fastflix/data/icon.ico')
5 changes: 2 additions & 3 deletions FastFlix_Windows_Installer.spec
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ for root, dirs, files in os.walk('fastflix'):
for file in files:
all_fastflix_files.append((os.path.join(root,file), root))


all_imports = collect_submodules('pydantic') + ['dataclasses', 'colorsys']
all_imports = collect_submodules('pydantic') + ['dataclasses', 'colorsys', 'typing_extensions']
with open("requirements-build.txt", "r") as reqs:
for line in reqs:
package = line.split("=")[0].split(">")[0].split("<")[0].replace('"', '').replace("'", '').strip()
Expand Down Expand Up @@ -47,6 +46,6 @@ coll = COLLECT(exe,
a.zipfiles,
a.datas,
strip=False,
upx=True,
upx=False,
upx_exclude=[],
name='FastFlix')
4 changes: 2 additions & 2 deletions FastFlix_Windows_OneFile.spec
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ for root, dirs, files in os.walk('fastflix'):
for file in files:
all_fastflix_files.append((os.path.join(root,file), root))

all_imports = collect_submodules('pydantic') + ['dataclasses', 'colorsys']
all_imports = collect_submodules('pydantic') + ['dataclasses', 'colorsys', 'typing_extensions']
with open("requirements-build.txt", "r") as reqs:
for line in reqs:
package = line.split("=")[0].split(">")[0].split("<")[0].replace('"', '').replace("'", '').strip()
Expand Down Expand Up @@ -41,7 +41,7 @@ exe = EXE(pyz,
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx=False,
upx_exclude=[],
runtime_tmpdir=None,
console=True , icon='fastflix\\data\\icon.ico')
35 changes: 17 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,18 @@ Check out [the FastFlix github wiki](https://github.com/cdgriffith/FastFlix/wiki

# Encoders

FastFlix supports the following encoders when their required libraries are found in FFmpeg:
FastFlix supports the following encoders if available:

* HEVC (libx265) &nbsp;&nbsp;&nbsp; <img src="./fastflix/data/encoders/icon_x265.png" height="30" alt="x265" style="background-color: #fff" >
* AVC (libx264) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <img src="./fastflix/data/encoders/icon_x264.png" height="30" alt="x264" style="background-color: #fff" >
* AV1 (librav1e) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <img src="./fastflix/data/encoders/icon_rav1e.png" height="30" alt="rav1e" style="background-color: #fff" >
* AV1 (libaom-av1) &nbsp; <img src="./fastflix/data/encoders/icon_av1_aom.png" height="30" alt="av1_aom" style="background-color: #fff" >
* AV1 (libsvtav1) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <img src="./fastflix/data/encoders/icon_svt_av1.png" height="30" alt="svt_av1" style="background-color: #fff" >
* VP9 (libvpx) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <img src="./fastflix/data/encoders/icon_vp9.png" height="30" alt="vpg" style="background-color: #fff" >
* WEBP (libwebp) &nbsp;&nbsp;&nbsp;<img src="./fastflix/data/encoders/icon_webp.png" height="30" alt="vpg" style="background-color: #fff" >
* GIF (gif) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <img src="./fastflix/data/encoders/icon_gif.png" height="30" alt="gif" style="background-color: #fff" >
| Encoder | x265 | NVENC HEVC | [NVEncC HEVC](https://github.com/rigaya/NVEnc/releases) | x264 | rav1e | AOM AV1 | SVT AV1 | VP9 | WEBP | GIF |
| --------- | ---- | ---------- | ----------- | ---- | ----- | ------- | ------- | --- | ---- | --- |
| HDR10 || || | | | |* | | |
| HDR10+ || || | | | | | | |
| Audio |||* |||||| | |
| Subtitles |||||||| | | |
| Covers ||| ||||| | | |
| bt.2020 ||||||||| | |

All of these are currently supported by [BtbN's Windows FFmpeg builds](https://github.com/BtbN/FFmpeg-Builds) which is the default FFmpeg downloaded.

Most other builds do not have all these encoders available by default and may require custom compiling FFmpeg for a specific encoder.

* [Windows FFmpeg (and more) auto builder](https://github.com/m-ab-s/media-autobuild_suite)
* [Windows cross compile FFmpeg (build on linux)](https://github.com/rdp/ffmpeg-windows-build-helpers)
* [FFmpeg compilation guide](https://trac.ffmpeg.org/wiki/CompilationGuide)
`✓ - Full support | ✓* - Limited support`

# Releases

Expand Down Expand Up @@ -71,10 +65,12 @@ VP9 has limited support to copy some existing HDR10 metadata, usually from other

## HDR10+

FastFlix supports using generated or [extracted JSON HDR10+ Metadata](https://github.com/cdgriffith/FastFlix/wiki/HDR10-Plus-Metadata-Extraction) with HEVC encodes via x265. However that is highly
dependant on a FFmpeg version that has been compiled with x265 that has HDR10+ support. [BtbN's Windows FFmpeg builds](https://github.com/BtbN/FFmpeg-Builds)
FastFlix supports using generated or [extracted JSON HDR10+ Metadata](https://github.com/cdgriffith/FastFlix/wiki/HDR10-Plus-Metadata-Extraction) with HEVC encodes via x265. However, that is highly
dependent on a FFmpeg version that has been compiled with x265 that has HDR10+ support. [BtbN's Windows FFmpeg builds](https://github.com/BtbN/FFmpeg-Builds)
have this support as of 10/23/2020 and may require a [manual upgrade](https://github.com/cdgriffith/FastFlix/wiki/Updating-FFmpeg).

If you add HDR10+ metadata file, make sure the encoding log does NOT contain the line `x265 [warning]: –dhdr10-info disabled. Enable HDR10_PLUS in cmake` or else it is unsupported.

## HLG

FastFlix (v4.0.2+) passes through HLG color transfer information to everything except webp and GIF.
Expand All @@ -83,6 +79,9 @@ FastFlix (v4.0.2+) passes through HLG color transfer information to everything e

FastFlix does not plan to support Dolby Vision's proprietary format at this time.

# Support FastFlix

Check out the different ways you can help [support FastFlix](https://github.com/cdgriffith/FastFlix/wiki/Support-FastFlix)!

# License

Expand Down
26 changes: 19 additions & 7 deletions fastflix/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import coloredlogs
import reusables
from qtpy import QtGui
from qtpy import QtGui, QtWidgets, QtCore

from fastflix.flix import ffmpeg_audio_encoders, ffmpeg_configuration, ffprobe_configuration
from fastflix.language import t
Expand All @@ -22,6 +22,10 @@


def create_app():
if hasattr(QtCore.Qt, "AA_EnableHighDpiScaling"):
QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling, True)
if hasattr(QtCore.Qt, "AA_UseHighDpiPixmaps"):
QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_UseHighDpiPixmaps, True)
main_app = FastFlixApp(sys.argv)
main_app.setStyle("fusion")
main_app.setApplicationDisplayName("FastFlix")
Expand Down Expand Up @@ -49,24 +53,32 @@ def init_encoders(app: FastFlixApp, **_):
from fastflix.encoders.avc_x264 import main as avc_plugin
from fastflix.encoders.copy import main as copy_plugin
from fastflix.encoders.gif import main as gif_plugin
from fastflix.encoders.ffmpeg_hevc_nvenc import main as nvenc_plugin
from fastflix.encoders.hevc_x265 import main as hevc_plugin
from fastflix.encoders.rav1e import main as rav1e_plugin
from fastflix.encoders.svt_av1 import main as svt_av1_plugin
from fastflix.encoders.vp9 import main as vp9_plugin
from fastflix.encoders.webp import main as webp_plugin
from fastflix.encoders.nvencc_hevc import main as nvencc_plugin
from fastflix.encoders.nvencc_avc import main as nvencc_avc_plugin

encoders = [
hevc_plugin,
avc_plugin,
gif_plugin,
vp9_plugin,
webp_plugin,
nvenc_plugin,
av1_plugin,
rav1e_plugin,
svt_av1_plugin,
avc_plugin,
vp9_plugin,
gif_plugin,
webp_plugin,
copy_plugin,
]

if app.fastflix.config.nvencc:
encoders.insert(1, nvencc_plugin)
encoders.insert(7, nvencc_avc_plugin)

app.fastflix.encoders = {
encoder.name: encoder
for encoder in encoders
Expand Down Expand Up @@ -94,9 +106,9 @@ def register_app():
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):
def start_app(worker_queue, status_queue, log_queue, queue_list, queue_lock):
app = create_app()
app.fastflix = FastFlix()
app.fastflix = FastFlix(queue=queue_list, queue_lock=queue_lock)
app.fastflix.log_queue = log_queue
app.fastflix.status_queue = status_queue
app.fastflix.worker_queue = worker_queue
Expand Down
27 changes: 4 additions & 23 deletions fastflix/command_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@

__all__ = ["BackgroundRunner"]

white_detect = re.compile(r"^\s+")


class BackgroundRunner:
def __init__(self, log_queue):
Expand Down Expand Up @@ -106,6 +104,8 @@ def read_output(self):
err_excess = err_file.read()
logger.info(err_excess)
self.log_queue.put(err_excess)
if self.process.returncode is not None and self.process.returncode > 0:
self.error_detected = True
break
line = out_file.readline().rstrip()
if line:
Expand Down Expand Up @@ -156,7 +156,7 @@ def clean(self):
self.started_at = None

def kill(self, log=True):
if self.process_two and self.process.poll() is None:
if self.process_two and self.process_two.poll() is None:
if log:
logger.info(f"Killing worker process {self.process_two.pid}")
try:
Expand All @@ -165,6 +165,7 @@ def kill(self, log=True):
except Exception as err:
if log:
logger.exception(f"Couldn't terminate process: {err}")

if self.process and self.process.poll() is None:
if log:
logger.info(f"Killing worker process {self.process.pid}")
Expand Down Expand Up @@ -193,23 +194,3 @@ def resume(self):
if not self.process:
return False
self.process.resume()


# if __name__ == "__main__":
# from queue import Queue
#
# logging.basicConfig(level=logging.DEBUG)
# br = BackgroundRunner(Queue())
# import shutil
#
# ffmpeg = shutil.which("ffmpeg")
# br.start_piped_exec(
# command_one=shlex.split(
# rf'"{ffmpeg}" -loglevel panic -i C:\\Users\\Chris\\scoob_short.mkv -c:v copy -vbsf hevc_mp4toannexb -f hevc -'
# ),
# command_two=shlex.split(r'"C:\\Users\\Chris\\ffmpeg\\hdr10plus_parser.exe" --verify -'),
# work_dir=r"C:\Users\Chris",
# )
# import time
# time.sleep(1)
# br.read_output()
Loading

0 comments on commit 070e4b8

Please sign in to comment.