intel / libvpl

Intel® Video Processing Library (Intel® VPL) API, dispatcher, and examples
https://intel.github.io/libvpl/
MIT License
262 stars 80 forks source link

Decode header using software implementation does not work with 1 frame encodes #102

Closed FallingSnow closed 11 months ago

FallingSnow commented 1 year ago

MFXVideoDECODE_DecodeHeader provides empty an mfxVideoParam when only provided 1 frame in the input bitstream.

You can try this with hevc files created with ffmpeg. Run the commands below then run a program with decode header function call on ffmpeg.hevc.

Source files: https://www.larmoire.info/jellyfish/

Works (2 frames in output):

ffmpeg -i /tmp/jellyfish-20-mbps-hd-hevc-10bit.mkv -ss 10 -frames 2 -c:v libx265 ffmpeg.hevc

Does not work (1 frame in output):

ffmpeg -i /tmp/jellyfish-20-mbps-hd-hevc-10bit.mkv -ss 10 -frames 1 -c:v libx265 ffmpeg.hevc
shepark commented 11 months ago

@FallingSnow Could you provide the information about ffmpeg you tested? Where did you get it? or Did you build it? If then, could you provide the link for the source code?

FallingSnow commented 11 months ago

Just tried it with the following version of ffmpeg, the issue still occurs.

ffmpeg version n6.0 Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 13.1.1 (GCC) 20230429
  configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libjxl --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librav1e --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-nvdec --enable-nvenc --enable-opencl --enable-opengl --enable-shared --enable-version3 --enable-vulkan
  libavutil      58.  2.100 / 58.  2.100
  libavcodec     60.  3.100 / 60.  3.100
  libavformat    60.  3.100 / 60.  3.100
  libavdevice    60.  1.100 / 60.  1.100
  libavfilter     9.  3.100 /  9.  3.100
  libswscale      7.  1.100 /  7.  1.100
  libswresample   4. 10.100 /  4. 10.100
  libpostproc    57.  1.100 / 57.  1.100

I'm using the arch linux ffmpeg package which pulls from https://git.ffmpeg.org/ffmpeg.git?signed#tag=${_tag}.

shepark commented 11 months ago

Thank you for the information. One more question, which platform do you use for testing?

FallingSnow commented 11 months ago

Arch Linux

$ uname -a
Linux ayrtonslaptop 6.4.3-arch1-1 #1 SMP PREEMPT_DYNAMIC Tue, 11 Jul 2023 05:13:39 +0000 x86_64 GNU/Linux

Let me know if you need any other information.


Edit: Here is the graphics adapter, but I'm not sure if that's related to decoding the header.

lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation CoffeeLake-H GT2 [UHD Graphics 630]
shepark commented 11 months ago

Thank you for the information. I checked your test internally and confirmed it's working. This is our configuration. $ ffmpeg 2>&1 | grep version ffmpeg version n6.0 Copyright (c) 2000-2023 the FFmpeg developers $ ldd `which ffmpeg` | grep libmfx libmfx.so.1 => /usr/lib/x86_64-linux-gnu/libmfx.so.1 (0x00007fd9e7791000)

It seems like ffmpeg version is same. I'd like to check the version of libmfx.so in your system. This libmfx.so is the main library for MediaSDK (legacy version of VPL) in CFL. Could you run 2nd command and find where the libmfx.so.1 is located? And then go there and run ls libmfx* and provide the result.

FallingSnow commented 11 months ago

Thanks for getting back to me. You are correct.

I tried testing with vpl-sample_decode and it does correctly decode the 1 frame file. I must be doing something wrong. Let me get back to you.

FallingSnow commented 11 months ago

I've discovered the issue. I guess setting the implementation type to software actually makes a difference.

Setting SW decoding fails to decode a 1 frame encoding. Setting HW decoding succeeds in decoding a 1 frame encoding.

I've confirmed these results in both my implementation and vpl-sample_decode. I'll update the issue title to reflect the issue accurately.

mav-intel commented 11 months ago

Hi, The software implementation has reached end-of-life and we have no plans to make additional updates. Thanks for your bug report.