JuliaIO / VideoIO.jl

Reading and writing of video files in Julia via ffmpeg
https://juliaio.github.io/VideoIO.jl/stable
Other
125 stars 53 forks source link

Writing videos doesn't work correctly on Mac M1 Monterey #361

Open davidalencia opened 2 years ago

davidalencia commented 2 years ago

When I write a video with RGB{N0f8} the video isn't viewable by any video player. I am running julia with a mac M1 Monterey

Julia Version 1.7.2
Commit bf53498635 (2022-02-06 15:21 UTC)
Platform Info:
  OS: macOS (arm64-apple-darwin21.2.0)
  CPU: Apple M1
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, cyclone)

This is the minimal code to create a falling video

using VideoIO
framestack = map(x->rand(RGB{N0f8}, 100, 100), 1:100) #vector of 2D arrays

encoder_options = (crf=23, preset="medium")
framerate=24
open_video_out("video.mp4", framestack[1], framerate=framerate, encoder_options=encoder_options) do writer
    for frame in framestack
        write(writer, frame)
    end
end

This appears when you try to open the video. Is spanish for: "The document couldn't be open"

image
giordano commented 2 years ago

Works for me with VLC, sounds like a problem with QuickTime? Side note, your code isn't reproducible, it's missing imports of ColorTypes and FixedPointNumbers.

bjarthur commented 8 months ago

i'm able to open videos in quicktime if i pass codec_name="libx264", target_pix_fmt=VideoIO.AV_PIX_FMT_YUV422P into open_video_out. should consider making this the default on macs since quicktime is the default video player and is otherwise broken.