Skip to content

Commit

Permalink
Version 3.1.0 (#82)
Browse files Browse the repository at this point in the history
* Adding support for movie title
* Adding settings for disable update check on startup and limited audio conversions
* Adding #57 after conversion options (thanks to TGMais)
* Adding Windows should not to go to sleep during conversion
* Changing #80 thumbnail preview will start at 10% in if no start time given (thanks to zsumie)
* Changing no longer need to restart for setting page changes
* Changing width and height will only give warnings if not divisible by two
* Fixing output name is not regenerated on encoder switch if matching extension
* Fixing #79 crash on no internet connection (thanks to L0Lock)
* Fixing output paths not working on network drives
  • Loading branch information
cdgriffith authored Oct 18, 2020
1 parent 09aa783 commit cffd852
Show file tree
Hide file tree
Showing 31 changed files with 498 additions and 133 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ repos:
- id: check-toml
- id: detect-private-key
- id: end-of-file-fixer
- repo: https://github.com/PyCQA/isort
rev: master
hooks:
- id: isort
# - repo: https://github.com/PyCQA/isort
# rev: master
# hooks:
# - id: isort
- repo: https://github.com/psf/black
rev: 20.8b1
hooks:
Expand Down
13 changes: 13 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## Version 3.1.0

* Adding support for movie title
* Adding settings for disable update check on startup and limited audio conversions
* Adding #57 after conversion options (thanks to TGMais)
* Adding Windows should not to go to sleep during conversion
* Changing #80 thumbnail preview will start at 10% in if no start time given (thanks to zsumie)
* Changing no longer need to restart for setting page changes
* Changing width and height will only give warnings if not divisible by two
* Fixing output name is not regenerated on encoder switch if matching extension
* Fixing #79 crash on no internet connection (thanks to L0Lock)
* Fixing output paths not working on network drives

## Version 3.0.2

* Fixing #76 Windows FFmpeg builds switch from gyan.dev to https://github.com/BtbN/FFmpeg-Builds/releases (thanks to sioc)
Expand Down
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

FastFlix is a simple and friendly GUI for encoding videos.

FastFlix keeps HDR10 metadata for x265, which will be expanded to AV1 libraries when available.

It needs `FFmpeg` (version 4.3 or greater) under the hood for the heavy lifting, and can work with a variety of encoders.

# Encoders
Expand Down Expand Up @@ -53,6 +55,27 @@ pip install -r requirements.txt
python -m fastflix
```

# HDR

On any 10-bit or higher video output, FastFlix will copy the input HDR colorspace (bt2020). Which is [different than HDR10 or HDR10+](https://codecalamity.com/hdr-hdr10-hdr10-hlg-and-dolby-vision/).

## HDR10

FastFlix was created to easily extract / copy HDR10 data, but as of sept 2020, only x265 supports copying that data through FFmpeg, no AV1 library does.

* rav1e - can set mastering data and CLL via their CLI but [not through ffmpeg](https://github.com/xiph/rav1e/issues/2554).
* SVT AV1 - accepts a "--enable-hdr" flag that is [not well documented](https://github.com/AOMediaCodec/SVT-AV1/blob/master/Docs/svt-av1_encoder_user_guide.md), not supported through FFmpeg.
* aomenc (libaom-av1) - does not look to support HDR10

## HDR10+

FastFlix does not currently support copying HDR10+ metadata, but is a planned feature for x265.

## Dolby Vision

FastFlix does not plan to support Dolby Visions proprietary format, as it requires royalties.


# License

Copyright (C) 2019-2020 Chris Griffith
Expand Down
7 changes: 6 additions & 1 deletion docs/build-licenses.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
This document contains ours and third party licenses included in FastFlix.

FastFlix's code is MIT licenced. When bundled into a Window's exe it is GPL licenced (blame PyQT5 for that).
FastFlix's code is MIT licenced. When bundled into a Window's exe it is GPL licenced.

* FastFlix (MIT)
* Box (MIT)
Expand All @@ -22,6 +22,11 @@ FastFlix's code is MIT licenced. When bundled into a Window's exe it is GPL lic
* PyQT5 (GPLv3)


Any embedded fonts have their own licenses each found in the "fastflix/data/fonts" directory.

##### LICENSES #####


## FastFlix (code only)

The MIT License
Expand Down
7 changes: 0 additions & 7 deletions fastflix.json.example

This file was deleted.

2 changes: 1 addition & 1 deletion fastflix/encoders/av1_aom/settings_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

class AV1(SettingPanel):
def __init__(self, parent, main):
super(AV1, self).__init__(parent)
super().__init__(parent, main)
self.main = main

grid = QtWidgets.QGridLayout()
Expand Down
2 changes: 1 addition & 1 deletion fastflix/encoders/avc_x264/settings_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

class AVC(SettingPanel):
def __init__(self, parent, main):
super(AVC, self).__init__(parent)
super().__init__(parent, main)
self.main = main

grid = QtWidgets.QGridLayout()
Expand Down
7 changes: 6 additions & 1 deletion fastflix/encoders/common/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ def __init__(self, condition, commands, dirs=(), files=(), name="", ensure_paths
class Command:
item = "command"

def __init__(self, command, variables, internal, name="", ensure_paths=(), exe=None):
def __init__(self, command, variables, internal, name="", ensure_paths=(), exe=None, shell=False):
self.name = name
self.command = command
self.variables = variables
self.internal = internal
self.ensure_paths = ensure_paths
self.exe = exe
self.shell = shell


def generate_ffmpeg_start(
Expand All @@ -41,17 +42,20 @@ def generate_ffmpeg_start(
filters=None,
max_mux="default",
fast_time=True,
video_title="",
**_,
):
time_settings = f'{f"-ss {start_time}" if start_time else ""} {f"-to {end_time}" if end_time else ""} '
time_one = time_settings if fast_time else ""
time_two = time_settings if not fast_time else ""
title = f'-metadata title="{video_title}"' if video_title else ""

return (
f'"{ffmpeg}" -y '
f" {time_one} "
f'-i "{source}" '
f" {time_two} "
f"{title} "
f"{f'-max_muxing_queue_size {max_mux}' if max_mux != 'default' else ''} "
f"-map 0:{video_track} "
f"-c:v:0 {encoder} "
Expand All @@ -77,6 +81,7 @@ def generate_ending(
f"{audio} {subtitles} {cover} {extra} "
)
if output_video and not null_ending:
output_video = output_video.replace("\\", "/")
ending += f'"{output_video}"'
else:
ending += null
Expand Down
25 changes: 15 additions & 10 deletions fastflix/encoders/common/setting_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,16 @@

logger = logging.getLogger("fastflix")

ffmpeg_extra_command = ""

class SettingPanel(QtWidgets.QWidget):

ffmpeg_extras_widget = QtWidgets.QLineEdit()
extras_connected = False

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
class SettingPanel(QtWidgets.QWidget):
def __init__(self, parent, main, *args, **kwargs):
super().__init__(parent, *args, **kwargs)
self.main = main
self.widgets = Box()
self.labels = Box()
self.only_int = QtGui.QIntValidator()
if not self.extras_connected:
self.ffmpeg_extras_widget.textChanged.connect(lambda: self.main.page_update())
self.extras_connected = True

def _add_combo_box(self, label, options, widget_name, connect="default", enabled=True, default=0, tooltip=""):
layout = QtWidgets.QHBoxLayout()
Expand Down Expand Up @@ -70,11 +66,15 @@ def _add_custom(self, connect="default"):
self.labels.ffmpeg_options = QtWidgets.QLabel("Custom ffmpeg options")
self.labels.ffmpeg_options.setToolTip("Extra flags or options, cannot modify existing settings")
layout.addWidget(self.labels.ffmpeg_options)
self.ffmpeg_extras_widget = QtWidgets.QLineEdit()
self.ffmpeg_extras_widget.setText(ffmpeg_extra_command)
if connect and connect != "default":
self.ffmpeg_extras_widget.disconnect()
if connect == "self":
connect = lambda: self.page_update()
self.ffmpeg_extras_widget.textChanged.connect(connect)
else:
self.ffmpeg_extras_widget.textChanged.connect(lambda: self.ffmpeg_extra_update())
layout.addWidget(self.ffmpeg_extras_widget)
return layout

Expand All @@ -93,7 +93,12 @@ def _add_remove_hdr(self, connect="default"):

@property
def ffmpeg_extras(self):
return self.ffmpeg_extras_widget.text().strip()
return ffmpeg_extra_command

def ffmpeg_extra_update(self):
global ffmpeg_extra_command
ffmpeg_extra_command = self.ffmpeg_extras_widget.text().strip()
self.main.page_update()

def new_source(self):
if not self.main.streams:
Expand Down
2 changes: 1 addition & 1 deletion fastflix/encoders/gif/settings_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class GIF(SettingPanel):
def __init__(self, parent, main):
super(GIF, self).__init__(parent)
super().__init__(parent, main)
self.main = main

grid = QtWidgets.QGridLayout()
Expand Down
2 changes: 1 addition & 1 deletion fastflix/encoders/hevc_x265/settings_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

class HEVC(SettingPanel):
def __init__(self, parent, main):
super().__init__(parent)
super().__init__(parent, main)
self.main = main

grid = QtWidgets.QGridLayout()
Expand Down
2 changes: 1 addition & 1 deletion fastflix/encoders/rav1e/settings_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

class RAV1E(SettingPanel):
def __init__(self, parent, main):
super().__init__(parent)
super().__init__(parent, main)
self.main = main
grid = QtWidgets.QGridLayout()

Expand Down
2 changes: 1 addition & 1 deletion fastflix/encoders/svt_av1/settings_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

class SVT_AV1(SettingPanel):
def __init__(self, parent, main):
super(SVT_AV1, self).__init__(parent)
super().__init__(parent, main)
self.main = main
grid = QtWidgets.QGridLayout()

Expand Down
2 changes: 1 addition & 1 deletion fastflix/encoders/vp9/settings_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

class VP9(SettingPanel):
def __init__(self, parent, main):
super(VP9, self).__init__(parent)
super().__init__(parent, main)
self.main = main

grid = QtWidgets.QGridLayout()
Expand Down
12 changes: 9 additions & 3 deletions fastflix/flix.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,14 @@ def guess_bit_depth(pix_fmt, color_primaries):

class Flix:
def __init__(self, ffmpeg="ffmpeg", ffprobe="ffprobe"):
self.tp = ThreadPool(processes=4)
self.update(ffmpeg, ffprobe)

def update(self, ffmpeg, ffprobe):
self.ffmpeg = ffmpeg
self.ffprobe = ffprobe
self.tp = ThreadPool(processes=4)
self.config, self.filters, self.ffmpeg_version = self.ffmpeg_configuration()
self.ffprobe_version = ff_version(ffprobe, True)
self.ffprobe_version = ff_version(self.ffprobe, True)

def probe(self, file):
command = f'"{self.ffprobe}" -v quiet -print_format json -show_format -show_streams "{file}"'
Expand All @@ -101,7 +104,10 @@ def ffmpeg_configuration(self):
raise FlixError(f'"{self.ffmpeg}" file not found')
output = res.stdout.decode("utf-8")
config = []
version = output.split(" ", 4)[2]
try:
version = output.split(" ", 4)[2]
except (ValueError, IndexError):
raise FlixError(f'Cannot parse version of ffmpeg from "{output}"')
line_denote = "configuration: "
for line in output.split("\n"):
if line.startswith(line_denote):
Expand Down
Loading

0 comments on commit cffd852

Please sign in to comment.