Notices


Reply
Thread Tools
Posts: 309 | Thanked: 519 times | Joined on Oct 2010
#101
Hey guys,
I had a bit of a go at learning QT yesterday, and created an App for streaming video/audio from the N900 to VLC media player on the PC.

Here's the video showing it:
http://www.youtube.com/watch?v=wfU9uf-lOvQ

I made it as a sort of personal **** you to my Windows-fag mates to show them how awesome linux is!

It's pretty much just a frontend for gst-launch, but with less of the fiddly bits, and can even a generate the .sdp VLC file for your PC (ish).

All you need to do is type in the IP adress of your desktop, and choose whether you want audio or video. (You can also choose image size, front/back camera, etc.)

Hope you guys like it
 

The Following 7 Users Say Thank You to tetris11_ For This Useful Post:
Posts: 1,378 | Thanked: 1,604 times | Joined on Jun 2010 @ Göteborg, Sweden
#102
and...... it is available where to like?
 

The Following User Says Thank You to handaxe For This Useful Post:
Posts: 309 | Thanked: 519 times | Joined on Oct 2010
#103
Lol

There's one teeny tiny minor (possibly major) bug in it that doesn't stop the camera from streaming after you close the app.
(It starts as a new process that you have to manually kill yourself, which probably isnt that safe for the average user.)

But give it another week and I'll probably have that down, and then I'll release it for testing.

PS:
If anyone can help me with understanding how to terminate a QProcess on application exit, I'd really appreciate it!

Edit: Okay, kinda fixed the continuing streaming problem (but it still exists if you exit the app improperly).... gonna have a look at it later again
Edit2: Nope. Done, app seems to work well

Last edited by tetris11_; 2011-03-07 at 22:45.
 

The Following 3 Users Say Thank You to tetris11_ For This Useful Post:
Posts: 435 | Thanked: 769 times | Joined on Apr 2010
#104
QProcess.kill or terminate stops the process but leave it in memory if the app is not run as root and from conky you still see the outgoing process. To solve it I get the PID from the started process and run QProcess::execute("sudo kill PID") when you stop the process or close the app. For the improperly exited app situation, you may try a sudo killall for gst-launch at mainwindow constructor to clean from previous process, if any.
 

The Following User Says Thank You to gionni88 For This Useful Post:
Posts: 435 | Thanked: 769 times | Joined on Apr 2010
#105
Also, which encode do you use? dsph264enc jpegenc?
 
Posts: 309 | Thanked: 519 times | Joined on Oct 2010
#106
Yeah lol, the sudo kill is pretty much what I did to stop it!

My main problem is the QCoreApplication::exit() thing which I dont understand, but I know is VERY neccesary for running a kill script before the application terminates....

And yep Im using dsph264enc for VLC at the moment, but I plan on giving the option for jpegenc, and smokeenc in the future.... (though there's no way smoke can be used through VLC)
 

The Following User Says Thank You to tetris11_ For This Useful Post:
Posts: 435 | Thanked: 769 times | Joined on Apr 2010
#107
Originally Posted by tetris11_ View Post
My main problem is the QCoreApplication::exit() thing which I dont understand, but I know is VERY neccesary for running a kill script before the application terminates....
The application closes when you click on the top right X of the top window(the one called in main function) inside the app, or the X in task manager, or when you call the function qApp->exit() (which is the inherited QCoreApplication::exit() you wrote; qApp is a global pointer to your QApplication istance) . When the app closes, the event loop handles all closing events, so you can put the kill all execution inside the main window destructor, MainWindow::~MainWindow() usually with QtCreator, to make it launch when the app is closing.
 

The Following User Says Thank You to gionni88 For This Useful Post:
Posts: 435 | Thanked: 769 times | Joined on Apr 2010
#108
Ah, another hint: if the stream is started before the camera lens cover, video will be without autofocus and auto white balance etc. You may add a banner at app start just to remind to open it if video streaming is planned to get used.
 

The Following User Says Thank You to gionni88 For This Useful Post:
Posts: 309 | Thanked: 519 times | Joined on Oct 2010
#109
Originally Posted by gionni88 View Post
You may add a banner at app start just to remind to open it if video streaming is planned to get used.
STOP READING MY MIND!

And total and complete thanks for the hints dude!
That streaming problem is now completely sorted!

I'm just gonna give it a few more run throughs, and tidy it up aesthetically abit, and I'll release it tomorrow!

Again, thanks ALOT man!
 
Posts: 309 | Thanked: 519 times | Joined on Oct 2010
#110
Okay, it's finished. The newest install is on the attachment.

Edit1: Do not use if you have kernel-power v46
Workaround: http://talk.maemo.org/showpost.php?p...&postcount=152
Edit2: If the app appears to do nothing (i.e. no streaming), then make sure gst-tools, rootsh, and expect are installed on your phone.
"sudo apt-get install gst-tools rootsh expect"
Edit3: If it's crashing when you click "generatesdp", then launch the app from terminal "/usr/local/bin/tester" but not as root. Repeat NOT as root.

It's called PhoneStreamer in case you guys are looking for the icon after install.

If you are using this app for the first time (which I imagine it probably is for most of you guys), then push the "ShowDebugConsole" button and generate both an audio and video sdp file for your desktop.

In future, I plan to just SCP these files (n900videostrm.sdp, n900audiostrm.sdp) over to the desktop PC from within the app, but that's later.
After generating the sdp file, you can then click "Send sdp to Linux Desktop" if you are a linux user, where it will prompt you for username and password and then send it straight to your PC's desktop.

For now just play around with it: choose your settings -> hit stream -> open sdp file on desktop.
(then point your desktop webcam at your pc screen, maximise VLC, and show the people on AIM or MSN, the ups and downs of your neighbourhood or the state of your room or even the inside of your fridge....)


PS: BIG thanks to gionni88 who pointed me in the right direction and saved me from hoooours of painful work, and justice4all3000 for finding the workaround, and leetnoob who thoroughly tested it and found major bugs. Thanks guys!

0.0.3 Fixed: Bug where wrong sdp is generated, hopefully implemented workaround for titans power kernel.

latest deb:External Mirror
Attached Files
File Type: deb tester_0.0.1_armel.deb (182.8 KB, 126 views)
File Type: deb tester_0.0.2_armel.deb (104.9 KB, 106 views)
File Type: deb tester_0.0.3_armel.deb (39.6 KB, 132 views)

Last edited by tetris11_; 2011-03-09 at 18:28.
 

The Following 9 Users Say Thank You to tetris11_ For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 14:34.