Skip to content

Creating a video from makie png files? #440

@rkube

Description

@rkube

Hi,
I'm trying to create a video from png files that I write with Makie.
the files are of type

❯ file output/frame_00122.png
output/frame_00122.png: PNG image data, 2400 x 1600, 8-bit/color RGBA, non-interlaced

When I try to create a video I get an ArgumentError that the array is not yet supported:

julia> open_video_out("video.mp4", load(joinpath("output", first(imgnames))), framerate=24) do writer
           for i in eachindex(imgnames)
               img = load(joinpath("output", imgnames[i]))
               write(writer, img)
           end
       end
ERROR: ArgumentError: Encoding arrays with eltype ColorTypes.RGBA{FixedPointNumbers.N0f8} not yet supported
Stacktrace:
 [1] VideoIO.VideoWriter(filename::String, ::Type{…}, sz::Tuple{…}; codec_name::Nothing, framerate::Int64, scanline_major::Bool, container_options::@NamedTuple{}, container_private_options::@NamedTuple{}, encoder_options::@NamedTuple{}, encoder_private_options::@NamedTuple{}, swscale_options::@NamedTuple{}, target_pix_fmt::Nothing, pix_fmt_loss_flags::Int64, input_colorspace_details::Nothing, allow_vio_gray_transform::Bool, sws_color_options::@NamedTuple{}, thread_count::Nothing)
   @ VideoIO ~/.julia/packages/VideoIO/bGXs5/src/encoding.jl:265
 [2] VideoWriter
   @ ~/.julia/packages/VideoIO/bGXs5/src/encoding.jl:234 [inlined]
 [3] VideoWriter
   @ ~/.julia/packages/VideoIO/bGXs5/src/encoding.jl:390 [inlined]
 [4] open_video_out
   @ ~/.julia/packages/VideoIO/bGXs5/src/encoding.jl:484 [inlined]
 [5] open_video_out(f::var"#29#30", s::String, args::Matrix{ColorTypes.RGBA{FixedPointNumbers.N0f8}}; kwargs::@Kwargs{framerate::Int64})
   @ VideoIO ~/.julia/packages/VideoIO/bGXs5/src/encoding.jl:487
 [6] top-level scope
   @ REPL[30]:1
Some type information was truncated. Use `show(err)` to see complete types.

Is there a way I can save the png file in a compatible format?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions