Why can't Quicktime play a movie file encoded by FFmpeg?
--------------------------------------------------
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: Ocean Floor
--
Chapters
00:00 Why Can'T Quicktime Play A Movie File Encoded By Ffmpeg?
01:26 Accepted Answer Score 97
02:28 Thank you
--
Full question
https://superuser.com/questions/820134/w...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#video #ffmpeg #quicktime
#avk47
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: Ocean Floor
--
Chapters
00:00 Why Can'T Quicktime Play A Movie File Encoded By Ffmpeg?
01:26 Accepted Answer Score 97
02:28 Thank you
--
Full question
https://superuser.com/questions/820134/w...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#video #ffmpeg #quicktime
#avk47
ACCEPTED ANSWER
Score 97
Based on this StackOverflow answer I would add -pix_fmt yuv420p
to your command like this; one of the comments mentions adding -vcodec libx264
as well so it’s included here:
ffmpeg -pattern_type glob -i '*.JPG' -vcodec libx264 -s 640x480 \
-pix_fmt yuv420p movie.mp4
Or you could use the format filter. This example will use the scale filter instead of -s
, and the format filter instead of -pix_fmt
:
ffmpeg -pattern_type glob -i '*.JPG' -vcodec libx264 \
-vf scale=640:-2,format=yuv420p movie.mp4
Also elaborated on in the official FFmpeg Wiki under the heading “Encoding for dumb players”; emphasis mine:
You may need to use
-pix_fmt yuv420p
for your output to work in QuickTime and most other players. These players only supports the YUV planar color space with 4:2:0 chroma subsampling for H.264 video. Otherwise, depending on your source, ffmpeg may output to a pixel format that may be incompatible with these players.