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

Missing file extension on `save` throws unhelpful error #370

Open IanButterworth opened 2 years ago

IanButterworth commented 2 years ago
julia> VideoIO.save(mktemp()[1], [rand(UInt8, 240,480) for _ in 1:10])
ERROR: Could not allocate AVFormatContext
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:33
 [2] output_AVFormatContextPtr
   @ ~/.julia/packages/VideoIO/hrriD/src/avptr.jl:149 [inlined]
 [3] VideoIO.VideoWriter(filename::String, ::Type{UInt8}, sz::Tuple{Int64, Int64}; codec_name::Nothing, framerate::Int64, scanline_major::Bool, container_options::NamedTuple{(), Tuple{}}, container_private_options::NamedTuple{(), Tuple{}}, encoder_options::NamedTuple{(:crf, :preset), Tuple{Int64, String}}, encoder_private_options::NamedTuple{(), Tuple{}}, swscale_options::NamedTuple{(), Tuple{}}, target_pix_fmt::Nothing, pix_fmt_loss_flags::Int64, input_colorspace_details::Nothing, allow_vio_gray_transform::Bool, sws_color_options::NamedTuple{(), Tuple{}}, thread_count::Nothing)
   @ VideoIO ~/.julia/packages/VideoIO/hrriD/src/encoding.jl:273
 [4] #VideoWriter#30
   @ ~/.julia/packages/VideoIO/hrriD/src/encoding.jl:369 [inlined]
 [5] #open_video_out#31
   @ ~/.julia/packages/VideoIO/hrriD/src/encoding.jl:463 [inlined]
 [6] open_video_out(f::VideoIO.var"#34#35"{Vector{Matrix{UInt8}}}, s::String, args::Matrix{UInt8}; kwargs::Base.Pairs{Symbol, Any, Tuple{Symbol, Symbol}, NamedTuple{(:framerate, :encoder_options), Tuple{Int64, NamedTuple{(:crf, :preset), Tuple{Int64, String}}}}})
   @ VideoIO ~/.julia/packages/VideoIO/hrriD/src/encoding.jl:467
 [7] #save#33
   @ ~/.julia/packages/VideoIO/hrriD/src/encoding.jl:492 [inlined]
julia> VideoIO.save(string(mktemp()[1], ".mp4"), [rand(UInt8, 240,480) for _ in 1:10])

julia> 

cc. @octogonapus