Stick Theory: How To Use x264 Like A Pro, Only Pro’s Can’t Legally Use It For Production Work

Just as String Theory attempts to govern the universe, Stick Theory governs how x264 works. Stick Theory is the theory that when choosing x264 settings, even if you have no idea what anything does, as long as your keep throwing shit at a wall, you’ll see what sticks, resulting in quality video.

A trend I notice is that very few people can really use x264 properly. Everyone expects wonderful magical GUI’s and automated shenanigans where you just set a preset and leave it, and your video comes out looking reasonably non-crap. The thing many people don’t know is that CLI is good for you, and not as scary as one might think. Additionally, x264 has presets now, and soon, a –device flag for incredibly simple encodes for PS3 or Windows Mobile or whatever else. This makes basic x264 usage really simple. Just read x264 –help, or if you want more comprehensive info, –longhelp or even –fullhelp.

I lurk in a lot of IRC channels. More and more often now, I am seeing people asking in places like #Archlinux how to encode. The channel is for linux discussion, not encoding. At the same time, the guys in #x264 don’t really like handing out tailored settings for every random lazy guy that drops into the channel. Spending two minutes on a quick google search will give you most info you want to see. http://mewiki.project357.com/wiki/X264_Settings should be one of the first results, and it has more info than pretty much everywhere else on the entire internet besides for possibly the musty halls of Darkhold, or inside Loren Merritt’s head.

I also see a lot of users calling Random Distro X crappy just because it doesn’t provide a crappy tool like Handbrake to transcode their porn with. The thing is, x264 is really easy to use. It’s simple, can be installed or compiled in seconds, and with the preset system you can do pretty decent encodes as long as your source is good. There is no real need for a GUI or for people to think encoding is hard. x264 is practically made for the lazy man now. Stop filling up my 119 IRC channels with useless shit about why you suck at encoding people.

The other problem with x264 users of course is that they often don’t know what different settings do, and mess with them anyway. This is where Stick Theory comes in. While throwing random shit at a wall DOES eventually give you a good result, what is significantly faster and more informed is to learn what common x264 settings do, especially things like the vbv-buffer, crf, aq, psy-rdo, trellis, bframes, b-pyramid, subme, motion estimation, rc-lookahead, and a few others. The above linked wiki article is a very good repo of x264 info mostly written by some very talented encoders (look Dae, I called you talented!)

Knowing what you’re doing will let you write out a full x264 command string in less than a minute to have a very well tuned encode, tailored for your content, resulting in VERY nice results. Of course this isn’t strictly necessary, but knowing it always helps. That does however sound tedious. Luckily, with x264, you can use both the presets AND the main flags, allowing you to choose a preset, autotune it with the –tune flag, and then override as necessary for a very easy yet customised encode string. And all in the space of a minute.

Now, stop being lazy and get off my lawn and out of my IRC channel. x264 does all the work for you, it’s MAGIC I say! (Some might argue that the AI in things like AQ and CRF is sentient, but Dark_Shikari assures me it isn’t, yet)

This Is Not An Elaborately Large Quote I Am Just Writing Some TL;DR About Subtitle Formats To Explain Things As Requested By The Masses

While speaking to Eric over at Siren Visual and my bro Shadow Wolf at Supanova this weekend, the topic of various subtitle formats and how they impact visual typesetting and typography came up. Today, I’m going to be writing about the three main ways you could classify subtitle formats and how they work; namely, text-based subtitles, DVD IDX/SUB format, and the two (yes two!) BD subtitle formats, PGS/SUP and TTXML.

I’m super lazy and there is so much variation in test-based subtitling that I’ll sorta skim over this. Text-based subtitles are formats such as SRT or SSA. They are common in the ripping and fansubbing communities mostly for their ability to be turned on and off at will. Some are more complex than others. ASS (SSA V4+) for example is capable of rendering full text effects as well as vector graphics and with a container like Matroska, it can be packaged with fonts and used for full typography and visual effects as well as the subtitles themselves. SRT on the other hand is a much more basic format, it just stores lines with their times. There are many formats like this and they are used in many places and so I leave further research to the reader as this post is mostly aimed at DVD and Blu-Ray.

DVD uses a format that can be referred to as either IDX, Sub, or VobSub after the horrible renderer for Windows it used to have. DVD SUB uses 4 colours in a raw bitmap storage format. That said, the way your DVD player displays each of those colours is up to the manufacturer as the palette has 16 colours, and there are a further 16 contrast values, also with only 4 that can be used. The four colours are for the background, foreground, outline, and shadow. The background colour is generally an alpha field and so your sub-picture will overlay onto your actual video with transparency, and not covering it. Common ‘fill’ colours are white, yellow, and pale blue, while black is the most common outline. Most players have a transparent shadow, although black is fairly common too.

Blu-Ray on the other hand is a bit better. It uses 24-bit colours in its sub-picture format. This allows for a rather unique ability on a Blu-Ray, if anyone was to take advantage of it (Siren Visual I am looking at you.) Given a BD disk has so much space on it, yet most times that space isn’t utilised even CLOSE to fully, one could take advantage of this 24-bit colour (+alpha) to render full ‘soft’ typesetting onto the video. A studio could open up their compositing application of choice, do their thing, and then output a PNG sequence. Convert that to SUP, mux, and you now have full soft-sub typesetting on a BD release. I have yet to see ANYONE in the industry typeset at all, regardless of method, so this would be a real bonus on release quality.

The second format Blu-Ray has, and it seems a lot of people don’t know about this, is TTXML. TTXML shouldn’t be confused with the MP4 format’s Timed Text, which is usually referred to as TTXT. TTXML is a format mostly defined by Adobe, although barely supported by any software I have seen including Adobe’s own Flash player. It is a text-based format similar to Ogg Kate or SSA, only using XML. It is rather basic and from what I can tell (limited spec) it has no vectoring capability, but I assume SVG incorporation isn’t too difficult. It is capable of the general font selection, bolding, styling like outline and shadow, stretching, and basic text animation effects like karaoke by it’s time function, quite similar to the ASS \t flag if more basic. I have no idea if many hardware Blu-Ray players support this format, but I’m just putting it out there that it exists.

This concludes me writing walls of text about subtitles, it’s 11:48PM and my fingers are freezing. We’ll see if anyone takes interest in the Australian Blu-Ray Industry.

Contrary To What Vivid Wireless Seem To Think Not All Of Australia Lives In The Stone Age

This might shock the folks over at Vivid Wireless but there are people in Australia that aren’t living in what most of the first world would consider the stone age of broadband and video, at least as far as usage goes. I had a brief look at the collective circlejerk on Whirlpool just now after seeing an advert for Vivid on TV while making my lunch and all I could think of was ‘lol’. Ok, so Vivid clearly hasn’t got 4G yet even though they advertise it, but the claims that when it happens it will blow ADSL2+ out of the water? I’m not seeing what appears to be 10mbit coming even close to blowing 24mbit away.

I’m going to shy away from the speed issue seeing as it’s well known that Australia has shit speeds no matter what. What prompted this post was the traffic restrictions they seem to impose, and more specifically their bullshit calculator. For starters, I cranked their usage calculator dials until I got my current monthly usage (if it wasn’t for my pesky lack of HDD space anyway.) The calculator then told me I was best suited for their 40GB plan, about 200GB short of what I actually use. This irked me a bit, how can an ISP that offers home connections not have a plan bigger than 40GB, given it costs $100 monthly.

I decided to take a look at what they consider average use. For starters, a TV episode for Vivid is about 1.3GB and is watched on ABC iView and YouTube, as opposed to downloading something that’s actually worth watching. Streaming is NOT the answer, everyone is a dirty pirate and a real ISP would know that. I was also a bit put off by what they consider the size of one movie. At first I suspected 700mb for an average shitty XviD encode but it turned out to be worse, but unsurprising. 3.4GB, the size of a common DVD online download. Hi guys, welcome to the age of bluray, where a single movie is usually 45GB if directly pulled from the disc, or if you had some cool compression going and properly encoded audio it’d be around 12GB. It’d be nice if HD movies were made available intelligently but that’s a pipedream for now.

I don’t understand how an ISP that’s supposedly done so much research has NO FUCKING CLUE about their own target audience. They rabbit on about having the latest technology and knowing what the market wants but when it comes down to it, a regular user is going to go with something far cheaper like Telstra’s 3G with it’s superior coverage. They don’t notice the speed difference or even care about it, Telstra is a name they trust. On the other side, the more technologically inclined users wouldn’t ever go for plans that are so restrictive.

Obviously my own ISP has silly rules regarding copyright and what a user downloads, but they aren’t stupid about enforcing them (having a few servers in Europe really helps) and I haven’t had any problem from Amnet yet concerning my huge and blatant copyright violations. Probably not the smartest thing to write about on the internet when I think about it. I don’t see the police here giving a shit about a few hundred grand worth of software, music, and video content though. (This is where I go “lolitrollu”)

To wrap up, Amnet recently upgraded all their plans up until the one just below mine, so $200/mo gets you 100/150GB while $99/mo gets you 70/140GB. For 40GB less the price difference is huge, but it’s mostly stripped from the peak. I might consider switching though, who knows.

Theora, H.264, HTML5, and Why Software Patents Are Giving Everybody Fansub Ice Cream

DISCLAIMER: This post is mostly about debunking myths and incosistencies. I’m going to start off by stating that I don’t know all that much about software patents, and that I really don’t care about them or legality. If the GPL Legal Team wants to sent a van for me, go right ahead, I violate your shitty license daily and I’m not going to stop for some freetards and their dignity. Additionally, although I condone and support piracy in some circumstances, this does not include supporting piracy of most commercial applications, especially those of Adobe and Apple. I wholeheartedly support stealing whatever you want from Microsoft.

Recently, there has been a lot of talk of Mozilla and HTML5, specifically over the proposed video tag. Mozilla and Opera are opting for Ogg Theora while Apple and Google are going for AVC (H.264). While I am a long-time Opera user, the change away from Qt has not pleased me, and the 10.5 screenshots are ugly as sin, so it looks like I won’t be concerning myself with that any time soon. I hate GTK so Firefox isn’t really an issue either. That does of course leave me with no browser to use but I’ll figure something out. The important thing though is that Mozilla Firefox is the biggest open-source browser in the world, as far as numbers go, so using Theora as opposed to AVC is a bit of a problem, and that is where the issue that prompted this post came in.

There is what I like to think of as a communal uproar on the internet about this. A schism if you will. Everyone is divided on what Firefox should use, even though the team has said (for the moment) that they’re going with Theora. The one thing that really got to me is people assuming that OGG == Theora. This is not the case. Another problem is that people assume x264 is an open-source implementation of H.264, also not the case. This article really shows that off fairly well. While x264 is an encoder, H.264 is a standard. OGG is a container and Theora is a codec. People messing up their terms has made following articles like that one rather difficult at times.

The main problem as I see it is that people are disillusioned by what Theora is capable of, and exactly how the royalties for H.264 work. Freetards say things like “contribute to Theora to make it better then” but as the codec is patent-free, it is fairly limited in what can be added to it. There is very little more that Theora can do, and nothing it can do to even approach AVC’s quality.

H.264 on the other hand has some difficult to comprehend and confusing patents involved. As long as you don’t intend to sell your stuff publically enough to grab the MPEGLA’s attention, there is really no issue though. Not all patents are even valid outside of the US. A patent in America isn’t really going to mean much to someone in Europe as the European Patent Convention doesn’t allow software patents, and from the pool of developers I know quite a few are european. There are of course countries where AVC is patented in Europe, but I don’t think the MPEGLA isn’t going to track someone down to backwater Norway (or anywhere else) just to yell at them for using unlicensed H.264. If you encode something with AVC and stick it on your website, they’re hardly going to come after you. It certainly does explain a bit about why Madman and other silly companies use VP6 though.

Another thing I see a lot of is people going on about “x264 is ok to use, just not H.264!” As I wrote above, they are not comparable like that at all. Additionally, some people are writing that OGG/Theora have patents too, where they don’t at all. The whole point of Xiph is to have no patents, which is mostly why it’s so shit terrible. There is of course the ffmpeg project which sort of ignores patents altogether, although they are very heavy-handed on GPL violations, especially of their own work, to the point of a wall of shame. It just shows how childish and bigotted the FOSS community can be.

What it comes down to is that H.264 has royalties and patents, Theora does not. Theora can be used in anything but as it’s a piece of shit as far as codecs go, it shouldn’t be used under any circumstances. H.264 is free for non-commercial use, something people seem to either forget or ignore, and the fees for commercial use are usually covered by your software and/or hardware, and not as Ben Shwartz writes, completely separate.

For an Operating System or commercial encoder/decoder to say that distributing your AVC files may require an additional fee is entirely correct, and there is no problem with it. If you are using that software in the first place and distributing commercially, you can afford the fees anyway, they really aren’t that high, and they have thresholds on where they begin and are scaled depending on your needs. That is to day, if you distribute only one copy, or even more than one but still relatively small, say as a video editor for functions, the fees don’t really apply. The standard does have a royalty-free period to encourage adoption, which has also just been extended.

As far as royalties go for a browser to decode things, it would be far simpler for it to rely on the system. On windows that would mean using VFW to select a decoder, and in *nix, my guess is libavcodec. This really kills the argument that free browsers cannot decode AVC without having to pay for it. Nothing is stopping Mozilla from making a paid version of Firefox that links to MainConcept’s decoder but I hardly see the point in that: almost all video online currently is H.264 and the browser handles that perfectly well in the flashplayers, why does it need to suddenly stop handling it so well?

Furthermore, along with codec wars, people are starting to get into container wars. There has always been a cold war as far as containers go (Hi NUT) but the arguments that one cannot stream Matroska for example are just ridiculous. Almost all streaming now is just sequential downloading of the file or beginning from a specific point and then downloading, as opposed to ‘real’ streaming. Calling a container a codec or incapable of streaming just shows off people’s ignorance and stupidity.

Naturally there is some contestation in the business world, something Jason Garret-Glaser (Dark Shikari) covers extremely well over at his blog, mostly about Adobe trying to take over the world and how everything besides Windows is irrelevant. In Ben Schwartz’s article above, Aki Jäntti (Kuukunen) makes some interesting comments about comparisons of AVC and Theora, and how optimisation effects it.

I too was present during the discussion of the –tune option in x264, and the developers really did put a lot of thought into it, especially on the Touhou setting. Something to note is that a game like Touhou is excellent for comparing codecs, its rapid changes in motion and bright simple colour make it rather good for testing at lower bitrates, which is about the only thing Theora is capable of being compared against.

I believe that most people comparing codecs aren’t really good at optimising all the codecs they’re working with, and as such most comparisons are skewed. As far as commercial use goes, x264 is on the brink of nal-hrd being committed, and once VFR works with nal-hrd I would imagine x264 could then be used for mastering standards compliant blurays, and would become a real contender. As far as visual quality is concerned, x264 is by FAR the best encoder in the world at this point in time.

Finally, to link this all back to patents and ice cream, this comic shows what I am talking about rather aptly. People in the FOSS community are so anti-patent and buying ANYTHING that they will use any free alternative, no matter what. They shun people for deciding against free things even if there is no better commercial option purely because they believe too strongly in flawed ideals. This is the main problem in the argument against AVC and for Theora in Firefox. They are too hung-up on using something free, even though it’s terrible, to notice that they CAN use H.264 without any problems. The entire argument is pointless, but it still drags on.

I think this is the longest post I’ve ever written, I completely and utterly blame stupid freetards for this, especially the Mozilla foundation, which honestly needs to die. Firefox is a terrible browser and I’m going to be an opinionated little elitist and not use it and there is nothing you can do about it. Long live x264 and Qt based webbrowsers.

Telecide Will Kill Your Children

It was recently pointed out to me that Certain Content Authoring Communities are still living in the dark ages. I occasionally speak to someone who writes their ‘guides’ but really it’s about time things were updated, especially to be clearer on The PAL Situation. Long ago in the bleak days of everything being shit, Donald Graft wrote his Telecide filter, a filter for performing Inverse Telecine. For those familiar, IVTC requires both field matching and decimation of resulting duplicate frames. Telecide is the field matcher.

While speaking to a friend named Vincent, I discovered that a video he was showing me was a little jerky, so I took a look. It was quickly apparent that every 5th frame was a duplicate. A classic sign of field matching without decimation. So I said “Hey Vincent, what the fuck did you do?” to which he replied “Oh I just followed the guide on the .org, it says just use telecide().” He was quickly informed of a longer filterchain to use which included decimation, however this had me a bit worried.

Tritical’s excellent field matcher and decimation filters (TFM+TDecimate) were written years ago and are effectively the standards inside the non-shit open source video editing crowds. I still use telecide myself for specific reasons at times however for blind IVTC it’s mostly useless. I couldn’t comprehend why people were still using it, and then it hit me. ‘AMV Editors’ are fucking retarded and have no clue as to what they are doing in the slightest. Every last one of them. Learn to RTFM guys, it’s not hard.

tl;dr amvfags suck cocks and can’t encode for shit, everyone go use TFM+TDecimate now k <3

On the Topic of Stupid

“If I master a movie with Windows Movie Maker and I burn it to a DVD-R as a DVD, how can I get it back onto the computer?”

…was the question that I was just asked. Besides the stupidity of using WMM, what really got to me here was the way he tried to sound so knowledgeable about the topic. I would imagine that if he was able to encode the thing, he would have a copy already on his computer, but apparently not. Short post that isn’t really important but is just a minor vent about encoders being retarded.

In that regard, a Certain Man in Sydney that I will not name has gone and shown himself to be just as stupid as I suspected by going on about how great encoding on servers is. Sure it’s faster on the upload and possibly on the processing depending on the gear, but that doesn’t make it better. For one thing, CLI encoding is almost impossible to watch over and ensure quality on. YATTA isn’t exactly made for server use either. Fuck you, CommieSubs, for bothering to put out shit when all you do is kill the scene.

Ohi AAPT, Why Won’t You Let Me Give You Money?

The other day, I came across this GLORIOUS offer from AAPT, an ISP in Austfailia. This afternoon, I gave them a call to enquire as to how good a deal it really was. Connection stability and speed aside, I went straight to the important bits: QUOTA. Australia has this awesome idea that all ISP’s should offer a quota, as in, if you download more than a certain amount during a certain time of the day, say hello to symmetrical 64kbit speeds. Obviously this AAPT offer for TRULY UNLIMITED off-peak downloads was awesome.

I download a lot, and I mean, a LOT. So when I called AAPT, I was much less than pleased to find out that their peak quota maxes out at 60GB. Nonetheless, I persevered, only to be completely and utterly shocked that an ISP is unable to handle multiple connections to the same physical location over different lines. I have two phone lines (disconnected from actual phones, because I live with a bunch of antisocial misfits) and I also have a dual line modem. It allows me to plug two lines into the modem and effectively split traffic between them.

I guess you can see where I cam going with this: $200 a month for 120GB peak, unmetered offpeak, 48MBit, although at my distance from the DSLAM it would be more like 12MBit, still a vast improvement on my current speed, at a slightly cheaper price. However, it seems AAPT is unable to have two COMPLTELY SEPARATE LINES going to the same client. How is that even a problem AAPT, please, just tell me.

My current quota is roughly 750GB including WAIX. I use almost all of this. How long till an ISP in Australia can offer me a useable plan I wonder? I pay an absolute fortune so clearly funding isn’t an issue, but why is it that no matter how much I pay I cannot get a non-commercial line with reasonable speeds and tranfer? The only thing I need say further is the following:

Dear Each and Every ISP in Australia,

Fuck you all.

Love,
Emess