mpv-player / mpv-player/mpv

double range compression video filter fix does not work

Open
#16,759 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

meta:question
Dominant language
C
Stars
37k
Forks
3.5k
Avg merge
1d 10h
Merged PRs (30d)
22

Description

mpv Information
mpv v0.40.0-292-g9f153e2a2 Copyright © 2000-2025 mpv/MPlayer/mplayer2 projects
 built on Aug 25 2025 00:04:47
libplacebo version: v7.353.0 (v7.351.0-63-gc674668-dirty)
FFmpeg version: N-120833-gdb2af6fd4
FFmpeg library versions:
   libavcodec      62.13.101
   libavdevice     62.2.100
   libavfilter     11.5.100
   libavformat     62.4.101
   libavutil       60.10.100
   libswresample   6.2.100
   libswscale      9.2.100
Other Information
- Windows version: Microsoft Windows [Version 10.0.19045.6216]
- GPU model, driver and version:
GPU 0

	Intel(R) HD Graphics 5500

	Driver version:	20.19.15.4531
	Driver date:	29/09/2016
	DirectX version:	12 (FL 11.1)
	Physical location:	PCI bus 0, device 2, function 0

	Utilization	1%
	Dedicated GPU memory	
	Shared GPU memory	0,5/4,0 GB
	GPU Memory	0,5/4,0 GB

- Source of mpv: Windows builds by zhongfly (git)	
- Latest known working version: -
- Issue started after the following happened: -
Reproduction Steps

have double range compressed video.
to undo this error, i tried to convert the python script below to ffmpeg filters (mpv filters)
--dither=error-diffusion --vf=scale=flags=neighbor:in_range=limited:out_range=full

Expected Behavior

(context: i tried to convert vapoursynth to mpv video filters)

src = ...
out = src.resize.Point(range_in=0, range=1, dither_type="error_diffusion")
out = out.std.SetFrameProp(prop="_ColorRange", intval=1)

https://vapoursynth.com/doc/functions/video/setframeprop.html and https://vapoursynth.com/doc/functions/video/resize.html may help
double range compression is fixed properly
https://slow.pics/c/ui8JHLyw
like this

Actual Behavior

double range compression is not fixed and another error adds to the issue: a rounding error.

Log File

output.txt

Sample Files

https://pixeldrain.com/u/CKgC8UY3

I carefully read all instruction and confirm that I did the following:
  • I tested with the latest mpv version to validate that the issue is not already fixed.
  • I provided all required information including system and mpv version.
  • 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.
  • I produced the log file while the behaviors described in "Actual Behavior" were actively observed.
  • I attached the full, untruncated log file.
  • I attached the backtrace in the case of a crash.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported behavior with the provided sample file, output.txt log, and --dither=error-diffusion --vf=scale=flags=neighbor:in_range=limited:out_range=full. Compare the result with the VapourSynth snippet and the slow.pics reference, then verify that both the double range compression and rounding error are resolved.

Written by the indexing model from the issue text.

Assessment

Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.