4
Konrad Simon, STVC/PRM 28/01/2010 www.boschsecurity.com 1 | CCTV | IP Video | Tech Note | RTSP Standard media player can be used to display live video Easy integration into 3 rd party software application OS platform independent Conjoined audio/video streaming Internet Streaming possible Tested players: Quicktime Player VLC (VideoLan Client) The Real Time Streaming Protocol allows live viewing of video from a BVIP encoder or IP camera with a compatible standard media player. “Standard” in this way has the meaning of “implemented according to the RTSP standard” RFC2326. RTSP is supported by BVIP encoders and IP cameras with MPEG-4 SH++ streaming running firmware version 3.0 and above. Since firmware version 4.0 also H.264 streaming is supported, and with firmware version 4.10 audio support has been added. In addition, firmware version 4.10 provides ONVIF compliance, and with this JPEG Streaming comes along. A standard media player could be e.g. VLC Video LAN Client, Quicktime, or other RTSP compatible players. Unfortunately, Real Player or Windows Media Player request proprietary forms of streaming protocols which are not supported. The MPEG-ActiveX does not need to be installed on the viewing PC. Generally, access via RTSP is also possible from other OS platforms like Linux or Macintosh. Due to standardisation issues, only CIF and 2CIF is supported. 4CIF uses interlacing which is not commonly standardised. The encoding profiles within the encoder must be set up properly to allow connections via RTSP. If an incompatible resolution, like 4CIF, has been set up, a connection will not be established. The following examples assume having installed a Dinion IP camera at IP address 160.10.0.1 a VideoJet X40 at IP address 160.10.0.40, with 4 cameras connected. Setting up a connection Connecting to a BVIP unit is as simple as entering a URL that specifies the protocol and the unit’s IP address. An RTSP connection from e.g. Quicktime to the Dinion IP is established by opening the “File” menu, choose “Open URL”, and entering: RTSP://160.10.0.1 This will show live video from the Dinion IP camera, using encoding stream 1. Expecting that the Dinion IP camera will be set up for best video on the encoding stream 1, using 4CIF resolution, which is per default used for live viewing, it might be of advantage to connect to the second encoding stream which is more likely set up to a compatible resolution. This is done by handing over a parameter “inst” to the RTSP server in the Dinion IP, thus the URL must look like: RTSP://160.10.0.1/video?inst=2 Tech Note Streaming Video from BVIP using RTSP

TechNote Streaming Video from BVIP using RTSP v2stna.resource.bosch.com/documents/Configuration_Note_enUS...A standard media player could be e.g. VLC Video LAN Client, ... of the parameters

  • Upload
    buicong

  • View
    216

  • Download
    1

Embed Size (px)

Citation preview

Page 1: TechNote Streaming Video from BVIP using RTSP v2stna.resource.bosch.com/documents/Configuration_Note_enUS...A standard media player could be e.g. VLC Video LAN Client, ... of the parameters

Konrad Simon, STVC/PRM 28/01/2010 www.boschsecurity.com

1 | CCTV | IP Video | Tech Note | RTSP

Standard media player can be used to display live video

Easy integration into 3rd party software application

OS platform independent Conjoined audio/video streaming Internet Streaming possible Tested players:

Quicktime Player VLC (VideoLan Client)

The Real Time Streaming Protocol allows live viewing of video from a BVIP encoder or IP camera with a compatible standard media player. “Standard” in this way has the meaning of “implemented according to the RTSP standard” RFC2326. RTSP is supported by BVIP encoders and IP cameras with MPEG-4 SH++ streaming running firmware version 3.0 and above. Since firmware version 4.0 also H.264 streaming is supported, and with firmware version 4.10 audio support has been added. In addition, firmware version 4.10 provides ONVIF compliance, and with this JPEG Streaming comes along. A standard media player could be e.g. VLC Video LAN Client, Quicktime, or other RTSP compatible players. Unfortunately, Real Player or Windows Media Player request proprietary forms of streaming protocols which are not supported. The MPEG-ActiveX does not need to be installed on the viewing PC. Generally, access via RTSP is also possible from other OS platforms like Linux or Macintosh. Due to standardisation issues, only CIF and 2CIF is supported. 4CIF uses interlacing which is not commonly standardised.

The encoding profiles within the encoder must be set up properly to allow connections via RTSP. If an incompatible resolution, like 4CIF, has been set up, a connection will not be established. The following examples assume having installed

a Dinion IP camera at IP address 160.10.0.1 a VideoJet X40 at IP address 160.10.0.40,

with 4 cameras connected. Setting up a connection Connecting to a BVIP unit is as simple as entering a URL that specifies the protocol and the unit’s IP address. An RTSP connection from e.g. Quicktime to the Dinion IP is established by opening the “File” menu, choose “Open URL”, and entering: RTSP://160.10.0.1 This will show live video from the Dinion IP camera, using encoding stream 1. Expecting that the Dinion IP camera will be set up for best video on the encoding stream 1, using 4CIF resolution, which is per default used for live viewing, it might be of advantage to connect to the second encoding stream which is more likely set up to a compatible resolution. This is done by handing over a parameter “inst” to the RTSP server in the Dinion IP, thus the URL must look like: RTSP://160.10.0.1/video?inst=2

Tech Note Streaming Video from BVIP using RTSP

Page 2: TechNote Streaming Video from BVIP using RTSP v2stna.resource.bosch.com/documents/Configuration_Note_enUS...A standard media player could be e.g. VLC Video LAN Client, ... of the parameters

Konrad Simon, STVC/PRM 28/01/2010 www.boschsecurity.com

2 | CCTV | IP Video | Tech Note | RTSP

The RTSP server inside the Bosch IP Video unit doesn’t need a web page addressed in the URL but needs the slash after the IP address followed by the question mark as a separator for the query string that carries the parameter. So this notation is valid as well: RTSP://160.10.0.1/?inst=2 Selecting a camera from a multi-channel unit Similar to the example above, an RTSP connection from Quicktime to the VideoJet X40 is established by opening the “File” menu, choose “Open URL”, and entering RTSP://160.10.0.40 This would show live video from the first camera on the VideoJet X40, using stream 1. The video inputs and the respective cameras can also be selected by handing over a parameter to the RTSP server in the VideoJet X40, this time the parameter “line”. To connect to video from the second camera, the URL must look like: RTSP://160.10.0.40/?line=2 Expecting also that the VideoJet X40 will be set up for best video on the live viewing streams 1 for its cameras, using 4CIF resolution, it might again be of advantage to connect to the second stream. Multiple parameters can be handed over equal to standard query string notation in an URL, separated by “&”.The order of the parameters in the query string is not relevant. An RTSP connection to camera 3, second encoding stream would require the URL: RTSP://160.10.0.40/?line=3&inst=2 Setting up a Multicast connection In case of multiple live viewing users need to connect to the same video source it is of advantage to use Multicast and have join the many users to the same RTSP stream. Multicast RTSP connections are established using the parameter “multicast”. The resulting URL to join the Multicast RTSP stream from the Dinion IP would be: RTSP://160.10.0.1/?multicast=1 Similarly, joining a Multicast RTSP stream from the fourth camera, second encoding stream of the VideoJet X40 is done by entering the URL: RTSP://160.10.0.40/?line=4&inst=2&multicast=1

Selecting the stream encoding type Bosch IP Video units, running firmware version 4.0 allow the selection of the encoding type to be used for the streamed video. The parameter to do this selection is “h26x”. The supported encoding types are: JPEG h26x=0 MPEG-4 SH++ h26x=3 H.264 h26x=4 Thus, if we don’t want to rely on default stream encoding settings, the first example above would be completely described as: RTSP://160.10.0.1/?h26x=3 Accordingly, if the connection should be established with H.264 streaming, the URL must look like: RTSP://160.10.0.1/?h26x=4 Another alternative would be to request JPEG Streaming for the RTSP connection. This would require the URL: RTSP://160.10.0.1/?h26x=0 Setting up a video connection with audio Some Bosch IP Video units are equipped with audio inputs. As an example, a VideoJet X40 provides two audio inputs. Enabling audio connections along with the video requires using different parameters. The first parameter, “enableaudio”, enables audio in general and should be set to 1. The second parameter, “audio_line”, identifies the audio input that is streamed together with the video. This parameter and its values are used similarly to the “line” parameter.

Note: For new Bosch IP Video units that support H.264 encoding only it is recommended to always include the stream encoding parameter “h26x=4”.

Note: If the parameter is not given, the internal RTSP server defaults to h26x=3, and the Bosch IP Video unit provides MPEG-4 SH++ streaming which is compatible to H.263 streaming. This is according to the requirement from the MPEG-4 standard ISO/IEC-14496 part 2 for backward compatibility of MPEG-4 Short Header implementations.

Page 3: TechNote Streaming Video from BVIP using RTSP v2stna.resource.bosch.com/documents/Configuration_Note_enUS...A standard media player could be e.g. VLC Video LAN Client, ... of the parameters

Konrad Simon, STVC/PRM 28/01/2010 www.boschsecurity.com

3 | CCTV | IP Video | Tech Note | RTSP

For an RTSP connection that would show live video from the first camera on the VideoJet X40 together with audio from the first audio input, the URL must look like: RTSP://160.10.0.40/?line=1&enableaudio=1&audio_line=1 Often, audio input and video input are used in concert. Thus, addressing only the audio input without the video line parameter will automatically connect the corresponding video input in combination. So this URL establishes the same video and audio connections as before: RTSP://160.10.0.40/?enableaudio=1&audio_line=1 This URL would establish the connections using the second input for both audio and video: RTSP://160.10.0.40/?enableaudio=1&audio_line=2 When a certain audio input shall be attached to a certain video input the parameters must be given accordingly. To conjoin the second audio input with the fourth video input the URL must look like: RTSP://160.10.0.40/?line=4&enableaudio=1&audio_line=1 Please note that in this case the “line” parameter must be provided in advance of the “audio_line” parameter. Otherwise the conjoin default mechanism would step in and the additional “line” parameter would be discarded. For a Multicast RTSP connection with H.264 streaming from our VideoJet X40’s camera 3, using the second stream, while listening to the signal from the first audio input, the URL must look like: RTSP://160.10.0.40/?h26x=4&line=3&inst=2&multicast=1& enableaudio=1&audio_line=1 Tunnelling video over TCP It may happen that the network, e.g. with connections via the Internet, does not allow UDP transmission. In such cases the connection can also be established by using a TCP tunnel. Both players, VLC and Quicktime, need special settings to allow respectively force a connection via a TCP tunnel. The Bosch IP Video unit can be requested to use a TCP tunnel by adding “rtsp_tunnel” after the IP address, just like “video” in the URL example above. The URL for accessing the Dinion IP camera would be: RTSP://160.10.0.1/rtsp_tunnel All other parameters can be appended as described above. Similarly, viewing the fourth camera of the VideoJet X40 is done by entering the URL: RTSP://160.10.0.40/rtsp_tunnel?line=4 For our maximum example from above, including audio, the URL for RTSP over TCP tunnelling would look like: RTSP://160.10.0.40/rtsp_tunnel?h26x=4&line=3&inst=2& enableaudio=1&audio_line=1&multicast=1

In VLC choose “Preferences” from the “Settings” menu, select “Input/Codecs->Demuxers->Rtp/Rtsp” and check the box “Advanced Options” below right. In this view the topmost 2 checkboxes must be checked to use video over TCP.

In Quicktime choose “Preferences->Quicktime Preferences”, select the “Advanced” tab, select “Custom” in the “Transport Setup” drop-down box and configure HTTP as the transport protocol.

Note that both, player and Bosch IP Video unit, must be set up for TCP tunnelling to allow connection.

Note: VLC might show decoding problems if there are no I-frames in the video stream. Make sure the encoder profiles are using an I-Frame Distance other than ‘0’, e.g. use ‘30’.

Page 4: TechNote Streaming Video from BVIP using RTSP v2stna.resource.bosch.com/documents/Configuration_Note_enUS...A standard media player could be e.g. VLC Video LAN Client, ... of the parameters

Konrad Simon, STVC/PRM 28/01/2010 www.boschsecurity.com

4 | CCTV | IP Video | Tech Note | RTSP

Americas: Bosch Security Systems, Inc. 130 Perinton Parkway Fairport, New York, 14450, USA Phone: + 1 800 289 0096 Fax: +1 585 223 9180 [email protected] www.boschsecurity.us

Europe, Middle East, Africa: Bosch Security Systems B.V. P.O. Box 80002 5600 JB Eindhoven, The Netherlands Phone:+31 (0) 40 25 77 101 Fax:+31 (0) 40 25 77 119 [email protected] http://www.boschsecurity.com

Asia-Pacific: Robert Bosch (SEA) Pte Ltd 11 Bishan Street 21 Singapore 573943 Phone:+65 6571 2541 Fax:+65 6571 2699 [email protected] http://www.boschsecurity.com

Data subject to change without notice | 28 January 2010

Internet Streaming It is possible to use VLC as a streaming server to provide live video via Internet. VLC must be set up as follows: Choose the “Streaming Assistant” from the “File” menu, select “Stream to network”, then select the stream via the URL as described before.

Define streaming mode RTSP with selecting the source URL, and set advanced options as required.

Define streaming method and target settings as required.

Other Streaming Servers The streaming servers Real Helix and Quicktime Server are requesting files for streaming, and we were not able to set up connections to RTSP streaming format. Thus, the only working scenario we found so far is with using VLC. VLC as an open source project can be compiled to different platforms, which makes it ideal to be adapted to whatever Internet environment in use.

Note: Tests were performed with Quicktime 7.1, 7.3 and 7.6 VLC 0.8.5c, 0.8.6.c and 1.0.2 Goldeneye