[streaming] Develop my own RTSP client

Julien Bruneau bruneaujulien at gmail.com
Sun Oct 14 01:03:53 CEST 2007


Hi,

I would like to control the stream of a video on demand with my own RTSP
client and not using the commands in VLC.
My goal is that my client controls the stream of a video that is displayed
in a VLC client.

I first typed

$ vlc --ttl 2 -vvv --color -I telnet --telnet-password videolan --rtsp-host
localhost:554

Then I added my video with the Telnet interface :

> new film vod enabled
> setup film input "/.../mymovie.avi"

When I open the stream rtsp://localhost:554/film by typing :
$vlc -vvv rtsp://localhost:554/film

I can see and control the stream (pause, read, rewind...). All works
perfectly.

Now, I would like to control the stream with my own client. So I send my
RTSP messages to the VOD server.
Here is the exchange of RTSP messages between my client and the vod server :

****************************************************************************************************************
** OPTIONS **

C-->S
OPTIONS rtsp://localhost:554/film RTSP/1.0\r\n
CSeq: 1\r\n
User-Agent: myvlc\r\n
\r\n

S-->C
RTSP/1.0 200 Ok\r\n
Cseq: 1\r\n
Server: VLC Server\r\n
Public: DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE\r\n
Content-Length: 0
\r\n

** DESCRIBE **

C-->S
DESCRIBE rtsp://localhost:554/film RTSP/1.0\r\n
CSeq: 2\r\n
Accept: application/sdp\r\n
User-Agent: myvlc\r\n
\r\n

S-->C
RTSP/1.0 200 OK\r\n
Content-type: application/sdp
Server: VLC Server\r\n
Content-Length: 373
Cseq: 2\r\n
Cache-Control: no-cache\r\n
\r\n

** SETUP **

C-->S
SETUP rtsp://localhost:554/film/trackID=0 RTSP/1.0
CSeq: 3
Transport: RTP/AVP;unicast;client_port=1234-1235
User-Agent: myvlc

S-->C
RTSP/1.0 200 OK
Transport: RTP/AVP/UDP;client_port=1234-1235
Server: VLC Server
Content-Length: 0
Cseq: 3
Cache-Control: no-cache
Session: 441791550

** SETUP **

C-->S
SETUP rtsp://localhost:554/film/trackID=1 RTSP/1.0
CSeq: 4
Session: 441791550
Transport: RTP/AVP;unicast;client_port=1236-1237
User-Agent: myvlc

S-->C
RTSP/1.0 200 OK
Transport: RTP/AVP/UDP;client_port=1236-1237
Server: VLC Server
Content-Length: 0
Cseq: 4
Cache-Control: no-cache
Session: 441791550

** PLAY **

C-->S
PLAY rtsp://localhost:554/film RTSP/1.0
CSeq: 5
Session: 441791550
Range: npt=0.000-
User-Agent: myvlc

S-->C
RTSP/1.0 200 OK
Server: VLC Server
Content-Length: 0
Cseq: 5
Cache-Control: no-cache
Session: 441791550;timeout=5
****************************************************************************************************************

The exchange of messages seems to be good. I then try to see the stream by
typing:
$ vlc -vvv rtp:

But I only get the audio, there is no video...

Do you know how I could get both? Is there settings to change?

Here is the log that I get after typing vlc -vvv rtp:

julien at julien-laptop:~$ vlc -vvv rtp:
VLC media player 0.8.6 Janus
[00000001] main private debug: checking builtin modules
[00000001] main private debug: checking plugin modules
[00000001] main private debug: loading plugins cache file
/home/julien/.vlc/cache/plugins-04041e.dat
[00000001] main private debug: recursively browsing `modules'
[00000001] main private debug: recursively browsing `/usr/lib/vlc'
[00000001] main private debug: recursively browsing `plugins'
[00000001] main private debug: module bank initialized, found 215 modules
[00000001] main private debug: opening config file /home/julien/.vlc/vlcrc
[00000001] main private debug: CPU has capabilities 486 586 MMX 3DNow!
MMXEXT SSE SSE2 FPU
[00000001] main private debug: looking for memcpy module: 1 candidate
[00000001] main private debug: using memcpy module "memcpy"
[00000280] main playlist debug: waiting for thread completion
[00000280] main playlist debug: thread 3079261072 (playlist) created at
priority 0 (playlist/playlist.c:184)
[00000281] main private debug: waiting for thread completion
[00000281] main private debug: thread 3070868368 (preparser) created at
priority 0 (playlist/playlist.c:210)
[00000282] main interface debug: looking for interface module: 1 candidate
[00000282] main interface debug: using interface module "hotkeys"
[00000282] main interface debug: thread 3062475664 (interface) created at
priority 0 (interface/interface.c:231)
[00000284] main interface debug: looking for interface module: 1 candidate
[00000284] main interface debug: using interface module "screensaver"
[00000284] main interface debug: thread 3054082960 (interface) created at
priority 0 (interface/interface.c:231)
[00000280] main playlist debug: adding playlist item `rtp:' ( rtp: )
[00000286] main interface debug: looking for interface module: 5 candidates
[00000286] main interface debug: using interface module "wxwidgets"
[00000286] main interface debug: thread 3028519824 (manager) created at
priority 0 (interface/interface.c:216)
[00000286] wxwidgets interface debug: Using last windows config
'(-1,0,0,1280,800)(0,507,113,452,76)(6,0,0,-1,150)'
[00000286] wxwidgets interface debug: id=0 p=(507,113) s=(452,76)
[00000286] wxwidgets interface debug: id=6 p=(0,0) s=(-1,150)
[00000280] main playlist debug: nothing requested, starting
[00000280] main playlist debug: creating new input thread
[00000289] main input debug: waiting for thread completion
[00000289] main input debug: thread 3005397904 (input) created at priority 0
(input/input.c:265)
[00000289] main input debug: creating statistics handler
[00000289] main input debug: `rtp:' gives access `rtp' demux `' path `'
[00000289] main input debug: creating demux: access='rtp' demux='' path=''
[00000291] main demuxer debug: looking for access_demux module: 0 candidates
[00000291] main demuxer warning: no access_demux module matched "rtp"
[00000289] main input debug: creating access 'rtp' path=''
[00000292] main access debug: looking for access2 module: 6 candidates
[00000292] access_udp access debug: opening server=:0 local=:1234
[00000292] main access debug: net: connecting to '[]:0@[]:1234'
[00000292] main access debug: looking for network module: 1 candidate
[00000292] main access debug: using network module "ipv6"
[00000292] main access debug: removing module "ipv6"
[00000292] main access debug: using access2 module "access_udp"
[00000295] main private debug: pre buffering
[00000292] access_udp access debug: detected MPEG audio over RTP
[00000292] access_udp access debug: RTP: prebuffered 5 packets
[00000289] main input debug: creating demux: access='rtp' demux='mpga'
path=''
[00000296] main demuxer debug: looking for demux2 module: 1 candidate
[00000298] main packetizer debug: looking for packetizer module: 17
candidates
[00000298] main packetizer debug: using packetizer module "mpeg_audio"
[00000298] mpeg_audio packetizer debug: MPGA channels:2 samplerate:48000
bitrate:128
[00000289] main input debug: selecting program id=0
[00000296] main demuxer debug: looking for id3 module: 1 candidate
[00000296] id3tag demuxer debug: checking for ID3 tag
[00000296] main demuxer debug: using id3 module "id3tag"
[00000296] main demuxer debug: removing module "id3tag"
[00000296] main demuxer debug: using demux2 module "mpga"
[00000289] main input debug: looking for a subtitle file in /home/julien/
[00000325] main decoder debug: looking for decoder module: 24 candidates
[00000325] main decoder debug: using decoder module "mpeg_audio"
[00000325] main decoder debug: thread 2994789264 (decoder) created at
priority 0 (input/decoder.c:159)
[00000292] access_udp access warning: unimplemented query in control
[00000289] main input debug: `rtp:' successfully opened
[00000325] mpeg_audio decoder debug: MPGA channels:2 samplerate:48000
bitrate:128
[00000325] main decoder debug: no aout present, spawning one
[00000332] main audio output debug: looking for audio output module: 3
candidates
[00000332] alsa audio output debug: opening ALSA device `default'
[00000332] main audio output debug: thread 2986199952 (aout) created at
priority 0 (alsa.c:662)
[00000332] main audio output debug: using audio output module "alsa"
[00000332] main audio output debug: output 'fl32' 48000 Hz Stereo frame=1
samples/8 bytes
[00000332] main audio output debug: mixer 'fl32' 48000 Hz Stereo frame=1
samples/8 bytes
[00000332] main audio output debug: no need for any filter
[00000332] main audio output debug: looking for audio mixer module: 3
candidates
[00000332] main audio output debug: using audio mixer module "float32_mixer"
[00000332] main audio output debug: input 'mpga' 48000 Hz Stereo frame=1152
samples/969 bytes
[00000332] main audio output debug: filter(s) 'mpga'->'fl32' 48000 Hz->48000
Hz Stereo->Stereo
[00000334] main private debug: looking for audio filter module: 24
candidates
[00000334] main private debug: using audio filter module "mpgatofixed32"
[00000332] main audio output debug: found a filter for the whole conversion
[00000332] main audio output debug: filter(s) 'fl32'->'fl32' 52800 Hz->48000
Hz Stereo->Stereo
[00000341] main private debug: looking for audio filter module: 24
candidates
[00000341] main private debug: using audio filter module
"bandlimited_resampler"
[00000332] main audio output debug: found a filter for the whole conversion
[00000332] mpgatofixed32 audio output debug: libmad error: bad
main_data_begin pointer
[00000332] mpgatofixed32 audio output debug: libmad error: bad
main_data_begin pointer
[00000332] main audio output warning: buffer is 41367 late, triggering
upsampling
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.videolan.org/pipermail/streaming/attachments/20071014/f7db39c8/attachment.htm 


More information about the streaming mailing list