maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [Announce] Smartcam Maemo 5 Port - Now with more Qt (https://talk.maemo.org/showthread.php?t=71452)

azkay 2011-03-24 18:54

[Announce] Smartcam Maemo 5 Port - Now with more Qt
 
Announcement

http://www.azkay.com/Screenshot-20110413-171103.png

What is this?
This is a client side port of the Smartcam Client software
It lets you use your N900 to stream video from either video0 or video1 to your windows PC, using it as a webcam.
Its compatible with most programs, skype, msn, etc.

IF YOU INSTALLED THE ORIGINAL C# VERSION, GO THROUGH THE INSTALL.SH AND REVERSE THE COMMANDS, THEN GO TO http://talk.maemo.org/showpost.php?p...3&postcount=19 AND REMOVE THE MONO RUNTIMES IF YOU ARENT USING THEM ANYMORE

What do I need?
- You need gstreamer installed
Code:

apt-get install gstreamer-tools
What do I do?
#0 Enable your wifi/usb networking!
#1 Download and install Smartcam for Windows
#2 Download and install Smartcam for Maemo 5
Code:

sudo gainroot
wget http://azkay.com/smartcam-m5_0_0_1_armel.deb
dpkg -i smartcam-m5_0_0_1_armel.deb

#3 Look through your applications, you should see Smartcam M5.
#4 Make sure Smartcam is running on Windows, make sure youve allowed it through firewalls.
#5 Open up Smartcam M5, put in the IP of your Windows PC and port for Smartcam; eg; 192.168.2.14:9361
#6 Hit <save> then hit <Start>

That should be it, if all went well you should be seeing live video on the Smartcam Windows side.

ToDo
Client
- Fix things, probably
- New logo/icon
- Back LED enable/disable

Server
- Code my own Smartcam server
- Windows & Linux
- Higher resolution stream
- Audio stream

End
Thanks me for for finally getting this done/released,
Thanks to danielz000 for all his help,
Thanks to deion for his work with Smartcam.
(hope you dont mind if I used the smartcam icon/logo in this, contact me if theres any problems, sourceforges contact is broken)

jedi 2011-03-24 19:20

Re: [Announce] Smartcam Maemo 5 Port
 
looks good - thanks for all the work which went into this :)

sophocha 2011-03-24 19:23

Re: [Announce] Smartcam Maemo 5 Port
 
installed it, reboot, then try to open the program automatically shuts down.I`m on the oveclocked kernel and SSU updates.tried to install libmono (in case it needs it) and I get "couldn`t find package libmono"

azkay 2011-03-24 19:23

Re: [Announce] Smartcam Maemo 5 Port
 
Quote:

Originally Posted by jedi (Post 974979)
looks good - thanks for all the work which went into this :)

http://img39.imageshack.us/img39/1070/sdfdsfw.png
Ive got just about as many more on my desktop, too.
Those have gathered up throughout the weeks ive been working on this, all relevant in one way- big or small. lolol.

Quote:

Originally Posted by sophocha (Post 974985)
install it, reboot, then try to open the program automatically shuts down.I`m on the oveclocked kernel and SSU updates.tried to install libmono (in case it needs it) and I get "couldn`t find package libmono"

Be sure to put libmono*, with the asterisk.
If it still doesnt work,

Trying running it from terminal;
mono /etc/smartcam-m5/smartcam-m5.exe

sophocha 2011-03-24 19:31

Re: [Announce] Smartcam Maemo 5 Port
 
tried to install libmono* same thing....couldn`t find package.Try to run it from terminal I get " the assembly mscorlib.dll was not found or could not be loaded.It should have been installed in the /usr/lib/mono/2.0/mscorelib.dll directory

what`s libmono* ? Is there another way of installing it?

azkay 2011-03-24 19:39

Re: [Announce] Smartcam Maemo 5 Port
 
Ill look into it when I wake up (in around 3 hours, blah), sorry.
5:34am, I really shouldve went to bed at 8pm.

Try the apt-get again with extras enabled and testing or also try adding:
Code:

deb http://go-mono.com/maemo diablo user
to /etc/apt/sources.list.d/hildon-application-manager.list

then apt-get update and apt-get install libmono*

jedi 2011-03-24 19:52

Re: [Announce] Smartcam Maemo 5 Port
 
Is there any chance something like VLC can be used as a client for those of us that "don't do" windows?

handaxe 2011-03-24 20:03

Re: [Announce] Smartcam Maemo 5 Port
 
Quote:

Originally Posted by jedi (Post 975014)
Is there any chance something like VLC can be used as a client for those of us that "don't do" windows?

Smartcam is available for linux, at the very least

sophocha 2011-03-24 20:10

Re: [Announce] Smartcam Maemo 5 Port
 
ouch! Installed the libmono libraries (they are a LOT!) and now my rootfs is down to 30mb from 60mb

and on top of this the program still doesn`t work

How do I uninstall these?

Thanks

EDIT: Never mind they are in the uninstall HAM directory

Bratag 2011-03-24 20:13

Re: [Announce] Smartcam Maemo 5 Port
 
Quote:

Originally Posted by sophocha (Post 975022)
ouch! Installed the libmono libraries (they are a LOT!) and now my rootfs is down to 30mb from 60mb

and on top of this the program still doesn`t work

How do I uninstall these?

Thanks

apt-get remove libmono* one would imagine. Well I guess I wont be installing this until those libs are optified.

handaxe 2011-03-24 20:14

Re: [Announce] Smartcam Maemo 5 Port
 
I would guess as root "apt-get purge libmono*"

The mono libs for 1 small streaming app is not really a bargain, is it.....?

Thanks nonetheless to the devs. Smartcam works on Symbian phones as well and so is rightly now on the n900 and maemo.

jedi 2011-03-24 20:19

Re: [Announce] Smartcam Maemo 5 Port
 
Quote:

Originally Posted by handaxe (Post 975018)
Smartcam is available for linux, at the very least

Oh yeah - didn't notice. Also for Android, Symbian, WinMo etc etc to.

http://sourceforge.net/projects/smartcam/files/

sophocha 2011-03-24 20:21

Re: [Announce] Smartcam Maemo 5 Port
 
....and how do I uninstall the smartcam app if it`s not in the uninstall folder?

handaxe 2011-03-24 20:30

Re: [Announce] Smartcam Maemo 5 Port
 
These are what the install script created / did:

made dir: /etc/smartcam-m5
copied smartcam-m5.exe to /etc/smartcam-m5
etc etc

cp smartcam-m5.desktop /usr/share/applications/hildon
cp smartcam-m5.png /opt/usr/share/icons/hicolor/32x32/apps
cp smartcam-m5.conf /etc/smartcam-m5

Delete them, as root

Then as root:

Code:

apt-get purge mono-runtime

sophocha 2011-03-24 20:32

Re: [Announce] Smartcam Maemo 5 Port
 
Quote:

Originally Posted by handaxe (Post 975037)
These are what the install script created / did:

made dir: /etc/smartcam-m5
coped smartcam-m5.exe to /etc/smartcam-m5
etc etc

cp smartcam-m5.desktop /usr/share/applications/hildon
cp smartcam-m5.png /opt/usr/share/icons/hicolor/32x32/apps
cp smartcam-m5.conf /etc/smartcam-m5

Delete them, as root

Got it!
Winscp and everything is gone.

handaxe 2011-03-24 22:23

Re: [Announce] Smartcam Maemo 5 Port
 
Ok, the mono-runtime included in the .gz is run-incompatible with the libmono* installs from the diablo repo.

sophocha 2011-03-24 22:36

Re: [Announce] Smartcam Maemo 5 Port
 
so, what does that mean?is that why the app is crashing for me?i dont wanna try and install it again,especially with the huge library that takes so much space on rootfs.i think ill wait for another optified version.

Quote:

Originally Posted by handaxe (Post 975127)
Ok, the mono-runtime included in the .gz is run-incompatible with the libmono* installs from the diablo repo.


azkay 2011-03-25 01:00

Re: [Announce] Smartcam Maemo 5 Port
 
Quote:

Originally Posted by jedi (Post 975014)
Is there any chance something like VLC can be used as a client for those of us that "don't do" windows?

http://talk.maemo.org/showthread.php?t=70877
This one streams to VLC/Webcam for Linux.

@thread ||
Ill go through and check which libs it actually uses to save installing them all.

handaxe 2011-03-25 01:14

Re: [Announce] Smartcam Maemo 5 Port
 
Works - well done devs!!

Here are the files needed for a minimal mono install to run smartcam:

libglib2.0-cil_2.10.4-1_armel.deb
libgtk2.0-cil_2.10.4-1_armel.deb
libmono2.0-cil_2.4.3-1_all.deb
libmono-corlib2.0-cil_2.4.3-1_all.deb
ibmono-posix2.0-cil_2.4.3-1_all.deb
libmono-system2.0-cil_2.4.3-1_all.deb
mono-runtime_2.4.3-1_arvmel.deb

Best source of these is:

http://www.torosoft.com/mono-maemo5/.../binary-armel/

Please see thread post for my source of information: http://talk.maemo.org/showpost.php?p...2&postcount=21

Do not use the "http://go-mono.com/maemo/" repo as it is version mismatched with the run-time provided and the older runtime in the repo does not work (at least not for me).

I got errors updating the torosoft repo (ymmv) via fapman so I wget'ed the files and dkpg -i'ed 'em.

azkay 2011-03-25 01:26

Re: [Announce] Smartcam Maemo 5 Port
 
Damn, I just got done apt-get purging' my libmono* and googling, found that thread, added that to apt and reinstalled them. Lololol.

Thanks, though. Maybe I can optify each deb then have them in the original tar.gz to make things easier.

handaxe 2011-03-25 01:29

Re: [Announce] Smartcam Maemo 5 Port
 
Quote:

Originally Posted by azkay (Post 975246)
Thanks, though. Maybe I can optify each deb then have them in the original tar.gz to make things easier.

That would a great idea. I hope those are all the depends but my tests seem to be OK. Thank you for your efforts big time!!

azkay 2011-03-25 01:44

Re: [Announce] Smartcam Maemo 5 Port
 
Your post is better than mine, I forgot that I had others installed already (gtk, etcetc), so my count was just corlib and posix, ha.

I was amazed when it actually worked at full fps (dont know about over wifi, havnt tried yet).
My original version was using TCP, it ran around 17fps, but was really really laggy, smooth/lag/smooth/lag.
Second version I moved over to UDP, fixed all the problems.
Then I looked at a GUI, then stopped because it was annoying me.
Then went back again, tried windows forms because it had been ported in through mono already, then I stopped because it was ugly and annoying me. Then I went back to GTK again to try and get it working, after 2 days of things making no sense, it finally worked.

There isnt any error checking, though. The only thing that error checks is when you hit "save", it checks if the ip:port is splittable into ip and port, so if theres no : itll error out. If the ip:port doesnt connect, itll error out, but ive yet to have it error while in use. Once it starts, it has yet to stop on me.

If you want to see how the GUI made no sense to align properly, open up the smartcam-m5.exe in windows, for some reason, I had to align it like that for it to come out right on the n900.

handaxe 2011-03-25 02:10

Re: [Announce] Smartcam Maemo 5 Port
 
It is good on wifi. I am impressed by the relatively low cpu usage at the get go.

I see that it is using gst-launch to feed to localhost - what are you doing to stream onto the network? Some mono library?

Regarding udp, does that create problems for trying to go over the WAN/internet as opposed to a LAN? If it does, perhaps there could be a udp/tcp option? I know tcp gives issues with resends --> latency etc whilst udp just streams on carelessly, but some routers kill udp traffic.

As for errors, if one closes the client smartcam then the n900 streamer crashes BUT the gst-launch process remains. Not good for battery :). Would be nice if it stayed up streaming so that you could go back but of course, the port is closed so.... but the n900 process should be killed of course.

azkay 2011-03-25 02:21

Re: [Announce] Smartcam Maemo 5 Port
 
This is the original non-gui version,
basically, it listens on udp 127.0.0.1:5000, starts up gstreamer which streams jpegs to udp 127.0.0.1:5000, every jpeg it gets, it adds on the needed info for smartcam to use, then it tcpsends the frames to smartcam.

danielz000 was thinking we look at modifying tcpsink for gstreamer to add on the needed parts, that would take off the 8% of so usage the GUI has when its streaming:

Code:

using System;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.IO;
using System.Collections.Generic;
using System.Diagnostics;

public class UDPListener{
        private const int listenPort = 5000;
       
        public static int Main(){
        Console.Write("Smartcam IP [XXX.XXX.XXX.XXX] : ");
        string ip = Console.ReadLine();
        Console.Write("/dev/video[0] or /dev/video[1]: ");
        string source = Console.ReadLine();

                bool done = false;
                UdpClient listener = new UdpClient(listenPort);
                IPEndPoint groupEP = new IPEndPoint(IPAddress.Any, listenPort);
                byte[] receive_byte_array;
        Queue<byte> _buffer = new Queue<byte>();
        byte[] message = new byte[2];
       
        TcpClient _tc = new TcpClient(ip, 9361);
        NetworkStream _ns = _tc.GetStream();

        Process.Start(String.Format("gst-launch-0.10 v4l2camsrc device=/dev/video{0} driver-name=omap3cam ! ffmpegcolorspace ! video/x-raw-yuv,width=320,height=240 ! jpegenc ! udpsink host=127.0.0.1 port=5000", source));

                try{
                        while(!done){
                                receive_byte_array = listener.Receive(ref groupEP);
                if (receive_byte_array.Length != 0){
                    byte[] _fileData = receive_byte_array;
                    byte[] _tmpSize = new byte[4];
                    _tmpSize = BitConverter.GetBytes(_fileData.Length);

                    _buffer.Enqueue(1);
                    _buffer.Enqueue(_tmpSize[2]);
                    _buffer.Enqueue(_tmpSize[1]);
                    _buffer.Enqueue(_tmpSize[0]);

                    foreach(byte _b in _fileData){
                        _buffer.Enqueue(_b);
                    }

                    byte[] _packet = _buffer.ToArray();
                    _ns.Write(_packet, 0, _packet.Length);

                    _buffer = new Queue<byte>();
                }
                        }
                }catch(Exception e){
                        Console.WriteLine(e.ToString());
                }
               
                listener.Close();
                return 0;
        }
}

Ill have to look at hooking the close event, to have it kill gststreamer, if I can.

I couldve probably coded this in python, save installing all the libs and such, but Ive been trying to force myself to use c# more lately and mono being available on n900 made me want to use it.

Ill try streaming it over the internet, the quality slider should help, maybe later an optional framerate limiter.

EDIT::
I portforwarded then connected through my public ip:port over wifi, a little delay but worked fine (was using front cam, around half quality on the slider). Then I tried over 3g, I dont get good 3g reception here, but I dont think itll work too well anyway, maybe with a frame limiter (and if youve got lots of bandwidth to waste), it was really delayed, hitting Stop didnt close gstreamer, I think it just piles up the frames and nothing really ends up getting through after a little while, had to turn off 3g/kill smartcam-m5

If anyone wants to test some "global" streaming, from one n900 to anothers computer, let me know.

If it crashes over /dev/video1 and gstreamer is not running- but theres still the red light, the only fix ive found is to run:
Code:

gst-launch v4l2camsrc device=/dev/video1 num-buffers=1 ! fakesink
to let it reactivate/deactivate, wish I knew why it does it.

Bratag 2011-03-25 04:08

Re: [Announce] Smartcam Maemo 5 Port
 
Quote:

Originally Posted by handaxe (Post 975243)
Works - well done devs!!

Here are the files needed for a minimal mono install to run smartcam:

libglib2.0-cil_2.10.4-1_armel.deb
libgtk2.0-cil_2.10.4-1_armel.deb
libmono2.0-cil_2.4.3-1_all.deb
libmono-corlib2.0-cil_2.4.3-1_all.deb
ibmono-posix2.0-cil_2.4.3-1_all.deb
libmono-system2.0-cil_2.4.3-1_all.deb
maemo-sharp_0.23-1_all.deb
mono-runtime_2.4.3-1_armel.deb

Best source of these is:

http://www.torosoft.com/mono-maemo5/.../binary-armel/

Please see thread post for my source of information: http://talk.maemo.org/showpost.php?p...2&postcount=21

Do not use the "http://go-mono.com/maemo/" repo as it is version mismatched with the run-time provided and the older runtime in the repo does not work (at least not for me).

I got errors updating the torosoft repo (ymmv) via fapman so I wget'ed the files and dkpg -i'ed 'em.

maemo-sharp is not necessary for this to function.

Now that out of the way - I have to say I am pretty damn impressed with the speed of this over wifi - even at max quality. Skype recognized it immediately and I was able to use it for other PC based apps requiring video.

Not bad - if a little large.

Have to agree with you - you do need to kill that gst-launcher process when the app closes however. Otherwise you have a 25% cpu eater just sitting there.

azkay 2011-03-25 04:45

Re: [Announce] Smartcam Maemo 5 Port
 
If you hit Stop before closing it, it *should* work.
I was having problems thinking of the best way to close it.

Currently when you hit stop, it sends a # packet which gets intercepted and runs gst.CloseMainWindow(), but it doesnt seem to work every time. gst.Close() doesnt seem to close it at all, might have to Process.Start("kill " + gst.Id).

Dont know how "proper" it is to do that, though.
Also, a problem with smartcam, it doesnt seem to work on some flash based sites that use the webcam; eg; tinychat.com, it shows smartcam as disconnected or something, if you choose it anyway flash crashes.

But yeah, other than that its worked in everything else.

danielz000 2011-03-25 10:55

Re: [Announce] Smartcam Maemo 5 Port
 
Quote:

Originally Posted by azkay (Post 975254)
This is the original non-gui version,
basically, it listens on udp 127.0.0.1:5000, starts up gstreamer which streams jpegs to udp 127.0.0.1:5000, every jpeg it gets, it adds on the needed info for smartcam to use, then it tcpsends the frames to smartcam.

danielz000 was thinking we look at modifying tcpsink for gstreamer to add on the needed parts, that would take off the 8% of so usage the GUI has when its streaming:

I thought about modifying jpegenc or udpsink but the right way to do it would be creating a new smartcam plugin to sit between jpegenc and udpsink.

Unfortunately it'll take me a while to read through the gstreamer docs for creating plugins as I'm a bit short of time.

handaxe 2011-03-25 15:24

Re: [Announce] Smartcam Maemo 5 Port
 
@azkay: if you don't mind, what is the advantage in using driver=omap.. with gst-launch? I could not see any reduction in cpu use, in fact if anything it increases it, as "omap3camd" kicks in, offsetting any reduction in gst-launch's cpu use. Does hw accel improve framerate?

Quote:

Originally Posted by azkay (Post 975299)
If you hit Stop before closing it, it *should* work.
I was having problems thinking of the best way to close it.

In my testing stop works just fine, the issue arises when the receiver disconnects, smartcam goes away without tidying up. Ideally, the gui should not disappear if tcp crashes, but revert to the gui with the "stop" button changed to "start". I assume this is what you meant by there being no error checking?

haffid 2011-03-25 16:40

Re: [Announce] Smartcam Maemo 5 Port
 
Thanks works very very well, thank you so much for the app great work

azkay 2011-03-26 04:23

Re: [Announce] Smartcam Maemo 5 Port
 
Quote:

Originally Posted by handaxe (Post 975575)
@azkay: if you don't mind, what is the advantage in using driver=omap.. with gst-launch? I could not see any reduction in cpu use, in fact if anything it increases it, as "omap3camd" kicks in, offsetting any reduction in gst-launch's cpu use. Does hw accel improve framerate?

If you dont use omap driver then the video has a noticable green tint.
Dont know how to use hardware acceleration, there was a hardware accelerated jpeg encoder for gstreamer in the past, but I cant find it anymore. I dont think it would improve framerates any higher, I think around 30 is the hardware limitation of the camera, I could be wrong.
Hardware acceleration would be for less cpu usage I would think.

lucas777 2011-03-27 02:43

Re: [Announce] Smartcam Maemo 5 Port
 
Any ideas, ive installed all the lib files seem to have done everything right opened ports on my pc, i have the smartcam app opened on PC and N900 soon as i hit start, i see the app on the pc say connected for like 0.1 seconds then the app on n900 closes down...

lucas777 2011-03-27 02:50

Re: [Announce] Smartcam Maemo 5 Port
 
home/user # mono /etc/smartcam-m5/smartcam-m5.exe

Unhandled Exception: System.Net.Sockets.SocketException: Connection refused
at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remote_end) [0x00000]
at System.Net.Sockets.TcpClient.Connect (System.Net.IPEndPoint remote_end_point) [0x00000]
at System.Net.Sockets.TcpClient.Connect (System.Net.IPAddress[] ipAddresses, Int32 port) [0x00000]
/home/user #

azkay 2011-03-27 03:05

Re: [Announce] Smartcam Maemo 5 Port
 
on windows, open up command prompt and type ipconfig, paste the output.
what ip/port are you connecting with (from n900), in smartcam on the PC go file > settings and check the port is the same.

Make sure youve got your wifi enabled, or if your doing it over usb, make sure thats all working right. brbrb, going to pie shop, be back in 15 minutes.

lucas777 2011-03-27 03:07

Re: [Announce] Smartcam Maemo 5 Port
 
This is what i get connecting from 3G connetion

ome/user # mono /etc/smartcam-m5/smartcam-m5.exe

Unhandled Exception: System.ComponentModel.Win32Exception: Cannot find the specified file
at System.Diagnostics.Process.Start_shell (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process) [0x00000]
at System.Diagnostics.Process.Start_common (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process) [0x00000]
at System.Diagnostics.Process.Start (System.Diagnostics.ProcessStartInfo startInfo) [0x00000]
at System.Diagnostics.Process.Start (System.String fileName) [0x00000]
at MainWindow.transport () [0x00000]
/home/user #

lucas777 2011-03-27 03:09

Re: [Announce] Smartcam Maemo 5 Port
 
Nah i know all about IP address and networking,

My Local machine PC is 10.0.0.1

Ive enable 9361 Port to my router so in smart cam i go 10.0.0.1:9361

Im connected to Wifi on both PC and N900 on windows smartcam i see it connected for like 1 second no video not enough time but it does say connected and then the app closes down on the n900..

lucas777 2011-03-27 03:10

Re: [Announce] Smartcam Maemo 5 Port
 
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Realtek PCIe GBE Family Controller
Physical Address. . . . . . . . . : 20-CF-30-08-0D-3C
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
Link-local IPv6 Address . . . . . : fe80::80ea:f1db:53fa:91fe%11(Preferred)
IPv4 Address. . . . . . . . . . . : 10.0.0.1(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 10.0.0.138
DHCPv6 IAID . . . . . . . . . . . : 237031216
DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-14-59-AA-C9-20-CF-30-08-0D-3C

azkay 2011-03-27 04:02

Re: [Announce] Smartcam Maemo 5 Port
 
Do you have gstreamer installed? The local part seems to have a problem with how your network is setup, dont know why.

If its giving a file not found over 3g, that would be at the line where it tries to run gst-launch.

lucas777 2011-03-27 07:16

Re: [Announce] Smartcam Maemo 5 Port
 
well in a link on the first page i install like 8 lib and mono files dpkg them all that went fine i thought gstreamer was part of those?

azkay 2011-03-27 07:26

Re: [Announce] Smartcam Maemo 5 Port
 
I thought gstreamer was installed by default on the n900;
try
Code:

apt-get install gstreamer-tools
then type gst-inspect, if it shows output then its installed.

lucas777 2011-03-27 08:09

Re: [Announce] Smartcam Maemo 5 Port
 
Oh my, installed gstreamer-tools i now can see myself thank you so much mate much appreciated


All times are GMT. The time now is 18:46.

vBulletin® Version 3.8.8