theultramage
23rd September 2018, 20:09
I've had a long-standing problem with my video toolchain. Whenever I use libx264 (ffmpeg or vfw codec) to encode a video processed by VirtualDub 1.10.4, and then play it back using MPC-HC, it appears washed out, like there's a filter over it. Using the mspaint dropper tool, I see that pure black (0,0,0) becomes (16,16,16).
This has plagued me for years, and my early workaround was to patch Vdub and tell x264vtw to encode as bgr24. Later I ditched vdub entirely and edited my videos straight through the ffmpeg commandline. Today I got hit by this again, and I really like the Vdub gui, so I thought I'd finally ask about it. Note that only MPC-HC seems to do this, and only on h264 yuv444p or yuv420p video that passed through vdub. Vdub and VLC show it fine, and a direct ffmpeg encode of the raw source shows fine as well. So I don't think the problem is in the actual pixels of the video.
There must be something in the video header or structure that's being mis-interpreted. It even happens if the vdub output is a raw DIB file... just changing the output's Color Depth from bgr24 to yv24_444p is enough to trigger this. MPC-HC's Mediainfo tab says in one case "Format: RGB, Codec ID: 0x00000000, Codec ID/Info: Basic Windows bitmap format...", and in the other case just "Format: YV24, Codec ID: YV24".
When looking at the libx264 encodes, the direct one says "Frame rate mode: Variable", while the vdub processed one says "Frame rate mode: Constant, Frame rate: 30.000 FPS, Bits/(Pixel*Frame): 0.064". No other noted differences.
I'm honestly at a loss as to what's going on here. I speculate that vdub's output is making libx264 generate yuv video files that make MPC-HC incorrectly apply a color range transform.
This has plagued me for years, and my early workaround was to patch Vdub and tell x264vtw to encode as bgr24. Later I ditched vdub entirely and edited my videos straight through the ffmpeg commandline. Today I got hit by this again, and I really like the Vdub gui, so I thought I'd finally ask about it. Note that only MPC-HC seems to do this, and only on h264 yuv444p or yuv420p video that passed through vdub. Vdub and VLC show it fine, and a direct ffmpeg encode of the raw source shows fine as well. So I don't think the problem is in the actual pixels of the video.
There must be something in the video header or structure that's being mis-interpreted. It even happens if the vdub output is a raw DIB file... just changing the output's Color Depth from bgr24 to yv24_444p is enough to trigger this. MPC-HC's Mediainfo tab says in one case "Format: RGB, Codec ID: 0x00000000, Codec ID/Info: Basic Windows bitmap format...", and in the other case just "Format: YV24, Codec ID: YV24".
When looking at the libx264 encodes, the direct one says "Frame rate mode: Variable", while the vdub processed one says "Frame rate mode: Constant, Frame rate: 30.000 FPS, Bits/(Pixel*Frame): 0.064". No other noted differences.
I'm honestly at a loss as to what's going on here. I speculate that vdub's output is making libx264 generate yuv video files that make MPC-HC incorrectly apply a color range transform.