Home > encode, x264, x264-bin > x264 rev2120+630 tMod ( Support rendering subtitles internally )

x264 rev2120+630 tMod ( Support rendering subtitles internally )

12th December 2011, Monday Leave a comment Go to comments

These builds are not officially merged by x264_L-SMASH project. I merged in my local git repo so don’t be surprised if you cannot find commits in x264_L-SMASH’s repo.

Latest updates:
– Update x264 to git rev2120;
– Update “skips depth filter when possible” patch, now raw input also skips depth filter when input and output depth are same;
– Add internal subtitles renderer ( ported from direct264 ), read below for more details;
– Add “–profile-force” to avoid x264 automatically reduce user defined profile when it is not needed according to other parameters, so –profile high –no-8x8dct –profile-force makes output profile high but not main, and –profile high422 –profile-force with 8bit 420 output won’t be reduced to high. I made this patch only to show that hi10p is not equal to 10-bit, so stop adding “hi10p” into filename when you actually means the content is 10-bit avc;
– Temporarily remove “Color matrix/range detection with ffms and lavf input” patch, as the new range structure in latest x264 changed the range logic and I need to update many codes of this patch, while I personally have no interest in it.

— How to load subtitles internally

These builds ported subtitles video-filter from direct264, and are able to render subtitles internally.
To render subtitles in this way, demuxer must be libav/ffms. Raw/avs demuxer is not supported for now. And VSFilter.dll(for 32-bit builds) or VSFilter64.dll(for 64-bit builds) must be placed together with the x264 binary or in the system path. Do NOT change filenames of them.
Rendering multiple subtitles is possible. Now you can render at most 16 subtitles simultaneously by calling –sub for each subtitles. Note that the later calling of –sub overlays the subtitles after previous calling of –sub, so if several subtitles are in the same position, the last one should overlays on all those rendered before.
The VSFilters are modified to add custom csri API. Patches can be found in svn of direct264 project. Therefore do NOT replace them with other builds. BT.709/BT.601 is auto detected according to video resolution. For HD videos BT.709 is used and for SD videos BT.601 is used.
Both 8-bit and 10-bit builds can use subtitles rendering, but rendering always takes place in 8-bit colorspaces.
The commandline example to render subtitles:
x264_32_tMod-8bit-420.exe –sub “subtitles-1.ass” –sub “subtitles-2.ass” –sub “subtitles-3.ass” –video-filter subtitles[/Other video filters] [Other x264 options] –output “output.mp4” “input.mkv”

——– Attention on high bit depth usage ——–

Several days before madshi pointed out that x264′s internal low bit depth to high bit depth conversion and high bit depth to low bit depth dithering is incorrect. The present converting and dithering algorithms seem to work correctly on full range sources of RGB and Y plane of YUV. Till now neither x264 nor swscale has a correct chroma upscaling algorithm for full range sources, and I didn’t make one. Anyway, the converting algorithm of x264 is absolutely wrong on limited range sources, according to ITU-R 601/709′s standard, in which the conversion should be done by simply appending LSBs of zero to the source. The dithering algorithm may also causes overflow on limited range source. So I hacked on my tMod builds to solve this issue.

When the input and output bit depth are the same, no conversion or dithering will be apllied. Otherwise when used with “–fullrange on”, the conversion and dithering will be exactly the same with x264′s original algorithm, which is still not reliable for YUV sources, so it is recommanded to use your own reliable approaches to convert those sources by yourself before passing them to my x264 builds; if used without “–fullrange on”, the conversion will be done by shifting according to the standard, and the dithering algorithm is fixed as well, so that the result should be absolutely right.



Use win32thread and fprofiled:


My other tools list ( including some of the x264 builds ) : MediaFirenmm-hd

–—––—–Download(L-Smash not included): patches-rev2120.7znmm-hd-Mirror
00-L-Smash(including qtaac in x86 build);
01-Re-enable –tune “touhou” in fullhelp;
02-Film Grain Optimization;
03-Fade Compensation;
04-Remove stats before renaming;
05-Set level of writing options in SEI;(new!!)
06-Demuxer Thread;
07-Auto VBV Settings;
08-Avi output;
09-Filter: hqdn3d/pad/vflip/yadif;
11-Encode Time;
12-Force level;
13-Force profile;(new!!)
15-BugMaster’s new aq-mode 3;
16-Fix bit depth conversion and dithering;
17-Print video info lavf ffms;
18-Enable lto Ofast;
19-AviSynth 16bit hack;
20-Skip bit depth filter;(updated!!)
21-Filter: subtitles;(new!!)
22-1-MixAQ-core(only in tMod+MixAQ version, remove AQDebug)
22-2-OreAQ-core(only in tMod+OreAQ version, remove AQDebug)

mingw-gcc 4.6.2

Libpack info:
libav r31266 git-5695ae4
ffms svn-r587
VSFilter svn-r3698 (MPC-HC)
lame 3.99-3
libvorbis-aotuv_b6.03 (libvorbis-1.3.2)
opencore-amr-0.1.2 r178 git-08d6986
vo-aacenc v0.1.1-7-git-07931e3
vo-amrwbenc v0.1.1-5-git-05114fa
aacplus 2.0.2
faac 1.28
qtsdk 7.3

MixAQ’s diff(AQDebug removed, also included in the patch package above):
OreAQ’s diff(AQDebug removed, also included in the patch package above):

Categories: encode, x264, x264-bin
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: