Tutorial:Streaming using VLC

From SpinetiX Support Wiki

Jump to: navigation, search

Contents

Introduction

VLC is a free and open source cross-platform Multimedia Player, Media Converter and Streamer.

The tutorials from this page explain how to use VLC to stream a video file (with or without transcoding). The stream can then be added inside a Hyper Media project to be played in HMD and / or HMP.

  • If you choose to transcode the source file, ensure your PC is powerful enough for real-time encoding of the selected format!

Requirements:

  • PC running Hyper Media Director software (latest version) and VLC software (tested with v2.0.3);
  • Video file for source;
  • Hyper Media Player (latest firmware);
  • Standard 100mbps network switch.

Steps

Stream option
Open Media dialogue
  1. Configure an independent network between the HMP and the PC running VLC.
    • Other devices present on the network may affect stream performance; always test with an isolated network first.
  2. Open VLC and from the "Media" menu, choose the "Stream..." option. (see the image on the left)
  3. In the "Open Media" dialogue that opens, select the file you want to stream.
    • It can be a file from your PC or from the network, a disc or the output of a capture device.
    • To add a file from your PC, select the "File" tab, press on "Add..." button, browse to your file, select it and then press "Open". This will add the selected file under the "File Selection" zone. (see the image on the left)
  4. Press on the "Stream" button. The "Stream Output" wizard dialogue will open.
  5. Press on the "Next" button to go to the "Destination Setup" area.
  6. Configure the settings of the stream. (this step is more detailed in the next sections for some particular cases)
    • Select the destination for your stream from RTSP, RTP or UDP and then press the "Add" button. Configure the details for the chosen streaming protocol.
    • For the multicast streaming, the address used is usually from the range of local administrative multicast IP addresses (e.g. 239.x.x.x); but you can configure a different multicast address if needed.
    • If your source file doesn't need transcoding (e.g. stream it as it is), then disable the "Activate Transcoding" option. Otherwise, make sure to choose a proper profile for transcoding that is compatible with the chosen streaming protocol.
  7. Once you have finished with the settings, press the "Stream" button to start streaming from VLC.
  8. In HMD, insert the streaming media source in your project and set the streaming media source URI according to the chosen streaming protocol.
  9. Verify that the stream plays in HMD.
  10. Publish your project on your HMP.

Examples

Transcode and stream as MPEG TS over RTP

The file used in this is example is a VOB file containing MPEG-2 video and AC3 audio.

  • Since AC3 audio is not supported by the HMP, we will use the Transcoding feature of VLC to transcode the audio codec on-the-fly to MPEG Audio.
  • If you choose to transcode the video stream as well, ensure your PC is powerful enough for real-time encoding of the selected format.

To configure the settings of the stream (step #6 in the tutorial above), follow these instructions:

  1. As destination, select RTP/MPEG Transport Stream from the drop-down list and then press the "Add" button.
    Vlc-addstream.png
  2. On the new "RTP/TS" tab, enter the multicast address and port as shown in the image below.
    • Inside the HMD project, you will set the URI for the streaming media source as rtp://239.192.1.23:5004.
  3. Make sure that "Activate Transcoding" option is enabled.
  4. Select "Video - MPEG2 + MPGA (TS)" from the "Profile" drop-down list.
    Vlc-transcoding.png
  5. Press the small toolbox icon next to the "Profile" drop-down list. (the "Form" dialogue will open)
  6. Set the encapsulation, video codec and audio codec settings as shown in the images below. When finished, press the "Save" button.
    • On the Encapsulation tab ensure that MPEG-TS is the selected radio button.
    • On the Video codec tab enable the "Video" option (to include the video stream in the output) and the "Keep original video track" option (for this example there's no need to transcode the video track since the file contains an MPEG bitstream).
      • If the video needs transcoding, then the "Keep original video track" option must be disabled and the rest of the options to be set appropriately.
    • On the Audio tab enable "Audio" option (to include the audio stream in the output), disable the "Keep original audio track" option and select "MPEG Audio" from the Codec drop-down list (in this example, the audio must be transcoded as the HMP does not support AC3 audio).
      • If the audio codec is supported by the HMP, then you can leave the "Keep original audio track" option enabled (the audio will not be transcoded).
      • If the audio track is not needed at all, then disable the "Audio" option.

Transcode and stream as MP4 over RTP

To configure the settings of the stream (step #6 in the tutorial above), follow these instructions:

  1. As destination, select RTP Audio/Video Profile from the drop-down list and then press the "Add" button.
  2. On the new "RTP/AVP" tab, enter the multicast address and port as shown in the image below.
    • Inside the HMD project, you will set the URI for the streaming media source as rtp://239.192.1.21:5004.
  3. Make sure that "Activate Transcoding" option is enabled.
  4. Select "Video - H.264 + AAC (MP4)" from the "Profile" drop-down list.
    Destinations rtp-avp.png
  5. Press the small toolbox icon next to the "Profile" drop-down list. (the "Form" dialogue will open)
  6. Set the encapsulation, video codec and audio codec settings as shown in the images below. When finished, press the "Save" button.