Streaming

From SpinetiX Support Wiki

Jump to: navigation, search

This page is about displaying real-time media streaming received over the network on HMP350, HMP200, HMP130, and HMP100 devices.

Introduction

The HMP is a multimedia decoder that can display streaming media received over the network from local or Internet sources. The HMP cannot stream its own video output over the network.

Streaming media is multimedia that is constantly received by and presented to an end-user while being delivered by a streaming server - which is a hardware / software product that is solely responsible with delivering streaming media (this is in contrast with a traditional web server that delivers all forms of web content, including HTML text, images, etc.). See also a collection of encoders and streamers that can be used for media streaming over the network and that should be compatible with the HMP.

The streaming media must be compliant with the HMP specification, as detailed on Video decoding page. If you are experiencing problems with a stream despite it confirming to the specifications, before asking for support, please see the Troubleshooting section below.

Note Notes:

Tutorials

ONVIF compliance

ONVIF is a "global open standard for the interface of physical IP-based security products". Some IP cameras mention ONVIF compliance. The HMP devices are not solely IP security products, so there are parts on ONVIF which are not relevant. The "real time streaming" section of the ONVIF specification is largely compatible with the HMP devices, including support for RTP, RTSP, H264 and AAC.

Streaming formats

The RTSP, RTP, UDP and SDP streaming protocols are natively supported by the HMP.

These should refer to an MPEG-2 Transport Stream containing video streams (MPEG 1/2/4/H264) & audio streams (AAC, MP3, LPCM) within the HMP specifications (see the Video decoding page for more details).

  • RTSP and SDP can also refer to a raw bitstream of MPEG 1/2/4/H264.

RTSP

The Real Time Streaming Protocol (RTSP) is a network control protocol designed to control streaming media servers. The protocol is used for establishing and controlling media sessions between end points. The transmission of streaming data itself is not a task of the RTSP protocol - the streaming being usually done with RTP over UDP.

An RTSP source has the following format: rtsp://{Streaming_Server_IP}/{Path} or rtsp://{user}:{password}@{Streaming_Server_IP}/{Path}. For example:

  • local streaming server: rtsp://172.21.3.121/high or rtsp://172.21.3.120/axis-media/media.amp
  • external Wowza streaming server: rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov
Note Notes:
  • The streaming server determines by default whether unicast or multicast is used - to force the HMP to request one or the other, set the spx:transport attribute value to "multicast" or "unicast" from Layer Properties > Advanced tab.
  • When the stream source is not inside the same network as the player / Elementi, the stream is usually blocked by firewall or router with network address translation (because the server uses by default UDP as the transport for the RTP packets) - in such cases, make sure to activate the "Use TCP transport ... " option when adding the streaming layer, to force the RTP packets to be sent interleaved over the RTSP TCP socket.

RTP

The Real-time Transport Protocol (RTP) defines a standardized packet format for delivering audio and video over IP networks. RTP is designed for end-to-end, real-time, transfer of stream data.

To include a multicast RTP source inside your project, set the URI of a media layer to
rtp://{Multicast_Address}:{Port}
  • For example: rtp://239.192.1.21:5000
To include an unicast RTP source inside your project, set the URI of a media layer to
rtp://@:<port>

UDP

The User Datagram Protocol (UDP) uses a simple transmission model with a minimum of protocol mechanism. UDP is suitable for purposes where error checking and correction is either not necessary or performed in the application, avoiding the overhead of such processing at the network interface level.


To include a multicast UDP source inside your project, set the URI of a media layer to:
udp://{Multicast_Address}:{Port}
  • For example: udp://239.192.1.21:5000


To include a unicast UDP source inside your project, set the URI of a media layer to
udp://@:<port>

SDP file

See the full article related to SDP file for more details. The following are supported:

  • SDP that refers to an MPEG2TS via RTP or UDP (all valid codecs for use in an MPEG2TS are supported - MPEG 1/2/4/H264);
  • SDP that refers to a raw bitstream of MPEG 1/2/4/H264.

MMS

Applies only for HMP200, HMP130, and HMP100 devices.

Microsoft Media Server (MMS), a Microsoft proprietary network-streaming protocol, serves to transfer unicast data in Windows Media Services. Microsoft deprecated MMS in favor of RTSP in 2003. The MMS protocol is supported by the HMP as a legacy feature, though its usage is strongly discouraged. To include an MMS source inside your project, set the URI of a media layer to mms://{Path} or to point to an .ASX file.

  • Note that for mms links, the layer mime type property must be manually set to "video/x-ms-asf".

ASX file

The Advanced Stream Redirector (ASX) format is a type of XML metafile with the following structure:

<?xml version="1.0" encoding="UTF-8"?>
<ASX VERSION="3.0">
<ENTRY>
  <REF href="mms://1.1.1.1/streamsource"/> 
</ENTRY>
</ASX>

This is a legacy feature for the support of the MMS format - the .ASX file is required when streaming from an Windows Media Server using a "publishing point". Although it is possible to use an ASX file to reference a http stream source, the support for HTTP streaming is limited and that usually doesn't work.

The ASX file can be stored locally or on a remote web server and referenced by an URI like http://webserver/path_to_file/file_name.asx. Note that remote ASX files are cached differently to avoid problems due to remote server load-balancing and, as a result, changes to the media source URI will be ignored. To avoid this, use a different method of accessing the stream, or use a javascript getURL() to download the file and query the server header.

HTTP

Applies only for HMP200, HMP130, and HMP100 devices.

The support for HTTP streaming is limited and provided as it is, meaning that using an HTTP URI (either direct or inside an ASX file) pointing to a streaming media source will likely not going to work.

  • The HTTP format is normally used for referencing an ASX file that is stored on a remote web server! (e.g., http://webserver/path_to_file/file_name.asx)
  • If the actual source is mms or asf referenced by an http link, the layer mime type property must be manually set to "video/x-ms-asf" or "audio/x-ms-asf".

HTTP Progressive download (e.g., a video file delivered by a regular HTTP web server rather than a streaming server, like videos from YouTube) is not supported. HTTP Live Streaming (HLS) is also not supported.

Unsupported

This list is not exhaustive!

  • RTSP streaming an ASF file directly.
  • Windows Media format over RTSP.
  • MPEG2 Transport Stream via HTTP.
  • RTMP streaming from Adobe Flash Player.
  • RealVideo (including over RTSP), RealRTSP or Real Data Transport (RDT).
  • MMS streaming directly (for instance a direct link to a WMS Publishing Point - an ASX file must be used instead).
  • HTTP stream of images (MJPEG, MxPEG etc.), HTTP Progressive download, HTTP Live Streaming (HLS).

Troubleshooting

Checklist

When the stream is not playing on the HMP, please do the following:

  1. Check that the streaming server is properly set up and is sending the network packets.
  2. Check that there are no constrains within your network that could block the network packets. For instance, firewalls or network switches / routers.
  3. Check that stream can be played by a multimedia player (like VLC) from a PC.
  4. Check that stream can be played by Elementi.
  5. Check that the stream characteristics are within the HMP specifications. See Video decoding page for more details.

Send the result of each step together with your enquiry to speed up the diagnostic process.

Known errors

  • Black / green screen on connection to stream - this usually means that the video being streamed is outside the HMP specification (see Video decoding page for more details).
    • If all codecs are correct and the stream is within range (resolution, etc) then this can indicate that the stream quality is too low for the HMP to decode the video. Check that the network throughput is sufficient.
  • Audio stream not playing - when the streaming media contains only an audio stream, without a video stream, Elementi/HMD/HMP will display an image having a red cross and a warning sign instead of playing the actual stream. To fix this, you must manually set the mime type of the media layer including the stream to either audio/mpeg or audio/x-ms-asf, depending on the audio codec used by the audio stream.
  • Packets lost - the playback is not smooth and player.log is full of the errors like
    Continuity loss of video stream in MPEG2TS stream detected
    and / or
    Continuity loss of audio stream in MPEG2TS stream detected
    • This indicates that the player is either:
      • not receiving all the packets of the stream because of network congestion / insufficient throughput - consider lowering the bitrate or using multicast (see the Bandwidth management page for more tips).
      • is receiving too many packets and the player is overloaded - check the usage data in player.log.
  • Image freeze or audio lost - this is the result of a non-optimal multiplexing of the audio and video streams that requires more than 3 MB of buffering of the audio or video stream in order to keep it in sync with the other. In this case the player.log has the following error:
    Stream demuxing failed because more than 3145728 bytes of buffering is required
    • Reconnecting to the streaming media (as often as needed) should fix the image freeze or the audio lost. Alternatively, the spx:maxDemuxingBufferSize attribute could be increased.
  • MPEG-2 AAC audio with ADTS framing is not supported - MPEG-2 AAC audio is supported only for normal media, but not for streaming media. The solution is to check if the streaming media contains another audio stream that is supported (like MPEG-4 AAC, MP3 etc.) and select that one instead.

Stream capture

For streaming related problems, you might be asked to capture your stream and send a sample to us for analysis. This can be done using Elementi / HMD or directly on the HMP. The procedure to follow for each is detailed below.

Stream capture using Elementi

  1. Open Elementi.
  2. Click Menu > Help and select "Capture Streaming Packets" option.
  3. Open the project containing the streaming source. Leave the stream running or trying to connect for around 2 minutes.
  4. Close the project.
  5. Open the Local Application Data folder of Elementi by typing the following command into the Run utility (Windows key + R):
    shell:Local AppData\SpinetiX\Elementi\capture
  6. Upload the stream capture to a file-sharing website (Dropbox etc.) and provide the access link.

Stream capture using HMP350

Stream capture
  1. Open Control Center > Advanced Applications > Streaming.
  2. Enable "Capture streaming packets".
  3. Re-publish your project, containing just the layer(s) with the stream to allow for a clean log.
  4. Wait 2 minutes while streaming packets are captured.
  5. In the same page from step #1, disable "Capture streaming packets".
  6. Download the captured file (CAP_) shown under "Streaming Captures" section.
  7. Upload the stream capture to a file-sharing website (Dropbox etc.) and provide the access link.

Stream capture using HMP200/HMP130

For firmware versions above 2.2.2:

  1. Open Control Center > Maintenance page > Debugging tab.
  2. Set "Capture streaming packets" to "on".
  3. Re-publish your project, containing just the layer(s) with the stream to allow for a clean log.
  4. Wait 2 minutes while streaming packets are captured.
  5. In the same page from step #1, set "Capture streaming packets" to "off".
  6. Download the captured file (CAP_) shown under "Streaming Captures" section.
  7. Clear the captured stream from the player to save storage space.
  8. Upload the stream capture to a file-sharing website (Dropbox etc.) and provide the access link.

Stream capture using HMD

  1. Close HMD.
  2. Locate the Local Application Data folder of HMD (see Finding logs and config files).
  3. Locate the file named profile.xml and open it in an text / xml editor (like Notepad++).
  4. Locate this line (group): <spx:directorSettings>
  5. Add the following line under the one from previous step: <spx:debug/>
  6. Save the file.
  7. Open HMD.
  8. Enable "Capture Streaming Packets" option from "Settings" menu.
  9. Attempt to connect to the streaming source (load the relevant project and press Play). All received packets will be dumped to a file. Leave the stream running or trying to connect for around 2 minutes.
  10. Re-open the HMD path from step #2 and open the sub-folder named "capture" which has been created with the captured stream.
  11. Upload the stream capture to a file-sharing website (Dropbox etc.) and provide the access link.

See also

This page was last modified on 20 September 2018, at 19:42.