Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide an easy way to multicast videos #19

Closed
ftsamis opened this issue Jan 18, 2017 · 5 comments
Closed

Provide an easy way to multicast videos #19

ftsamis opened this issue Jan 18, 2017 · 5 comments

Comments

@ftsamis
Copy link
Member

ftsamis commented Jan 18, 2017

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).

Launchpad Details: #LP1504547 Laércio de Sousa - 2015-10-09 13:21:54 +0000

@ftsamis
Copy link
Member Author

ftsamis commented Jan 18, 2017

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?

Launchpad Details: #LPC Fotis Tsamis - 2015-10-16 04:22:56 +0000

@ftsamis
Copy link
Member Author

ftsamis commented Jan 18, 2017

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 ':file-caching=300' '' ':sout-keep'

Replace 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.

Launchpad Details: #LPC Laércio de Sousa - 2015-10-16 16:30:43 +0000

@ftsamis
Copy link
Member Author

ftsamis commented Jan 18, 2017

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"

Launchpad Details: #LPC Laércio de Sousa - 2015-10-16 16:54:00 +0000

@ftsamis
Copy link
Member Author

ftsamis commented Jan 18, 2017

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()."\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"

Launchpad Details: #LPC Laércio de Sousa - 2015-10-16 17:30:17 +0000

@ftsamis ftsamis added the gsoc label Mar 12, 2018
@alkisg alkisg removed the gsoc label Nov 23, 2018
@alkisg
Copy link
Member

alkisg commented Nov 23, 2018

Some things, like this one, aren't reliable enough to put in upstream code, because we wouldn't be able to support them adequately.
But it would be very nice if this was implemented as a "custom action": #86

@alkisg alkisg closed this as completed Nov 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants