TheAMM / mpv_thumbnail_script

A Lua script to show preview thumbnails in mpv's OSC seekbar, sans external dependencies
GNU General Public License v3.0
679 stars 68 forks source link

Failed to generate thumbnails for HDR content #26

Closed laichiaheng closed 5 years ago

laichiaheng commented 5 years ago

I can see nothing in the thumbnail.

TheAMM commented 5 years ago

Post a log (there should be some in the thumbnail directory) or provide a sample file. There's not much for me to go on, here.

laichiaheng commented 5 years ago

thumbnail_prefer_mpv=no.zip thumbnail_prefer_mpv=yes.zip

[auto_profiles] Applying profile aspect<2.35 
Playing: Samsung Chasing The Light Demo.ts
[ffmpeg/demuxer] mpegts: start time for stream 1 is not set in estimate_timings_from_pts
[ffmpeg/demuxer] mpegts: Could not find codec parameters for stream 1 (Audio: aac ([15][0][0][0] / 0x000F), 0 channels): unspecified sample format
[ffmpeg/demuxer] Consider increasing the value for the 'analyzeduration' and 'probesize' options
 (+) Video --vid=1 (hevc 3840x2160 59.940fps)
 (+) Audio --aid=1 (aac)
mesa: for the -simplifycfg-sink-common option: may only occur zero or one times!
mesa: for the -global-isel-abort option: may only occur zero or one times!
[ffmpeg] AVHWFramesContext: Failed to create surface: 2 (resource allocation failed).
[ffmpeg] AVHWFramesContext: Unable to allocate a surface from internal buffer pool.
[auto_profiles] Applying profile UHD 60 
Using hardware decoding (vaapi).
AO: [pulse] 48000Hz stereo 2ch float
VO: [gpu] 3840x2160 vaapi[p010]
[auto_profiles] Applying profile HDR 60 
AV: 00:00:08 / 00:01:34 (10%) A-V:  0.006 DS: 1.000/1

Exiting... (Quit)
TheAMM commented 5 years ago

Using ffmpeg with the script is deprecated, If the thumbnail generation fails, the sub-process logs should've been in the thumbnail directory, but seems like they don't actually error out. Put mpv_keep_logs=yes in your config and try again (clear out the existing thumbnails so it'll re-run the commands), then link one of the logfiles. The log you pasted looks to be the stdout from the main process, which complains about hardware decoding not working. This should not happen with the sub-mpvs, because hardware decoding is explicitly disabled for them (assuming you are using the latest script release).

TheAMM commented 5 years ago

I ended up downloading the file myself and seeing what's up. The HDR part is irrelevant; the problem is the container (or a bad mux), which results in broken seeks. Try it yourself: mpv --pause --start 30 "Samsung Chasing The Light Demo.ts" The script requires the file to be properly seekable; broken input is broken input.

You can fix the file with ffmpeg -i "Samsung Chasing The Light Demo.ts" -c copy remuxed.mkv or such. This can be thumbnailed.