|
|
2011-03-25
, 01:29
|
|
Posts: 1,378 |
Thanked: 1,604 times |
Joined on Jun 2010
@ Göteborg, Sweden
|
#21
|
|
|
2011-03-25
, 01:44
|
|
Posts: 395 |
Thanked: 509 times |
Joined on Jan 2011
@ Brisbane, Australia
|
#22
|
ort is splittable into ip and port, so if theres no : itll error out. If the ip
ort 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.| The Following 3 Users Say Thank You to azkay For This Useful Post: | ||
|
|
2011-03-25
, 02:10
|
|
Posts: 1,378 |
Thanked: 1,604 times |
Joined on Jun 2010
@ Göteborg, Sweden
|
#23
|
. 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.
|
|
2011-03-25
, 02:21
|
|
Posts: 395 |
Thanked: 509 times |
Joined on Jan 2011
@ Brisbane, Australia
|
#24
|
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;
}
}
ort 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-m5gst-launch v4l2camsrc device=/dev/video1 num-buffers=1 ! fakesink
| The Following User Says Thank You to azkay For This Useful Post: | ||
|
|
2011-03-25
, 04:08
|
|
Posts: 2,014 |
Thanked: 1,581 times |
Joined on Sep 2009
|
#25
|
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.
| The Following User Says Thank You to Bratag For This Useful Post: | ||
|
|
2011-03-25
, 04:45
|
|
Posts: 395 |
Thanked: 509 times |
Joined on Jan 2011
@ Brisbane, Australia
|
#26
|
|
|
2011-03-25
, 10:55
|
|
Posts: 110 |
Thanked: 18 times |
Joined on Dec 2009
|
#27
|
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:
| The Following User Says Thank You to danielz000 For This Useful Post: | ||
|
|
2011-03-25
, 15:24
|
|
Posts: 1,378 |
Thanked: 1,604 times |
Joined on Jun 2010
@ Göteborg, Sweden
|
#28
|
If you hit Stop before closing it, it *should* work.
I was having problems thinking of the best way to close it.
|
|
2011-03-25
, 16:40
|
|
Posts: 41 |
Thanked: 37 times |
Joined on Jan 2011
@ Guatemala
|
#29
|
|
|
2011-03-26
, 04:23
|
|
Posts: 395 |
Thanked: 509 times |
Joined on Jan 2011
@ Brisbane, Australia
|
#30
|
@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?
| The Following User Says Thank You to azkay For This Useful Post: | ||