Question

I'm still trying to implement RTSP in Java according to example from http://www.csee.umbc.edu/~pmundur/courses/CMSC691C/lab5-kurose-ross.html

Now I have approached the problem mentioned there: RTSP server java implementation problems :(

I'd like to explain more about it. I use the example above combined with jlibrtp (http://sourceforge.net/projects/jlibrtp/files/jlibrtp/) to answer the RTSP requests and initiate the RTP/RTCP seccion and transmit the data.

When I set up payload format for MJPEG to 26 (as all sheets say) or to 96 (as gstreamer rtsp server example does when streams avi-packed mjpeg in this example How can I stream mjpeg file as rtsp). Actually, payload it as simple as jpegs bytes, separated to the packets. https://www.rfc-editor.org/rfc/rfc2435 is not implemented, so i'm sending potentially wrong packets. Since the VLC is very debug-friendly, my expectation is to see frame surprisingly correctly encoded or some error message on each frame in the log. However, nothing occurs.

Please see the output log of the vlc:

vlc rtsp://localhost:6666/autostream -vvv
VLC media player 2.0.3 Twoflower (revision 2.0.2-93-g77aa89e)
[0x652108] main libvlc debug: VLC media player - 2.0.3 Twoflower
[0x652108] main libvlc debug: Copyright © 1996-2012 VLC authors and VideoLAN
[0x652108] main libvlc debug: revision 2.0.2-93-g77aa89e
[0x652108] main libvlc debug: configured with ./configure  '--enable-static' '--    build=x86_64-linux-gnu' 'CFLAGS=-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security' 'CPPFLAGS=-D_FORTIFY_SOURCE=2' 'CXXFLAGS=-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security' 'LDFLAGS=-Wl,-z,relro' '--config-cache' '--disable-maintainer-mode' '--disable-silent-rules' '--disable-update-check' '--enable-fast-install' '--prefix=/usr' '--docdir=/usr/share/doc/vlc-nox' '--sysconfdir=/etc' '--with-binary-version=4' '--enable-a52' '--enable-aa' '--enable-bluray' '--enable-bonjour' '--enable-caca' '--enable-dbus' '--enable-dca' '--enable-dirac' '--enable-directfb' '--enable-dvbpsi' '--enable-dvdnav' '--enable-faad' '--enable-flac' '--enable-fluidsynth' '--enable-freetype' '--enable-fribidi' '--enable-gnutls' '--enable-jack' '--enable-kate' '--enable-libass' '--enable-libmpeg2' '--enable-libproxy' '--enable-libxml2' '--enable-lirc' '--enable-live555' '--enable-mad' '--enable-mkv' '--enable-mod' '--enable-mpc' '--enable-mtp' '--enable-mux_ogg' '--enable-ncurses' '--enable-notify' '--enable-ogg' '--enable-oss' '--enable-pulse' '--enable-qt4' '--enable-realrtsp' '--enable-samplerate' '--enable-schroedinger' '--enable-sdl' '--enable-shout' '--enable-skins2' '--enable-smb' '--enable-speex' '--enable-svg' '--enable-taglib' '--enable-theora' '--enable-twolame' '--enable-upnp' '--enable-vcd' '--enable-vcdx' '--enable-vorbis' '--enable-x264' '--enable-zvbi' '--with-kde-solid=/usr/share/kde4/apps/solid/actions/' '--disable-dxva2' '--disable-gnomevfs' '--disable-goom' '--disable-portaudio' '--disable-projectm' '--disable-sqlite' '--disable-telx' '--enable-alsa' '--enable-atmo' '--enable-dc1394' '--enable-dv' '--enable-fbosd' '--enable-libva' '--enable-linsys' '--enable-omxil' '--enable-pvr' '--enable-udev' '--enable-v4l2' '--enable-crystalhd' '--enable-mmx' '--enable-sse' '--disable-neon' '--disable-altivec' 'build_alias=x86_64-linux-gnu'
[0x652108] main libvlc debug: searching plug-in modules
[0x652108] main libvlc debug: loading plugins cache file /usr/lib/vlc/plugins/plugins.dat
[0x652108] main libvlc warning: This doesn't look like a valid plugins cache
[0x652108] main libvlc debug: recursively browsing `/usr/lib/vlc/plugins'
[0x652108] main libvlc debug: saving plugins cache /usr/lib/vlc/plugins/plugins.dat
[0x652108] main libvlc debug: plug-ins loaded: 422 modules
[0x652108] main libvlc debug: opening config file (/home/ilya/.config/vlc/vlcrc)
[0x652108] main libvlc debug: translation test: code is "ru"
[0x652108] main libvlc debug: CPU has capabilities MMX MMXEXT SSE SSE2 SSE3 FPU
[0x652108] main libvlc debug: looking for memcpy module: 4 candidates
[0x652108] main libvlc debug: using memcpy module "memcpymmxext"
[0x688a58] main input debug: Creating an input for 'Медиатека'
[0x688a58] main input debug: Input is a meta file: disabling unneeded options
[0x688a58] main input debug: using timeshift granularity of 50 MiB, in path '/tmp'
[0x688a58] main input debug: `file/xspf-open:///home/ilya/.local/share/vlc/ml.xspf'     gives access `file' demux `xspf-open' path `/home/ilya/.local/share/vlc/ml.xspf'
[0x688a58] main input debug: creating demux: access='file' demux='xspf-open' location='/home/ilya/.local/share/vlc/ml.xspf' file='/home/ilya/.local/share/vlc/ml.xspf'
[0x68e978] main demux debug: looking for access_demux module: 3 candidates
[0x68e978] main demux debug: no access_demux module matching "file" could be loaded
[0x68e978] main demux debug: TIMER module_need() : 2.410 ms - Total 2.410 ms / 1 intvls (Avg 2.410 ms)
[0x688a58] main input debug: creating access 'file' location='/home/ilya/.local/share/vlc/ml.xspf', path='/home/ilya/.local/share/vlc/ml.xspf'
[0x6929a8] main access debug: looking for access module: 2 candidates
[0x6929a8] filesystem access debug: opening file `/home/ilya/.local/share/vlc/ml.xspf'
[0x6929a8] main access debug: using access module "filesystem"
[0x6929a8] main access debug: TIMER module_need() : 1.149 ms - Total 1.149 ms / 1 intvls (Avg 1.149 ms)
[0x68f928] main stream debug: Using stream method for AStream*
[0x68f928] main stream debug: starting pre-buffering
[0x68f928] main stream debug: received first data after 25 ms
[0x68f928] main stream debug: pre-buffering done 301 bytes in 0s - 11 KiB/s
[0x68fbb8] main stream debug: looking for stream_filter module: 7 candidates
[0x68fbb8] main stream debug: no stream_filter module matching "any" could be loaded
[0x68fbb8] main stream debug: TIMER module_need() : 1.755 ms - Total 1.755 ms / 1 intvls (Avg 1.755 ms)
[0x68fbb8] main stream debug: looking for stream_filter module: 1 candidate
[0x68fbb8] main stream debug: using stream_filter module "stream_filter_record"
[0x68fbb8] main stream debug: TIMER module_need() : 0.659 ms - Total 0.659 ms / 1 intvls (Avg 0.659 ms)
[0x688a58] main input debug: creating demux: access='file' demux='xspf-open' location='/home/ilya/.local/share/vlc/ml.xspf' file='/home/ilya/.local/share/vlc/ml.xspf'
[0x7f6c18] main demux debug: looking for demux module: 1 candidate
[0x7f6c18] playlist demux debug: using XSPF playlist reader
[0x7f6c18] main demux debug: using demux module "playlist"
[0x7f6c18] main demux debug: TIMER module_need() : 0.905 ms - Total 0.905 ms / 1 intvls (Avg 0.905 ms)
[0x7f74b8] main demux meta debug: looking for meta reader module: 2 candidates
[0x7f74b8] lua demux meta debug: Trying Lua scripts in /home/ilya/.local/share/vlc/lua/meta/reader
[0x7f74b8] lua demux meta debug: Trying Lua scripts in /usr/lib/vlc/lua/meta/reader
[0x7f74b8] lua demux meta debug: Trying Lua playlist script /usr/lib/vlc/lua/meta/reader/filename.luac
[0x7f74b8] lua demux meta debug: Trying Lua scripts in /usr/share/vlc/lua/meta/reader
[0x7f74b8] main demux meta debug: no meta reader module matching "any" could be loaded
[0x7f74b8] main demux meta debug: TIMER module_need() : 37.475 ms - Total 37.475 ms / 1 intvls (Avg 37.475 ms)
[0x688a58] main input debug: `file/xspf-open:///home/ilya/.local/share/vlc/ml.xspf' successfully opened
[0x805418] main xml reader debug: looking for xml reader module: 1 candidate
[0x805418] main xml reader debug: using xml reader module "xml"
[0x805418] main xml reader debug: TIMER module_need() : 39.262 ms - Total 39.262 ms / 1 intvls (Avg 39.262 ms)
[0x7f6c18] playlist demux debug: parsed 0 tracks successfully
[0x688a58] main input debug: EOF reached
[0x7f6c18] main demux debug: removing module "playlist"
[0x68fbb8] main stream debug: removing module "stream_filter_record"
[0x6929a8] main access debug: removing module "filesystem"
[0x688a58] main input debug: TIMER input launching for 'Медиатека' : 73.195 ms - Total 73.195 ms / 1 intvls (Avg 73.195 ms)
[0x68e668] main interface debug: looking for interface module: 1 candidate
[0x68e668] main interface debug: using interface module "hotkeys"
[0x68e668] main interface debug: TIMER module_need() : 0.444 ms - Total 0.444 ms / 1 intvls (Avg 0.444 ms)
[0x689f58] main interface debug: looking for interface module: 1 candidate
[0x7f4a98] main playlist debug: playlist threads correctly activated
[0x689f58] main interface debug: using interface module "inhibit"
[0x689f58] main interface debug: TIMER module_need() : 43.720 ms - Total 43.720 ms / 1 intvls (Avg 43.720 ms)
[0x7f4a98] main playlist debug: adding item `rtsp://localhost:6666/autostream' ( rtsp://localhost:6666/autostream )
[0x68b0a8] main interface debug: looking for interface module: 1 candidate
[0x7f4a98] main playlist debug: meta ok for (null), need to fetch art
[0x7f4a98] main playlist debug: rebuilding array of current - root Плейлист
[0x7f4a98] main playlist debug: rebuild done - 1 items, index -1
[0x7f2218000b78] main demux meta debug: looking for meta fetcher module: 1 candidate
[0x7f2218000b78] lua demux meta debug: Trying Lua scripts in /home/ilya/.local/share/vlc/lua/meta/fetcher
[0x7f2218000b78] lua demux meta debug: Trying Lua scripts in /usr/lib/vlc/lua/meta/fetcher
[0x7f2218000b78] lua demux meta debug: Trying Lua playlist script /usr/lib/vlc/lua/meta/fetcher/tvrage.luac
[0x7f2218000b78] main demux meta debug: using meta fetcher module "lua"
[0x7f2218000b78] main demux meta debug: TIMER module_need() : 33.783 ms - Total 33.783 ms / 1 intvls (Avg 33.783 ms)
[0x7f2218000b78] main demux meta debug: removing module "lua"
[0x7f4a98] main playlist debug: searching art for rtsp://localhost:6666/autostream
[0x7f2218005948] main art finder debug: looking for art finder module: 2 candidates
[0x7f2218005948] lua art finder debug: Trying Lua scripts in /home/ilya/.local/share/vlc/lua/meta/art
[0x7f2218005948] lua art finder debug: Trying Lua scripts in /usr/lib/vlc/lua/meta/art
[0x7f2218005948] lua art finder debug: Trying Lua playlist script /usr/lib/vlc/lua/meta/art/00_musicbrainz.luac
[0x7f2218005948] lua art finder debug: Trying Lua playlist script /usr/lib/vlc/lua/meta/art/01_googleimage.luac
[0x7f2218005948] lua art finder debug: Trying Lua playlist script /usr/lib/vlc/lua/meta/art/02_frenchtv.luac
[0x7f2218005948] lua art finder debug: Trying Lua playlist script /usr/lib/vlc/lua/meta/art/03_lastfm.luac
[0x7f2218005948] lua art finder debug: Trying Lua scripts in /usr/share/vlc/lua/meta/art
[0x7f2218005948] main art finder debug: no art finder module matching "any" could be loaded
[0x7f2218005948] main art finder debug: TIMER module_need() : 17.852 ms - Total 17.852 ms / 1 intvls (Avg 17.852 ms)
[0x7f4a98] main playlist debug: art not found for rtsp://localhost:6666/autostream
[0x68b0a8] main interface debug: using interface module "globalhotkeys"
[0x68b0a8] main interface debug: TIMER module_need() : 53.552 ms - Total 53.552 ms / 1 intvls (Avg 53.552 ms)
[0x652108] main libvlc: Запуск vlc с интерфейсом по умолчанию. Используйте 'cvlc' для запуска vlc без интерфейса.
[0x68ba18] main interface debug: looking for interface module: 6 candidates
Fontconfig warning: "/etc/fonts/conf.d/65-droid-sans-fonts.conf", line 103: Having multiple values in <test> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/65-droid-sans-fonts.conf", line 138: Having multiple values in <test> isn't supported and may not work as expected
[0x7f221823c6a8] main generic debug: looking for extension module: 1 candidate
[0x7f221823c6a8] lua generic debug: Opening Lua Extension module
[0x7f221823c6a8] lua generic debug: Trying Lua scripts in /home/ilya/.local/share/vlc/lua/extensions
[0x7f221823c6a8] lua generic debug: Trying Lua scripts in /usr/lib/vlc/lua/extensions
[0x7f221823c6a8] lua generic debug: Trying Lua scripts in /usr/share/vlc/lua/extensions
[0x7f221823c6a8] main generic debug: using extension module "lua"
[0x7f221823c6a8] main generic debug: TIMER module_need() : 0.972 ms - Total 0.972 ms / 1 intvls (Avg 0.972 ms)
[0x68ba18] main interface debug: using interface module "qt4"
[0x68ba18] main interface debug: TIMER module_need() : 10383.488 ms - Total 10383.488 ms / 1 intvls (Avg 10383.488 ms)
[0x7f4a98] main playlist debug: processing request item: null, node: Плейлист, skip: 0
[0x7f4a98] main playlist debug: starting playback of the new playlist item
[0x7f4a98] main playlist debug: resyncing on rtsp://localhost:6666/autostream
[0x7f4a98] main playlist debug: rtsp://localhost:6666/autostream is at 0
[0x7f4a98] main playlist debug: creating new input thread
[0x7f2220000b78] main input debug: Creating an input for     'rtsp://localhost:6666/autostream'
[0x68ba18] qt4 interface debug: IM: Setting an input
[0x7f2220000b78] main input debug: using timeshift granularity of 50 MiB, in path '/tmp'
[0x7f2220000b78] main input debug: `rtsp://localhost:6666/autostream' gives access `rtsp' demux `' path `localhost:6666/autostream'
[0x7f2220000b78] main input debug: creating demux: access='rtsp' demux='' location='localhost:6666/autostream' file='(null)'
[0x7f220c001178] main demux debug: looking for access_demux module: 1 candidate
[0x7f220c001178] live555 demux debug: version 2013.04.30
Opening connection to 127.0.0.1, port 6666...
...remote connection opened
Sending request: OPTIONS rtsp://localhost:6666/autostream RTSP/1.0
CSeq: 2
User-Agent: LibVLC/2.0.8 (LIVE555 Streaming Media v2013.04.30)

Received 158 new bytes of response data.
Received a complete OPTIONS response:
RTSP/1.0 200 OK
CSeq: 2
Public: OPTIONS, PAUSE, PLAY, SETUP, SET_PARAMETER, TEARDOWN
Server: GStreamer RTSP server
Date: Sun, 15 Sep 2013 16:34:40 GMT

Sending request: DESCRIBE rtsp://localhost:6666/autostream RTSP/1.0
CSeq: 3
User-Agent: LibVLC/2.0.8 (LIVE555 Streaming Media v2013.04.30)
Accept: application/sdp

Received 445 new bytes of response data.
Received a complete DESCRIBE response:
RTSP/1.0 200 OK
CSeq: 3
Content-Type: application/sdp
Content-Base: rtsp://localhost:6666/autostream/
Server: GStreamer RTSP server
Date: Sun, 15 Sep 2013 16:34:40 GMT
Content-Length: 248

v=0
o=- 123456 1 IN IP4 127.0.0.1
s=123456
i=rtsp-server
e=NONE
t=0 0
a=tool:GStreamer
a=type:broadcast
a=control:*
a=range:npt=0,000000-119,961667
m=video 59722 RTP/AVP 26
c=IN IP4 127.0.0.1
a=rtpmap:26 JPEG/90000
a=control:stream=0

[0x7f220c001178] live555 demux debug: RTP subsession 'video/JPEG'
Sending request: SETUP rtsp://localhost:6666/autostream/stream=0 RTSP/1.0
CSeq: 4
User-Agent: LibVLC/2.0.8 (LIVE555 Streaming Media v2013.04.30)
Transport: RTP/AVP;unicast;client_port=59722-59723

Received 215 new bytes of response data.
Received a complete SETUP response:
RTSP/1.0 200 OK
CSeq: 4
Transport: RTP/AVP;unicast;client_port=59722-59723;server_port=59721-59722;ssrc=11111111;mode="PLAY"
Server: GStreamer RTSP server
Date: Sun, 15 Sep 2013 16:34:40 GMT
Session: 123456

[0x7f2220000b78] main input debug: selecting program id=0
[0x7f220c001178] live555 demux debug: setup start: 0.000000 stop:119.961670
Sending request: PLAY rtsp://localhost:6666/autostream/ RTSP/1.0
CSeq: 5
User-Agent: LibVLC/2.0.8 (LIVE555 Streaming Media v2013.04.30)
Session: 123456
Range: npt=0.000-

Received 224 new bytes of response data.
Received a complete PLAY response:
RTSP/1.0 200 OK
CSeq: 5
RTP-Info: url=rtsp://localhost:6666/autostream/stream=0;seq=101;rtptime=101
Range: npt=119,961667-119,961667
Server: GStreamer RTSP server
Session: 123456
Date: Sun, 15 Sep 2013 16:34:44 GMT

[0x7f220c001178] live555 demux debug: play start: 119.000000 stop:119.961670
[0x7f220c001178] main demux debug: using access_demux module "live555"
[0x7f220c001178] main demux debug: TIMER module_need() : 5498.564 ms - Total 5498.564 ms / 1 intvls (Avg 5498.564 ms)
[0x7f220c0021f8] main decoder debug: looking for decoder module: 31 candidates
[0x7f220c0021f8] avcodec decoder debug: libavcodec initialized (interface 0x362300)
[0x7f220c0021f8] avcodec decoder debug: trying to use direct rendering
[0x7f220c0021f8] avcodec decoder debug: allowing 3 thread(s) for decoding
[0x7f220c0021f8] avcodec decoder debug: ffmpeg codec (Motion JPEG Video) started
[0x7f220c0021f8] main decoder debug: using decoder module "avcodec"
[0x7f220c0021f8] main decoder debug: TIMER module_need() : 839.572 ms - Total 839.572 ms / 1 intvls (Avg 839.572 ms)
[0x7f220c030e98] main demux meta debug: looking for meta reader module: 2 candidates
[0x7f220c030e98] lua demux meta debug: Trying Lua scripts in /home/ilya/.local/share/vlc/lua/meta/reader
[0x7f220c030e98] lua demux meta debug: Trying Lua scripts in /usr/lib/vlc/lua/meta/reader
[0x7f220c030e98] lua demux meta debug: Trying Lua playlist script /usr/lib/vlc/lua/meta/reader/filename.luac
[0x7f220c030e98] lua demux meta debug: Trying Lua scripts in /usr/share/vlc/lua/meta/reader
[0x7f220c030e98] main demux meta debug: no meta reader module matching "any" could be loaded
[0x7f220c030e98] main demux meta debug: TIMER module_need() : 27.457 ms - Total 27.457 ms / 1 intvls (Avg 27.457 ms)
[0x7f2220000b78] main input debug: `rtsp://localhost:6666/autostream' successfully opened
[0x7f220c001178] live555 demux warning: no data received in 10s. Switching to TCP
Sending request: TEARDOWN rtsp://localhost:6666/autostream/ RTSP/1.0
CSeq: 6
User-Agent: LibVLC/2.0.8 (LIVE555 Streaming Media v2013.04.30)
Session: 123456

[0x7f220c0021f8] main decoder debug: removing module "avcodec"
[0x7f220c0021f8] avcodec decoder debug: ffmpeg codec (Motion JPEG Video) stopped
[0x7f220c0021f8] main decoder debug: killing decoder fourcc `MJPG', 0 PES in FIFO
[0x7f2220000b78] main input debug: Program doesn't contain anymore ES
Opening connection to 127.0.0.1, port 6666...
...Connection to server failed: В соединении отказано
Opening connection to 127.0.0.1, port 6666...
...Connection to server failed: В соединении отказано
[0x7f220c001178] live555 demux debug: connection error -115
[0x7f220c001178] live555 demux error: Failed to connect with     rtsp://localhost:6666/autostream
[0x7f220c001178] live555 demux error: TCP rollover failed, aborting
[0x7f2220000b78] main input debug: EOF reached
[0x7f220c001178] main demux debug: removing module "live555"
[0x7f4a98] main playlist debug: dead input
[0x7f4a98] main playlist debug: changing item without a request (current 0/1)
[0x7f4a98] main playlist debug: nothing to play
[0x68ba18] qt4 interface debug: IM: Deleting the input
[0x652108] main libvlc debug: exiting
[0x652108] main libvlc debug: deactivating the playlist
[0x7f4a98] main playlist debug: deactivating the playlist
[0x7b6ab8] main playlist export debug: saving Медиатека to file /home/ilya/.local/share/vlc/ml.xspf
[0x7b6ab8] main playlist export debug: looking for playlist export module: 1 candidate
[0x7b6ab8] main playlist export debug: using playlist export module "export"
[0x7b6ab8] main playlist export debug: TIMER module_need() : 10.016 ms - Total 10.016 ms / 1 intvls (Avg 10.016 ms)
[0x7b6ab8] main playlist export debug: removing module "export"
[0x7f4a98] main playlist debug: playlist correctly deactivated
[0x652108] main libvlc debug: removing all services discovery tasks
[0x652108] main libvlc debug: removing all interfaces
[0x68ba18] main interface debug: removing module "qt4"
[0x68ba18] qt4 interface debug: requesting exit...
[0x68ba18] qt4 interface debug: waiting for UI thread...
[0x68ba18] qt4 interface debug: QApp exec() finished
[0x68ba18] qt4 interface debug: Video is not needed anymore
[0x68ba18] qt4 interface debug: Killing extension dialog provider
[0x68ba18] qt4 interface debug: ExtensionsDialogProvider is quitting...
[0x7f221823c6a8] main generic debug: removing module "lua"
[0x7f221823c6a8] lua generic debug: Deactivating all loaded extensions
[0x7f221823c6a8] lua generic debug: All extensions are now deactivated
[0x68b0a8] main interface debug: removing module "globalhotkeys"
[0x689f58] main interface debug: removing module "inhibit"
[0x7f2220000b78] main input debug: TIMER input launching for 'rtsp://localhost:6666/autostream' : 6368.241 ms - Total 6368.241 ms / 1 intvls (Avg 6368.241 ms)
[0x68e668] main interface debug: removing module "hotkeys"
[0x7f4a98] main playlist debug: destroying
[0x652108] main libvlc debug: TIMER ML Load : Total 119.403 ms / 1 intvls (Avg 119.403 ms)
[0x652108] main libvlc debug: TIMER Items array build : Total 0.785 ms / 1 intvls (Avg 0.785 ms)
[0x652108] main libvlc debug: TIMER ML Dump : Total 24.306 ms / 1 intvls (Avg 24.306 ms)
[0x652108] main libvlc debug: removing stats
[0x652108] main libvlc debug: removing module "memcpymmxext"
[0x652108] main libvlc debug: opening config file (/home/ilya/.config/vlc/vlcrc)

Note that server is closed due to TEARDOWN message (my code is still fragile and it is now implemented yet). TEARDOWN is sent by the client after 10s timeout -

live555 demux warning: no data received in 10s. Switching to TCP

I have monkeyed around the parameters my server sents to the VLC client. In general, in every case I got the same error. The only exception was such configuration of SDP sent by the DESCRIBE response:

Received 438 new bytes of response data.
Received a complete DESCRIBE response:
RTSP/1.0 200 OK
CSeq: 3
Content-Type: application/sdp
Content-Base: rtsp://localhost:6666/autostream/
Server: GStreamer RTSP server
Date: Sun, 15 Sep 2013 17:10:47 GMT
Content-Length: 241

v=0
o=- 123456 1 IN IP4 127.0.0.1
s=123456
i=rtsp-server
e=NONE
t=0 0
a=tool:GStreamer
a=type:broadcast
a=control:*
a=range:npt=0,000000-119,961667
m=audio 0 RTP/AVP 0
c=IN IP4 127.0.0.1
a=rtpmap:0 PCMU/8000
a=control:stream=0

[0x7f13140013f8] live555 demux debug: RTP subsession 'audio/PCMU'
Sending request: SETUP rtsp://localhost:6666/autostream/stream=0 RTSP/1.0
CSeq: 4
User-Agent: LibVLC/2.0.8 (LIVE555 Streaming Media v2013.04.30)
Transport: RTP/AVP;unicast;client_port=49584-49585

with payload type 0, PCMU/8000. For this case my potentially wrong MJPEG RTP packet are interpreted as correct audio; the streaming starts and some noisy sounds are produced. Note, that the same configuration doesn't work if i will replace audio 0 (0 means port is proposed by the client) to some specific port number.

[0x7f13140013f8] live555 demux debug: play start: 119.000000 stop:119.961670
[0x7f13140013f8] main demux debug: using access_demux module "live555"
[0x7f13140013f8] main demux debug: TIMER module_need() : 4273.737 ms - Total 4273.737 ms / 1 intvls (Avg 4273.737 ms)
[0x7f1314002c38] main decoder debug: looking for decoder module: 31 candidates
[0x7f1314002c38] araw decoder debug: samplerate:8000Hz channels:1 bits/sample:8
[0x7f1314002c38] main decoder debug: using decoder module "araw"
[0x7f1314002c38] main decoder debug: TIMER module_need() : 18.290 ms - Total 18.290 ms / 1 intvls (Avg 18.290 ms)
[0x7f131400d3d8] main demux meta debug: looking for meta reader module: 2 candidates
[0x7f131400d3d8] lua demux meta debug: Trying Lua scripts in /home/ilya/.local/share/vlc/lua/meta/reader
[0x7f131400d3d8] lua demux meta debug: Trying Lua scripts in /usr/lib/vlc/lua/meta/reader
[0x7f131400d3d8] lua demux meta debug: Trying Lua playlist script /usr/lib/vlc/lua/meta/reader/filename.luac
[0x7f131400d3d8] lua demux meta debug: Trying Lua scripts in /usr/share/vlc/lua/meta/reader
[0x7f131400d3d8] main demux meta debug: no meta reader module matching "any" could be loaded
[0x7f131400d3d8] main demux meta debug: TIMER module_need() : 2.056 ms - Total 2.056 ms / 1 intvls (Avg 2.056 ms)
[0x7f131c000b78] main input debug: `rtsp://localhost:6666/autostream' successfully opened
[0x19b1a98] main playlist debug: creating audio output
[0x7f131c000b78] main input debug: Buffering 0%
[0x7f1304000958] main audio output debug: looking for audio output module: 3 candidates
[0x7f1304000958] pulse audio output debug: using mono channel map
[0x7f1304000958] pulse audio output debug: using library version 2.0.0
[0x7f1304000958] pulse audio output debug:  (compiled with version 4.0.0, protocol 28)
[0x7f131c000b78] main input debug: Buffering 0%
[0x7f131c000b78] main input debug: Buffering 0%
[0x7f131c000b78] main input debug: Buffering 0%
[0x7f131c000b78] main input debug: Buffering 0%
[0x7f131c000b78] main input debug: Buffering 0%
[0x7f131c000b78] main input debug: Buffering 0%

So, if someone can advice how I can specify SDP data sent to make VLC working with payload type 26 or 96, please help. Or, it some RTP/RTCP request needed for MJPEG only but not for PCMU behind the scene is possibly ommited, just give the direction to investigate.

Was it helpful?

Solution

There were 2 prolems there.

1) I misused RTP, RTCP and RTSP ports ther, so after I have set a correct port I got some more lines in VLC log:

[0x7f3fbc000b78] main input debug: `rtsp://localhost:6666/audiostream.mjpg' successfully opened
[0x7f3fb0001358] live555 demux debug: tk->rtpSource->hasBeenSynchronizedUsingRTCP()
[0x7f3fbc000b78] main input error: ES_OUT_RESET_PCR called
[0x7f3fb0001358] live555 demux warning: no data received in 10s. Switching to TCP

(Not sure that they are correct, but first three are exactly the same as in working gstreamer example)

2) But there was still a problem. After I have installed wireshark I have realized that my RTP packets are sent with default 0-type payload. After I have updated it to the new type, 26, it got new problems, the VLC no longer wait for 10s for data and close the connection.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top