vvdec: Decoding fails an a valid file?

AV: 00:09:32 / unknown (100%) A-V:  0.000 Dropped: 8321
[ffmpeg/video] libvvdec: error in vvdec::decode - ret:-11 - (possibly recoverable) exception Exception occured: 
[ffmpeg/video] ERROR: In function "void vvdec::DecSlice::parseSlice(vvdec::Slice*, vvdec::InputBitstream*, int)" in /tmp/vvdec-2.1.3/source/Lib/DecoderLib/DecSlice.cpp:172: Expecting a terminating bit
[ffmpeg/video] ERROR CONDITION: !binVal
Error while decoding frame!
[ffmpeg/video] libvvdec: error in vvdec::decode - ret:-11 - restart required, please reinit. Exception occured: 
[ffmpeg/video] ERROR: In function "void vvdec::DecSlice::parseSlice(vvdec::Slice*, vvdec::InputBitstream*, int)" in /tmp/vvdec-2.1.3/source/Lib/DecoderLib/DecSlice.cpp:172: Expecting a terminating bit
[ffmpeg/video] ERROR CONDITION: !binVal
Error while decoding frame!
[ffmpeg/video] libvvdec: error in vvdec::decode - ret:-11 - restart required, please reinit. Exception occured: 
[ffmpeg/video] ERROR: In function "void vvdec::DecSlice::parseSlice(vvdec::Slice*, vvdec::InputBitstream*, int)" in /tmp/vvdec-2.1.3/source/Lib/DecoderLib/DecSlice.cpp:172: Expecting a terminating bit
[ffmpeg/video] ERROR CONDITION: !binVal
Error while decoding frame!
[ffmpeg/video] libvvdec: error in vvdec::decode - ret:-11 - restart required, please reinit. Exception occured: 
[ffmpeg/video] ERROR: In function "void vvdec::DecSlice::parseSlice(vvdec::Slice*, vvdec::InputBitstream*, int)" in /tmp/vvdec-2.1.3/source/Lib/DecoderLib/DecSlice.cpp:172: Expecting a terminating bit
[ffmpeg/video] ERROR CONDITION: !binVal
Error while decoding frame!
[ffmpeg/video] libvvdec: error in vvdec::decode - ret:-11 - restart required, please reinit. Exception occured: 
[ffmpeg/video] ERROR: In function "void vvdec::DecSlice::parseSlice(vvdec::Slice*, vvdec::InputBitstream*, int)" in /tmp/vvdec-2.1.3/source/Lib/DecoderLib/DecSlice.cpp:172: Expecting a terminating bit
[ffmpeg/video] ERROR CONDITION: !binVal
Error while decoding frame!
[ffmpeg/video] libvvdec: error in vvdec::decode - ret:-11 - restart required, please reinit. Exception occured: 
[ffmpeg/video] ERROR: In function "void vvdec::DecSlice::parseSlice(vvdec::Slice*, vvdec::InputBitstream*, int)" in /tmp/vvdec-2.1.3/source/Lib/DecoderLib/DecSlice.cpp:172: Expecting a terminating bit
[ffmpeg/video] ERROR CONDITION: !binVal
Error while decoding frame!
[ffmpeg/video] libvvdec: error in vvdec::decode - ret:-11 - restart required, please reinit. Exception occured: 
[ffmpeg/video] ERROR: In function "void vvdec::DecSlice::parseSlice(vvdec::Slice*, vvdec::InputBitstream*, int)" in /tmp/vvdec-2.1.3/source/Lib/DecoderLib/DecSlice.cpp:172: Expecting a terminating bit
[ffmpeg/video] ERROR CONDITION: !binVal
Error while decoding frame!
[ffmpeg/video] libvvdec: error in vvdec::decode - ret:-11 - restart required, please reinit. Exception occured: 
[ffmpeg/video] ERROR: In function "void vvdec::DecSlice::parseSlice(vvdec::Slice*, vvdec::InputBitstream*, int)" in /tmp/vvdec-2.1.3/source/Lib/DecoderLib/DecSlice.cpp:172: Expecting a terminating bit
[ffmpeg/video] ERROR CONDITION: !binVal
Error while decoding frame!
[ffmpeg/video] libvvdec: error in vvdec::decode - ret:-11 - restart required, please reinit. Exception occured: 
[ffmpeg/video] ERROR: In function "void vvdec::DecSlice::parseSlice(vvdec::Slice*, vvdec::InputBitstream*, int)" in /tmp/vvdec-2.1.3/source/Lib/DecoderLib/DecSlice.cpp:172: Expecting a terminating bit
[ffmpeg/video] ERROR CONDITION: !binVal
Error while decoding frame!
[ffmpeg/video] libvvdec: error in vvdec::decode - ret:-11 - restart required, please reinit. Exception occured: 
[ffmpeg/video] ERROR: In function "void vvdec::DecSlice::parseSlice(vvdec::Slice*, vvdec::InputBitstream*, int)" in /tmp/vvdec-2.1.3/source/Lib/DecoderLib/DecSlice.cpp:172: Expecting a terminating bit
[ffmpeg/video] ERROR CONDITION: !binVal
Error while decoding frame!
[ffmpeg/video] libvvdec: error in vvdec::decode - ret:-11 - restart required, please reinit. Exception occured: 
[ffmpeg/video] ERROR: In function "void vvdec::DecSlice::parseSlice(vvdec::Slice*, vvdec::InputBitstream*, int)" in /tmp/vvdec-2.1.3/source/Lib/DecoderLib/DecSlice.cpp:172: Expecting a terminating bit
[ffmpeg/video] ERROR CONDITION: !binVal
Error while decoding frame!
[ffmpeg/video] libvvdec: error in vvdec::decode - ret:-11 - restart required, please reinit. Exception occured: 
[ffmpeg/video] ERROR: In function "void vvdec::DecSlice::parseSlice(vvdec::Slice*, vvdec::InputBitstream*, int)" in /tmp/vvdec-2.1.3/source/Lib/DecoderLib/DecSlice.cpp:172: Expecting a terminating bit
[ffmpeg/video] ERROR CONDITION: !binVal
Error while decoding frame!
[ffmpeg/video] libvvdec: error in vvdec::decode - ret:-11 - restart required, please reinit. Exception occured: 
[ffmpeg/video] ERROR: In function "void vvdec::DecSlice::parseSlice(vvdec::Slice*, vvdec::InputBitstream*, int)" in /tmp/vvdec-2.1.3/source/Lib/DecoderLib/DecSlice.cpp:172: Expecting a terminating bit
[ffmpeg/video] ERROR CONDITION: !binVal
Error while decoding frame!
[ffmpeg/video] libvvdec: error in vvdec::decode - ret:-11 - restart required, please reinit. Exception occured: 
[ffmpeg/video] ERROR: In function "void vvdec::DecSlice::parseSlice(vvdec::Slice*, vvdec::InputBitstream*, int)" in /tmp/vvdec-2.1.3/source/Lib/DecoderLib/DecSlice.cpp:172: Expecting a terminating bit
[ffmpeg/video] ERROR CONDITION: !binVal
Error while decoding frame!
[ffmpeg/video] libvvdec: error in vvdec::decode - ret:-11 - restart required, please reinit. Exception occured: 
[ffmpeg/video] ERROR: In function "void vvdec::DecSlice::parseSlice(vvdec::Slice*, vvdec::InputBitstream*, int)" in /tmp/vvdec-2.1.3/source/Lib/DecoderLib/DecSlice.cpp:172: Expecting a terminating bit
[ffmpeg/video] ERROR CONDITION: !binVal
Error while decoding frame!
[ffmpeg/video] libvvdec: error in vvdec::decode - ret:-11 - restart required, please reinit. Exception occured: 
[ffmpeg/video] ERROR: In function "void vvdec::DecSlice::parseSlice(vvdec::Slice*, vvdec::InputBitstream*, int)" in /tmp/vvdec-2.1.3/source/Lib/DecoderLib/DecSlice.cpp:172: Expecting a terminating bit
[ffmpeg/video] ERROR CONDITION: !binVal
Error while decoding frame!
[ffmpeg/video] libvvdec: error in vvdec::decode - ret:-11 - restart required, please reinit. Exception occured: 
[ffmpeg/video] ERROR: In function "void vvdec::DecSlice::parseSlice(vvdec::Slice*, vvdec::InputBitstream*, int)" in /tmp/vvdec-2.1.3/source/Lib/DecoderLib/DecSlice.cpp:172: Expecting a terminating bit
[ffmpeg/video] ERROR CONDITION: !binVal
Error while decoding frame!
[ffmpeg/video] libvvdec: error in vvdec::decode - ret:-11 - restart required, please reinit. Exception occured: 
[ffmpeg/video] ERROR: In function "void vvdec::DecSlice::parseSlice(vvdec::Slice*, vvdec::InputBitstream*, int)" in /tmp/vvdec-2.1.3/source/Lib/DecoderLib/DecSlice.cpp:172: Expecting a terminating bit
[ffmpeg/video] ERROR CONDITION: !binVal
Error while decoding frame!
[ffmpeg/video] libvvdec: error in vvdec::decode - ret:-11 - restart required, please reinit. Exception occured: 
[ffmpeg/video] ERROR: In function "void vvdec::DecSlice::parseSlice(vvdec::Slice*, vvdec::InputBitstream*, int)" in /tmp/vvdec-2.1.3/source/Lib/DecoderLib/DecSlice.cpp:172: Expecting a terminating bit
[ffmpeg/video] ERROR CONDITION: !binVal
Error while decoding frame!
[ffmpeg/video] libvvdec: error in vvdec::decode - ret:-11 - restart required, please reinit. Exception occured: 
[ffmpeg/video] ERROR: In function "void vvdec::DecSlice::parseSlice(vvdec::Slice*, vvdec::InputBitstream*, int)" in /tmp/vvdec-2.1.3/source/Lib/DecoderLib/DecSlice.cpp:172: Expecting a terminating bit
[ffmpeg/video] ERROR CONDITION: !binVal
Error while decoding frame!
[ffmpeg/video] libvvdec: error in vvdec::decode - ret:-11 - restart required, please reinit. Exception occured: 
[ffmpeg/video] ERROR: In function "void vvdec::DecSlice::parseSlice(vvdec::Slice*, vvdec::InputBitstream*, int)" in /tmp/vvdec-2.1.3/source/Lib/DecoderLib/DecSlice.cpp:172: Expecting a terminating bit
[ffmpeg/video] ERROR CONDITION: !binVal
Error while decoding frame!
[ffmpeg/video] libvvdec: error in vvdec::decode - ret:-11 - restart required, please reinit. Exception occured: 
[ffmpeg/video] ERROR: In function "void vvdec::DecSlice::parseSlice(vvdec::Slice*, vvdec::InputBitstream*, int)" in /tmp/vvdec-2.1.3/source/Lib/DecoderLib/DecSlice.cpp:172: Expecting a terminating bit
[ffmpeg/video] ERROR CONDITION: !binVal
[ffmpeg/video] libvvdec: Too many errors when draining, this is a bug. Stop draining and force EOF.
Error while decoding frame!

I’m using mpv + ffmpeg 6.0.1 patched with vvdec support.

The raw H.266 file can be downloaded here: https://mega.nz/file/PgNiwLzA#pIRNACUVTpD1xcbWlo0Il4p_vv2E5nE4l5c-1Y5_hno

The source file was encoded using VVENC 1.10.0 this way:

ffmpeg -i *mp4 -vf scale=1024x576:flags=lanczos,fps=30 -f yuv4mpegpipe - | nice -20 vvencapp --y4m -i - --preset slow -q 31 -o y4m.266

vvenc [info]: stats summary: frame= 192931 avg_fps= 0.5 avg_bitrate= 638.11 kbps
vvenc [info]: stats summary: frame I: 6029, kbps: 9202.92, AvgQP: 25.25
vvenc [info]: stats summary: frame P:    0, kbps:     nan, AvgQP: nan
vvenc [info]: stats summary: frame B: 186902, kbps:  361.83, AvgQP: 36.34


vvenc [info]:   Total Frames |   Bitrate     Y-PSNR    U-PSNR    V-PSNR    YUV-PSNR
vvenc [info]:      192931    a     638.1111   37.7132   43.8204   43.9743   37.6809
vvencapp [info]: Total Time: 401380.129 sec. Fps(avg): 0.481 encoded Frames 192931

About this issue

  • Original URL
  • State: closed
  • Created 6 months ago
  • Comments: 30 (14 by maintainers)

Commits related to this issue

Most upvoted comments

I worked a little on the thread pool implementation: Now it won’t keep one core busy any more, when decoding at a fixed frame rate. This should fix the issue with the power consumption, because the whole CPU can sleep in between frames.

Here is an example playing 30s of your sample video.

Before:

> turbostat --quiet --show Avg_MHz,Busy%,Bzy_MHz,PkgWatt --Summary sh -c './ffplay blast.mp4 -an -t 30 -v 0 -autoexit >/dev/null'
29.296818 sec
Avg_MHz	Busy%	Bzy_MHz	PkgWatt
933	23.66	3945	43.06

With PR #162:

./turbostat --quiet --show Avg_MHz,Busy%,Bzy_MHz,PkgWatt --Summary sh -c './ffplay blast.mp4 -an -t 30 -v 0 -autoexit >/dev/null'
29.311245 sec
Avg_MHz	Busy%	Bzy_MHz	PkgWatt
516	26.02	1981	14.33

Thanks for pointing the issue out to us. The threading implementation was developed with maximum throughput in mind, before there was an integration into FFmpeg or media players. So, looking at it with turbostat was quite helpful.

3x is actually alright. They do good job at FFmpeg at optimizing. We also don’t know how much of HEVC they really used in the bitstream. With VVenC slow you’re basically getting all of VVC.

That’s what I thought, so thank you for answering my concerns! The issue is solved then 👍

So where does the 10x with 60W come from?

Ryzen 7 5800X idles at around 21W, so it’s not 60W, it’s 60-21=39W. I can force it down a lot by using power saving mode but the CPU prefers to burn watts (it keeps CPU cores running a lot faster than it’s necessary to decode) for some reasons.

Thats what you get when you use FFmpeg or mpv patched with VVdeC?

Yeah, the same software setup (Fedora 39 + ffmpeg 6.0.1 patched with vvdec support + mpv), just different HW.

Try setting the number of threads to 2 or 4 and the power consumption will probably go down.

No idea how it can be done when using mpv with patched ffmpeg. You cannot play videos using vvdecapp you know 😉

Thanks a lot!

3x is actually alright. They do good job at FFmpeg at optimizing. We also don’t know how much of HEVC they really used in the bitstream. With VVenC slow you’re basically getting all of VVC.

Your FPS is good as well. And you are using an internal system buffer (pipe) which is some workload as well.

So where does the 10x with 60W come from? Thats what you get when you use FFmpeg or mpv patched with VVdeC?