Opened 9 months ago

Last modified 8 months ago

#10517 new defect

NVDEC "No decoder surfaces left" with bad (corrupted) video stream.

Reported by: ua0lnj Owned by:
Priority: normal Component: avcodec
Version: git-master Keywords: nvdec
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description (last modified by ua0lnj)

Difficult to reproduce.
In case of poor receive from a satellite or the air, a broken stream arrives, there is no problem with vaapi, vdpau and cuvid hwdecs. With nvdec after a while, the decoder stops working.

How I tested.
Application used: softhdcevice plugin for vdr, test branch.
https://github.com/ua0lnj/vdr-plugin-softhddevice/tree/test

NVDEC code was added:
https://github.com/ua0lnj/vdr-plugin-softhddevice/commit/27a305336999553e24e680f823c417f45d64ae00

Attachments (1)

ffmpeg.log (11.6 KB ) - added by ua0lnj 9 months ago.

Download all attachments as: .zip

Change History (10)

by ua0lnj, 9 months ago

Attachment: ffmpeg.log added

comment:1 by ua0lnj, 9 months ago

Description: modified (diff)

comment:2 by Balling, 9 months ago

where is the sample?

comment:3 by ua0lnj, 9 months ago

This is a realtime dvb receive, I don't know if I can record a broken stream and what size it will be.

comment:4 by Balling, 9 months ago

Please try to record. We have bugs like that but they are usually very complex. Does it happen with -threads 1 or -threads 2?

Last edited 9 months ago by Balling (previous) (diff)

comment:5 by ua0lnj, 9 months ago

I use threads 1. I will try to record.

comment:6 by ua0lnj, 8 months ago

I uploded ts file, ~10 min h.264.
https://streams.videolan.org/ffmpeg/incoming/10517/

The main error occurs at 7-8 minutes. I solved the problem by reopening the codec, when it starts giving errors.
https://github.com/ua0lnj/vdr-plugin-softhddevice/commit/926992a8e8e32d1068537af547cab921e9f0861c
Maybe MPV does the same, after a short delay, playback continues.
Terrible recording, MPV can not cope with sound synchronization, VLC copes, VDR with softhddevice is best :)

Last edited 8 months ago by ua0lnj (previous) (diff)

comment:7 by Balling, 8 months ago

Strange. I cannot see any "No decoder surfaces left" I am using Turing.

ffmpeg.exe -hwaccel nvdec -i 00001.ts -f null -

I can see a lot of "Application provided invalid, non monotonically increasing dts to muxer in stream" though.

Also both cuvid and nvdec give "Error submitting packet to decoder: Invalid data found when processing input"

Also ffplay.exe -vcodec h264_cuvid 00001.ts

appears to have no such warnings but incorrectly reorders the frames. Sigh, ffplay.exe 00001.ts has no such problem.

Last edited 8 months ago by Balling (previous) (diff)

comment:8 by ua0lnj, 8 months ago

Try mpv with nvdec.
I can't reproduce the error with ffmpeg, but with mpv it is reproduced

[ffmpeg/video] h264: No decoder surfaces left
Error while decoding frame (hardware decoding)!
[ffmpeg/video] h264: reference picture missing during reorder
[ffmpeg/video] h264: reference picture missing during reorder
[ffmpeg/video] h264: reference picture missing during reorder
[ffmpeg/video] h264: Missing reference picture, default is 65537
[ffmpeg/video] h264: Missing reference picture, default is 65537
[ffmpeg/video] h264: Missing reference picture, default is 65537
[ffmpeg/video] h264: No decoder surfaces left
Error while decoding frame (hardware decoding)!

You need to play the entire file, if only a segment, then no error occurs, perhaps this is a cumulative error.

comment:9 by Balling, 8 months ago

Just tried mpv.com --target-colorspace-hint=yes -hwdec=nvdec --gpu-api=vulkan -vo=gpu-next 00001.ts

[ffmpeg/video] h264: No decoder surfaces left
Error while decoding frame (hardware decoding)!

is there, yep.

Note: See TracTickets for help on using tickets.