Skip to content

Commit 3356268

Browse files
committed
fix mp4 from ffmpeg unplayable on Mac
1 parent 030479c commit 3356268

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/meshcat/animation.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ def convert_frames_to_video(tar_file_path, output_path="output.mp4", framerate=6
147147
"-i", r"%07d.png",
148148
"-vcodec", "libx264",
149149
"-preset", "slow",
150+
"-pix_fmt", "yuv420p",
150151
"-crf", "18"]
151152
if overwrite:
152153
args.append("-y")
@@ -158,7 +159,7 @@ def convert_frames_to_video(tar_file_path, output_path="output.mp4", framerate=6
158159
Could not call `ffmpeg` to convert your frames into a video.
159160
If you want to convert the frames manually, you can extract the
160161
.tar archive into a directory, cd to that directory, and run:
161-
ffmpeg -r 60 -i %07d.png \\\n\t -vcodec libx264 \\\n\t -preset slow \\\n\t -crf 18 \\\n\t output.mp4
162+
ffmpeg -r 60 -i %07d.png -vcodec libx264 -preset slow -pix_fmt yuv420p -crf 18 output.mp4
162163
""")
163164
raise
164165
print("Saved output as {:s}".format(output_path))

0 commit comments

Comments
 (0)