From 4affd7bf51f37ad78077e202dc118a49894e247d Mon Sep 17 00:00:00 2001 From: Theelgirl <43764914+Theelgirl@users.noreply.github.com> Date: Fri, 26 Feb 2021 10:55:59 -0500 Subject: [PATCH] Speed up ffmpeg part of H.265 encoding/decoding At the expense of a bit of video size (~5% bigger files). This will cause files previously encoded with the H.265 codec to be incompatible. Since H.265 is still an experimental feature though and hasn't been released to PyPi, this will not be a major version bump. --- fvid/fvid.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fvid/fvid.py b/fvid/fvid.py index a41a03f..0017e54 100644 --- a/fvid/fvid.py +++ b/fvid/fvid.py @@ -227,7 +227,7 @@ def get_bits_from_video(video_filepath: str, use_h265: bool) -> str: + video_filepath + "' -c:v libx265 -filter:v fps=fps=" + FRAMERATE - + " -x265-params lossless=1 -preset 6 -tune grain " + + " -x265-params lossless=1 -tune grain " + TEMPVIDEO ) else: @@ -436,7 +436,7 @@ def make_video(output_filepath: str, framerate: int = FRAMERATE, use_h265: bool "ffmpeg -r " + framerate + " -i ./fvid_frames/encoded_frames_%d.png -c:v libx265 " - + " -x265-params lossless=1 -preset 6 -tune grain " + + " -x265-params lossless=1 -tune grain " + outputfile ) else: @@ -578,4 +578,4 @@ def main(): cleanup() if __name__ == '__main__': - main() \ No newline at end of file + main()