Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tune x264 parameters to reduce resulting file size #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/videojitter/generate_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ def _parse_arguments():
),
default="5",
)
argument_parser.add_argument(
"--fastest-encoding",
help=(
"Enables fastest encoding speed (about 1.5x faster) at the expense of"
" generated file size (about 8x bigger)."
),
action="store_true",
)
return argument_parser.parse_args()


Expand Down Expand Up @@ -125,8 +133,9 @@ def color_input(color):
args.output_file,
**{
"shortest": None,
"profile:v": "baseline",
"preset": "ultrafast",
"profile:v": "baseline" if args.fastest_encoding else "main",
"preset": "ultrafast" if args.fastest_encoding else "superfast",
"x264-params": "" if args.fastest_encoding else "bframes=0",
# Make the video behave like typical HD video for compatibility and to
# ensure the video players behave similarly to a "real" video.
"pix_fmt": "yuv420p",
Expand Down