Provide an easy way to multicast videos

Bug #1504547 reported by Laércio de Sousa
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Epoptes
New
Undecided
Unassigned

Bug Description

One task I do a lot in my lab is video multicast using VLC, but the manual setup for multicast always take me some time. I wonder if Epoptes could provide an easy way to provide such a fature (e.g. an interface to VLC to automate multicast configuration).

Revision history for this message
Fotis Tsamis (ftsamis) wrote :

Hi Laércio,

in the past we've done some tests with multicasting, but we couldn't find any reliable ways to do it, that would nicely fall back to single casting when multicasting is unavailable, e.g. over wifi or remote connections.

How are you implementing it? Is it completely stable in your use case?

Revision history for this message
Laércio de Sousa (lbssousa) wrote :

Hi Fotis,

this is my procedure for multicasting videos using VLC:

1. In my clients, run "vlc rtp://@239.255.100.100" (replace 239.255.100.100 with any suitable address for multicasting, if you want it). Use option -f for fullscreen. I don't remember now why is that @ needed.

2. In my server, run "vlc <video-path-or-MRL> ':file-caching=300' '<VLC-multicast-options>' ':sout-keep'

Replace <VLC-multicast-options> with any of the following:

a) No live transcoding, no local playback
:sout=#rtp{dst=239.255.100.100,port=5004,mux=ts}

b) No live transcoding, local playback
:sout=#duplicate{dst=rtp{dst=239.255.100.100,port=5004,mux=ts},dst=display}

c) Live transcoding, no local playback
:sout=#transcode{vcodec=h264,acodec=mpga,ab=128,channels=2,samplerate=44100}:rtp{dst=239.255.100.100,port=5004,mux=ts}

d) Live transcoding, local playback
:sout=#transcode{vcodec=h264,acodec=mpga,ab=128,channels=2,samplerate=44100}:duplicate{dst=rtp{dst=239.255.100.100,port=5004,mux=ts},dst=display}

It works pretty fine for local files, but for some Youtube streams I need to enable live transcoding, which may slow down the multicast if original video resolution is high (720p and higher).

With these options, I can only multicast a single video. I still can't make it multicast an entire playlist.

Revision history for this message
Laércio de Sousa (lbssousa) wrote :

Synthesizing all options above in a server-side script, I've got the following:

#!/bin/sh

ADDRESS=239.255.100.100
PORT=5004

MULTICAST_BASE="rtp{dst=${ADDRESS},port=${PORT},mux=ts}"
MULTICAST_LOCAL_PLAYBACK="duplicate{dst=${MULTICAST_BASE},dst=display}"

ENABLE_LIVE_TRANSCODING=false
ENABLE_LOCAL_PLAYBACK=false

if ${ENABLE_LOCAL_PLAYBACK}
then
  MULTICAST="${MULTICAST_LOCAL_PLAYBACK}"
else
  MULTICAST="${MULTICAST_BASE}"
fi

if ${ENABLE_LIVE_TRANSCODING}
then
  LIVE_TRANSCODING="transcode{vcodec=h264,acodec=mpga,ab=128,channels=2,samplerate=44100}:"
else
  LIVE_TRANSCODING=
fi

vlc ${1} ":file-caching=300" ":sout=#${LIVE_TRANSCODING}${MUSTICAST}" ":sout-keep"

Revision history for this message
Laércio de Sousa (lbssousa) wrote :

I've found some errors in the script above. The following one is functional:

#!/bin/sh

ADDRESS=239.255.100.100
PORT=5004
MRL=$(echo ${1} | perl -MURI::file -e 'print URI::file->new(<STDIN>)."\n"')

ENABLE_LIVE_TRANSCODING=${ENABLE_LIVE_TRANSCODING:-false}
ENABLE_LOCAL_PLAYBACK=${ENABLE_LOCAL_PLAYBACK:-false}

MULTICAST_BASE="rtp{dst=${ADDRESS},port=${PORT},mux=ts}"
MULTICAST_LOCAL_PLAYBACK="duplicate{dst=${MULTICAST_BASE},dst=display}"

if ${ENABLE_LOCAL_PLAYBACK}
then
  MULTICAST="${MULTICAST_LOCAL_PLAYBACK}"
else
  MULTICAST="${MULTICAST_BASE}"
fi

if ${ENABLE_LIVE_TRANSCODING}
then
  LIVE_TRANSCODING="transcode{vcodec=h264,acodec=mpga,ab=128,channels=2,samplerate=44100}:"
else
  LIVE_TRANSCODING=
fi

vlc ${MRL} ":file-caching=300" ":sout=#${LIVE_TRANSCODING}${MULTICAST}" ":sout-keep"

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.