I've been using ffmpeg for the occasional video conversion for quite some time, and recently discovered that H.264 (libx264) videos generated by ffmpeg aren't working in iMovie or QuickTime (nor will they play or show a preview in Finder with the quick view feature).
If I generate videos using OS X applications which internally use ffmpeg (e.g. MP4tools or Adapter) the videos work fine, but not when I try to use ffmpeg directly, e.g. to convert a video:
# ffmpeg -i input.avi output.mp4
or to combine some images into a video:
# ffmpeg -f image2 -pattern_type sequence image-%04d.png output.mp4
iMovie just imports the video as black/blank, quick preview just shows the file info, (but no video preview), and Quicktime tells me it cannot play it:
What's going on?!
ffprobe -select_streams v -show_streams output.mp4
? – drfrogsplat Mar 17 '15 at 00:06-pix_fmt yuv420p
works for HEVC and h264, but-vf format=yuv420p
does not. From the link:Encoding for dumb players: You may need to use -vf format=yuv420p (or the alias -pix_fmt yuv420p) for your output to work in QuickTime and most other players.
I made a movie QuickTime will open:
– NoahR Sep 19 '23 at 14:39ffmpeg -r 60 -f image2 -pattern_type glob -I 'frame.*.png' -r 60 -c:v libx265 -crf 28 -tag:v hvc1 -pix_fmt yuv420p test5hevc.mov