Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Stream capture of UDP audio and video traffic from dump file

WCS can automatically capture and play stream from the specified file in Pcap format. The file must be formed with tcpdump or any other tool to collect IP packets. This feature is useful primarily for debugging in the development of applicationsю 

File name must be set in audioPort-videoPort-name.pcap form, for example

Code Block
languagebash
themeRDark
pull_streams=pcap://31070-31072-test.pcap

where 31070 is audio packets port and 31072 is video packets port.

SDP file must be added to every pcap file. SDP file must be named similarly to pcap file

Code Block
languagebash
themeRDark
31070-31072-test.pcap.sdp

SDP file example:

Code Block
languagebash
themeRDark
v=0
o=Gateway-0.0.0.666 0 0 IN IP[local_ip_type] [local_ip]
s=-
c=IN IP[local_ip_type] [local_ip]
t=0 0
m=audio 0 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=sendrecv
m=video 0 RTP/AVP 112
a=rtpmap:112 H264/90000
a=fmtp:112 profile-level-id=42e01f; packetization-mode=1
a=content:main
a=rtcp-fb:* ccm fir
a=rtcp-fb:* nack pli
a=sendrecv

Dump file and SDP file must be placed to /usr/local/FlashphonerWebCallServer/media directory on server.

RTSP-interleaved stream capture from dump file

For debugging purpose, WCS includes the utility to capture RTSP stream from file obtained by tcpdump or any other IP packets dump collection tool. Then, the stream is published via RTSP, emulating IP camera. In its turn, WSC can capture RTSP stream from this "camera". The feature is useful when RTSP-source itself is not accessible, but there are dump files of stream from that source. The utility works with RTSP iterleaved interleaved session files only.

To launch utility the following parameters mus must be set:

  • a directory containing dump files on server
  • a port to listen RTSP incoming connections
  • a source port for the stream dumped
  • a condition to handle dropped packets

...

Code Block
languagebash
themeRDark
java -Dcom.flashphoner.fms.AppHome=/usr/local/FlashphonerWebCallServer -cp /usr/local/FlashphonerWebCallServer/lib/tbswcs-flashphonercore.jar:/usr/local/FlashphonerWebCallServer/lib/* com.flashphoner.tools.rtsp.RtspPcapServer /usr/local/FlashphonerWebCallServer/pcaps 3554 2554 true

...

If WCS is launched on this server, the second parameter port number should be out of ranges used by WCS. The stream that will be available on this port, will be named as the stream in the dump file

If source port is set to 0

Code Block
languagebash
themeRDark
java -Dcom.flashphoner.fms.AppHome=/usr/local/FlashphonerWebCallServer -cp /usr/local/FlashphonerWebCallServer/lib/wcs-core.jar:/usr/local/FlashphonerWebCallServer/lib/* com.flashphoner.tools.rtsp.RtspPcapServer /usr/local/FlashphonerWebCallServer/pcaps 3554 0 true

the utility will try to detect all RTSP streams in all the dumps found, and list them to the standard output (see below).

The utility prints all information to stdout. Foe For example, if there is one file log.pcap in /usr/local/FlashphonerWebCallServer/pcaps directory, the following will be prited printed to console:

Code Block
languagebash
themeRDark
04:35:20,721 INFO        RtspPcapServer - Starting
04:35:22,244 INFO        RtspPcapServer - Available sources:
04:35:22,245 INFO        RtspPcapServer - Source{path=/usr/local/FlashphonerWebCallServer/pcaps/log.pcap, pcap=io.pkts.Pcap@5a39699c, stream=RTSPStream{config=8, data=22052, streamName='live1.sdp'}}
04:35:22,245 INFO        RtspPcapServer - Starting PCAP RTSP server
04:35:22,407 INFO        RtspPcapServer - Listening PCAP RTSP on address /0.0.0.0 port 5543554

The RTSP stream name exposed by utility will be set to RTSP stream name from the dump, or RTSP URI from the dump encoded as base64.

In this case, stream can be captured from address

Code Block
languagebash
themeRDark
rtsp://hostname:3554/livelive1.sdp

where hostname is server name with utility running.

If the directory contains a number of dump files, the stream names should not be the same, only one of such streams will be captured.

Setting a custom name for captured streams

Since build 5.2.1794 it ts possible to set a custom name prefix for RTSP streams captured from a dump file

Code Block
themeRDark
rtsp_pcap_server_custom_stream_name=source

An index number starting from 0 will be added to the prefix. In this case all the RTSP streams captured from the dump file using the command

Code Block
languagebash
themeRDark
java -Dcom.flashphoner.fms.AppHome=/usr/local/FlashphonerWebCallServer -cp /usr/local/FlashphonerWebCallServer/lib/wcs-core.jar:/usr/local/FlashphonerWebCallServer/lib/* com.flashphoner.tools.rtsp.RtspPcapServer /usr/local/FlashphonerWebCallServer/pcaps 3554 0 true

will be available by the following URLs

Code Block
languagebash
themeRDark
rtsp://hostname:3554/source0
rtsp://hostname:3554/source1
...

where hostname is a server name where the utility is running.

RTSP connection redirection testing

To test RTSP connection redirection using IP camera emulator, it is necessary to set the method in flashphoner.properties file, in response on which 302 Moved Temporarily should be returned, for example

...

Then, run RTSP dump file capture utility and connect to stream from dump file as described above. RTSP connection will be redirected to address defined.

RTSP authentication testing

Since build 5.2.1002 it is possible to test RTSP digest authentication. To do this, the additional parameter must be set when launching the utility:

Code Block
languagebash
themeRDark
java -Dcom.flashphoner.fms.AppHome=/usr/local/FlashphonerWebCallServer -cp /usr/local/FlashphonerWebCallServer/lib/wcs-core.jar:/usr/local/FlashphonerWebCallServer/lib/* com.flashphoner.tools.rtsp.RtspPcapServer /usr/local/FlashphonerWebCallServer/pcaps 3554 0 true 'login:password:SHA-256,MD5'

Wher

  • login - user name to login
  • password - passwird
  • SHA-256,MD5 - authentication algorithms list

In this case, all the streams exposed by the utility must be played by URI like 

Code Block
languagebash
themeRDark
rtsp://login:password@hostname:3554/streamName