From 4e7abe8706f2e3a3f5f29b8103e4e7c71528caaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Eertmans?= Date: Wed, 17 Apr 2024 17:02:43 +0200 Subject: [PATCH] fix(lib): revert `reverse-...` utils because of warnings --- manim_slides/utils.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/manim_slides/utils.py b/manim_slides/utils.py index e27d219..4db34ee 100644 --- a/manim_slides/utils.py +++ b/manim_slides/utils.py @@ -95,7 +95,7 @@ def reverse_video_file(src: Path, dest: Path) -> None: ) as output_container: input_stream = input_container.streams.video[0] output_stream = output_container.add_stream( - codec_name=input_stream.codec_context.name, rate=input_stream.base_rate + codec_name="libx264", rate=input_stream.base_rate ) output_stream.width = input_stream.width output_stream.height = input_stream.height @@ -118,9 +118,8 @@ def reverse_video_file(src: Path, dest: Path) -> None: for _ in range(frames_count): frame = graph.pull() - - for packet in output_stream.encode(frame): - output_container.mux(packet) + frame.pict_type = 5 # Otherwise we get a warning saying it is changed + output_container.mux(output_stream.encode(frame)) for packet in output_stream.encode(): output_container.mux(packet)