[Live-devel] Questions on streaming live H263 videos
Cristiano Belloni
belloni at imavis.com
Mon Dec 17 03:48:30 PST 2007
Hi to everybody,
I've got a couple hopefully basic questions about live streaming with
live555.
I'd like to stream h263-encoded videos to various media players (mainly
realplayer on mobile phones).
What I do now is starting a thread that captures live frames and encodes
them in H263 with ffmpeg. The thread writes on a Unix named pipe (FIFO).
Then I create a RTSPServer instance, create a ServerMediaSession and add
a subsession, passing the FIFO file name as the subsession parameter.
A few problems arise, in order of importance:
1) VLC and Mplayer are able to play the live video, while RealPlayer
isn't. I captured the network conversation with wireshark, and it seems
the RTSP negotiation is done correctly, but the server just won't send
RTP packets (while with VLC or MPlayer it does).
Here's the captured RTSP conversation:
User-Agent: RealMedia Player/mc.28.16.01 (s60; epoc_av21_thumb)
CSeq: 1
RTSP/1.0 200 OK
CSeq: 1
Date: Mon, Dec 17 2007 11:26:51 GMT
Public: OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE
DESCRIBE rtsp://217.133.231.30/H263ESVideoTest RTSP/1.0
x-wap-profile: "http://nds1.nds.nokia.com/uaprof/NN70-1r100.xml"
ClientID: RealOnePlayer_s60.28.16.01_21-Apr-2006_10:28:59_epoc_av21_thumb
Accept: application/sdp
Bandwidth: 298368
GUID: 00000000-0000-0000-0000-000000000000
User-Agent: RealMedia Player/mc.28.16.01 (s60; epoc_av21_thumb)
CSeq: 2
RTSP/1.0 200 OK
CSeq: 2
Date: Mon, Dec 17 2007 11:26:51 GMT
Content-Base: rtsp://217.133.231.30/H263ESVideoTest/
Content-Type: application/sdp
Content-Length: 384
v=0
o=- 1197890794075912 1 IN IP4 217.133.231.30
s=Session streamed live by "rtspServer"
i=H263ESVideoTest
t=0 0
a=tool:LIVE555 Streaming Media v2007.12.06
a=type:broadcast
a=control:*
a=range:npt=0-
a=x-qt-text-nam:Session streamed live by "rtspServer"
a=x-qt-text-inf:H263ESVideoTest
m=video 0 RTP/AVP 96
c=IN IP4 0.0.0.0
a=rtpmap:96 H263-1998/90000
a=control:track1
SETUP rtsp://217.133.231.30/H263ESVideoTest/track1 RTSP/1.0
x-wap-profile: "http://nds1.nds.nokia.com/uaprof/NN70-1r100.xml"
Transport: RTP/AVP;unicast;client_port=26022-26023;mode=play
User-Agent: RealMedia Player/mc.28.16.01 (s60; epoc_av21_thumb)
CSeq: 3
RTSP/1.0 200 OK
CSeq: 3
Date: Mon, Dec 17 2007 11:26:52 GMT
Transport:
RTP/AVP;unicast;destination=217.201.153.216;source=217.133.231.30;client_port=26022-26023;server_port=6970-6971
Session: 1
PLAY rtsp://217.133.231.30/H263ESVideoTest/ RTSP/1.0
Range: npt=0.000-
Session: 1
User-Agent: RealMedia Player/mc.28.16.01 (s60; epoc_av21_thumb)
CSeq: 4
RTSP/1.0 200 OK
CSeq: 4
Date: Mon, Dec 17 2007 11:26:52 GMT
Range: npt=0.000-
Session: 1
RTP-Info:
url=rtsp://217.133.231.30/H263ESVideoTest/track1;seq=1723;rtptime=1928192185
(The client was RealPlayer from a Nokia N70 mobile, same behaviour with
RealPlayer for Linux on the same host of the server, so it's not a
network problem).
The client will then send RTCP control packets regularly, along with
some strange RTP packets with payload = 73, but the server won't send
any RTP or RTCP packet, even if the PLAY command was accepted by the server.
2) VLC and Mplayer correctly view the live video, but they often will
play a chunk of it, then "freeze" the frame for a few seconds, then play
another chunk, then freeze again. What could the problem be? Buffering?
Too many packets? (I acquire at 25 fps, but vlc is on the same host as
the server). Please note all this problems disappear when i stream from
a file containing raw h263 data @ 25 fps.
3) In my naive implementation, I start the encoder thread after adding
the subsession and before the taskScheduler().doEventLoop() call. I'd
like, instead, to start my decoder thread when and only when a client
does a request for the stream (sparing resources when the server is
idle), in an "on demand" fashion.
How can I do that? I thought about starting the decoder thread in
specialClientAccessCheck method, subclassing RTSPServer class, but I
don't think it's the right way to do it (after all,
specialClientAccessCheck is for checking IPs and request URLs).
Best regards and thanks in advance for your help,
Cristiano.
--
Belloni Cristiano
More information about the live-devel
mailing list