Skip to content

Commit b225304

Browse files
authored
Version 2.3.2 (#41)
* Fixing #39 HEVC two pass bitrate does not work (thanks to schlotkins)
1 parent 6568123 commit b225304

File tree

10 files changed

+30
-11
lines changed

10 files changed

+30
-11
lines changed

CHANGES

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
Changelog
22
---------
33

4+
Version 2.3.2
5+
~~~~~~~~~~~~~
6+
7+
* Fixing #39 HEVC two pass bitrate does not work (thanks to schlotkins)
8+
9+
410
Version 2.3.1
511
~~~~~~~~~~~~~
612

fastflix/plugins/av1/command_builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def build(source, video_track, bitrate=None, crf=None, start_time=0, duration=No
1010
filters = helpers.generate_filters(**kwargs)
1111
audio = build_audio(audio_tracks)
1212

13-
ending = "dev/null && \\"
13+
ending = "/dev/null"
1414
if reusables.win_based:
1515
ending = "NUL"
1616

fastflix/plugins/av1/settings_panel.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,3 +151,4 @@ def new_source(self):
151151

152152
def set_mode(self, x):
153153
self.mode = x.text()
154+
self.main.build_commands()

fastflix/plugins/hevc/command_builder.py

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def build(
3131
audio = build_audio(audio_tracks)
3232
subtitles = build_subtitle(subtitle_tracks)
3333

34-
ending = "dev/null && \\"
34+
ending = "/dev/null"
3535
if reusables.win_based:
3636
ending = "NUL"
3737

@@ -81,18 +81,24 @@ def build(
8181
if intra_encoding:
8282
x265_params.append("keyint=1")
8383

84-
if x265_params:
85-
beginning += '-x265-params "{}" '.format(":".join(x265_params))
86-
8784
if side_data.cll:
8885
pass
8986

9087
extra_data = "-map_chapters 0 " # -map_metadata 0 # safe to do for rotation?
9188

89+
def get_x265_params(params=()):
90+
if not isinstance(params, (list, tuple)):
91+
params = [params]
92+
all_params = x265_params + list(params)
93+
return '-x265-params "{}" '.format(":".join(all_params)) if all_params else ""
94+
9295
if bitrate:
93-
command_1 = f'{beginning}:pass=1 -passlogfile "<tempfile.1.log>" -b:v {bitrate} -an -f mp4 {ending}'
96+
command_1 = (
97+
f'{beginning} {get_x265_params(["pass=1"])} '
98+
f'-passlogfile "<tempfile.1.log>" -b:v {bitrate} -preset {preset} -an -sn -dn -f mp4 {ending}'
99+
)
94100
command_2 = (
95-
f'{beginning}:pass=2 -passlogfile "<tempfile.1.log>" '
101+
f'{beginning} {get_x265_params(["pass=2"])} -passlogfile "<tempfile.1.log>" '
96102
f'-b:v {bitrate} -preset {preset} {audio} {subtitles} {extra_data} "{{output}}"'
97103
)
98104
return [
@@ -101,7 +107,10 @@ def build(
101107
]
102108

103109
elif crf:
104-
command = f'{beginning} -crf {crf} -preset {preset} {audio} {subtitles} {extra_data} "{{output}}"'
110+
command = (
111+
f"{beginning} {get_x265_params()} -crf {crf} "
112+
f'-preset {preset} {audio} {subtitles} {extra_data} "{{output}}"'
113+
)
105114
return [Command(command, ["ffmpeg", "output"], False, name="Single pass CRF", exe="ffmpeg")]
106115

107116
else:

fastflix/plugins/hevc/settings_panel.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,3 +226,4 @@ def new_source(self):
226226

227227
def set_mode(self, x):
228228
self.mode = x.text()
229+
self.main.build_commands()

fastflix/plugins/svt_av1/settings_panel.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,3 +182,4 @@ def new_source(self):
182182

183183
def set_mode(self, x):
184184
self.mode = x.text()
185+
self.main.build_commands()

fastflix/plugins/vp9/command_builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def build(
2424
filters = generate_filters(**kwargs)
2525
audio = build_audio(audio_tracks)
2626

27-
ending = "dev/null && \\"
27+
ending = "/dev/null"
2828
if reusables.win_based:
2929
ending = "NUL"
3030

fastflix/plugins/vp9/settings_panel.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,3 +228,4 @@ def new_source(self):
228228

229229
def set_mode(self, x):
230230
self.mode = x.text()
231+
self.main.build_commands()

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__ = "2.3.1"
3+
__version__ = "2.3.2"
44
__author__ = "Chris Griffith"

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "fastflix"
3-
version = "2.3.1"
3+
version = "2.3.2"
44
description = "Easy to use video encoder GUI wrapper"
55
authors = ["Chris Griffith <chris@cdgriffith.com>"]
66
license = "MIT"

0 commit comments

Comments
 (0)