Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation on codec_name should be clarified #364

Closed
BioTurboNick opened this issue Jun 4, 2022 · 2 comments · Fixed by #366
Closed

Documentation on codec_name should be clarified #364

BioTurboNick opened this issue Jun 4, 2022 · 2 comments · Fixed by #366

Comments

@BioTurboNick
Copy link
Contributor

BioTurboNick commented Jun 4, 2022

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.

@BioTurboNick BioTurboNick changed the title Documentation says codec_name option can be used to specify libx264rgb codec, but fails Documentation on codec_name should be clarified Jun 4, 2022
@IanButterworth
Copy link
Member

(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
Copy link
Contributor Author

I probably will :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants