MythTV .nuv -> mpg and DVD

I started this way, but it takes forever time wise on my Mac Mini and
my quality was pretty bad with all the reencoding that went on. Also,
iDVD is not good for controlling the bit rate on the final DVD. iDVD
would record my content at full DVD quality which would just fit a one
hour show on my single layer DVD-R (lame!).


  I am now doing the following with Linux which takes far less CPU time,
but does take a fair amount of I/O time. Which of course assumes you
have a Linux box.

  1. Demux/Cut MPEG2 content from MythTV with Java based ProjectX. You
can download ProjectX from http://www.doom9.org/DigiTV/projectx.htm .
This application not only has the ability to cut the MPEG (only on
keyframes) without reencoding, but it appears to have fixed all of the
audio sync problems for me. I have yet to tackle real long stuff but my
kids two hour shows are fine.

  2. Re-multiplex audio/video streams with mplex

  3. Create DVD structures with dvdauthor

  4. Create DVD ISO with mkisofs (not sure why others are using
growisofs, mkisofs works fine for me).

  5. Copy DVD ISO to my Mac for burning (My Mac has the only DVD burner
in the house.)

  I started using avidemux2 for step 1. but I had audio sync issues that
I could not correct with a static audio skew. ProjectX seems to do some
kind of correction, and in fact it says it is fixing frame ordering
when I use it in the logs. Total time from transfer of the MPEG2 to my
Linux box to a burned DVD is about 45 minutes. I even have a little
content on one single layer DVD-R which plays on every settop DVD
player I have tried so far (including some xboxes) with zero audio sync
issues. This means three one hour episodes minus commercials on each
DVD-R! Excellent! I started with the following HOW-TO and adapted as I
stated above:

http://www.mythtv.info/moin.cgi/ArchiveRecordingsToDvdHowTo . If you
want all the gory tech details, then I will put together an HTML based
HOW-TO and post it someplace.

Regards,
   John P. Mitchell <john@cepros.com>

7/29 – My Bad Day

7/29 – My Bad Day

 I wish I could provide photographic evidence (maybe I will), but after a few days of not visiting the vegetable field, I went to find all 8 of my remaining watermelons have been destroyed / eaten. I don’t just mean like a little messed up, I mean like inside out, completely gone. All 8 of them. Small ones and big ones alike. Kiko thought it was birds, but I am convinced it was dogs. emoticon

 

That wasn’t the worst of it. I have been doing translating on the side and I haven’t been getting much work in the last few weeks after a supervisor change. Anyways, he decides to give me another job without actually getting my confirmation that I will do it. (long story…) well a long story that ends up with him calling me and berating me for not doing it. I point out that I never said I would, and then he accuses me of ignoring the confirmation e-mail he sent … which I didn’t receive.

Alas, I am on my way to Tokyo for the JET Tokyo Orientation. I will be leaving pregnant Kiko alone, I have to do that translation (or I’m in "more" trouble) and I don’t have any watermelons to look forward to.

Woe is me. (is the spelling right?) emoticon 

Recently…

Other than yesterday’s exciting Jet Journal news, here are a few pictures of what we have been up to the past few days.

It has been very hot, and very busy, but our very good friends from California were in Japan, and we got together in Okayama to see them for a few days. Their kids are crazy cute.

One of Kiko’s best friends, Sanae, has some very good news and is up from Tokyo to visit her boyfriends family in Takamatsu. We were really happy to be able to see them (and Kouichi for the first time!)

Finally, a very nice family, the Yamauchis, had Kiko, myself and Greg over for a great BBQ and a magic show. Don’t get me started with the magic show, the kid is amazing. I have some on video and hopefully I will start getting video up on this site.

Anyways, e-mail me and post in the ugly shoutbox already. Don’t say I don’t love you. 

Also, look at the pictures already.

Friends in Japan Picture   Friends in Japan Picture   Friends in Japan Picture   Friends in Japan Picture

Oh yeah… also had a Jamaican cooking class with semi-real Jamaican food and a real Jamaican. It was actually really good. Curry chicken, rice and peas and pepper jelly. nice. I know you’re jealous.

Jamaican cooking picture

 

Jet Journal 2005

Now… if you have been following this site, you may have seen me refer to myself as a Camera Genius, or a Picture Taking Machine (or something like that)…

 Well, it’s true. I submitted some pictures to this year’s Jet Journal (a magazine that goes out to all 6000 JET’s, and three of my pictures have been selected for publication. Take a look at the cover, and click on it to take a look at the pictures themselves. I’m super. emoticon

Jet Journal Cover 

Writing WordPress Plugins and Hooks

Original can be found here

Hooks: why?
————-

When you write a plugin you want to be able to switch it on and off whenever you want. This is not that trivial: say you write a function that does something useful, simply calling the function from your code gives an error when your plugin is deactivated. If you are lucky, it displays nothing, if you are less fortunate it displays all kinds of ugly debug information that people can abuse.

That is why ‘hooks’ were invented. Simply put, a hook is a point somewhere in the generation of your page where you can attach functions. When the hook is reached, all functions attached to it are executed in order of priority. When there are no functions attached to it, it does nothing.

So a plugin should do two tasks:

  • define a useful function
  • attach that function to the right ‘hook’

Many hooks exist already, and most people stick to those hooks. However, hooks are not black magic. Nothing stops you from defining your own hooks, and that is exactly what I’ll do in this page: I’ll create a trivial plugin, put it on my own hook at a place in the page where I like it.

Adding a hook
————–

The first thing I’ll do is the thing many people fear: I’ll create a hook. Using the default theme as an example, the page has a div called "content" which contains the posts in one page. I might want something to happen on the top of the "posts" section, maybe a status message, or a ‘recent comments’ section. That would be the right place to add my own hook.


Now before do that, there is some danger here: many hooks exist already, and before everyone starts defining their own hooks with the same names, let’s set a rule here: if you define your own hook, it should start with your own initials, to let the world know that it works for your plugins and to avoid name collisions. If it is a useful hook, it might become a standard hook for everyone one day.

Ok. Now let’s dive into the "default" theme directory (of course, we work on a backup) and start hacking on "index.php". The spot I had in mind was on line 4, right below the "content" div. I create a hook here called ‘lv_content_head’, because ‘lv’ are my initials, and it is the head of the content. I don’t use any parameters for now.

Below line 3 of "index.php", right below the "content" div, add the following line:

< ?php do_action("lv_content_head"); ?>

That’s all. If you load the page, you’ll see that nothing special happened. That is as it should, because there are no functions attached to it yet.

Now let’s write a "Hello World…" function.

A "Hello World" function
————————-

Now let’s create a real plugin; the file is called "helloworld.php", which will go in the "plugins" directory. The function is plain php; the "Plugin Name" entry in the commented section is is mandatory.

< ?php
/*
Plugin Name: Hello World
*/
function helloworld() {
echo "Hello World…";
}

Now if you would add the closing php-tag, you could see it already in the plugins part of the site administration. Right now, it is not a plugin yet, because it merely defines a function. The next step is to put the function on the hook. Keep the editor open!

Attaching a function to a hook
——————————

Just now we did two things:

  1. we created a hook somewhere in the generation of the page, and
  2. we created a function that is to be called when the hook is reached.

The next step is to attach the function to the hook. This is done by calling the function add_action, where its first parameter is the name of the hook (‘lv_content_head’ in our case), and its second parameter is the name of the function (‘helloworld’ in our case).

Our editor is still waiting for us, so add the function to the hook, and close the php part:

add_action("lv_content_head", "helloworld");
?>

Now the entire plugin looks like this:

< ?php
/*
Plugin Name: Hello World
*/
function helloworld() {
echo "Hello World…";
}

add_action("lv_content_head", "helloworld");

?>

Call it helloworld.php and put it in the wp-content/plugins directory.

From the admin panel it can now be activated, and it should display "Hello World…" on the top of the content area.

A few more pictures from Canada

I finally managed to pry a few more pictures off of my cellphone. This is Kiko, Chris, Franz & I celebrating Chris B’s birthday at a very good restaurant: Banzai sushi. I still owe him a present though… (not that seeing me wasn’t present enough mind you…) ps. Franz was kind of enough to treat Kiko and I to dinner. Thank you!! (my brain was not working, and I apologize, but upon reflection I could have used that as an opportunity to give Chris a birthday present and pay for his dinner. d’oh. chris, forgive me!)

 

chrisfranzdavidcanada2005.jpg   davekikojuly2005.jpg

The Sunflower Parade

I thought this post was going to be more exciting… (as you can see we have the first ever baby name poll happening to your right, SO VOTE!) but things have been pretty hectic. emoticon

We are finally getting over our jetlag, and even though my school visits are over until September I am preparing for the arrival of the new JET‘s to Japan as a member of the Tokyo Orientation Committee and the Kagawa Orientation.

This Friday I also have a Jamaican Cooking day in my town. Apparently I am in charge so I am going to try and make something resembling Jamaican cooking. They also are trying to get me to sing some Bob Marley… umm… no.

Other than that, I am reading Harry Potter 6 (yeah!) and am getting ready for a busy summer:

  1. July 30th to August 3rd: Tokyo Orientation (in Tokyo)
  2. August 5th: Kagawa Orientation
  3. August (dunno): Interning at the Canadian Embassy in Tokyo (yeah!)
  4. August 25th: Kagawa Orientation #2
  5. Rest of my life: Baby.

My town is known for sunflowers (and frogs, and rice, and being a really small town) and their festival was actually a lot crazier than I thought it would be. Take a look! (click on the picture to go to a gallery.)

2005 Sunflower

Here is a picture of me being a Japanese ninja archer from like 2 years ago. I ran into it on my computer a few days ago. I’m cool. 

I am a Japanese Ninja

Summer in Canada 2005

We are  back in Chunan!!! … and have begun the process to get rid of as much jetlag as possible. We both had a fantastic time back in Canada.

I had a scholarship interview that went fantastic emoticon(I’m gonna need something to do when my contract here ends in 2006/08 or 2007/08.) and we got to see a number of really good friends. That being said, we were completely strapped for time, and for everyone that we were able to see, there were 2 more people we would have loved to but couldn’t. Between my scholarship interview in the first week, my Dad’s operation in the second (he’s ok!) and the fact that we only had 10 days in Canada, we did our best.

For those that we did see: Thank you!!! We had an amazing time. emoticonFor those we didn’t: Next year, February. emoticonWe miss you all, and unfortunately because of the baby, this will be our only trip to Canada back this year. Next year we will be back with Baby Awesome (or whatever he/she is named at the time.)

In the meantime, here are a few sample pictures of what we did while back in Canada, and the full gallery can be seen by clicking here.

Canada 2005 Picture   Canada 2005 Picture   Canada 2005 Picture   Canada 2005 Picture   Canada 2005 Picture   Canada 2005 Picture   Canada 2005 Picture   Canada 2005 Picture   Canada 2005 Picture   Canada 2005 Picture   Canada 2005 Picture