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

Documentation on `codec_name` should be clarified #364

Closed BioTurboNick closed 2 years ago

BioTurboNick commented 2 years ago

https://juliaio.github.io/VideoIO.jl/stable/writing/ (see bottom on lossless)

Tried libx264rgb and libx265.

encoder_options = (crf=0, preset="ultrafast", codec_name = "libx264rgb")
VideoIO.save("video.mp4", eachframe(imgstack), framerate=30, encoder_options=encoder_options)

# error
Could not set class option codec_name to libx264rgb: got error -1414549496
Stacktrace:
error(::String)@error.jl:35
set_class_option(::VideoIO.NestedCStruct{VideoIO.libffmpeg.AVCodecContext}, ::Symbol, ::String, ::Int64)@avptr.jl:184
set_class_option@avptr.jl:183[inlined]
set_class_options(::VideoIO.NestedCStruct{VideoIO.libffmpeg.AVCodecContext}, ::NamedTuple{(:crf, :color_range, :preset, :codec_name), Tuple{Int64, Int64, String, String}})@avptr.jl:189
var"#VideoWriter#29"(::Nothing, ::Int64, ::Bool, ::NamedTuple{(), Tuple{}}, ::NamedTuple{(), Tuple{}}, ::NamedTuple{(:crf, :color_range, :preset, :codec_name), Tuple{Int64, Int64, String, String}}, ::NamedTuple{(), Tuple{}}, ::NamedTuple{(), Tuple{}}, ::Nothing, ::Int64, ::Nothing, ::Bool, ::NamedTuple{(), Tuple{}}, ::Nothing, ::Type{VideoIO.VideoWriter}, ::String, ::Type{UInt16}, ::Tuple{Int64, Int64})@encoding.jl:324
#VideoWriter#30@encoding.jl:379[inlined]
#open_video_out#31@encoding.jl:473[inlined]
var"#open_video_out#32"(::Base.Pairs{Symbol, Any, Tuple{Symbol, Symbol}, NamedTuple{(:framerate, :encoder_options), Tuple{Int64, NamedTuple{(:crf, :color_range, :preset, :codec_name), Tuple{Int64, Int64, String, String}}}}}, ::typeof(VideoIO.open_video_out), ::VideoIO.var"#34#35"{Base.Generator{Base.OneTo{Int64}, Base.var"#245#246"{Base.ReinterpretArray{UInt16, 3, ColorTypes.Gray{FixedPointNumbers.N0f16}, TiffImages.DenseTaggedImage{ColorTypes.Gray{FixedPointNumbers.N0f16}, 3, UInt32, Array{ColorTypes.Gray{FixedPointNumbers.N0f16}, 3}}, false}, Tuple{}, Tuple{Colon, Colon}}}}, ::String, ::SubArray{UInt16, 2, Base.ReinterpretArray{UInt16, 3, ColorTypes.Gray{FixedPointNumbers.N0f16}, TiffImages.DenseTaggedImage{ColorTypes.Gray{FixedPointNumbers.N0f16}, 3, UInt32, Array{ColorTypes.Gray{FixedPointNumbers.N0f16}, 3}}, false}, Tuple{Base.Slice{Base.OneTo{Int64}}, Base.Slice{Base.OneTo{Int64}}, Int64}, false})@encoding.jl:476
#save#33@encoding.jl:501[inlined]
top-level scope@[Local: 3](http://localhost:1234/edit?id=a2a47340-e414-11ec-18fe-7bff5e71591b#)[inlined]

EDIT: Apparently this is intended to be an argument to the main function, not to encoder_options. So that bit of documentation should be clarified.

IanButterworth commented 2 years ago

(Thanks for this any the other issues)

Encoder name is an arg in the docstring.

https://juliaio.github.io/VideoIO.jl/stable/writing/#VideoIO.open_video_out

Please feel free to submit PRs to fix these things if the wording isn't clear. Hopefully it's not much more work than opening issues

BioTurboNick commented 2 years ago

I probably will :-)