Multi-View .vlm rtp output

I’ve created a .vlm file to create a multi view. It’s working well when using VLC to playback. The .vlm file ingests (4)channels dvr channels from m3u combines them into one stream and outputs the stream to my network using rtp protocol. Unfortunately channels doesn’t support RTP protocol when setting up a custom source.

Would any one know how to change this line of code so that it outputs hls or TS?

#transcode{vcodec=mp4v,vb=0,fps=30,acodec=none,channels=2,sfilter=mosaic{alpha=255,width=1920,height=1080,cols=2,rows=2,position=1,order="ch1,ch2,ch3,ch4",keep-aspect-ratio=enabled,mosaic-align=0,keep-picture=1}}:bridge-in{offset=100}:rtp{dst=127.0.0.1,port=20000,mux=ts,sap,name=Multi4,ttl=10}

Can this part be changed to not use rtp?

:rtp{dst=127.0.0.1,port=20000,mux=ts,sap,name=Multi4,ttl=10}

Here it is running in VLC

@tmm1 does channels support rtp protocol?

Here is the complete .vlm file if anyone wants to play with it. Audio plays from top right box(input 2)

del all

new ch1 broadcast enabled
setup ch1 input "http://127.0.0.1:8089/devices/ANY/channels/6141/stream.mpg"
setup ch1 output #mosaic-bridge{id=ch1,width=960,height=540}

new ch2 broadcast enabled
setup ch2 input "http://127.0.0.1:8089/devices/ANY/channels/6140/stream.mpg"
setup ch2 output #duplicate{dst=mosaic-bridge{id=ch2,width=960,height=540},select=video,dst=bridge-out{id=0},select=audio}

new ch3 broadcast enabled
setup ch3 input "http://127.0.0.1:8089/devices/ANY/channels/6197/stream.mpg"
setup ch3 output #mosaic-bridge{id=ch3,width=960,height=540}

new ch4 broadcast enabled
setup ch4 input "http://127.0.0.1:8089/devices/ANY/channels/6003/stream.mpg"
setup ch4 output #mosaic-bridge{id=ch4,width=960,height=540}

new bg broadcast enabled
setup bg input "bg.jpg"
setup bg option image-duration=-1
setup bg option image-fps=60/1
setup bg output #transcode{vcodec=mp4v,vb=0,fps=60,acodec=none,channels=2,sfilter=mosaic{alpha=255,width=1920,height=1080,cols=2,rows=2,position=1,order="ch1,ch2,ch3,ch4",keep-aspect-ratio=enabled,mosaic-align=0,keep-picture=1}}:bridge-in{offset=100}:rtp{dst=127.0.0.1,port=5589,mux=ts,sap,name=Multi4,ttl=10}

control bg play
control ch1 play
control ch2 play
control ch3 play
control ch4 play

*updated to use stream.mpg instead of HLS.

Here is the background .jpg I use. ("bg.jpg")

1 Like

Reading through Documentation:Streaming HowTo/Command Line Examples - VideoLAN Wiki and Documentation:Streaming HowTo New - VideoLAN Wiki it appears you could use something like:

:std{access=http,mux=ts,dst=:8080/stream}

to do this and then setup an m3u to have the DVR connect to http://<ip>:8080/stream via MPEG-TS.

Try something like this:

#EXTM3U

#EXTINF:-1 channel-id="my-channel",Channel
udp://0.0.0.0:5589

then send RTP packets to your DVR IP on port 5589

Absolutely sick!

1

2 Likes
2 Likes

Coming soon...

2 Likes

Quit teasing us...... :wink:

I've been doing this for years. I'm so glad somebody else finally got it to get some traction. I've got vlms for side by side as well as a 6 stream if anybody is interested. I just never knew if my vlc flags were efficient for transcoding or streaming.

Also just a heads up if you're source is an hdhomerun then you need to select the proper id for the audio stream typically 48 or 52 iirc. So instead of "select=audio" it would be "select=es=48" otherwise it's luck of the draw if you get the English audio or the Spanish audio.

1 Like

Looks like a nice proof of concept idea.

The way it's setup requires Channels DVR to transcode the 4 inputs to it.
Could try adding &codec=copy&abr=false parameters to
setup ch# input "http://127.0.0.1:8089/devices/ANY/channels/ch#/hls/master.m3u8?"
and let VLC do any necessary transcoding (if needed).

Maybe allow all channels audio and mute those not on ch2?

Then, a way to select which channel is playing audio.

A way to change channels in the mosaic.

I’m going to change the code above for better performance by switching to stream.mpg. When I was messing with it I just did a quick link to the feed not thinking about efficiency. Without a doubt this needs to be included as it drops my very powerful CPU load from ~25-45% to just 9%.
@babsonnexus

**

channels actually handles the audio channels for you. you select them as tracks.

1 Like

question, why are you using the hls links instead of the plain stream.mpg links? i've always used the stream.mpg links but am definitely open to improving my vlms.

here is what my vlm looks like:

del all

new channel1 broadcast enabled
setup channel1 input "http://ip:8089/devices/ANY/channels/11.1/stream.mpg"
setup channel1 output #duplicate{dst=mosaic-bridge{id=1,width=635,height=355,x=0,y=0},select=video,dst=bridge-out{id=1},select=es=52}

new channel2 broadcast enabled
setup channel2 input "http://ip:8089/devices/ANY/channels/13.1/stream.mpg"
setup channel2 output #duplicate{dst=mosaic-bridge{id=2,width=635,height=355,x=640,y=0},select=video,dst=bridge-out{id=2},select=es=52}

new channel3 broadcast enabled
setup channel3 input "http://ip:8089/devices/ANY/channels/21.1/stream.mpg"
setup channel3 output #duplicate{dst=mosaic-bridge{id=3,width=635,height=355,x=0,y=360},select=video,dst=bridge-out{id=3},select=es=52}

new channel4 broadcast enabled
setup channel4 input "http://ip:8089/devices/ANY/channels/6033/stream.mpg"
setup channel4 output #duplicate{dst=mosaic-bridge{id=4,width=635,height=355,x=640,y=360},select=video,dst=bridge-out{id=4},select=audio}

new mosaic broadcast enabled
setup mosaic input "file:///E:/Backup/black_bg.jpg"
setup mosaic option image-duration=-1
setup mosaic option image-fps=60/1
setup mosaic output #transcode{sfilter=mosaic{width=1280,height=720,keep-picture=1},vcodec=mp4v}:bridge-in:http{mux=ts,dst=:8084}

control mosaic play
control channel1 play
control channel2 play
control channel3 play
control channel4 play

edit: did some testing with some of the changes listed here. you definitely need the "stream.mpg" links to capture the entire streams to grab all audio. otherwise you only get 1 audio track and its the last one listed in the #duplicate tag, in your case there is only 1.

I’m not sure it’s necessary to use hls. Again I just threw the source feeds together not really considering efficiency. I know that hls streams are more resilient and choose that not knowing what to expect using this setup. I have an AMD 9600x cpu and wasn’t worried about processor power but I wanted the stream to be able to handle hiccups if they happened. It sounds like you have spent a lot more time working on this than I and gladly welcome any improvements you can add.

Was wondering how it works using 60 fps vs. 30 fps.
Is it a smoother display with fast moving Sports related content?

With the hls streams it would work better remotely, but if you feed it to a VLC instance on a server local to your Channels DVR, I don't think it would matter.

the streams have different id's with hls. so my earlier statement is incorrect about audio. the id is no longer 52. it would be like select=es=2 instead.

yes, but the client needs to be able to handle it. works on my shield but is choppy on ccwgtv.

I did try out 60fps after changing to codec=copy. I didn’t notice much if any difference on a soccer game. I’m not sure what the native stream was at that time on the TVE channel. My cpu did go from 9% to 14% with that change though. It’s possible one of the 4 channels was 30fps which might trigger a transcode.

But that is supposed to be fed to VLC for the mosaic, not directly to a client, right?

as far as i know this tells the mosaic to output at 60 fps. can confirm via show stats on channels dvr.