[localhost:~]$ cat * > /dev/ragfield

Wednesday, July 8, 2009

Upload videos to YouTube with Mathematica

First, install the GData package in $UserBaseDirectory/Applications. Load the GData package which contains the code used to interact with YouTube (and other Google services).
<<GData`
Next, log in to YouTube. This will prompt for a user name and/or password if either is not specified.
yt = YouTubeLogin["User"->"robragfield"]
YouTube[<...>]
We can make sure it's working by asking for a list of videos uploaded to this account.
("Title"/.#)&/@YouTubeUploads[yt]
{OmetepeProfile.mov, Homer Fireworks, Tripod, Cobb Park Crit, Mt. Diablo descent, Seymour TT starts, Screaming hard drive, Descent (iMovie image stabilization comparison), Descent, Descent, Carpenter Park Cross #2 (Line Art), Indy Marathon chase}
We can also check out other accounts.
YouTubeUploads[yt, "wolframmathematica"]//Length
950
Finally, we can upload a new video to YouTube.
YouTubeUpload[yt, "/Users/schofield/Movies/carpenter_park_2.mp4", "Title"->"Carpenter", "Description"->"Carpenter Park cyclocross race"]
«JavaObject[com.google.gdata.data.youtube.VideoEntry]»
You can also specify the category and keywords.
Options[YouTubeUpload]
{Title->Automatic, Description->Undescripted, Category->Tech, Keywords->{uploaded by Mathematica}}

Friday, July 3, 2009

I thought 802.11N 5GHz was the fastest

Not so. While I was setting up my Airport Extreme 802.11N (gigabit ethernet) router I could have sworn I read that the fastest wireless performance would be achieved with 802.11N-Only 5GHz mode, so this is what I have been using for the past year+. All our computers and the AppleTV use 802.11N, but our iPhones only have 802.11G. So I set up my old Airport Extreme 802.11G (hershey kiss) router to handle the iPhones.

Anyway, this causes some annoying problems where apparently iPhone & desktop apps which are supposed to sync with each other don't work very well (Apple's Remote and Filemaker's Bento come to mind). Even though they're on the same subnet the syncing was just incredibly unreliable. It would work every once in a while, but usually it would just wait forever for a connection that never came.

A little frustrated with the situation I decided to try out some of the other modes for the Airport Extreme 802.11N router to see how much worse the network performance was. Perhaps I'd be willing to live with a slight performance hit if it meant more reliable iPhone app syncing.

I was shocked to find that, of all the available modes, the supposed fastest mode I had been using all this time was actually the slowest. I saw roughly twice the file transfer speed using 2.4 GHz, even when G/B compatible mode was enabled, even when the 802.11G iPhone was connected to the router loading web pages.

For each of the modes I copied a 246 MB file using scp from my MacBook Pro 15" downstairs to my Mac Pro desktop upstairs. Twice.

schofieldmaclap.local (802.11N/5.0GHz) Airport Extreme (gigabit) macpro.local

[schofieldmaclap:tmp]$ scp ApertureTrial.dmg macpro.local:/tmp/
ApertureTrial.dmg                             100%  246MB   3.7MB/s   01:07    
[schofieldmaclap:tmp]$ scp ApertureTrial.dmg macpro.local:/tmp/
ApertureTrial.dmg                             100%  246MB   3.7MB/s   01:06    


schofieldmaclap.local (802.11N/G/B/2.4GHz) Airport Extreme (gigabit) macpro.local

[schofieldmaclap:tmp]$ scp ApertureTrial.dmg macpro.local:/tmp/
ApertureTrial.dmg                             100%  246MB   7.9MB/s   00:31    
[schofieldmaclap:tmp]$ scp ApertureTrial.dmg macpro.local:/tmp/
ApertureTrial.dmg                             100%  246MB   8.2MB/s   00:30    


schofieldmaclap.local (802.11N/G/B/2.4GHz/iPhone) Airport Extreme (gigabit) macpro.local

[schofieldmaclap:tmp]$ scp ApertureTrial.dmg macpro.local:/tmp/
ApertureTrial.dmg                             100%  246MB   7.9MB/s   00:31    
[schofieldmaclap:tmp]$ scp ApertureTrial.dmg macpro.local:/tmp/
ApertureTrial.dmg                             100%  246MB   8.2MB/s   00:30    


schofieldmaclap.local (802.11N/2.4GHz) Airport Extreme (gigabit) macpro.local

[schofieldmaclap:tmp]$ scp ApertureTrial.dmg macpro.local:/tmp/
ApertureTrial.dmg                             100%  246MB   7.5MB/s   00:33    
[schofieldmaclap:tmp]$ scp ApertureTrial.dmg macpro.local:/tmp/
ApertureTrial.dmg                             100%  246MB   8.5MB/s   00:29    


schofieldmaclap.local (802.11N/5.0GHz) Airport Extreme (gigabit) macpro.local

[schofieldmaclap:tmp]$ scp ApertureTrial.dmg macpro.local:/tmp/
ApertureTrial.dmg                             100%  246MB   3.5MB/s   01:11    
[schofieldmaclap:tmp]$ scp ApertureTrial.dmg macpro.local:/tmp/
ApertureTrial.dmg                             100%  246MB   3.5MB/s   01:11    

I guess I'll be switching to 802.11N/G/B compatible mode.