Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
cuda bug: falling back to software decoding doesn't play video from the beginning #3914
mpv version and platform
CUDA fails to decode 10-bit h264 and mpv falls back to software decoding. Playback starts from
Playback starts from
Any 10-bit h264 (assuming that your GPU can't decode them)
@philipl do you know what could be the problem here?
@philipl this is made somewhat harder by the fact that I get the following return values from the API:
Is this necessarily so? If I got the error on the first send_frame, then --vd-lavc-software-fallback=1 could be used to force a fallback without discarding packets. I might look into an alternative solution, though.
Yeah, it's not possible to fail in send_frame. We get notified of failure asynchronously in a callback from cuda that happens after send_frame returns to the caller. So receive_frame is the first opportunity to pass that error back. We could try and force a synchronisation in the first send_frame but that'll be ugly and you'd still have this problem with other async decoders at some point, so a more general solution is going to be better in the end.
I did an additional investigation - the behaviour will depend on what format you're decoding and what exactly isn't supported.
10bit vp9 fails immediately, and you will get an error back from send_frame. I cannot test 10bit hevc failing properly (it works on my hardware) but I tried to emulate a failure and I did see the first send_frame return success.
The difference here is that the callback appears to fire immediately in the vp9 case (so we have the error in hand when we return) and it's delayed in the hevc case.