Log in

View Full Version : x264 live streaming


uray
26th April 2009, 23:43
can someone point me out how to set live streaming using x264 codec?

what I want to try is distributing live video from source such as webcam or tv-tuner over network (LAN or internet) where there will be single server and multiple clients tuned in on same live feed on one-way stream.

how the server configuration would be needed to encode live stream of video at least at 25fps?

how the communication between components of live streaming scheme?

what i thought was it will use directshow filter to capture frame from source (tv-tuner or webcam), then each frame will be encoded by x264 frame by frame, then the output will be muxed to data container, then the data will be sent to client using some standard network protocol, and will be decoded on client side using some x264 decoder, is it correct? if its what software will I need to build such system, is there any free software?

:thanks:

popper
27th April 2009, 11:03
VLC should work fine if your machines powerful enough to realtime transcode the given captured screen size.

the advantage of this multicast address is you send one single binary data flow, anyone reading the Sap announce can tune in.

a MASSIVE saving in long term bandwidth use ,and server CPU resources when compared to any Unicast options...

vlc dvdsimple:// --sout '#rtp{dst=239.255.1.1,mux=ts,sdp=sap,name="My DVD"}'

the problem, Multicast works Great on the LAN, But the worlds ISP's have taken it uppon themselves to restrict this great protocol thats been around since the unicast ,but they usually filter direct Multicast to and from your CPE broadband modems kit sat on your desk, and so your users cant directly webside conntect to your Multicast server feed..

a generic Multicast client to server tunnel app is the simple answer, and what ordinary people paying for your connections should start using for near realtime web content streaming and totally bypass any ISPs arbitry Multicast IPv4/6 restrictions.


iv never tryed "point to multi point" server clients, with this simple but really good "IP Multicast tunnel" but it works fine for point to point when im outside , as long as you have your OS ethernet routing setup right for IP multicast ,it should work, give it a try... and report back your step by step if it works....

http://www.cdt.luth.se/~peppar/progs/mTunnel/
" multicast Tunnel - mTunnel

--------------------------------------------------------------------------------
The mTunnel is an application that tunnels multicast packets over an unicast UDP channel. Several multicast streams can be sent over the same tunnel while the tunnel will still only use one port.

This is useful if tunneling through a firewall.

The applications primary goal is to allow for easy tunneling of multicast over for instance a modem and/or an ISDN connection.

The mTunnel has a built in Web-server allowing for easy access to information about current tunnels. This server listens by default on port 9000 on the machine where started.

The mTunnel also listens on session announcements for easier tunneling of known sessions.

If you download and install this package please send me an email! :-) (peppar@cdt.luth.se)

The latest public version is 0.3 released 980102.
README Changelog
Download: Windows UNIX
"


another option if your any good with basic scripting is, you could modify these rare "rebol view" TCP/IP/UDP Multicast scripts and make your own light server and client with Multicast tunnel capabilitys to then feed your VLC x264 Encoded/streamed ouput directly to incoming Mtunnel/rebol tunnel connections perhaps.

this rebol multicasting script demo with a whiteboard, (but could be just about anything on rebol) has many interesting possibilitys perhaps.

download rebol view (by Carl Sassenrath, the amiga OS lead Dev) for your OS
http://www.rebol.com/view-platforms.html

and run this fully working Muticasting nework example code
http://www.rebolfrance.info/org/articles/multicast/sources.zip

tec people see http://www.rebolfrance.info/org/articles/multicast/multicast.html
and put it through http://www.freetranslation.com/free/web.htm
french to english/whatever to get the better translation (googlesucks)if you dont read french OC ;)

http://www.rebol.net/builds/
http://www.rebol.com/docs.html

obviously with VLC you change the input from the DVDsimple for your given input device,and transcode codec outputs etc see VLC docs.

vlc dvdsimple:// --sout '#rtp{dst=239.255.1.1,mux=ts,sdp=sap,name="My DVD"}'

vlc -vvv --color v4l2:///dev/video:norm=secam:size=640x480 --sout '#transcode{vcodec=mp4v,acodec=mpga,vb=3000}:rtp{mux=ts,dst=239.255.12.13,port=5004}' --ttl 12


VLC Streaming Howto: http://www.videolan.org/doc/ for a general over view of the input/output options etc.

fifth5
29th April 2009, 11:58
Is there any exsited solution for Linux platform? A stream server runs on Linux.

I know live555, but it doesn't fully support H264.

uray
29th April 2009, 21:09
@fifth5 : AFAIK, vlc works on linux too, and it support h.264 using x264, don't forget to install ffmpeg too.

another question:
is it possible to build my own apps, that use libvlc (and its dependencies) to build complete streaming system?