Hi Federico,
I dont much about this but can tell you something I did and it worked..
1. which is the command that I need to send to start the streaming to the apache server?
I wrote a script like -
make sure you have a working camera and videox device created and test it by capturing the webcam frames using vlc. now install apache server on ubuntu may be with apt-get.
following script will start the http server. it will start listing for requests for http streaming on your linux machine (IP-192.168.91.77) on 8080 port. It will not stream start sending packets on network until it gets a request from a client. now to test this, open vlc player on any other machine and try carpturing the network stream by typing
http://192.168.91.77:8080. you should see webcam frames.
#!/bin/bash
/etc/init.d/httpd restart
vlc -vvv v4l:/dev/video0:norm=secam:frequency=543250:size=640x480:channel=0:adev=/dev/dsp:audio=0 --sout '#transcode{vcodec=mp4v,acodec=mpga,vb=3000,ab=256,vt=800000,keyint=80,deinterlace}:std{access=http,mux=ts,dst=192.168.91.77:8080}' --ttl 12
you can play here with codecs and other options if you want.
2. which ports do I need to open on the firewall?
not sure about this..
3. Which is the html code to visualize the webcam
here is a webpage I created in /var/www/html/ to embed vlc player in webpage which will capture the same network stream mentioned above. (Ref- vlc documentation)
<html>
<head><title>Webcam Streaming</title></head>
<body>
<h2><font face="Verdana">Webcam Streaming</font></h2>
<embed type="application/x-vlc-plugin"
name="parth"
autoplay="no" loop="yes" width="640" height="480"
target="
http://192.168.91.77:8080" />
<br />
<a href="javascript:;" onclick='document.parth.play()'><font size="5"> <b>Play</b></font></a>
<a href="javascript:;" onclick='document.parth.pause()'><font size="5"><b>Pause</b></font></a>
<a href="javascript:;" onclick='document.parth.stop()'><font size="5"><b>Stop</b></font></a>
<a href="javascript:;" onclick='document.parth.fullscreen()'><font size="5"><b>Fullscreen</b></font></a>
</body>
</html>
now restart the http server with above script. on client machine you should have vlc plugin in mozilla firefox webbrowser. type the server IP and u should see the embedded vlc player capturing webcam stream.
this works for me firefox and safari browsers but IE crashes on client side for some reasons.
hope this helps somehow..