it successfully saves an mp4 video, but it saves it with a codec that Quicktime player is unable to open on my Mac. (Quicktime gives the error “The file isn’t compatible with QuickTime Player.”)
Based on this webpage, and inspecting the codec of the video using the VLC media player, it looks like the issue is that Quicktime does not support the the H264 - MPEG-4 AVC (part 10) format that the video is saved in.
Does anyone know how to tell VideoIO to save a video in a more standard codec? (I am not familiar with codecs, but if I’m understanding, the issue is the “AVC” part.)
In case it helps, I think that this page may explain how to use FFMPEG to save a video in a suitable format.
I think this catches a lot of people out, not just in Julia.
The default also does not play in Firefox, and FF tells you it is a bad encoding (the error message is deliberately wrong and WontFix), so you fiddle with the encoder options instead of target_pix_fmt
Here’s my code to create a Firefox compatible video from still images
firstimg = RGB{N0f8}.(load(imgnames[1]))
open_video_out("$(vfname).$(ftype)", firstimg, framerate=24, target_pix_fmt =VideoIO.AV_PIX_FMT_YUV420P) do writer
@showprogress "Encoding video frames.." for i in eachindex(imgnames)
img = RGB{N0f8}.(load(imgnames[i]))
write(writer, img)
end
end