March 14, 2007

House Dictionary

Congratulations! By following these tenets you’ll hopefully be able to gain some useful information on how to speak and understand us.

Rule 1: Any movie quote, tv quote or music lyric must be followed by its corresponding line.
E.g. “It means nothing to me” – “Oh Vienna!”

You can bend this rule slightly, to spatchcock quotes into the conversation, but this is generally frowned upon. The more well known the quote, the more impressive it is. Similarly, the more tenuous the link, the worse it is.

Rule 2: Microwave = nukrowave. If we cook something in the nukrowave we are “nuking” it. If we cook something for a long time, we are “nuking it from orbit” (“it’s the only way to be sure” – see Rule 1). You make nukrocake in a nukrowave.

Rule 3: Defrosting chicken usually involves a short period of SnoopDog speak. Defrosting some chicken becomes “defrizzling some chizzle”. Ma nizzle.

Rule 4: Coke is Cock. Diet Coke is therefore Diet Cock

Rule 5: Depending on your location, a sequence of Ra’s either culminate in a “bear” or a “Merchant Navy”. Hence “Ra ra bear” and “Ra ra ra Merchant Navy”.

Rule 6: When describing Boursin you must use as few syllables as possible in as guttural a French accent as possible. Hence “Bourrrrrrrrrrrrrgh”

Rule 7: An Ice Crime occurs when there are 2 or less icecubes in a tray.

Rule 8: When you need to clean something (a room, the dishes) you need to use “cleansing fire”. An exception may be a particularly untidy room in which case you can “nuke it from orbit” (itowtbs).

Rule 9: If someone yawns in a vocal way, the polite response is “Easy Chewie”.

Rule 10: Depending on what is happening, arbitrary rules may be placed on speech to enjoy hilarity at others bewilderment. Examples include speaking only in iambic pentameter, and singing your sentences like an opera singer. The rules are usually relaxed when the bewildered party leaves the area.

Rule 11: Most words can be verbised. Or verbinated. Verberated. Verbified. The process of this may be called verbification. The more verbification you can add to a word, the better it is.
E.g : I cleansified the bathroom, I haven’t deciderated yet.

Rule 12: Any and all puns must be declared at time of thinkeratage.

By followerating these simple rules you ensure a better environment for all.


March 05, 2007

Shuffle with Geexbox

Time for a blog!
WARNING - GEEKY COMPUTER STUFF AHEAD.

Thought I'd address a burning issue in our house - namely, our media centre PC can't play files randomly (ie shuffled). This of course is a major major issue, so I set about fixing it. And I did.

Firstly, I had a poke around Geexbox's filing system. Unfortunately MPlayer only shuffles if you specify it from the command line, which didn't really work for me. So I looked at how files were passed to MPlayer itself.

Turns out, when you create a playlist, it gets written to a playlist file (.pls). "Aha," thought I, "I can randomize the playlist file itself!" So I looked into a program to do this for me. Now I could have written lots of code, but I couldn't really be arsed. So instead I tried to make the shell do most of the work for me.

Being as Google is omniscient, it led me to http://www.shellarchive.co.uk/Shell.html where I found this code fragment:

   while read line; do
       echo "$RANDOM $line"
   done | sort -n | cut -d ' ' -f '2-'


Ingenious. And almost perfect. Unfortunately the $RANDOM variable is not in ash, the shell Geexbox uses (though the other tools are, thankfully). So I had to write my own little C program for generating randoms. Suffice it to say, it works (though not without a few teething bugs, which were expertly programmed out hacked around)

Utilising the above code, mixed in with some scripting, and allocating keys on our All in Wonder, I can now play shuffled directories to my heart's content.

Unfortunately the above glosses over the time spent working out how to compile my program properly, compiling the kernel and generally trying to make it work. I'm slightly annoyed at myself, because if I put the effort into uni work that I have into interesting projects, I'd be set.

Now, for a beef sammich.


October 11, 2006

Show of hands….

Ok, it’s time I ask this question.
How many of you think my name is awesome?

Just in case you don’t know my name :D it is…

Max Dymond

Edit: (Dymond is pronounced Diamond)

What I’m expecting is for half of the people (if any) who reply to say:
“Meh.. nothing special”
and half to say:
“That’s an awesome name.”

It’s the most random people who say it. Apparently the girl at Southern Electric thought it was awesome when we were setting up our bill, and she actually said so.

Since you probably want a real question too….

Onion rings – battered or breaded?


September 25, 2006

Films they should never had made sequels of…

I’ll open with Jurassic Park and Men In Black.

Over to you!


September 23, 2006

I'll take languages you shouldn't write complex programs in for 100 please Alex…

Follow-up to The wonderful tale of VFR FLV1 to CFR AVI to 3GP from Shine on, you crazy Dymond

I almost forgot I was going to write this update, but meh.
I wrote a script in PHP (that’s probably worth more if written in C, but unfortunately I don’t know how to write C) that negates the need for converting to MKV etc.
It turns out that VFR FLV has the timecodes built in to it. Using the code from FLV Extract , convert-timecodes and timecode2avs, I wrote this.

With any luck, someone who is well versed in C can either help me translate this, or give me some pointers on the knowledge I’d need to do it. It works, but I reckon using C would help – not least in actually using unsigned ints :p

<?php
if ($argc == 2){

    $file = $argv[1];
    if(!file_exists($file)){ die($file.' does not exist'); }

    function strhex($string) {
       $hex = '';
       $len = strlen($string);
       for ($i = 0; $i < $len; $i++) {
           $hex .= str_pad(dechex(ord($string[$i])), 2, 0, STR_PAD_LEFT);
       }
       return $hex;
    }

    function strdec($string){ return hexdec(strhex($string)); }
    function ReadUInt8($fd){ return fread($fd,1); }
    function ReadUInt24($fd){ return fread($fd,3); }
    function ReadUInt32($fd){ return fread($fd,4); }

    function Int8($fd){ return strdec(ReadUInt8($fd)); }
    function Int24($fd){ return strdec(ReadUInt24($fd)); }
    function Int32($fd){ return strdec(ReadUInt32($fd)); }

    $fd = fopen($file,'r');

    $header = ReadUInt32($fd);
    $flags = ReadUInt8($fd);
    $dataOffset = Int32($fd);

    fseek($fd, $dataOffset);

    $prevTagSize = Int32($fd);

    $tmp = fstat($fd); $fs = $tmp['size'];
    $timecodes = Array();

    while (ftell($fd) < $fs) {
        $tagType = Int8($fd);
        $dataSize = Int24($fd);
        $timeStamp = Int24($fd);
        $timeStamp |= Int8($fd) << 24; 
        $streamID = Int24($fd);
        $mediaInfo = Int8($fd);

        $data = fread($fd, $dataSize - 1);

        if($tagType==9){
            //echo $mediaInfo & 0x0F.'<br/>';
            $timecodes[]=$timeStamp; 
        }
        $prevTagSize = ReadUInt32($fd);

    }

    fclose($fd);

    $fmsg = '';

    function fecho($x){
        global $fmsg;
        $fmsg .= $x."\r\n";
    }

    fecho('source = DirectShowSource("'.$file.'")');
    fecho('audio = DirectShowSource("'.$file.'")');

    $curtime = 0;
    $framestart = 0;
    $curfps = 0;
    $startframe = 0;
    $starttime = 0;
    $curframe = 0;

    $curvid = 0;

    for($i=0;$i<count($timecodes)-1;$i++){
        $framestart = $timecodes[$i+1];
        $framedur = $framestart - $curtime;
        $framefps = 1000 / $framedur;

        if(abs($framefps - $curfps)>1 && $i>0){

            fecho('video'.$curvid.' = source.trim('.$startframe.','.($i-1).').AssumeFPS('.$curfps.').ChangeFPS(119.88)');

            $curvid++;

            $startframe = $i;
            $starttime = $curtime;
            $curtime = $framestart;
            $curfps = $framefps;
            $curframe++;
        }else{
            $curframe++;
            $curtime = $framestart;
            $curfps = ($curframe - $startframe) * 1000 / ($curtime - $starttime);
        }
    }

    if($curvid<5){ die('This file does not seem to be VFR. Try encoding it directly!'."\r\n"); }

    fecho('video'.$curvid.' = source.trim('.$startframe.','.$i.').AssumeFPS('.(float)$curfps.').ChangeFPS(119.88)');

    $msg='video = ';
    for($i=0;$i<$curvid;$i++){
        $msg.='video'.$i.' + ';
    }
    $msg.='video'.$curvid;

    fecho($msg);

    fecho('audiodub(video,audio)');
    fecho('FDecimate(29.97)');

    $fd = fopen($file.'.avs','w');
    fwrite($fd,$fmsg);
    fclose($fd);
    echo 'I wrote the avs file to '.$file.'.avs'."\r\n";

}else{
    echo 'Usage: '.$argv[0].' <flv file>'."\r\n";
}
?>

July 24, 2006

The wonderful tale of VFR FLV1 to CFR AVI to 3GP

WARNING: Needlessly long tech ramble follows.

So, browsing Youtube, like you do, I come across Interpretation of Trivium
Now, I quite like Trivium, and even though the video disses them a bit, I still like it. “Boat, Rudder, Strange Mountain!”

Anyway. Saving it for posterity, it goes into an flv (Flash Video). VLC player can play these quite easily. “Magic”, I thought, “FFMpeg can convert this no problem”.

Unfortunately, I was wrong. For some strange reason, the video was randomly sped up in places. So, I found FFDShow, which can understand FLV1 files, and uses DirectShow. The files played fine in MPC, Media Player, VLC – but as soon as they were converted they messed up. Moyea Flash to Video converter worked fine, but there was a massive watermark over the picture, as it was a demo.

I installed AviSynth. This is where the fun began. AviSynth’s DirectShowSource filter was giving me the same output as my AVIs. “Strange”, I thought. Googling led me to my problem: VFR.
Variable Frame Rate. The AVI container format is quite happy working with CFR (Constant Frame Rate) but as soon as you start going variable, it messes up. “No matter!” thought I, reading the documentation for DirectShowSource. “ConvertFPS will solve it!”
Err.. No.
So, after more googling, this lead me to Graphedit, which is possibly the coolest bit of kit Microsoft has done. You can chain together DirectShow filters and output them anywhere.
Another google found a forum post recommending Matroska as a halfway house to AVI. So, I set up Graphedit – FLV->FFDShow Decoder->Xvid Encoder->AviMux->File Writer.
Success! The video played fine! This was because MKV is a clever little format that understands VFR.
Fuelled by this development, I frantically Googled for VFR MKV to CFR AVI solutions. The AviSynth page didn’t really help with this, but I found a tool called mkv2vfr. This would give me an AVI, and Timecodes of the frames. Using TVITC, I could create a proper AVI!
Except, mkv2vfr didn’t work. Disheartened, I instead looked at MKVtoolnix. MKVExtract has a function that gives out V2 Timecodes. mkv2vfr gives out V1 Timecodes, which are easier to work with. convert-timecodes.exe sorted this little hiccup up.
Another google found Timecode2AVS – A brilliant idea. Since V1 timecodes are in the format
frameX,frameY,framerateFromXtoY

you can convert every one of the lines in the file to the form
source.trim(X,Y).AssumeFPS(framerate).ChangeFPS(119.88)

The ChangeFPS is because it’s the LCM of 24 and 30. At the end of the file, you have to glue all the bits of files together, and then FDecimate(targetFramerate). In my case, I originally used 24. Having problems, I disregarded this method. Noticing later that my frames were around 30fps, I changed the setting from 23.976 to 29.97. It worked!

Now, all I had to do was set source to DirectShowSource(“Interpretation of Trivium.mkv”) and hope… Thankfully, it worked!
The last steps were academic really… VirtualDubMod can handle avs files, so I imported it and turned it into an XVid. The project that had me banging my head on the wall was complete! I’d turned a VFR FLV/MKV into a CFR AVI. The final step was to throw it at 3gp_Converter (which runs FFMpeg under the bonnet). Being CFR, it had no such problems this time.
Finally, I had my 3GP FLV :p Now I can take the best of YouTube to the pub with me.

In short:
1. Open FLV with Graphedit (with FFDShow installed and FLV1 activated)
2. XVidise the video and mux it with Matroska
3. Extract the V2 Timecodes
4. Convert the timecodes to avs, and edit the filenames, etc
5. Import the avs into VDubMod
6. Export as AVI
7. Import into 3GPConverter
8. Play your brand spanking new 3GP file!


September 2023

Mo Tu We Th Fr Sa Su
Aug |  Today  |
            1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30   

Tags

Galleries

Most recent comments

  • Two years have passed since I wrote comment 26. I haven't seen Indy 4. Was my prediction accurate? by on this entry
  • WHATS EVEN FREAKIER KEN IS THAT YOUR BROTHER ALSO FOUND THIS PAGE!! and his favourite band is Pink F… by Michael Dymond on this entry
  • It is indeed an awesome name! When people hear my name, they generally think I've made it up and I a… by Ken Dymond on this entry
  • This is a good entry. by on this entry
  • I've always heard it as die–mond. by joe dymond on this entry

Blog archive

Loading…
RSS2.0 Atom

Current Info




Not signed in
Sign in

Powered by BlogBuilder
© MMXXIII