mpv
mpv copied to clipboard
MPV Tone Mapping Failure for certain videos
mpv Information
mpv v0.40.0-dev-ga418d2163 Copyright © 2000-2025 mpv/MPlayer/mplayer2 projects
built on Jun 6 2025 08:48:52
libplacebo version: v7.351.0
FFmpeg version: 7.1.1
FFmpeg library versions:
libavcodec 61.19.101
libavdevice 61.3.100
libavfilter 10.4.100
libavformat 61.7.100
libavutil 59.39.100
libswresample 5.3.100
libswscale 8.3.100
Other Information
- macOS version: macOS 15.2 (24C101)
- Source of mpv: https://nightly.link/mpv-player/mpv/workflows/build/master mpv-macos-15-arm
- Latest known working version: Not applicable
- Issue started after the following happened: Trying to tonemap hdr to sdr on a certain video
Reproduction Steps
Running the below using ffmpeg version 7.1.1 on my dobly vision hdr video, succesfully produces a tonemapped HDR -> SDR thumbnail
ffmpeg7 -ss 627 -i "test hdr.mkv.mkv" -vf "zscale=transfer=linear,format=gbrpf32le,tonemap=hable,zscale=transfer=bt709,scale=1400:-1" -frames:v 1 -y "ffmpeg_thumbnail.png"
Expand
ffmpeg version 7.1.1 Copyright (c) 2000-2025 the FFmpeg developers
built with Apple clang version 16.0.0 (clang-1600.0.26.6)
configuration: --cc=/usr/bin/clang --datadir=/opt/local/libexec/ffmpeg7/share/data --docdir=/opt/local/libexec/ffmpeg7/share/doc --progs-suffix=7 --prefix=/opt/local/libexec/ffmpeg7 --enable-audiotoolbox --disable-indev=jack --disable-libjack --disable-libopencore-amrnb --disable-libopencore-amrwb --disable-libplacebo --disable-libvmaf --disable-libxcb --disable-libxcb-shm --disable-libxcb-xfixes --disable-metal --enable-opencl --disable-outdev=xv --enable-sdl2 --disable-securetransport --enable-videotoolbox --disable-xlib --enable-avfilter --enable-fontconfig --enable-gnutls --enable-lcms2 --enable-libass --enable-libbluray --enable-libdav1d --enable-libfreetype --enable-libfribidi --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libzimg --enable-libzvbi --enable-lzma --enable-pthreads --enable-shared --enable-swscale --enable-zlib --enable-libaom --enable-libsvtav1 --arch=arm64 --enable-gpl --enable-libvidstab --enable-libx264 --enable-libx265 --enable-libxvid --enable-postproc --enable-libvmaf
libavutil 59. 39.100 / 59. 39.100
libavcodec 61. 19.101 / 61. 19.101
libavformat 61. 7.100 / 61. 7.100
libavdevice 61. 3.100 / 61. 3.100
libavfilter 10. 4.100 / 10. 4.100
libswscale 8. 3.100 / 8. 3.100
libswresample 5. 3.100 / 5. 3.100
libpostproc 58. 3.100 / 58. 3.100
Input #0, matroska,webm, from 'test hdr.mkv':
Metadata:
encoder : libebml v1.4.5 + libmatroska v1.7.1
creation_time : 2025-04-05T00:43:24.000000Z
Duration: 01:06:21.73, start: 0.000000, bitrate: 3646 kb/s
Chapters:
Chapter #0:0: start 3929.175000, end 3981.728000
Metadata:
title : Credits
Stream #0:0: Video: hevc (Main 10), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 3840x1920, SAR 1:1 DAR 2:1, 23.98 fps, 23.98 tbr, 1k tbn (default)
Side data:
Content Light Level Metadata, MaxCLL=1000, MaxFALL=400
Mastering Display Metadata, has_primaries:1 has_luminance:1 r(0.6800,0.3200) g(0.2650,0.6900) b(0.1500 0.0600) wp(0.3127, 0.3290) min_luminance=0.005000, max_luminance=1000.000000
DOVI configuration record: version: 1.0, profile: 8, level: 6, rpu flag: 1, el flag: 0, bl flag: 1, compatibility id: 1, compression: 0
Stream #0:1(eng): Audio: aac (HE-AAC), 48000 Hz, 5.1, fltp (default)
Stream mapping:
Stream #0:0 -> #0:0 (hevc (native) -> png (native))
Press [q] to stop, [?] for help
Output #0, image2, to 'ffmpeg_thumbnail.png':
Metadata:
encoder : Lavf61.7.100
Chapters:
Chapter #0:0: start 3302.175000, end 3354.728000
Metadata:
title : Credits
Stream #0:0: Video: png, rgb48be(pc, gbr/bt2020/bt709, progressive), 1400x700 [SAR 1:1 DAR 2:1], q=2-31, 200 kb/s, 23.98 fps, 23.98 tbn (default)
Metadata:
encoder : Lavc61.19.101 png
Side data:
Mastering Display Metadata, has_primaries:1 has_luminance:1 r(0.6800,0.3200) g(0.2650,0.6900) b(0.1500 0.0600) wp(0.3127, 0.3290) min_luminance=0.000100, max_luminance=298.000000
Content Light Level Metadata, MaxCLL=298, MaxFALL=95
[image2 @ 0x13e605c10] The specified filename 'ffmpeg_thumbnail.png' does not contain an image sequence pattern or a pattern is invalid.
[image2 @ 0x13e605c10] Use a pattern such as %03d for an image sequence or use the -update option (with -frames:v 1 if needed) to write a single image.
[out#0/image2 @ 0x600002b30480] video:4904KiB audio:0KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: unknown
frame= 1 fps=0.0 q=-0.0 Lsize=N/A time=00:00:00.04 bitrate=N/A speed=0.161x
Doing the same with mpv 0.40 compiled with the same ffmpeg version (7.1.1) on the same video, leads to an error:
/Applications/mpv.app/Contents/MacOS/mpv --no-config --start=627 --frames=1 -vf="zscale=transfer=linear,format=gbrpf32le,tonemap=hable,zscale=transfer=bt709,scale=1400:-1" --o="mpv_thumbnail.png" "test hdr.mkv"
Expand
client removed during hook handling
Disabling audio (not supported by target format).
● Video --vid=1 (hevc 3840x1920 23.976 fps) [default]
○ Audio --aid=1 --alang=en (aac 6ch 48000 Hz) [default]
[ffmpeg/video] hevc: Multiple Dolby Vision RPUs found in one AU. Skipping previous.
[ffmpeg] mpv_src_default_in: Changing video frame properties on the fly is not supported by all filters.
[ffmpeg] mpv_src_default_in: filter context - w: 3840 h: 1920 fmt: 62 csp: unknown range: tv, incoming frame - w: 3840 h: 1920 fmt: 62 csp: bt2020nc range: tv pts_time: 38.997
[ffmpeg] filter: code 3074: no path between colorspaces
[ffmpeg] filter: code 3074: no path between colorspaces
[ffmpeg] filter: code 3074: no path between colorspaces
[ffmpeg] filter: code 3074: no path between colorspaces
[ffmpeg] filter: code 3074: no path between colorspaces
[ffmpeg] filter: code 3074: no path between colorspaces
[ffmpeg] filter: code 3074: no path between colorspaces
[ffmpeg] filter: code 3074: no path between colorspaces
[ffmpeg] filter: code 3074: no path between colorspaces
[ffmpeg] filter: code 3074: no path between colorspaces
[ffmpeg] filter: code 3074: no path between colorspaces
[ffmpeg] filter: code 3074: no path between colorspaces
[ffmpeg] filter: code 3074: no path between colorspaces
[ffmpeg] filter: code 3074: no path between colorspaces
[ffmpeg] filter: code 3074: no path between colorspaces
[ffmpeg] filter: code 3074: no path between colorspaces
[ffmpeg] filter: code 3074: no path between colorspaces
[ffmpeg] filter: code 3074: no path between colorspaces
[ffmpeg] filter: code 3074: no path between colorspaces
[ffmpeg] filter: code 3074: no path between colorspaces
[ffmpeg] filter: code 3074: no path between colorspaces
[ffmpeg] filter: code 3074: no path between colorspaces
[ffmpeg] filter: code 3074: no path between colorspaces
[ffmpeg] filter: code 3074: no path between colorspaces
[ffmpeg] filter: code 3074: no path between colorspaces
[ffmpeg] filter: code 3074: no path between colorspaces
[lavfi] error on filtering (-542398533)
Issue seems to be isolated to a certain type of Dolby Vision HDR video
FFProbe of my video
{
"streams": [
{
"index": 0,
"codec_name": "hevc",
"codec_long_name": "H.265 / HEVC (High Efficiency Video Coding)",
"profile": "Main 10",
"codec_type": "video",
"codec_tag_string": "[0][0][0][0]",
"codec_tag": "0x0000",
"width": 3840,
"height": 1920,
"coded_width": 3840,
"coded_height": 1920,
"closed_captions": 0,
"has_b_frames": 2,
"sample_aspect_ratio": "1:1",
"display_aspect_ratio": "2:1",
"pix_fmt": "yuv420p10le",
"level": 150,
"color_range": "tv",
"color_space": "bt2020nc",
"color_transfer": "smpte2084",
"color_primaries": "bt2020",
"chroma_location": "topleft",
"refs": 1,
"r_frame_rate": "24000/1001",
"avg_frame_rate": "24000/1001",
"time_base": "1/1000",
"start_pts": 0,
"start_time": "0.000000",
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0
},
"side_data_list": [
{
"side_data_type": "Content light level metadata",
"max_content": 1000,
"max_average": 400
},
{
"side_data_type": "Mastering display metadata",
"red_x": "11408507/16777216",
"red_y": "5368709/16777216",
"green_x": "2222981/8388608",
"green_y": "11576279/16777216",
"blue_x": "5033165/33554432",
"blue_y": "16106127/268435456",
"white_point_x": "10492471/33554432",
"white_point_y": "689963/2097152",
"min_luminance": "5368709/1073741824",
"max_luminance": "1000/1"
}
]
},
{
"index": 1,
"codec_name": "aac",
"codec_long_name": "AAC (Advanced Audio Coding)",
"profile": "HE-AAC",
"codec_type": "audio",
"codec_tag_string": "[0][0][0][0]",
"codec_tag": "0x0000",
"sample_fmt": "fltp",
"sample_rate": "48000",
"channels": 6,
"channel_layout": "5.1",
"bits_per_sample": 0,
"r_frame_rate": "0/0",
"avg_frame_rate": "0/0",
"time_base": "1/1000",
"start_pts": 23,
"start_time": "0.023000",
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0
},
"tags": {
"language": "eng"
}
}
],
"format": {
"filename": "test hdr.mkv",
"nb_streams": 2,
"nb_programs": 0,
"format_name": "matroska,webm",
"format_long_name": "Matroska / WebM",
"start_time": "0.000000",
"duration": "3981.728000",
"size": "1814788154",
"bit_rate": "3646232",
"probe_score": 100,
"tags": {
"encoder": "libebml v1.4.5 + libmatroska v1.7.1",
"creation_time": "2025-04-05T00:43:24.000000Z"
}
}
}
Expected Behavior
The mpv command to tonemap succesfully like ffmpeg
Actual Behavior
MPV command failed
Log File
Sample Files
No response
I carefully read all instruction and confirm that I did the following:
- [x] I tested with the latest mpv version to validate that the issue is not already fixed.
- [x] I provided all required information including system and mpv version.
- [x] I produced the log file with the exact same set of files, parameters, and conditions used in "Reproduction Steps", with the addition of
--log-file=output.txt. - [x] I produced the log file while the behaviors described in "Actual Behavior" were actively observed.
- [x] I attached the full, untruncated log file.
- [x] I attached the backtrace in the case of a crash.