JuliaIO / VideoIO.jl

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

UndefVarError bits_per_pixel when transforming to gray during decoding #313

Closed Octogonapus closed 2 years ago

Octogonapus commented 3 years ago

When opening a raw Gray video in Gray color space, the Gray transform block of VideoReader results in an UndefVarError:

ERROR: LoadError: UndefVarError: bits_per_pixel not defined
Stacktrace:
 [1] VideoIO.VideoReader(avin::VideoIO.AVInput{String}, video_stream::Int64; transcode::Bool, target_format::Int32, pix_fmt_loss_flags::Int64, target_colorspace_details::Nothing, allow_vio_gray_transform::Bool, swscale_options::NamedTuple{(), Tuple{}}, sws_color_options::NamedTuple{(), Tuple{}})
   @ VideoIO ~/.julia/packages/VideoIO/B6VOI/src/avio.jl:311
 [2] #VideoReader#19
   @ ~/.julia/packages/VideoIO/B6VOI/src/avio.jl:339 [inlined]
 [3] #openvideo#20
   @ ~/.julia/packages/VideoIO/B6VOI/src/avio.jl:588 [inlined]

The video is opened in this way:

VideoIO.openvideo(video_path, target_format = VideoIO.AV_PIX_FMT_GRAY8)

Video description from ffmpeg:

Input #0, avi, from 'video.avi':
  Metadata:
    encoder         : Lavf54.35.100
  Duration: 00:00:26.52, start: 0.000000, bitrate: 629158 kb/s
    Stream #0:0: Video: rawvideo (Y800 / 0x30303859), gray, 1280x1024, 629541 kb/s, 60 fps, 60 tbr, 60 tbn, 60 tbc

I am using VideoIO v0.9.1 and Julia v1.6.0.