Wednesday, September 24, 2008

 

Remultiplexing Video Files

A common error message people may encounter when making a DVD:

"WARN: Skipping sector, waiting for first VOBU..."

I come by this error fairly often when presented with video files that were created in half-dvd format (352x480 resolution).

The solution is to demultiplex and remultiplex the file. It's useful to know how do to this manually as some automatic scripts like tovid may not always work as expected.

Let's say we have a video file called start.mpg which is already in half-dvd resolution. We make use of the mpgtx and mplex utilities:

mpgtx -d -b test.mpg start.mpg
mplex -f 8 -M -V -o final.mpg test.mpg-0.m2v test.mpg-0.mp2

Now that we have our remuxed file we can process to make a DVD from it like so: (replacing /dev/cdrom1 with the device name of the burner in your system)

makexml final.mpg -out MyDisc
makedvd -device /dev/cdrom1 -burn MyDisc.xml

To perform the burning you may need to be root.

mpgtx can be downloaded from mpgtx.sourceforge.net

To learn about the other utilities the best place to start is tovid.

Monday, September 15, 2008

 

Watching Tennis using Linux

Watching sports online is harder than it should be especially if you are a Linux user. One can definitely get the sense that Linux users are being locked out. In previous years I was able to listen to tennis radio for the US Open and Australian Open using mplayer:

mplayer -nocache -playlist http://mfile.akamai.com/8588/live/reflector:57833.asx?bkup=59561

One of the main ways to see tennis is ATP Master Series TV. Unfortunately one must be able to use at least Windows Media Player 9. It is possible (in theory) to overcome the this limitation and create a wmv file without DRM with lots of effort. Another stumbling block is the appearance of RTMP or Real Time Messaging Protocol which Linux doesn't seem to be able to handle. As a result I wasn't able to listen to US Open radio this year.

I was able to see the US Open final on my computer by watching channel 4 which is the CBS affiliate in Buffalo New York. They didn't show all the matches and CBS seemed to only show tennis on Friday or the weekend. Another method is to scan file sharing services like rapidshare or megaupload and checking newsgroups like rec.sports.tennis. Generally speaking it's best to avoid wmv files as it's becoming more and more likely that wmv files will contain DRM.

Another couple of possibilities for viewing tennis may be Betfair and MyP2P. I haven't had the chance to view tennis on these sites but there is a ATP challenger event "Szczecin" scheduled for tomorrow. I'll report later on this with regards to Linux compatibility.

UPDATE: Yes, it is possible to see sports on betfair and other betting sites like Bwin under Linux. The video size is very small but the frame rate wasn't bad. I had to update to Shockwave Flash 9.0 r124 by downloading the newest libflashplayer.so file. I watched some of the Pekao Open in Poland which is an ATP challenger event. Rafal Gozdur of Poland was playing Juan Pablo Brzezicki of Argentina, two guys I may never see on tv. It seems that MyP2P is merely links to other sites like Betfair and Bwin.

Thursday, September 11, 2008

 

TV and Radio Reception

We recently changed our antenna from an huge old VHF antenna to a channel master cm4228 optimized for digital television. As a result my radio reception isn't quite as good as it was with the old antenna, e.g. I can't receive WBFO 88.70 in Buffalo as well as before. I can hear it but there's a lot of static. Not really too big a deal as WBFO streams on the internet.

Running coaxial cable from the new antenna to the Hauppauge WinTV-GO-FM I can get all the local radio stations just as well as before. I'm using the console radio program from the xawtv 3.95 package. By running "radio -S" in bash one can create a radio.fmmap file to see what frequencies are available. The scanning ranges from 87.50 to 108 Mhz. One interesting radio station that showed up it the scan was CIUT FM at 89.50 Mhz which is evidently broadcast from the University of Toronto.

Switching from the old VHF to the new UHF-optimized antenna seemed to put an end to receiving American analog stations 2, 4 and 7 (the NBC, CBS and ABC affiliates in my case) but they will disappear soon anyway. Of course now I can get digital 2, 4 and 7, just not on the old Hauppauge card. Sooner or later I'll get a pcHDTV card for the computer. There are many other analog channels still receivable with the UHF antenna which will continue to broadcast into 2011.
UPDATE: I can get analog channel 7 if the Antenna is pointed directly south, maybe it's possible to get 2 and 4?

The picture with digital TV is quite good but things seem a bit thin on the SCI-FI side compared to Rogers Cable. Of course there's no monthly bill with digital TV over antenna, just the initial cost of the new antenna.

Sunday, September 7, 2008

 

The Funny Papers Circa 1934

I found some Toronto Star newspapers in the attic of the house a few years back probably dating back to when the house was first built over 70 years ago. The funny papers were much bigger in those days. Only one of them was small enough to fit on my scanner (hp 5200C).

As you can see from the scan it's dated November 24, 1934:

It's Papa Who Pays

I don't have the heart to throw out the old newspapers. At least with the scanner I can keep a version which won't decay any further. This blog entry really doesn't have anything to do with Linux beyond the fact that it's hosted on a Linux server and it was scanned using kooka.

While we are looking at 1930's era funnies it might be of interest to look at some historical pictures of Toronto. There are quite a number of old photos from the same time period:

Historical Toronto Pics

A while ago I asked this guy who was over 80 if the ratio between wages and the cost of living was different now compared to when he was young. He told me it was approximately the same then (say the 1940's) as it is now, but I'm inclined to think things are generally better now.

Friday, September 5, 2008

 

Pesky Filenames

It's common knowledge among Linux aficionados that you can encounter files and directories with strange names.

For example it's possible to encounter a youtube video with a dash as the first character in a filename. Let's say the you download a file from youtube using the youtube-dl script and the filename is -m7PqBPqCl4.flv

Now if you try to play it at the command line with mplayer:

mplayer -m7PqBPqCl4.flv

you get:

Unknown option on the command line: -m7PqBPqCl4.flv

You could simply rename the file to something a bit more descriptive and without the dash in front but:

mv -m7PqBPqCl4.flv video1.flv

gives:

mv: invalid option -- m

So you have to tell the mv command not to process the dash like so:

mv -- -m7PqBPqCl4.flv video1.flv

You'll get the same result if you try to delete a file when the first character is a dash but the solution is similar:

rm -- -m7PqBPqCl4.flv

But what if you wanted to copy the file? Same thing:

cp -- -m7PqBPqCl4.flv video1.flv

I have come across another example of strange directories in /tmp which were able to resist the rm command.

Let's say some hacker (the bad kind) wanted to make a directory in /tmp to store their malware. One thing they could do is make a directory name of ". ." in /tmp

We will assume in this case that the files are owned by user 'nobody'.

Now deleting with rm may not work:

find /tmp -user nobody | xargs rm -r -f -v

The directory ". ." will still be in /tmp

Instead you may need to explicitly reference the directory:

cd /tmp
rmdir ". ."

Or it can be removed by this method, as there may be more files in ". ."

find /tmp -user nobody | xargs rm -r -f -v ". ."

Thursday, September 4, 2008

 

Programming a Flatbed Scanner

This is something that has been a bit of a thorn in my side for years. It all started when I bought a HP 4470C scanner and couldn't get it working on my Linux box. To make a long story short the programming specifications of the RealTek RTS8891 chip were kept secret so no one could easily write a driver for it, instead one would have to reverse-engineer it... a time consuming process only a true die-hard would tackle. The long still on-going story is here.

There is a driver for it which you can see here:

https://sourceforge.net/project/showfiles.php?group_id=121985

I've never got it to work which is a shame since it had a nice transparency adapter which was handy for scanning slides and negatives. What I ended up doing was backtracking to the HP 5200C. I still like HP scanners, at least the ones that use SCL or Scanner Control Language.

Although I can use kooka or xsane to do scanning with the 5200C I still wanted to try to program the scanner myself. I hereby place the SCL documentation on the net.

If you are currently looking for a scanner I'm sorry to say that HP doesn't make any scanners that support SCL, with the possible exception of MFPs or Multi-Function Peripherals. So if you're looking for a scanner and you want Linux compatibility I would suggest an Epson. Don't run out to the store and pick up the first scanner you see!

Tuesday, September 2, 2008

 

Bash Scripts: Watching TV off the Antenna

I wrote a bash script to watch television a while ago. It can change to the channels that are receivable via the antenna. It seemed rather harder to write than it should have been but I think it would be of some interest to people who use mplayer, especially if you live around the Toronto area in southern Ontario and have an antenna.

Here is the script:

http://cubeman.org/bash-scripts/watch-tva.txt

The script references another script that toggles the input of line in off and on since the sound card needs to receive the tv card's output to it's input.

Here is the script to toggle the line in off and on:

http://cubeman.org/bash-scripts/tog-input.txt

Note that this second script is only of use for KDE users. I don't know what the equivalent would be for Gnome.

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]