Showing posts with label Streaming server. Show all posts
Showing posts with label Streaming server. Show all posts

11/17/2011

如何正確停止「live555 RTSP串流伺服器」

在前一篇文章裡,我介紹如何利用live555撰寫RTSP串流伺服器。文章的原始碼範例,並無針對一些例外訊號例如:「Ctrl+C(SIGINT)」進行捕捉處理。 在Linux中,這些例外訊號若沒有處理,其預設行為將是立刻終止程式,進而導致資源遺漏(resource leak)。
在Linux裡,我們可以透過signal()於程式中設立處理常式(signal handler),於對應之處理常式中,我們將可正確地停止RTSP伺服器。

6/19/2011

WebP/HTTP Push on Google Chrome

Google Chrome browser, and it borther Chromium browser, seems the only web browser that supports WebP server push at this moment. Opera 11 can display WebP image frame by frame but not in server push mode according to my experiments. By the way, I found that Opera 11 cannot recognize MIME type: image/webp.

6/18/2011

JPEG/HTTP PUSH how-to

JPEG/HTTP server side push is done by adopting "multipart/x-mixed-replace" MIME type. More detail information could be found on Wikipedia:

HTTP server push
HTTP server push (also known as HTTP streaming) is a mechanism for sending data from a web server to a web browser. HTTP server push can be achieved through several mechanisms.
Generally the web server does not terminate a connection after response data has been served to a client. The web server leaves the connection open such that if an event is received, it can immediately be sent to one or multiple clients. Otherwise the data would have to be queued until the client's next request is received. Most web servers offer this functionality via CGI (e.g. Non-Parsed Headers scripts on Apache).
Another mechanism is related to a special MIME type called multipart/x-mixed-replace, which was introduced by Netscape in 1995. Web browsers would interpret this as a document changing whenever the server felt like pushing a new version to the client.[1] It is still supported by Firefox, Opera and Safari today, but ignored by Internet Explorer.[2] It can be applied to HTML documents, but also for streaming images in webcam applications.
The WHATWG Web Applications 1.0 proposal[3] included a mechanism to push content to the client. On September 1, 2006, the Opera web browser implemented this new experimental technology in a feature called "Server-Sent Events."[4][5] It is now being standardized as part of HTML5.[6] Another related part of HTML5 is the WebSockets API, which allows a web server and client to communicate over a full-duplex TCP connection. 

Streaming JPEG images over RTP using live555 streaming media

Live555 streaming media  is a software library that provides RTP/RTSP streaming features mainly. It supports many popular video and audio codecs. At this moment, JPEG is still the most popular lossy compression image format. It says that Live555 supports JPEG as well but not directly, see here, here and here. Live555 implements JPEG's RTP payload however it doesn't come with any JPEG parser. According to common  Live555 streaming media programming flow, a user that gonna to stream JPEG images through  it should(here):
(i) "JPEGVideoRTPSink", which will be fed by
(ii) a *subclass* of "JPEGVideoSource".

6/17/2011

To cross compile Live555 streaming media for ARM/Linux

To compile Live555 streaming media for ARM/Linux is quite easy.
It needs only few steps:
> cd live
> ./genMakefiles armlinux
> make

Pre-built binary package:
live.2011.06.16-dev-armlinux.tar.bz2

6/12/2011

使用live555 streaming media建立RTSP串流伺服器

Live555 Streaming Media是一套優秀的開放程式碼函示庫,擁有完整的RTSP/RTP實作,除了支援RTP over UDP外,尚支援RTP over RTSP以及RTP/RTSP over HTTP,可用於傳輸多種主流的影音壓縮格式如:H.264、MPEG4、MP3....等。知名的播放軟體VLC的串流功能就是基於此函式庫開發。
利用它我們只要短短幾行程式碼即可建立自己的串流伺服器。