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.
This commit is contained in:
Theelgirl 2021-02-26 10:55:59 -05:00 committed by GitHub
parent e5d8455152
commit a061aacd9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -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()
main()