Archive for the ‘Other’ Category

Compile ffmpeg 64 bit on Windows with MSYS/MinGW-w64

Wednesday, January 8th, 2014

Set up the MSYS environment

Download MSYS from MinGW-builds. Extract it to a path with no spaces, to which you have write permissions. For example, D:\msys. This already includes useful features like pkg-config, Autotools and Git.

Download a pre-built MinGW-w64 from and extract it inside the MSYS directory. This already includes useful features like Yasm.

Start MSYS with msys.bat

In MSYS, run:

echo 'export PATH=.:/local/bin:/bin:/mingw64/bin' > .profile
source .profile

Check that it has worked with gcc -v

Compile ffmpeg and libraries

These steps are similar to the Linux/BSD version of this guide.

git config --global core.autocrlf false
git clone git:// x264
cd x264
./configure --host=x86_64-w64-mingw32 --enable-static --enable-shared && make && make install
cd ..
git clone git:// fdk-aac
cd fdk-aac
./configure --host=x86_64-w64-mingw32 --enable-static --enable-shared && make && make install
cd ..
git clone git:// ffmpeg
cd ffmpeg
./configure --enable-gpl --enable-nonfree --enable-libx264 --enable-libfdk_aac --enable-static --disable-shared --extra-cflags=-I/local/include --extra-ldflags='-L/local/lib -static' && make && make install

NOTE: configure on ffmpeg in mingw is slow. Be patient. You should also check for success after each library has compiled.

This should build ffmpeg.exe as a 64 bit static executable that can be run directly in Windows x64, with H.264 and AAC support. It does not need to be run from MSYS. In my testing, the 64 bit version is approx. 10% faster than the 32 bit version.

If you want it to use DLLs instead of creating a static executable, change --disable-shared to --enable-shared and remove the -static from the ldflags in the ffmpeg configure.

YouTube My Subscriptions grid view

Friday, August 16th, 2013

YouTube has finally removed the old grid view my_subscriptions page. If you don’t like the frankly broken and unusable /feed/subscriptions page, there is a Chrome extension that will fix it for you.

Better Youtube Subscriptions Page
“Transforms Youtube’s broken feed subscription page and restore it to it’s former grid glory.”

In fact, I actually prefer it over the old grid page because it fills the grid to the width of the page, showing more on wider resolutions. It doesn’t seem to hide watched videos, but I didn’t like the grid page doing that anyway because it also hid partially watched videos (anything viewed for more than a couple of seconds).

This app does not require strange permissions that it shouldn’t need or an OAuth login (as YouTube Video Deck does) or anything like that, it just alters your subscription feed to appear as a grid.

As a side note, the YouTube API actually doesn’t need authentication to get channel or video information. You should only need to give login auth if it tracks what you have watched, automatically gets your subscriptions from your YouTube account or anything else that involves your account directly. Although it’s better than a 3rd party website saving your password, you should still be very careful who you give your OAuth authentication to, as it essentially logs them into your Google account for you.

It’s also compatible with the YouTube Ratings Preview extension, which shows the green/red rating bar on the thumbnail before you view the video, although this seems to only show ratings previews on the first 30 or so videos on each page.

The solution to most of the US’ political problems

Friday, February 1st, 2013

In a US election, most states are pretty much guaranteed to vote a certain way. Amazingly, these political parties are actually distinguishable from one another (this is not the case in my country, in which all politicians are equally corrupt, greedy liars that may as well be in a single political party). These parties have been arguing over the same points for decades.

The solution is obvious. Split the republican states and the democrat states into two separate countries. Swing states can either pick and choose, redefine their borders or emigrate. A couple of suggestions for the name of the resulting republican country are Acirema and ‘merica.

This way, the democratic country can have free healthcare, while the republican country can have all the guns they want and so on.

P.S. This post is tongue in cheek. Don’t take it too seriously (unless you’re a US president and think it’s a good idea!)


Monday, February 20th, 2012

Suggestion for YouTube:

Put the green and red like/dislike bar on the thumbnail of the video so you can see if a video is going to be any good before you visit it and to reduce mindless spam from misleading video names and thumbnails.

Possibly the best improvement to YouTube usability since the advent of the play button.

Update: This exists as a Google Chrome extension.

Faster than light neutrinos

Sunday, December 4th, 2011

OK so this is probably going to demonstrate how bad I am at physics, and I will probably be flamed for being an idiot, but here are some of my thoughts on the faster than light neutrinos.

  1. Time slows down as you approach the speed of light. Velocity is a derivation of time (speed = distance / time). This can make it difficult to measure, and the time dilation needs to be accounted for.
  2. When measuring things close to the speed of light, the equipment itself has the same limitations. It takes time for a signal to get from one part of the equipment to another.
  3. The Earth itself is moving in the solar system, the solar system is moving in the galaxy, and the galaxy is moving in the universe. The speed of light is an absolute limit, but the measurement of something moving between two points on Earth is a relative measurement. If something was fixed in an absolute position, it would be moving very quickly relative to the Earth.
  4. The speed of light limitation applies to objects with mass. The mass of neutrinos is believed to be non-zero, but is not yet completely known, and objects with energy essentially have more mass, so the mass of it changes as it accelerates. It’s hard to do maths when you don’t have all of the starting variables.

Windows 8 is the next Vista fail.

Thursday, September 22nd, 2011

I’m calling it now. First Windows ME, then Vista, next 8. All failures, or soon to be.

There’s nothing new in Windows 8 that warrants replacing Windows 7 so soon but there’s enough changed on the surface to piss people off. People don’t like having changes forced upon them (see also: Facebook). The only people that will be getting Windows 8 will be people who got it pre-installed and had no choice, and I don’t see any businesses upgrading to Windows 8 whatsoever.

Concise glossary of reverse engineering

Tuesday, September 13th, 2011

Executes a program, displaying the memory as it runs.

Converts object code to a higher level language, such as C.

Converts object code to assembly.

Charging thousands of dollars for software whose target audience primarily use it to crack software rather than paying for it.

Stop saying SEQUEL

Saturday, July 2nd, 2011

SQL is not the same thing as SEQUEL. If you’re a grumpy old DBA, stuck in your ways, who actually used SEQUEL back in the 1970s, that’s fine. For all the new kids just getting into SQL, it’s pronounced es-que-el, not sequel. When you call it sequel, you sound like just as much of an idiot as someone who says lynuks. It’s annoying.

The “SQL” pronunciation is actually defined in the original 1986 specification for SQL and confirmed by common DBMS such as MySQL.

Visual Studio “There was a problem sending the command to the program”

Friday, March 25th, 2011

Since moving to Visual Studio 2010 on Windows 7 x64, I’ve been getting this error a lot. Every time I open Visual Studio by opening a file rather than running its executable directly, in fact.

Most of the answers seem to revolve around running Visual Studio as a normal user rather than an administrator, but I was already doing that.

Eventually, a reply to this bug provided an answer.

When I checked the key, I saw

"WindowName"="Visual Studio Application Management Window"

Deleting the “system” key then opening a file again worked and replaced the key with working values


When it has the correct values (refresh to make sure that it does) remove “set” permissions from your own user so that it can’t replace them with the bad values, to make the change permanent.

Set default command prompt directory

Friday, February 11th, 2011

It’s too difficult to set the default command prompt directory on Windows. I found several methods, none of which worked correctly.

In particular, it is common for people to set a “cd /d path” in their AutoRun key in the registry but this breaks the power toy and Windows 7′s built in hold shift and right click on a directory to open a command prompt there. This can be worked around by adding a /d to the shell extension in the registry.

What doesn’t seem to be mentioned anywhere though is that this AutoRun key also gets run when you double click on a batch file. That means a batch file which assumes its own current directory (a reasonable assumption – more reasonable than using absolute paths) may not be able to find files in the same directory as it.

What I really wanted to do was move my home directory to my D: drive but the command prompt was still opening on the C:

Most people also seem to only change the default directory of their command prompt to match a non-default home directory.

The first mistake I made was to type “cmd” into the start menu and right click on it to pin it there. This calls it “Windows Command Processor” and starts in C:\Windows\System32 (because that’s where cmd.exe lives). Instead, go through the start menu programs list and find “Command Prompt” under “Accessories” and pin that. It will correctly default to your home directory, because the “start in” is set to %HOMEDRIVE%%HOMEPATH%. Note that you could just change this shortcut’s arguments (cmd /k cd “PATH”) or start in but it will only change it for that one shortcut.

Anyway, once you are using “Command Prompt”, set your home directory. I’m using Windows 7 Pro, so I can go to Computer Management and just set the directory for my user in the GUI under “Users and Groups”. This is no longer available in home versions of Windows (they shouldn’t have removed it) but you may still be able to set your home directory by using the command

net user USERNAME /homedir:PATH

where “USERNAME” is your user name and “PATH” is the directory you want to set. You can check this with the command net user.

When I type “cmd” into the run dialogue, it still opens on C: but at least batch files work now. Further suggestions are welcome.