Category Archives: Maemo

Prison Break: Freedom for your videos

Good news for all the people that ever wanted to watch live-tv/DVD/etc.. on your N800: GMyth-Streamer.

At first it was an add-on for MythTV that would enable you to watch live-tv from MythTV on the device. But then, it started to grow and we had so many ideas that, right now, it can be more than just a simply add-on for MythTV, it can be a media streaming solution.

Using it you are able to stream any kind of video from your computer through the Internet or cabled/wireless network at home to your N800 or another computer.

During my tests I streamed video content from a file/DVD disc on my computer using GMyth-Streamer and Mplayer+test application on N800. Mplayer used about 26% of N800’s CPU and CPU usage on my notebook depended on the video (sometimes got 50% of the CPU – Core 2 Duo @ 2.33 GHz). To test I streamed mpeg4 videos (mpeg2 720×576 -> mpeg4 320×240) and mpeg1 videos (DVD – one episode of Prison Break and the entire “Butterfly Effect” movie – mpeg2 -> mpeg1 400×240).

GMyth-Streamer was entirely written in python and supports plugins (MEDIA plugins to handle the transcode/stream of the video and COMM plugins to handle what I call “control socket” – where you send commands to GMyth-Streamer). Right now we have fully working Mencoder media plugin (Gstreamer plugin almost there) and a VLC media plugin under development. Regarding comm plugins we have a TCP plugin (simple tcp connection) and also a XMLRPC plugin (both 100% working).

The ones of you who have already played a little bit with Mencoder knows about it’s potential and understand that we are able to encode video directly from the tv tuner and also do some nice stuff like using video/audio filters supported by Mencoder (some of them: remove logo from video, put logo on video, put subtitles, crop , flip, mirror, rotate, noise, denoise).

It’ s important to say that IMHO Mencoder+Mplayer is a better solution than gstreamer because it could encode/play any kind of videos (as well stream them) and gstreamer had problems depending on the muxer+codec you used. For example, gstreamer could not play AVI files without index for seeking and Mplayer could handle it.

Somebody can say that VLC already does all this stuff but we had more success using GMyth-Streamer to stream video to N800 than with VLC. Also notice that it’s very easy to implement your own plugin for GMyth-Streamer and it’s still easy to integrate it with MythTV/Freevo and another solutions (transcoding videos for Tivo, Slingbox ? πŸ˜‰ ).

Here you can see a little demo about what I said. I put a DVD inside my notebook and through my wireless connection I streamed it to N800 and at the same time I played it on the TV (notebook’s dvi out). The TV and the device were not synchronized because they didn’t start at the same time (and it was not the idea). But audio+video on the device and on the TV were 100% synchronized.

Selfone = HF for Linux Box

Selfone is a project we created to play a little bit with a cell phone + handsfree + bluetooth + linux boxes.

It was created based on a document we found that specifies the HandsFree profile and also using some stuff from libgnokii . It uses RFCOMM and SCO connections to handle all the stuff, like audio exchange, access to contact list, sending sms messages, etc… We are developing a library using pure C and some python applications, using pybluez, to help the development.

Imagine that you can use your cell phone from your PC or even an N800 and also while using it with the PC, redirect your calls through VOIP…That would be good ahn ? =P

So, if you are interested in either testing, coding, sending suggestions please, contact us ! We need developers! =)a

Link: Selfone at the garage

Yes! We Have Live-TV

That’s right! GMyth now supports live-tv! So it’ll be a matter of time about anybody doing an application just as a proof of concept using this new feature from GMyth (maybe some guys from INdT ? – it also includes me πŸ˜‰ )

Today we were able to play live-tv on our N800, using the stream from a PC running MythTV with an analog card. We are still not able to play live-tv from DVB cards because the resolution of the video is too high (and as well because of the MPEG2 codec).

This week I started working with some ffmpeg stuff, so I can learn how to code using it, to start coding a patch for MythTV. This patch will be able to transcode any request of live-tv before sending the stream, so we’ll not only be able to watch live-tv on N800 but also on any other device that requires any change regarding codecs/framerate/resolution.

GMyth: Remote transcoding

Last week I promised that GMyth would handle all that stuff from MythTV’s remote transcoding and here it is.

The last version from svn is already able to request (start/stop) the transcode of videos that were recorded through MythTV. It’s also possible to create/delete and list myth’s transcoding profiles. I also modified some structure’s members from GString* type to gchar* type following Gustavo Barbieri’s suggestion.

In order to be able to use this profiles features you need to apply another patch that I’ve submitted for MythTV’s developers. Using this last patch with the one that I mentioned on a post below, you can use all this GMyth’s transcoding features. Here I show the basic steps for setting up and using a transcode object and listing/creating a profile:

  • GSList* profiles = gmyth_http_retrieve_rec_profiles(backend_info, “Transcoders”);
  • GMythRecProfile* prof = profiles->data;
  • int test = gmyth_http_del_rec_profile(backend_info, prof->id);
  • GMythRecProfile* profile = gmyth_recprofile_new();
  • gmyth_recprofile_set_name(profile,”Teste”);
  • gmyth_recprofile_set_group(profile,”Transcoders”);
  • gmyth_recprofile_set_vcodec(profile,”MPEG-4″);
  • gmyth_recprofile_set_acodec(profile,”MP3″);
  • test = gmyth_http_create_rec_profile(backend_info, profile);
  • GMythTranscode* transcode = gmyth_transcode_new();
  • transcode->backend_info = backend_info;
  • transcode->cutlist = TRUE;
  • gmyth_transcode_set_profile (transcode, “N800”);
  • gmyth_transcode_set_filename (transcode, “1000_20061207123000.nuv”);
  • int test = gmyth_jobqueue_add_job(transcode, “JOB_TRANSCODE”);
  • test = gmyth_jobqueue_change_cmd(transcode, “STOP”, “JOB_TRANSCODE”);

We are also changing a lot of SQL queries inside GMyth for HTTP+XML requests. I think we are almost there πŸ˜‰

MythTV’s JobQueue patch

Here we go again! πŸ™‚ As I said before, this version of the patch is much better. Now you can specify some options like use or not the “cutlist” and you can choose to output the result to another file or not.

I also changed the way the whole thing is done: before it was an entry in mythprotocol to start/stop the transcode process. Now I’m dealing directly with the JobQueue, so you can remotely add any Job on the backend, not just the transcode task. It’s important to say that everything is prepared for SystemJobs, UserJobs, etc.. but here we have a HUGE security problem: letting an user remotely add a SystemJob will open an way to a malicious user add a malicious job to be run on your computer..to this is why I didn’t code anything about this.

Tomorrow I’ll start doing things inside GMyth:

  • Check/Insert profiles for transcoding (new patch for mythtv ? [1]);
  • START/STOP/PAUSE/RESUME/RESTART transcoding.

I will also think about a good solution about getting the progress of the task inside the database. Maybe another patch ( [1] ) to use xml+http (avoiding the use of SQL queries).

Link for the patch on MythTV’s Trac

N800 Video streaming + netcat

This tip is for that kind of person who loves command lines and so on !! πŸ˜‰

You’ll need ffmpeg and netcat. It’s important to notice that you’ll need netcat on the device also. Get it here: Netcat for maemo.

Then you just need to run something like this on your computer:

  • ffmpeg (…n800 best options…) | nc 192.168.4.5 5000

and on the device:

  • nc -l -p 5000 | mplayer –

Here you have your easy streaming solution. πŸ™‚

PS: remember to execute the client first (the one that is being run on the device) because this is actually the server of the connection.