# VideoIO.jl can’t seem to open a .mkv video

**URL:** <https://discourse.julialang.org/t/videoio-jl-can-t-seem-to-open-a-mkv-video/83875>\
**Category:** General Usage\
**Tags:** video, videoio\
**Created:** [July 7, 2022, 5:33am UTC](https://discourse.julialang.org/t/videoio-jl-can-t-seem-to-open-a-mkv-video/83875 "2022-07-07T05:33:01Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hareruya](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hareruya/32/47536_2.png) [@Hareruya](https://discourse.julialang.org/u/Hareruya)\
**Post date:** [July 7, 2022, 5:33am UTC](https://discourse.julialang.org/t/videoio-jl-can-t-seem-to-open-a-mkv-video/83875/1 "2022-07-07T05:33:01Z")

</div>

Greetings.

I do image signal processing as a hobby, especially playing around with images taken from video. I used to take screenshots using MPV, but I started to wonder if it would not be better to take shots from within Julia using VideoIO.jl. I have no real experience using video processing tools, and I seem to have hit a wall.  
I have tried importing into Julia a .mkv video(here called “test.mkv”). It opens the file with no issue, but can’t open the video. This is the code I use:

```julia
using GLMakie, VideoIO, Images
io = VideoIO.open(“test.mkv”)
v = VideoIO.openvideo(io)

```

And this is the value of io:

```julia
io = AVInput(/Users/julianogarcia/Desktop/test.mkv, …), with
1 video stream(s)
1 audio stream(s)
5 data stream(s)
20 attachment stream(s)
)

```

However, when I try to actually open the video in v, I get an Unknown pixel format error with the following stacktrace:

> **Unknown pixel format**
> 
> 1. **error** (::String)@_error.jl:33_
> 2. **var"#VideoReader#18"** (::Bool, ::Nothing, ::Int64, ::Nothing, ::Bool, ::NamedTuple{(), Tuple{}}, ::NamedTuple{(), Tuple{}}, ::Int64, ::Type{VideoIO.VideoReader}, ::VideoIO.AVInput{String}, ::Int64)@_avio.jl:296_
> 3. **VideoIO.VideoReader** (::VideoIO.AVInput{String}, ::Int64)@_avio.jl:275_
> 4. **#openvideo#20** @_avio.jl:636_ [inlined]
> 5. **openvideo** (::VideoIO.AVInput{String})@_avio.jl:636_
> 6. **top-level scope** @_[Local: 1](http://localhost:1234/edit?id=99512b94-fd87-11ec-2d20-d1bce8c9c1e6#)_ [inlined]

Is there anything I am doing wrong here? Looking at the [VideoIO.jl page](https://juliaio.github.io/VideoIO.jl/stable/) I was able to find that I can specify the pixel format using ‘target\_format = VideoIO.AV\_PIX\_FMT\_\*’. However, when I try to check the available formats in VideoIO, there are only 4 available in the following dictionary(apologies for the screenshot, I am using Pluto):

 ![Screen Shot 2022-07-07 at 14.11.10](https://global.discourse-cdn.com/julialang/original/3X/c/5/c565d849b8e8bbdf865dc06c774b0e691d8ba1ba.png)

Which is a far cry from the [total of available formats in ffmpeg](https://ffmpeg.org/doxygen/4.1/pixfmt_8h.html#a9a8e335cf3be472042bc9f0cf80cd4c5).  
And none of the available 4 seem to work, returning the following stacktrace:

> **Unknown pixel format**
> 
> 1. **error** (::String)@_error.jl:33_
> 2. **var"#VideoReader#18"** (::Bool, ::Int32, ::Int64, ::Nothing, ::Bool, ::NamedTuple{(), Tuple{}}, ::NamedTuple{(), Tuple{}}, ::Int64, ::Type{VideoIO.VideoReader}, ::VideoIO.AVInput{String}, ::Int64)@_avio.jl:296_
> 3. **#openvideo#20** @_avio.jl:636_ [inlined]
> 4. **top-level scope** @_[Local: 1](http://localhost:1234/edit?id=99512b94-fd87-11ec-2d20-d1bce8c9c1e6#)_ [inlined]

My platform is MACOS, on a 2019 MacBookPro. My Julia version is as follows:

```julia
Julia Version 1.7.3
Commit 742b9abb4d (2022-05-06 12:58 UTC)
Platform Info:
OS: macOS (x86_64-apple-darwin21.4.0)
CPU: Intel(R) Core™ i7-9750H CPU @ 2.60GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-12.0.1 (ORCJIT, skylake)
Environment:
JULIA_REVISE_WORKER_ONLY = 1

```

I apologize if I overlooked something elementary in the process.

---

<div class="post-metadata">

**Author:** ![contradict](https://avatars.discourse-cdn.com/v4/letter/c/ac91a4/32.png) [@contradict](https://discourse.julialang.org/u/contradict)\
**Post date:** [July 7, 2022, 3:55pm UTC](https://discourse.julialang.org/t/videoio-jl-can-t-seem-to-open-a-mkv-video/83875/2 "2022-07-07T15:55:44Z")

</div>

That argument controls the decoded pixel format, that is the pixel format in the arrays returned from the call. I suspect the problem here is the input pixel format stored in the video file, which should be handled automatically but isn’t for some reason. Can you share the video file?

---

<div class="post-metadata">

**Author:** ![Hareruya](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hareruya/32/47536_2.png) [@Hareruya](https://discourse.julialang.org/u/Hareruya)\
**Post date:** [July 7, 2022, 4:23pm UTC](https://discourse.julialang.org/t/videoio-jl-can-t-seem-to-open-a-mkv-video/83875/3 "2022-07-07T16:23:29Z")

</div>

I think we can find the format from the output from ffmpeg, since VideoIO is also using it:

```julia
ffmpeg -i test.mkv
ffmpeg version 5.0.1 Copyright (c) 2000-2022 the FFmpeg developers
  built with Apple clang version 13.1.6 (clang-1316.0.21.2.5)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/5.0.1_3 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox
  libavutil 57. 17.100 / 57. 17.100
  libavcodec 59. 18.100 / 59. 18.100
  libavformat 59. 16.100 / 59. 16.100
  libavdevice 59. 4.100 / 59. 4.100
  libavfilter 8. 24.100 / 8. 24.100
  libswscale 6. 4.100 / 6. 4.100
  libswresample 4. 3.100 / 4. 3.100
  libpostproc 56. 3.100 / 56. 3.100
[libdav1d @ 0x7f79fa304800] libdav1d 1.0.0
Input #0, matroska,webm, from 'test.mkv':
  Metadata:
    ENCODER : Lavf58.76.100
  Duration: 00:23:40.06, start: -0.007000, bitrate: 2006 kb/s
  Chapters:
    Chapter #0:0: start 0.061000, end 40.835433
    Chapter #0:1: start 40.835433, end 140.801967
    Chapter #0:2: start 140.801967, end 616.644000
    Chapter #0:3: start 616.644000, end 1329.489467
    Chapter #0:4: start 1329.489467, end 1419.479367
  Stream #0:0(eng): Video: av1 (Main), yuv420p10le(tv), 1920x1080, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 1k tbn (default)
    Metadata:
      DURATION : 00:23:40.064000000
  Stream #0:1(eng): Audio: opus, 48000 Hz, stereo, fltp (default)
    Metadata:
      ENCODER : Lavc58.91.100 libopus
      DURATION : 00:23:40.061000000

```

The pixel format seems to be `AV_PIX_FMT_YUV420P10LE`, which is a supported format for ffmpeg given in [the pixfmt.h list](https://ffmpeg.org/doxygen/4.1/pixfmt_8h.html#a9a8e335cf3be472042bc9f0cf80cd4c5), but does not show up in the available formats for VideoIO, since it does not correspond to entries 77, 171, 2 or 8. It’s entry 64.

---

<div class="post-metadata">

**Author:** ![contradict](https://avatars.discourse-cdn.com/v4/letter/c/ac91a4/32.png) [@contradict](https://discourse.julialang.org/u/contradict)\
**Post date:** [July 7, 2022, 5:23pm UTC](https://discourse.julialang.org/t/videoio-jl-can-t-seem-to-open-a-mkv-video/83875/4 "2022-07-07T17:23:20Z")

</div>

I believe that is the list of supported output pixel formats, [this](https://github.com/JuliaIO/VideoIO.jl/blob/master/src/avio.jl#L344) should build an ffmpeg pipeline to transcode the pixel format to one of those (selected [here](https://github.com/JuliaIO/VideoIO.jl/blob/c29aeb01138a77eb098e34741721457dca19fca3/src/avframe_transfer.jl#L40)).

Looking at the stack trace, this line stands out:

[avio.jl:275](https://github.com/JuliaIO/VideoIO.jl/blob/master/src/avio.jl#L275)

```julia
    bad_px_type = transcode && target_format !== nothing && !is_pixel_type_supported(target_format)

```

The default value for `transcode` is true and `target_format` is `nothing`, so leaving those unchanged should never trigger the test for `is_pixel_type_supported`, which is the function throwing the error. Just to be sure you are using the most recent versions, what is the output (in a new julia session) of

```julia
# press ] to enter package mode and create a temporary environment
(@v1.7) pkg> activate --temp
  Activating new project at `/tmp/jl_z2sW4n`

# with only VideoIO and it's dependencies.
(jl_z2sW4n) pkg> add VideoIO

# press <Backspace> to return to REPL mode.
julia> using VideoIO

julia> ENV["JULIA_DEBUG"] = VideoIO

julia> io = VideoIO.open(“test.mkv”)

julia> v = VideoIO.openvideo(io)

```

---

<div class="post-metadata">

**Author:** ![Hareruya](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hareruya/32/47536_2.png) [@Hareruya](https://discourse.julialang.org/u/Hareruya)\
**Post date:** [July 7, 2022, 5:49pm UTC](https://discourse.julialang.org/t/videoio-jl-can-t-seem-to-open-a-mkv-video/83875/5 "2022-07-07T17:49:07Z")

</div>

Thank you very much for your help so far.  
I did try running it now and this is the output in the session:

```julia
ERROR: Unknown pixel format
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:33
 [2] VideoIO.VideoReader(avin::VideoIO.AVInput{String}, video_stream::Int64; transcode::Bool, target_format::Nothing, pix_fmt_loss_flags::Int64, target_colorspace_details::Nothing, allow_vio_gray_transform::Bool, swscale_options::NamedTuple{(), Tuple{}}, sws_color_options::NamedTuple{(), Tuple{}}, thread_count::Int64)
   @ VideoIO ~/.julia/packages/VideoIO/V24Bg/src/avio.jl:296
 [3] VideoIO.VideoReader(avin::VideoIO.AVInput{String}, video_stream::Int64) (repeats 2 times)
   @ VideoIO ~/.julia/packages/VideoIO/V24Bg/src/avio.jl:275
 [4] #openvideo#20
   @ ~/.julia/packages/VideoIO/V24Bg/src/avio.jl:636 [inlined]
 [5] openvideo(::VideoIO.AVInput{String})
   @ VideoIO ~/.julia/packages/VideoIO/V24Bg/src/avio.jl:636
 [6] top-level scope
   @ REPL[6]:1

```

---

<div class="post-metadata">

**Author:** ![contradict](https://avatars.discourse-cdn.com/v4/letter/c/ac91a4/32.png) [@contradict](https://discourse.julialang.org/u/contradict)\
**Post date:** [July 7, 2022, 7:00pm UTC](https://discourse.julialang.org/t/videoio-jl-can-t-seem-to-open-a-mkv-video/83875/6 "2022-07-07T19:00:29Z")

</div>

Huh, I expected more debug output. I’m not sure what to try next, I think that error is coming from FFMPEG. Hopefully someone more knowledgeable will chime in!

As a workaround, you could try specifying a different pixel format during recording.

---

<div class="post-metadata">

**Author:** ![Hareruya](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hareruya/32/47536_2.png) [@Hareruya](https://discourse.julialang.org/u/Hareruya)\
**Post date:** [July 7, 2022, 11:55pm UTC](https://discourse.julialang.org/t/videoio-jl-can-t-seem-to-open-a-mkv-video/83875/7 "2022-07-07T23:55:12Z")

</div>

Thank you for trying to help.  
Looking at [**avframe\_transfer.jl**](https://github.com/JuliaIO/VideoIO.jl/blob/master/src/avframe_transfer.jl), they define 4 different functions to read frames based on the 4 specified formats, so I think this might be the issue here.

---

<div class="post-metadata">

**Author:** ![contradict](https://avatars.discourse-cdn.com/v4/letter/c/ac91a4/32.png) [@contradict](https://discourse.julialang.org/u/contradict)\
**Post date:** [July 8, 2022, 7:57pm UTC](https://discourse.julialang.org/t/videoio-jl-can-t-seem-to-open-a-mkv-video/83875/8 "2022-07-08T19:57:45Z")

</div>

Here is a good one! My installed `ffmpeg` and the one used by VideoIO seem to have very different opinions about some files I created to test this. What does this command report for you:

```julia
julia> import Pkg; Pkg.add("FFMPEG_jll")

julia> using FFMPEG_jll

julia> run(`$(FFMPEG_jll.ffprobe()) test.mkv`);

```

You may have to use the full path to `test.mkv`

---

<div class="post-metadata">

**Author:** ![Hareruya](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hareruya/32/47536_2.png) [@Hareruya](https://discourse.julialang.org/u/Hareruya)\
**Post date:** [July 9, 2022, 3:01am UTC](https://discourse.julialang.org/t/videoio-jl-can-t-seem-to-open-a-mkv-video/83875/9 "2022-07-09T03:01:05Z")

</div>

Thank you for still trying to help.  
This is the output:

```julia
ffprobe version 4.4 Copyright (c) 2007-2021 the FFmpeg developers
  built with clang version 11.0.1 (/home/ec2-user/.julia/dev/BinaryBuilderBase/deps/downloads/llvm-project.git 43ff75f2c3feef64f9d73328230d34dac8832a91)
  configuration: --enable-cross-compile --cross-prefix=/opt/x86_64-apple-darwin14/bin/x86_64-apple-darwin14- --arch=x86_64 --target-os=darwin --cc=cc --cxx=c++ --dep-cc=cc --ar=ar --nm=nm --sysinclude=/workspace/destdir/include --pkg-config=/usr/bin/pkg-config --pkg-config-flags=--static --prefix=/workspace/destdir --sysroot=/opt/x86_64-apple-darwin14/x86_64-apple-darwin14/sys-root --extra-libs=-lpthread --enable-gpl --enable-version3 --enable-nonfree --disable-static --enable-shared --enable-pic --disable-debug --disable-doc --enable-avresample --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libx264 --enable-libx265 --enable-libvpx --enable-encoders --enable-decoders --enable-muxers --enable-demuxers --enable-parsers --enable-openssl --disable-schannel --extra-cflags=-I/workspace/destdir/include --extra-ldflags=-L/workspace/destdir/lib --objcc='cc -x objective-c'
  libavutil 56. 70.100 / 56. 70.100
  libavcodec 58.134.100 / 58.134.100
  libavformat 58. 76.100 / 58. 76.100
  libavdevice 58. 13.100 / 58. 13.100
  libavfilter 7.110.100 / 7.110.100
  libavresample 4. 0. 0 / 4. 0. 0
  libswscale 5. 9.100 / 5. 9.100
  libswresample 3. 9.100 / 3. 9.100
  libpostproc 55. 9.100 / 55. 9.100
[av1 @ 0x7f95f4814c00] Your platform doesn't suppport hardware accelerated AV1 decoding.
[av1 @ 0x7f95f4814c00] Failed to get pixel format.
[av1 @ 0x7f95f4814c00] Missing Sequence Header.
    Last message repeated 54 times
[av1 @ 0x7f95f4814c00] video_get_buffer: image parameters invalid
[av1 @ 0x7f95f4814c00] get_buffer() failed
[av1 @ 0x7f95f4814c00] thread_get_buffer() failed
[av1 @ 0x7f95f4814c00] Failed to allocate space for current frame.
[av1 @ 0x7f95f4814c00] Get current frame error
[av1 @ 0x7f95f4814c00] video_get_buffer: image parameters invalid
[av1 @ 0x7f95f4814c00] get_buffer() failed
[av1 @ 0x7f95f4814c00] thread_get_buffer() failed
[av1 @ 0x7f95f4814c00] Failed to allocate space for current frame.
[av1 @ 0x7f95f4814c00] Get current frame error
[av1 @ 0x7f95f4814c00] Failed to get reference frame.
[av1 @ 0x7f95f4814c00] video_get_buffer: image parameters invalid
[av1 @ 0x7f95f4814c00] get_buffer() failed
[av1 @ 0x7f95f4814c00] thread_get_buffer() failed
[av1 @ 0x7f95f4814c00] Failed to allocate space for current frame.
[av1 @ 0x7f95f4814c00] Get current frame error
[av1 @ 0x7f95f4814c00] Failed to get reference frame.
[av1 @ 0x7f95f4814c00] video_get_buffer: image parameters invalid
[av1 @ 0x7f95f4814c00] get_buffer() failed
[av1 @ 0x7f95f4814c00] thread_get_buffer() failed
[av1 @ 0x7f95f4814c00] Failed to allocate space for current frame.
[av1 @ 0x7f95f4814c00] Get current frame error
[av1 @ 0x7f95f4814c00] Failed to get reference frame.
[av1 @ 0x7f95f4814c00] video_get_buffer: image parameters invalid
[av1 @ 0x7f95f4814c00] get_buffer() failed
[av1 @ 0x7f95f4814c00] thread_get_buffer() failed
[av1 @ 0x7f95f4814c00] Failed to allocate space for current frame.
[av1 @ 0x7f95f4814c00] Get current frame error
[av1 @ 0x7f95f4814c00] Failed to get reference frame.
[av1 @ 0x7f95f4814c00] video_get_buffer: image parameters invalid
[av1 @ 0x7f95f4814c00] get_buffer() failed
[av1 @ 0x7f95f4814c00] thread_get_buffer() failed
[av1 @ 0x7f95f4814c00] Failed to allocate space for current frame.
[av1 @ 0x7f95f4814c00] Get current frame error
[av1 @ 0x7f95f4814c00] Failed to get reference frame.
[av1 @ 0x7f95f4814c00] video_get_buffer: image parameters invalid
[av1 @ 0x7f95f4814c00] get_buffer() failed
[av1 @ 0x7f95f4814c00] thread_get_buffer() failed
[av1 @ 0x7f95f4814c00] Failed to allocate space for current frame.
[av1 @ 0x7f95f4814c00] Get current frame error
[av1 @ 0x7f95f4814c00] Failed to get reference frame.
[av1 @ 0x7f95f4814c00] video_get_buffer: image parameters invalid
[av1 @ 0x7f95f4814c00] get_buffer() failed
[av1 @ 0x7f95f4814c00] thread_get_buffer() failed
[av1 @ 0x7f95f4814c00] Failed to allocate space for current frame.
[av1 @ 0x7f95f4814c00] Get current frame error
[av1 @ 0x7f95f4814c00] Failed to get reference frame.
[av1 @ 0x7f95f4814c00] video_get_buffer: image parameters invalid
[av1 @ 0x7f95f4814c00] get_buffer() failed
[av1 @ 0x7f95f4814c00] thread_get_buffer() failed
[av1 @ 0x7f95f4814c00] Failed to allocate space for current frame.
[av1 @ 0x7f95f4814c00] Get current frame error
[av1 @ 0x7f95f4814c00] Failed to get reference frame.
[av1 @ 0x7f95f4814c00] video_get_buffer: image parameters invalid
[av1 @ 0x7f95f4814c00] get_buffer() failed
[av1 @ 0x7f95f4814c00] thread_get_buffer() failed
[av1 @ 0x7f95f4814c00] Failed to allocate space for current frame.
[av1 @ 0x7f95f4814c00] Get current frame error
[av1 @ 0x7f95f4814c00] Failed to get reference frame.
[av1 @ 0x7f95f4814c00] video_get_buffer: image parameters invalid
[av1 @ 0x7f95f4814c00] get_buffer() failed
[av1 @ 0x7f95f4814c00] thread_get_buffer() failed
[av1 @ 0x7f95f4814c00] Failed to allocate space for current frame.
[av1 @ 0x7f95f4814c00] Get current frame error
[av1 @ 0x7f95f4814c00] Failed to get reference frame.
[av1 @ 0x7f95f4814c00] video_get_buffer: image parameters invalid
[av1 @ 0x7f95f4814c00] get_buffer() failed
[av1 @ 0x7f95f4814c00] thread_get_buffer() failed
[av1 @ 0x7f95f4814c00] Failed to allocate space for current frame.
[av1 @ 0x7f95f4814c00] Get current frame error
[av1 @ 0x7f95f4814c00] Failed to get reference frame.
[av1 @ 0x7f95f4814c00] video_get_buffer: image parameters invalid
[av1 @ 0x7f95f4814c00] get_buffer() failed
[av1 @ 0x7f95f4814c00] thread_get_buffer() failed
[av1 @ 0x7f95f4814c00] Failed to allocate space for current frame.
[av1 @ 0x7f95f4814c00] Get current frame error
[av1 @ 0x7f95f4814c00] video_get_buffer: image parameters invalid
[av1 @ 0x7f95f4814c00] get_buffer() failed
[av1 @ 0x7f95f4814c00] thread_get_buffer() failed
[av1 @ 0x7f95f4814c00] Failed to allocate space for current frame.
[av1 @ 0x7f95f4814c00] Get current frame error
[av1 @ 0x7f95f4814c00] Failed to get reference frame.
[av1 @ 0x7f95f4814c00] video_get_buffer: image parameters invalid
[av1 @ 0x7f95f4814c00] get_buffer() failed
[av1 @ 0x7f95f4814c00] thread_get_buffer() failed
[av1 @ 0x7f95f4814c00] Failed to allocate space for current frame.
[av1 @ 0x7f95f4814c00] Get current frame error
[av1 @ 0x7f95f4814c00] video_get_buffer: image parameters invalid
[av1 @ 0x7f95f4814c00] get_buffer() failed
[av1 @ 0x7f95f4814c00] thread_get_buffer() failed
[av1 @ 0x7f95f4814c00] Failed to allocate space for current frame.
[av1 @ 0x7f95f4814c00] Get current frame error
[av1 @ 0x7f95f4814c00] video_get_buffer: image parameters invalid
[av1 @ 0x7f95f4814c00] get_buffer() failed
[av1 @ 0x7f95f4814c00] thread_get_buffer() failed
[av1 @ 0x7f95f4814c00] Failed to allocate space for current frame.
[av1 @ 0x7f95f4814c00] Get current frame error
[av1 @ 0x7f95f4814c00] video_get_buffer: image parameters invalid
[av1 @ 0x7f95f4814c00] get_buffer() failed
[av1 @ 0x7f95f4814c00] thread_get_buffer() failed
[av1 @ 0x7f95f4814c00] Failed to allocate space for current frame.
[av1 @ 0x7f95f4814c00] Get current frame error
[av1 @ 0x7f95f4814c00] Failed to get reference frame.
[av1 @ 0x7f95f4814c00] video_get_buffer: image parameters invalid
[av1 @ 0x7f95f4814c00] get_buffer() failed
[av1 @ 0x7f95f4814c00] thread_get_buffer() failed
[av1 @ 0x7f95f4814c00] Failed to allocate space for current frame.
[av1 @ 0x7f95f4814c00] Get current frame error
[av1 @ 0x7f95f4814c00] Failed to get reference frame.
[av1 @ 0x7f95f4814c00] video_get_buffer: image parameters invalid
[av1 @ 0x7f95f4814c00] get_buffer() failed
[av1 @ 0x7f95f4814c00] thread_get_buffer() failed
[av1 @ 0x7f95f4814c00] Failed to allocate space for current frame.
[av1 @ 0x7f95f4814c00] Get current frame error
[av1 @ 0x7f95f4814c00] Failed to get reference frame.
[av1 @ 0x7f95f4814c00] video_get_buffer: image parameters invalid
[av1 @ 0x7f95f4814c00] get_buffer() failed
[av1 @ 0x7f95f4814c00] thread_get_buffer() failed
[av1 @ 0x7f95f4814c00] Failed to allocate space for current frame.
[av1 @ 0x7f95f4814c00] Get current frame error
[av1 @ 0x7f95f4814c00] video_get_buffer: image parameters invalid
[av1 @ 0x7f95f4814c00] get_buffer() failed
[av1 @ 0x7f95f4814c00] thread_get_buffer() failed
[av1 @ 0x7f95f4814c00] Failed to allocate space for current frame.
[av1 @ 0x7f95f4814c00] Get current frame error
[av1 @ 0x7f95f4814c00] Failed to get reference frame.
[av1 @ 0x7f95f4814c00] video_get_buffer: image parameters invalid
[av1 @ 0x7f95f4814c00] get_buffer() failed
[av1 @ 0x7f95f4814c00] thread_get_buffer() failed
[av1 @ 0x7f95f4814c00] Failed to allocate space for current frame.
[av1 @ 0x7f95f4814c00] Get current frame error
[av1 @ 0x7f95f4814c00] Failed to get reference frame.
[av1 @ 0x7f95f4814c00] video_get_buffer: image parameters invalid
[av1 @ 0x7f95f4814c00] get_buffer() failed
[av1 @ 0x7f95f4814c00] thread_get_buffer() failed
[av1 @ 0x7f95f4814c00] Failed to allocate space for current frame.
[av1 @ 0x7f95f4814c00] Get current frame error
[av1 @ 0x7f95f4814c00] Failed to get reference frame.
[av1 @ 0x7f95f4814c00] video_get_buffer: image parameters invalid
[av1 @ 0x7f95f4814c00] get_buffer() failed
[av1 @ 0x7f95f4814c00] thread_get_buffer() failed
[av1 @ 0x7f95f4814c00] Failed to allocate space for current frame.
[av1 @ 0x7f95f4814c00] Get current frame error
[av1 @ 0x7f95f4814c00] Failed to get reference frame.
[av1 @ 0x7f95f4814c00] video_get_buffer: image parameters invalid
[av1 @ 0x7f95f4814c00] get_buffer() failed
[av1 @ 0x7f95f4814c00] thread_get_buffer() failed
[av1 @ 0x7f95f4814c00] Failed to allocate space for current frame.
[av1 @ 0x7f95f4814c00] Get current frame error
[av1 @ 0x7f95f4814c00] Failed to get reference frame.
[av1 @ 0x7f95f4814c00] video_get_buffer: image parameters invalid
[av1 @ 0x7f95f4814c00] get_buffer() failed
[av1 @ 0x7f95f4814c00] thread_get_buffer() failed
[av1 @ 0x7f95f4814c00] Failed to allocate space for current frame.
[av1 @ 0x7f95f4814c00] Get current frame error
[av1 @ 0x7f95f4814c00] Failed to get reference frame.
[av1 @ 0x7f95f4814c00] video_get_buffer: image parameters invalid
[av1 @ 0x7f95f4814c00] get_buffer() failed
[av1 @ 0x7f95f4814c00] thread_get_buffer() failed
[av1 @ 0x7f95f4814c00] Failed to allocate space for current frame.
[av1 @ 0x7f95f4814c00] Get current frame error
[av1 @ 0x7f95f4814c00] Failed to get reference frame.
[av1 @ 0x7f95f4814c00] video_get_buffer: image parameters invalid
[av1 @ 0x7f95f4814c00] get_buffer() failed
[av1 @ 0x7f95f4814c00] thread_get_buffer() failed
[av1 @ 0x7f95f4814c00] Failed to allocate space for current frame.
[av1 @ 0x7f95f4814c00] Get current frame error
[av1 @ 0x7f95f4814c00] Failed to get reference frame.
[av1 @ 0x7f95f4814c00] video_get_buffer: image parameters invalid
[av1 @ 0x7f95f4814c00] get_buffer() failed
[av1 @ 0x7f95f4814c00] thread_get_buffer() failed
[av1 @ 0x7f95f4814c00] Failed to allocate space for current frame.
[av1 @ 0x7f95f4814c00] Get current frame error
[av1 @ 0x7f95f4814c00] Failed to get reference frame.
[av1 @ 0x7f95f4814c00] video_get_buffer: image parameters invalid
[av1 @ 0x7f95f4814c00] get_buffer() failed
[av1 @ 0x7f95f4814c00] thread_get_buffer() failed
[av1 @ 0x7f95f4814c00] Failed to allocate space for current frame.
[av1 @ 0x7f95f4814c00] Get current frame error
[av1 @ 0x7f95f4814c00] Failed to get reference frame.
[av1 @ 0x7f95f4814c00] video_get_buffer: image parameters invalid
[av1 @ 0x7f95f4814c00] get_buffer() failed
[av1 @ 0x7f95f4814c00] thread_get_buffer() failed
[av1 @ 0x7f95f4814c00] Failed to allocate space for current frame.
[av1 @ 0x7f95f4814c00] Get current frame error
[av1 @ 0x7f95f4814c00] Failed to get reference frame.
[av1 @ 0x7f95f4814c00] video_get_buffer: image parameters invalid
[av1 @ 0x7f95f4814c00] get_buffer() failed
[av1 @ 0x7f95f4814c00] thread_get_buffer() failed
[av1 @ 0x7f95f4814c00] Failed to allocate space for current frame.
[av1 @ 0x7f95f4814c00] Get current frame error
[av1 @ 0x7f95f4814c00] video_get_buffer: image parameters invalid
[av1 @ 0x7f95f4814c00] get_buffer() failed
[av1 @ 0x7f95f4814c00] thread_get_buffer() failed
[av1 @ 0x7f95f4814c00] Failed to allocate space for current frame.
[av1 @ 0x7f95f4814c00] Get current frame error
[av1 @ 0x7f95f4814c00] Failed to get reference frame.
[av1 @ 0x7f95f4814c00] video_get_buffer: image parameters invalid
[av1 @ 0x7f95f4814c00] get_buffer() failed
[av1 @ 0x7f95f4814c00] thread_get_buffer() failed
[av1 @ 0x7f95f4814c00] Failed to allocate space for current frame.
[av1 @ 0x7f95f4814c00] Get current frame error
[av1 @ 0x7f95f4814c00] Failed to get reference frame.
[av1 @ 0x7f95f4814c00] video_get_buffer: image parameters invalid
[av1 @ 0x7f95f4814c00] get_buffer() failed
[av1 @ 0x7f95f4814c00] thread_get_buffer() failed
[av1 @ 0x7f95f4814c00] Failed to allocate space for current frame.
[av1 @ 0x7f95f4814c00] Get current frame error
[matroska,webm @ 0x7f95f4808200] decoding for stream 0 failed
[matroska,webm @ 0x7f95f4808200] Could not find codec parameters for stream 0 (Video: av1 (Main), none(tv), 1920x1080 [SAR 1:1 DAR 16:9]): unspecified pixel format
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options

```

EDIT: I noticed that the version of ffmpeg used in FFMPEG\_jll and FFMPEG.jl are older versions than the one I am using. They also don’t identify the pixel format. Notice the “none(tv)”.  
The ffmpeg version I can call from the command line(Homebrew version) is more recent(5.0.1), and it identifies the pixel format no problem:

```julia
ffprobe version 5.0.1 Copyright (c) 2007-2022 the FFmpeg developers
  built with Apple clang version 13.1.6 (clang-1316.0.21.2.5)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/5.0.1_3 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox
  libavutil 57. 17.100 / 57. 17.100
  libavcodec 59. 18.100 / 59. 18.100
  libavformat 59. 16.100 / 59. 16.100
  libavdevice 59. 4.100 / 59. 4.100
  libavfilter 8. 24.100 / 8. 24.100
  libswscale 6. 4.100 / 6. 4.100
  libswresample 4. 3.100 / 4. 3.100
  libpostproc 56. 3.100 / 56. 3.100
[libdav1d @ 0x7fc11f805b40] libdav1d 1.0.0
Input #0, matroska,webm, from 'test.mkv':
  Metadata:
    ENCODER : Lavf58.76.100
  Duration: 00:23:40.06, start: -0.007000, bitrate: 2006 kb/s
  Chapters:
    Chapter #0:0: start 0.061000, end 40.835433
    Chapter #0:1: start 40.835433, end 140.801967
    Chapter #0:2: start 140.801967, end 616.644000
    Chapter #0:3: start 616.644000, end 1329.489467
    Chapter #0:4: start 1329.489467, end 1419.479367
  Stream #0:0(eng): Video: av1 (Main), yuv420p10le(tv), 1920x1080, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 1k tbn (default)

```

Notice the “yuv420p10le(tv)”.

---

<div class="post-metadata">

**Author:** ![contradict](https://avatars.discourse-cdn.com/v4/letter/c/ac91a4/32.png) [@contradict](https://discourse.julialang.org/u/contradict)\
**Post date:** [July 10, 2022, 12:23am UTC](https://discourse.julialang.org/t/videoio-jl-can-t-seem-to-open-a-mkv-video/83875/10 "2022-07-10T00:23:29Z")

</div>

Hurray, that is the same behavior I see! I think the problem is that FFMPEG\_jll is built without --enable-libaom. The version I get in Ubuntu and the version you are using from Homebrew both the include that library for av1 decoding. I’m not sure why it was left out, but at least that is something concrete to investigate.

---

<div class="post-metadata">

**Author:** ![ianshmean](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ianshmean/32/216042_2.png) [@ianshmean](https://discourse.julialang.org/u/ianshmean)\
**Post date:** [July 11, 2022, 3:08am UTC](https://discourse.julialang.org/t/videoio-jl-can-t-seem-to-open-a-mkv-video/83875/11 "2022-07-11T03:08:59Z")

</div>

It would be good to open this as an issue on VideoIO. I think it’s clear that there’s a gap in support

---

<div class="post-metadata">

**Author:** ![contradict](https://avatars.discourse-cdn.com/v4/letter/c/ac91a4/32.png) [@contradict](https://discourse.julialang.org/u/contradict)\
**Post date:** [July 11, 2022, 5:38am UTC](https://discourse.julialang.org/t/videoio-jl-can-t-seem-to-open-a-mkv-video/83875/12 "2022-07-11T05:38:21Z")

</div>

Issue opened: [VideoIO can't open some AV1 encoded mkv files · Issue #373 · JuliaIO/VideoIO.jl · GitHub](https://github.com/JuliaIO/VideoIO.jl/issues/373)

---

<div class="post-metadata">

**Author:** ![contradict](https://avatars.discourse-cdn.com/v4/letter/c/ac91a4/32.png) [@contradict](https://discourse.julialang.org/u/contradict)\
**Post date:** [July 11, 2022, 11:55pm UTC](https://discourse.julialang.org/t/videoio-jl-can-t-seem-to-open-a-mkv-video/83875/13 "2022-07-11T23:55:43Z")

</div>

A new version of FFMPEG\_jll (4.4.2) has been released with AV1 support. Updating your packages should get the new version, the commands here now succeed on my test video.

---

<div class="post-metadata">

**Author:** ![Hareruya](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hareruya/32/47536_2.png) [@Hareruya](https://discourse.julialang.org/u/Hareruya)\
**Post date:** [July 12, 2022, 6:53am UTC](https://discourse.julialang.org/t/videoio-jl-can-t-seem-to-open-a-mkv-video/83875/14 "2022-07-12T06:53:53Z")

</div>

On mine, the problem persisted even after updating. Then I uninstalled FFMPEG\_jll and Video IO, then reinstalled them and now it does indeed work! I thought that might be relevant to say if anyone else has a similar issue.  
I’ll consider this solved, then!  
EDIT: I also get this warning, but it can actually read the video fine:

```julia
WARNING: using libffmpeg.##meta#62 in module VideoIO conflicts with an existing identifier.

```
