Archive

Archive for October, 2012

x264 with high bit depth y4m support ( for VapourSynth )

27th October 2012, Saturday 1 comment

Accept high bit depth y4m created by VapourSynth. Patch is here (from D_S’s x264 devel repo, thanks for Jeeb’s work).

Skip unnecessary depth conversion for y4m input, just like high bpp avs/raw input in old x264_tMod. Patch is here, note this patch comes after original tMod’s Skip bit depth filter when possible patch.

Ideally bit depth conversion should be put into one function instead of duplicating those codes in different files (input/raw.c, input/y4m.c, etc.). Jeeb seems to be working on it (link). If it is applied in the next official update, all above patches need to be re-written, so I didn’t put them on my GitHub’s repo.

Just a minor update mainly for high bpp y4m input, so didn’t include libav/ffms in it. Only Lite version:
Download:
MediaFire, NMM-Mirror

Example:

#!/bin/env python

import vapoursynth as vs
import sys
core = vs.Core()
core.std.LoadPlugin(path=r"ffms2.dll")
ret = core.ffms2.Source(r"input.mkv")
ret = core.resize.Bicubic(clip=ret, format=vs.YUV420P16)
ret.output(sys.stdout, y4m=True)

python example.vpy | x264 --demuxer y4m --output output.mp4 -

or

#!/bin/env python

import vapoursynth as vs
import sys
core = vs.Core()
core.std.LoadPlugin(path=r"ffms2.dll")
ret = core.ffms2.Source(r"input.mkv")
ret = core.resize.Bicubic(clip=ret, format=vs.YUV420P10)
ret.output(sys.stdout, y4m=True)

python example.vpy | x264 --demuxer y4m --output output.mp4 -

If you feed the second example.vay to x264_**_tMod-10bit-420.exe, you’ll see skip depth info as with high bpp raw/avs input for old tMod with same output depth:

Categories: encode, x264, x264-bin