mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
28.63k stars 2.92k forks source link

80Gb 4k HEVC: Hw decoder usage is inconsistent #5609

Closed falcn closed 4 years ago

falcn commented 6 years ago

mpv 0.28.2 OS X

IINA 0.0.15

Related issue: https://github.com/lhc70000/iina/issues/1539

Reproduction steps

  1. Download 80GB blu-ray copy magnet:?magnet link removed. message me if you need it
  2. $ mpv --no-config --hwdec=videotoolbox /Users/falcn/Downloads/Blu-ray/BDMV/STREAM/00336.m2ts
  3. hw decoding is on: smooth playback and low cpu usage
  4. rewind movie
  5. mpv switches to software decoding. Choppy playback / 100% cpu usage

Expected behavior

Consistent hardware-accelerated decoding throughout the whole movie

Log file

https://pastebin.com/8DpLL2i3

[ffmpeg/video] hevc: hardware accelerator failed to decode picture
Error while decoding frame!
Falling back to software decoding.
sfan5 commented 6 years ago

Is this reproducible with a shorter sample file?

ghost commented 6 years ago

Probably incorrectly muxed file so that the decoder can't resume correctly soon enough, hard to tell.

falcn commented 6 years ago

This is the official Blu-ray, so I don't think we should blame the media file. I'll try to get a sample.

ghost commented 6 years ago

Well, transport streams are not designed to be seekable in the first place. AFAIK the real bluray structure has something else for seeking, because anything else would be batshit and downright impossible since otherwise it'd have to read half of the bluray disk for every seek.

falcn commented 6 years ago

Sample (472.51 MB) aHR0cDovL3NlbmRmaWxlLnN1LzE0MDExMDc= base64 to avoid github auto-ban. Google "base64 decode" for online tool

This is not my sample, it was provided by the releaser. Blu-ray was copied using DVDFab 10.0.7.9.

Opening sample from the beginning falls back to software decoding right away, but mpv --no-config --hwdec=videotoolbox --start=20 sample.ts opens and plays it with hardware accelerated decoding till the end, unless rewind is used.

ghost commented 6 years ago

base64 to avoid github auto-ban. Google "base64 decode" for online tool

What? Just upload a sample to 0x0.st like a normal person.

falcn commented 6 years ago
 curl -F'file=@/Users/falcn/Downloads/sample.ts' https://0x0.st
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>413 Request Entity Too Large</title>
<h1>Request Entity Too Large</h1>
<p>The data value transmitted exceeds the capacity limit.</p>
averms commented 6 years ago

pirating blade runner i see... 😏

falcn commented 6 years ago

@aaether32323 Absolutely not! We are just a large group of friends who use torrents to make sure that blue rays that we buy haven't got damaged during shipment.

leigh123linux commented 6 years ago

@falcn Your last comment was comical and complete bulllshit, anyone with half a brain would use sha256sum locally and compare checksums.

Try reading the Copyright included with the blueray and you will find all sharing is prohibited.

Akemi commented 6 years ago

i tried the sample and can confirm the problem. most of the warnings (all the [ffmpeg/demuxer] ones) i could get rid of by remuxing the .ts into an mkv file. for me the hw decoding is really choppy and drops frames, though it doesn't fall back to sw decoding. i get a lot of [ffmpeg/video] hevc: First slice in a frame missing. errors till it deactivates DS because of too much dropped frames and desync.

Akemi commented 4 years ago

https://trac.ffmpeg.org/ticket/8731#ticket reported to ffmpeg.

Akemi commented 4 years ago

ffmpeg marked this as a "wontfix". it's still possible that ffmpeg is doing something suboptimal but i am not going to waste my time on proving that.