From 3c3448f3d0153af8d49a4eb9c0e2ecffa26390e5 Mon Sep 17 00:00:00 2001 From: Maximilian Stolzle Date: Sat, 7 Sep 2024 18:27:24 -0400 Subject: [PATCH] Fix `OpenCV: FFMPEG: tag 0x5634504d/'MP4V' is not supported with codec id 12 and format 'mp4 / MP4 (MPEG-4 Part 14)'` warning --- examples/simulate_pendulum.py | 2 +- examples/simulate_planar_pcs.py | 2 +- src/jsrm/rendering/planar_hsa/opencv_renderer.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/simulate_pendulum.py b/examples/simulate_pendulum.py index e4a7a24..4867b73 100644 --- a/examples/simulate_pendulum.py +++ b/examples/simulate_pendulum.py @@ -101,7 +101,7 @@ def draw_robot( print("sol.ys =\n", sol.ys) # create video - fourcc = cv2.VideoWriter_fourcc(*"MP4V") + fourcc = cv2.VideoWriter_fourcc(*"mp4v") video_path.parent.mkdir(parents=True, exist_ok=True) video = cv2.VideoWriter( str(video_path), diff --git a/examples/simulate_planar_pcs.py b/examples/simulate_planar_pcs.py index b1aeee6..ba84afb 100644 --- a/examples/simulate_planar_pcs.py +++ b/examples/simulate_planar_pcs.py @@ -158,7 +158,7 @@ def draw_robot( plt.show() # create video - fourcc = cv2.VideoWriter_fourcc(*"MP4V") + fourcc = cv2.VideoWriter_fourcc(*"mp4v") video_path.parent.mkdir(parents=True, exist_ok=True) video = cv2.VideoWriter( str(video_path), diff --git a/src/jsrm/rendering/planar_hsa/opencv_renderer.py b/src/jsrm/rendering/planar_hsa/opencv_renderer.py index 6110d72..2a235cf 100644 --- a/src/jsrm/rendering/planar_hsa/opencv_renderer.py +++ b/src/jsrm/rendering/planar_hsa/opencv_renderer.py @@ -235,7 +235,7 @@ def animate_robot( video_height: video height """ # create video - fourcc = cv2.VideoWriter_fourcc(*"MP4V") + fourcc = cv2.VideoWriter_fourcc(*"mp4v") filepath.parent.mkdir(parents=True, exist_ok=True) video_dt = jnp.mean(video_ts[1:] - video_ts[:-1]).item() print(f"Rendering video with dt={video_dt} and {video_ts.shape[0]} frames")