Thursday, June 21, 2007

UKTUBE - smooth playback of youtube files

I was talking to a few Nokia guys some time ago and they asked what was the single thing I would change for the tablet immediately. I said: make a proper D-pad (direction pad). Get one from the n-gage team. They said, yeah, but software wise. I thought for a while and said: calendaring / PIM. Almost every review complains about that.

But now, after a few weeks from that, I've been thinking again. Nope, the answer is playable youtube. Make the device web 2.0 compliant. It has to be able to play youtube movies smooth as silk. That's just the way it goes these days. Jittery playback is not an option.

So, yesterday I though - well, if no-one has made that app so far, no-one probably will. That is, unless I do it. So, I scanned the net a bit for youtube info, got some scripts to start the project and had a working application that plays smoothly youtube clips in fullscreen.

Then I went to bed.

Now, I put two hours more and the user interface is adequate for end user use and I've packaged the program as part of ukmp 1.3. Why part of? I didn't have the time to make a separate package. It's holiday time, midsummers fest is about to begin.

All right, so what do you need?
Python (as ever)
mplayer
ukmp-1.3-uktube

So, how does the app work?

Go to a youtube page.
Copy the url of the page.
Open uktube
paste the url to a field.
Press Play clip (only once, even if the app may seem to stall).
In a short while, it'll tell you the download size and progress. Once download is complete, it'll use mplayer to play the clip.




Files are stored on MMC1 in the root, so you need to have the front panel SD /MMC inserted.
On the very bright side, the files can be player later on as well from mplayer.

UPDATE:
I just added a youtube video that demonstrates how it functions. Have a look at it.

EDIT: ALSO WORKS ON 770!

9 comments:

  1. Anonymous04:00

    So ... you just take a movie player which plays the file for u ...
    can also be done in xterm ...

    ReplyDelete
  2. Anonymous09:29

    sounds awesome. I'm all for stuff that's easy to use.

    First additional thing I'd want is to have a user-definable place to store the movies. I'd keep mine in /media/mmc1/animations/youtube/ for instance.

    Second feature I'd want is a button displayed after the clip is done playing so you can easily delete it if you want (most youtube videos are watch once and throw away, but deleting shouldn't be the default behavior).

    The only feature I'd want that might be difficult to implement is having UKtube launch directly from the browser when browsing a video on youtube.com. There's a share via email button on the standard youtube interface, so maybe you could register UKtube as the default email app and it could grab the url that way. (the format is mailto:?subject=You%27ve%20received%20a%20YouTube%20Video%21&body=http%3A//youtube.com/watch%3Fv%3DC1Zp7vfyew8) It's a couple extra button presses over the usual youtube, but it doesn't require a copy and paste. I don't know if that's the best way to do it, it's just a suggestion. Would be 10 times easier if you didn't have to copy and paste.

    ReplyDelete
  3. Anonymous23:06

    Very nice.....
    My 1 question is where's your stylus.

    ReplyDelete
  4. Anonymous04:19

    It's his finger :)

    I will test this app in a moment. I'm excited, though i understand it needs a c/p to work. It would be great if it launched mplayer automatically.

    Anyway, good work man.

    ReplyDelete
  5. Anonymous17:45

    Urho, that's nice stuff. Funnily, we were just recently discussing similiar solution with Tuomas and researching into the area. Here are some hints:

    *) FFMPEG can play the .flv files too. So if you compile the gst-ffmpeg (gstreamer) module for the device, you'll be able to play .flv directly in the n800 media player (just as you can play them in Totem on the desktop)

    *) Another solution -- mobile youtube (http://m.youtube.com) offers videos in alternative format. With gst-ffmpeg you should be able to play them too. One advantage -- they can be streamed! I haven't tested it though.

    *) Finally, with a little regexp, html parsing and python it shouldn't be too difficult to provide a full you tube browser/ui for the device. That would TOTALLY rock.

    Get in touch with me if you need some more details. Great work.

    ReplyDelete
  6. @MDK:
    mobiletube plays files in 3gp format, so it's not even remotely comparable to the flash movie experience, so it's a no-go.

    If I have the time, I will make a proper client, a little bit as you suggested.

    I would also love the get the default player to play those files. But I'm not a compilation expert so I won't even try to compile ffmpeg lib for gstreamer. Maybe if someone else can do it, I could support the default player instead. But for now, I'll stick to mplayer.

    ReplyDelete
  7. Anonymous22:29

    thanks Urho, what ever improvements you may carry out, please include those improvements to us 770 users too, Mika

    ReplyDelete
  8. The app crashes every time a URL is entered. I am using OS2007 ver. 4.2007.38-2. Anybody else having the problem?

    ReplyDelete
  9. Anonymous01:45

    Same problem here. Verry disapointing.

    ReplyDelete