Skip to content

Commit c3a9cea

Browse files
authored
Merge pull request #108 from shensquared/fix-saved-mp4-quicktime
Fix mp4 unplayable on Mac
2 parents 0ab6000 + 3356268 commit c3a9cea

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: src/meshcat/animation.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ def convert_frames_to_video(tar_file_path, output_path="output.mp4", framerate=6
142142
"-i", r"%07d.png",
143143
"-vcodec", "libx264",
144144
"-preset", "slow",
145+
"-pix_fmt", "yuv420p",
145146
"-crf", "18"]
146147
if overwrite:
147148
args.append("-y")
@@ -153,7 +154,7 @@ def convert_frames_to_video(tar_file_path, output_path="output.mp4", framerate=6
153154
Could not call `ffmpeg` to convert your frames into a video.
154155
If you want to convert the frames manually, you can extract the
155156
.tar archive into a directory, cd to that directory, and run:
156-
ffmpeg -r 60 -i %07d.png \\\n\t -vcodec libx264 \\\n\t -preset slow \\\n\t -crf 18 \\\n\t output.mp4
157+
ffmpeg -r 60 -i %07d.png -vcodec libx264 -preset slow -pix_fmt yuv420p -crf 18 output.mp4
157158
""")
158159
raise
159160
print("Saved output as {:s}".format(output_path))

0 commit comments

Comments
 (0)