My Deinterlacing and Post-Processing Scripts

Posted by Keith Gable (ZiggyTheHamster) Wed, 26 Nov 2008 15:05:00 GMT

At work, we put up a lot of Flash video. I use On2 Flix Pro for the Flash encoding part. But I get the content in a variety of formats. Perhaps the most common format we get is 480i MPEG-2 video interleaved. I’m encoding on a Mac, and QuickTime cannot correctly feed the audio stream into Flix Pro because it’s interleaved in the video stream. Also, Flix Pro’s deinterlacer sucks. So, I use mplayer and mencoder to fudge the video around and deinterlace it. It’s working very well. Oh yeah, you’ll need Perian.

Read it after the break.

Wait, how do you get mplayer and mencoder on a Mac? mplayer is included in MPlayer OSX. Show Package Contents, Resources, External_Binaries, mplayer, Show Package Contents, MacOS, and bam, your binary for mplayer is in there. mencoder, on the other hand, is hard to find. I ended up using ffmpegX’s mencoder, which is “MEncoder dev-CVS-060307-04:23-4.0.1”, compared to my mplayer which is “MPlayer dev-SVN-r25648-4.0.1” and way newer.

First, I have to strip the MP3 audio stream and the MPEG-2 video stream, into separate files. I have my video rips folder set up with a “scripts” subfolder and a “work” subfolder. Here is my script to dump both streams:

#!/bin/bash

# Takes $1 and dumps it into two files in work/
./scripts/mplayer "$1" -dumpvideo -dumpfile work/dump.m2v
./scripts/mplayer "$1" -dumpaudio -dumpfile work/dump.mp3

Next, I run cropdetect, which is a stupid script to save me typing:

#!/bin/bash

# Runs crop detect on the stream we dumped.
./scripts/mplayer work/dump.m2v -vf cropdetect -vo null -ao null

Next, I run a deinterlacing and cropping filter. And postprocessing maybe, but I’m not even sure if it works in mplayer like it works in mencoder. I’m sure the latest mencoder can let me combine this step with the next one. But as it stands I need to do this in two steps.

#!/bin/bash

# Takes work/dump.m2v and applies the crop in $1
# and deinterlaces, outputting to work/dump.deint.yuv

./scripts/mplayer work/dump.m2v -vf crop=$1,pp=de,yadif=0 \
    -vo yuv4mpeg:file=work/dump.deint.yuv

Finally, I put both streams together, doing final postprocessing. I also convert it to HuffYUV because QuickTime can play it with Perian. Again, I think the latest mencoder has the yadif deinterlacer, which would let me combine the previous script and current script in one step. BTW - A/V sync gets off if you leave out harddup.

#!/bin/bash

# Takes files in work and compiles them into work/output.avi
# $1 if specified is a list of additional filters to apply.

if [ "x$1" == "x" ]; then
    ./scripts/mencoder work/dump.deint.yuv -noskip -vf harddup,pp=de -ofps 30000/1001 -ovc lavc \
        -lavcopts vcodec=huffyuv:format=422p -audiofile work/dump.mp3 -oac copy -o work/output.avi
else
    ./scripts/mencoder work/dump.deint.yuv -noskip -vf harddup,pp=de,$1 -ofps 30000/1001 -ovc lavc \
        -lavcopts vcodec=huffyuv:format=422p -audiofile work/dump.mp3 -oac copy -o work/output.avi
fi

Also, if you noticed, the previous script lets me specify additional filters on the command line if I want. Usually I have to run hqdn3d, but not always.

Oh, and this will use about 1 GB per minute of content, times two because it’s creating an uncompressed file twice (the final AVI and the intermediate .deint.yuv). Don’t run yourself out of disk space! :)

Vista Sucks, But...

Posted by Keith Gable (ZiggyTheHamster) Wed, 26 Nov 2008 07:12:00 GMT

…does Windows Server 2008? I’m currently trying it out, and after killing services that should not be on, I got to 900MB of RAM usage while idle. Noticing “TrustedInstaller.exe” was using ~200MB of RAM, I did some Googling and found out that it’s to do with UAC. So I turned that off - now I’m running at around 625MB of RAM, and at times it dips to 580MB. That’s better; my Windows XP x64 install ran at about 400MB, and those higher resolution images have to be loaded in memory somewhere…

So am I liking it so far? For the most part. Left 4 Dead seems to run a lot better, but this could be due to defragmenting my games partition. I’ll post updates as I use it more. And if you want to know what it looks like, it looks exactly like Windows 2000. I like it like that.

Oh, and two control panel items in Vista/2008 that should not be gone can be brought back to life - Display Settings and Network Connections. Here’s the .reg file:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Control Panel\don't load]
"ncpa.cpl"=-
"desk.cpl"=-

Update on the SiriusXM Censorship Post-Channel Update

Posted by Keith Gable (ZiggyTheHamster) Fri, 14 Nov 2008 14:45:00 GMT

I did a little bit of looking around and here’s what I’m able to deduce:

  1. In the channel merge, some channels were pulled from XM and renamed to match the original Sirius channels. (Think SBC buys AT&T and changes name to AT&T)
  2. These channels broadcast from XM’s studios where their playlists were not explicit prior to the channel merge.
  3. These channels have either not updated their playlists to be explicit due to oversight or intentionally. This is what’s important - if it’s intentional, they had better fix it.

So far, looks like they fixed it. eXonyte confirmed Faction and Octane are not edited, and this morning I heard My Own Worst Enemy by Lit .. and we all know the line “‘cause every now and then, I kick the living shit outta me” .. and that played unedited. This backs up my theory they just weren’t ready for the switch and the XM stations didn’t change their playlists.

If the censorship is fixed - awesome - but they still need to put back BackSpin.

Update 11/17: It’s not fixed. They’re playing a mix of edited and unedited on Lithium.

A Letter to SiriusXM

Posted by Keith Gable (ZiggyTheHamster) Thu, 13 Nov 2008 22:26:00 GMT

I wrote this letter on their online feedback system. I hope it doesn’t fall on deaf ears:


I would like to complain about the new channel lineup. I previously called customer care and they were supposed to note this on my account, but to ensure the customer care operator actually noted my account, I am writing you.

Here are my complaints:

  1. Most music is censored now. I understand this is because the same feed is used on XM and Sirius now and those channels aren’t marked XL on XM. That’s fine - give them the shitty feed and let us keep our profanity. The artist would have left the profanity out if that’s how they wanted the song to sound. And, hey, that’s one of the reasons Stern is on here - because of the lack of censorship. Yet now you’re censoring music.
  2. BuzzSaw 19 is now Boneyard 19, and Eddie Trunk is an asshole, so fuck him. But besides that, you’ve replaced it with the AC/DC limited engagement channel for the next two months. Sorry, AC/DC is not that great. Give me back BuzzSaw or move AC/DC, please!
  3. BackSpin 43 is gone, leaving effectively three rap channels - new rap, new rap, and well, new rap. Awesome thinkin’ Gomer! XM still has their old school hip-hop channel - I want ours back.

Please give me a reasonable timeline for when you guys will undo some of what you did, in particular the censorship. One of the reasons I even chose Sirius was the lack of censorship and therefore Howard Stern and my music as I want to hear it. Expect to lose all three radios as well as a loyal Stern fan if you continue to censor your music channels.

Also, be rest assured that the contents of this are being posted to a relatively high traffic website - please don’t sit around and do nothing. I would love for the manager of programming to read this and set all of his/her minions straight and fix this mess. And for the love of God, don’t send me a canned response.

SiriusXM Channel Changes 1

Posted by Keith Gable (ZiggyTheHamster) Thu, 13 Nov 2008 04:45:00 GMT

I’m pretty happy to be a Sirius subscriber. Commercial free music for the win! Anyway, today they pushed a major channel update that incorporated a ton of channels from XM, sans commercials. Among those channels they moved, they replaced almost all of the pop channels 4-9 with XM versions or combined with Sirius versions. Which I like a lot better. The Pulse moved up to 12 (taking over what used to be Super Shuffle?), and they put a real 90’s pop channel there, which is awesome because I didn’t like The Pulse, but I definitely dig 90’s on 9. I’m also pretty happy with the fact there’s a 2000’s pop channel, because people in my car sometimes want to listen to something besides my presets, and that’s fine. Now, it’s stupid they didn’t put it on channel 10 or 20 to fit in the numbering scheme they’ve been using (except that would piss off Bruce Springsteen and/or Octane, but screw them both). And what pisses me off about that is that they replaced Boombox with that channel.

And that’s not the only channel they killed that I liked. They killed BackSpin 43 and BuzzSaw 19 too. I would say BuzzSaw wasn’t dead per se, but Eddie Trunk is annoying - I much prefer Long Paul, Keith Roth, and Kim Mulligan - and my experience with Eddie is just at Rocklahoma. Especially since they replaced BuzzSaw with AC/DC radio until next year. Yeuck - AC/DC rules, but not 24/7. Throw in some other hard bands and you get, well, BuzzSaw! Either way, it looks like we screwed XM out of Boneyard, so I guess I can be happy about that (but we got screwed out of it too - it doesn’t start until next year).

That said, on the other presets I had that changed, I am totally happy with the new changes. bpm can replace Boombox as far as I’m concerned, and they kept the Sirius DJs for Big 80’s (80s on 8).

Update 11/13: Since they’re broadcasting the same feed on both XM and Sirius, the XM “non explicit channels” that made me not buy XM in the first place are fed over to Sirius. I’m fucking pissed. 1-888-539-SIRIUS (7474) is the number to call. Seriously, I’m paying $6/mo, I want my profanity goddamnit.

Wishlists for 2008 2

Posted by Keith Gable (ZiggyTheHamster) Tue, 11 Nov 2008 23:14:00 GMT

I have wishlists. You should buy me things from them:

  1. ThinkGeek
  2. Amazon