VLM to MUX two Channels

Discussion about configuration and usage of VLM (a stream scheduler) within VLC.
Skinnersplace
Blank Cone
Blank Cone
Posts: 48
Joined: 23 May 2008 09:55

Re: VLM to MUX two Channels

Postby Skinnersplace » 14 Sep 2008 08:54

Ok so I have tested a little further and it seams that my script only plays the first input to the final broadcast channel (whichever one that is) ?

xsimio
Blank Cone
Blank Cone
Posts: 13
Joined: 07 Jul 2008 15:24

Re: VLM to MUX two Channels

Postby xsimio » 25 Sep 2008 22:44

same like my, for set op boxes ?

nice.

now i'm making a small pause with muxing part, now I'm able to remux them from multicast to unicast and now i'm configuring the servers to create the topology for serving them to the internet.

like last time, i'm able to mux now only two channels, the 3rd one don't like to enter into the stream :))

Skinnersplace
Blank Cone
Blank Cone
Posts: 48
Joined: 23 May 2008 09:55

Re: VLM to MUX two Channels

Postby Skinnersplace » 26 Sep 2008 08:42

Hi Xsimo,

So you actually get two channels muxed together and working properly ?
all I get is a transport stream containg two channels (created using the sout-ts-program-pmt and mux=pmt lines) however only the fist channel is populated (with the first input into that channel) the second cahnnel is empty.

It seams i am creating two channels but am not adigning the contect properly.

I have tried the bridge in / out option, but that dos not mux the videos together , it just plays them both in the same channel ?

Skinnersplace
Blank Cone
Blank Cone
Posts: 48
Joined: 23 May 2008 09:55

Re: VLM to MUX two Channels

Postby Skinnersplace » 30 Sep 2008 13:17

Ok this is how to do it :

new chan1 broadcast enabled loop
setup chan1 input "File"
setup chan1 output #transcode{vcodec=mp4v,vb=4096,scale=1,acodec=mpga,ab=192,channels=2}:std{access=udp,dst=127.0.0.1:8081}
setup chan1 option sout-ts-es-id-pid
setup chan1 option sout-ts-pid-audio=110
setup chan1 option sout-ts-pid-video=120
setup chan1 option sout-ts-program-pmt="100"

control chan1 play

new chan2 broadcast enabled loop
setup chan2 input "udp://@127.0.0.1:8082"
setup chan2 output #duplicate{dst=bridge-out{id=220},select=video,dst=bridge-out{id=210},select=audio}
setup chan2 option sout-ts-es-id-pid
setup chan2 option sout-ts-program-pmt="200"


control chan2 play

new output broadcast enabled loop
setup output input "udp://@127.0.0.1:8081"
setup output option sout-ts-es-id-pid
setup output option sout-ts-tsid=1
setup output option sout-ts-netid=510
setup output option sout-ts-program-pmt="100,200"
setup output option sout-ts-muxpmt="110,120,,210,220"
setup output option sout-ts-sdtdesc="MY TV,Channel 1,MY TV,Channel 2"

setup output output #bridge-in{id-offset=0}:duplicate{dst=std{access=udp,mux=ts,dst=127.0.0.1:8083}

Will mux a file with a udp streem (if you want to mux two files transmitt the second file to the second UDP input)
Note the Pids have to be added separatley to the first channel where as as they are included in the bridge out command of the second channel)

Have fun !

fpgamaster
New Cone
New Cone
Posts: 4
Joined: 26 Sep 2008 09:59

Re: VLM to MUX two Channels

Postby fpgamaster » 01 Oct 2008 08:49

Okay, your configuration should work.
But this is not the right way to multiplex channels at least because you have demuxing muxing at first channel and then again demuxing muxing at the output.
However, can you try to mix more channels, 5 or more?
I have made some changes in vlc code to allow correct es -> pid mapping and my configuration work too but when I try to mix >5 channels I have continuity errors at the output. May be I need to adjust some parameters but no luck till now. This problem is not related to speed of the machine or network problems.

Best Regards

Skinnersplace
Blank Cone
Blank Cone
Posts: 48
Joined: 23 May 2008 09:55

Re: VLM to MUX two Channels

Postby Skinnersplace » 04 Oct 2008 21:06

Hi fpgamaster, sorry I dont know what you mean by demuxing muxing ?

I have tried 4 channels at this time, but will test if more then five if I get a chance and see if work's

cable007
Blank Cone
Blank Cone
Posts: 24
Joined: 25 Mar 2008 09:43

Re: VLM to MUX two Channels

Postby cable007 » 05 Oct 2008 08:50

hi all,

can I ask you what VLC version you use on what OS ? because I tried your example but it doesn't work for me on my Ubuntu Server Edition with VLC 0.8.6e

Thanks

Nicolas

Skinnersplace
Blank Cone
Blank Cone
Posts: 48
Joined: 23 May 2008 09:55

Re: VLM to MUX two Channels

Postby Skinnersplace » 15 Oct 2008 07:40

Hi Cable007, 0.8.6e on XP - have not been able to get it to work properly on vista yet !

tonsofpcs
Cone that earned his stripes
Cone that earned his stripes
Posts: 363
Joined: 04 Jan 2006 10:03
Location: Binghamton, NY, USA
Contact:

Re: VLM to MUX two Channels

Postby tonsofpcs » 12 Nov 2008 21:40

I have been trying the following but cannot get it to work:

Code: Select all

# TS Batch del all # Input options new chan1 broadcast enabled setup chan1 input "file1.mpg" setup chan1 option sout-ts-es-id-pid setup chan1 option sout-ts-program-pmt="30" setup chan1 option sout-ts-pid-video=31 setup chan1 option sout-ts-pid-audio=32 setup chan1 option sout-ts-sdtdesc="chan1 Out" setup chan1 output #duplicate{dst=bridge-out{id=31},select=video,dst=bridge-out{id=32},select=audio} new chan2 broadcast enabled setup chan2 input "file2.mpg" setup chan2 option sout-ts-es-id-pid setup chan2 option sout-ts-program-pmt="40" setup chan2 option sout-ts-pid-video=41 setup chan2 option sout-ts-pid-audio=42 setup chan2 option sout-ts-sdtdesc="chan2 Out" setup chan2 output #duplicate{dst=bridge-out{id=41},select=video,dst=bridge-out{id=42},select=audio} # Launch everything control chan1 play control chan2 play new muxerout broadcast enabled setup muxerout option sout-ts-tsid=1 setup muxerout option sout-ts-netid=10 setup muxerout option sout-ts-program-pmt="30,40" setup muxerout option sout-ts-muxpmt="31,32,,41,42" setup muxerout option sout-ts-sdtdesc="chan1,1,chan2,2" setup muxerout output #bridge-in{id-offset=0}:duplicate{dst=std{access=http,mux=ts,dst=:8181}} control muxerout play # end of TS Batch
any Ideas?
Eric Adler

Want to help VLC? Help review strings -- Currently under review: QT4StringsReview
Want to talk about video production techniques or get useful things? visit my video production support site

septi
New Cone
New Cone
Posts: 1
Joined: 30 Oct 2010 15:44

Re: VLM to MUX two Channels

Postby septi » 31 Oct 2010 14:27

Hello all !

Did somebody succeded to make all of this work ?

I have the same problem, i wat to mux 2 channels into a single TS, and send it via a multicast udp address to a STB, and switch between the channels.
Skinnersplace, did you test those examples ? Did they worked ?

Any ideas ?

mclii
New Cone
New Cone
Posts: 1
Joined: 11 Apr 2013 22:27

Re: VLM to MUX two Channels

Postby mclii » 12 Apr 2013 18:15

I figured I'd post in this thread, since it's the most active thread I've found about this topic--even though it is an older thread. Hopefully, my findings will help somebody out that is looking for a similar solution.

For a bit of background, my goal was a mux of multiple program streams into a single transport stream. The end user would then be able to select the program stream via the Playback->Program selector by either playing a single UDP stream, or by playing a file.

After a lot of documentation and forum research, I finally found a working solution for myself. The other code snippets I've seen (including the ones in this thread) worked only partially for me. I'd have issues with either two program streams playing at the same time, or the program selectors not working properly, or program selectors pointing to the wrong video. Maybe I was using the wrong VLC version when trying these code snippets, I'm not entirely sure.

A couple of notes:

1. This configuration does not work in VLC 2.x.x. It only works in VLC 1.x.x. If you run the configuration in VLC 2.x.x, all of the program streams open at once, and there are no selectable programs in the Playback->Program menu. I assume this is because some of the options that I'm calling are either named differently in VLC 2.x.x, or are simply not implemented the same as VLC 1.x.x. If anyone can shed any light on this, that'd be helpful.
2. I've only tested this VLM configuration in VLC 1.1.12 in OS X, and VLC 1.1.11 in Windows.
3. I've only tested this with MPEG2 files that are encoded as single program transport streams (.ts files). I have not tested any other files/codecs. In an ideal world, all of the single program transport streams would have the same running length, or would be continuously running streams. I've found that "broadcast enabled loop" seems to chop some frames off the end of the single programs, in the recorded file mux.
4. To call the VLM configuration file, I've found that the file name OR file path must not contain spaces. I have tried various methods of escaping the spaces like "\" or """ or "//" or ', but no combination seems to work. The file name/file path looks correct in the debugger, but then is followed with a message that says "main libvlc warning: error while loading the configuration file". Then, no further information is given as to why there was an error loading it.

Here's my config file, which I've named broadcast.vlm.

Code: Select all

################################# # This VLM file does not work with VLC 2.x.x. # Please use the latest version of VLC 1.x.x (tested in 1.1.12 in OS X and 1.1.11 in Windows XP) # This VLM file takes 4 single program transport streams # and muxes them into a single, multiple program transport stream. # It outputs this muxed stream to a file and to a UDP IP address. # Remove "dst=standard{access=file,mux=ts,dst=mux.ts}," from MuxTS output to remove file saving. # Remove ",dst=standard{access=udp,mux=ts,dst=127.0.0.1:1234}" from MuxTS output to remove UDP streaming. # Change all IP addresses as necessary. These are all loopback addresses, viewable only on the serving machine. # Add or remove channels by following the PID, PMT, and bridge-out pattern. # First channel must stream to the input of last muxed output channel, not bridge-out to it. # This VLM file only loads in a location with no spaces in the file name OR file path # e.g. "/Users/shortname/Desktop/broadcast.vlm" not "/Users/shortname/Desktop/Untitled Folder/broadcast.vlm" # Adjust file paths on inputs to reflect your files or streams - valid MRLs only # this means no "\" file path characters in Windows, use "file:///C:/path/to/file.ts". # In OS X, use full paths, not characters like "~" for the file path. # Ideally all stream inputs would be the same running time, or continuously running. # The loop command seems to cut off some frames at end of each stream in the recorded file. # OS X command in Terminal.app: /Applications/VLC.app/Contents/MacOS/VLC -I telnet --vlm-conf /Users/shortname/Desktop/vlc-test/broadcast.vlm # To stop the configuration running press control-c in the open Terminal.app window. # Windows command: "C:\Program Files\VideoLAN\VLC\vlc.exe" -I telnet --vlm-conf "C:\pathto\broadcast.vlm" # Stop command: taskkill.exe /IM vlc.exe /F # The Windows stop command kills all processes named vlc.exe, so use wisely. # To open the muxed stream, open this network connection in VLC: udp://@127.0.0.1:1234 # Adjust IP addresses as necessary. ################################# # reset VLM configuration del all ################################# # Create Channel 1 - This channel should stream to the last input new Channel1 broadcast enabled loop setup Channel1 input "file:///Users/shortname/Desktop/vlc-test/Channel1.ts" setup Channel1 option sout-ts-es-id-pid setup Channel1 option sout-ts-pid-video=110 setup Channel1 option sout-ts-pid-audio=120 setup Channel1 option sout-ts-program-pmt="100" setup Channel1 output #standard{mux=ts,dst=127.0.0.1:8081,access=udp} ################################# ################################# # Create Channel 2 new Channel2 broadcast enabled loop setup Channel2 input "file:///Users/shortname/Desktop/vlc-test/Channel2.ts" setup Channel2 option sout-ts-es-id-pid setup Channel2 option sout-ts-pid-video=210 setup Channel2 option sout-ts-pid-audio=220 setup Channel2 option sout-ts-program-pmt="200" setup Channel2 output #duplicate{dst=bridge-out{id=210},select=video,dst=bridge-out{id=220},select=audio} ################################# ################################# # Create Channel 3 new Channel3 broadcast enabled loop setup Channel3 input "file:///Users/shortname/Desktop/vlc-test/Channel3.ts" setup Channel3 option sout-ts-es-id-pid setup Channel3 option sout-ts-pid-video=310 setup Channel3 option sout-ts-pid-audio=320 setup Channel3 option sout-ts-program-pmt="300" setup Channel3 output #duplicate{dst=bridge-out{id=310},select=video,dst=bridge-out{id=320},select=audio} ################################# ################################# # Create Channel 4 new Channel4 broadcast enabled setup Channel4 input "file:///Users/shortname/Desktop/vlc-test/Channel4.ts" setup Channel4 option sout-ts-es-id-pid setup Channel4 option sout-ts-pid-video=410 setup Channel4 option sout-ts-pid-audio=420 setup Channel4 option sout-ts-program-pmt="400" setup Channel4 output #duplicate{dst=bridge-out{id=410},select=video,dst=bridge-out{id=420},select=audio} ################################# ################################# # Create mux of channels above # Feed first input's output into this input # Output file gets placed in root of user folder new MuxTS broadcast enabled loop setup MuxTS input udp://@127.0.0.1:8081 setup MuxTS option sout-ts-es-id-pid setup MuxTS option sout-ts-pid-video=510 setup MuxTS option sout-ts-pid-audio=520 setup MuxTS option sout-ts-tsid=1 setup MuxTS option sout-ts-netid=610 setup MuxTS option sout-ts-program-pmt="100,200,300,400,500" setup MuxTS option sout-ts-muxpmt="110,120,,210,220,,310,320,,410,420" setup MuxTS option sout-ts-sdtdesc="Sub-Channel Name 1,Program Name 1,Sub-Channel Name 2,Program Name 2,Sub-Channel Name 3,Program Name 3,Sub-Channel Name 4,Program Name 4" setup MuxTS output #bridge-in{id-offset=0}:duplicate{dst=standard{access=file,mux=ts,dst=mux.ts},dst=standard{access=udp,mux=ts,dst=127.0.0.1:1234}} ################################# # Play all channels control Channel1 play control Channel2 play control Channel3 play control Channel4 play control MuxTS play

nfrancia87
New Cone
New Cone
Posts: 3
Joined: 06 Apr 2013 21:44

Re: VLM to MUX two Channels

Postby nfrancia87 » 14 Jun 2013 05:44

It also works for vlc 2.0.6 you just have to add in the output channel ...mux=ts{program-pmt="...,...",muxpmt="...,...,,...,...,"},dst=.... and you will be able to select programs from the menu. The numerbs that go into de program-pmt are the same as the ones you declarate previosly at
setup output option sout-ts-program-pmt and the same for the muxpmt.
PD: I use the vlm code in the post to demux a file with 2 raw programs, transcode them separately and re mux them to stream them by udp

hiphin
New Cone
New Cone
Posts: 3
Joined: 13 Dec 2013 11:50

Re: VLM to MUX two Channels

Postby hiphin » 13 Dec 2013 15:38

soo we have this working solution on VLC 2.0.8 on Debian

Code: Select all

#!/bin/bash killall vlc sleep 3 su someuser -c 'cvlc --daemon --intf=dummy --vlm-conf p005-test.cfg'
and part-"working" VLM config, we have MUX but pid's are random, has anyone hve some idea how to solve PID-s ?

Code: Select all

# reset VLM configuration del all ################################# # Create Channel 1 - This channel should stream to the last input new Channel1 broadcast enabled loop setup Channel1 input http://192.168.3.11:31344 setup Channel1 option sout-ts-es-id-pid setup Channel1 option sout-ts-pid-video=110 setup Channel1 option sout-ts-pid-audio=120 setup Channel1 option sout-ts-program-pmt="100" setup Channel1 output #standard{mux=ts,dst=127.0.0.1:8081,access=udp} ################################# ################################# # Create Channel 2 new Channel2 broadcast enabled loop setup Channel2 input "http://192.168.3.12:31344" setup Channel2 option sout-ts-es-id-pid setup Channel2 option sout-ts-pid-video=210 setup Channel2 option sout-ts-pid-audio=220 setup Channel2 option sout-ts-program-pmt="200" setup Channel2 output #duplicate{dst=bridge-out{id=210},select=video,dst=bridge-out{id=220},select=audio} ################################# ################################# # Create Channel 3 new Channel3 broadcast enabled loop setup Channel3 input http://192.168.3.13:31344 setup Channel3 option sout-ts-es-id-pid setup Channel3 option sout-ts-pid-video=310 setup Channel3 option sout-ts-pid-audio=320 setup Channel3 option sout-ts-program-pmt="300" setup Channel3 output #duplicate{dst=bridge-out{id=310},select=video,dst=bridge-out{id=320},select=audio} ################################# ################################# # Create Channel 4 new Channel4 broadcast enabled setup Channel4 input http://192.168.3.14:31344 setup Channel4 option sout-ts-es-id-pid setup Channel4 option sout-ts-pid-video=410 setup Channel4 option sout-ts-pid-audio=420 setup Channel4 option sout-ts-program-pmt="400" setup Channel4 output #duplicate{dst=bridge-out{id=410},select=video,dst=bridge-out{id=420},select=audio} ################################# ################################# # Create mux of channels above # Feed first input's output into this input # Output file gets placed in root of user folder new MuxTS broadcast enabled loop setup MuxTS input udp://@127.0.0.1:8081 setup MuxTS option sout-ts-es-id-pid setup MuxTS option sout-ts-pid-video=510 setup MuxTS option sout-ts-pid-audio=520 setup MuxTS option sout-ts-tsid=1 setup MuxTS option sout-ts-netid=610 #setup MuxTS option sout-ts-program-pmt="100,200,300,400,500" #setup MuxTS option sout-ts-muxpmt="110,120,,210,220,,310,320,,410,420" #setup MuxTS option sout-ts-sdtdesc="Sub-Channel Name 1,Program Name 1,Sub-Channel Name 2,Program Name 2,Sub-Channel Name 3,Program Name 3,Sub-Channel Name 4,Program Name 4" #setup MuxTS output #bridge-in{id-offset=0}:duplicate{dst=standard{access=udp,mux=ts{program-pmt="100,200,300,400,500",muxpmt="110,120,,210,220,,310,320,,410,420"},dst=192.168.2.111:1234},dst=standard{access=file,mux=ts,dst=mux.ts}} setup MuxTS output #bridge-in{id-offset=0}:std{access=udp,mux=ts{program-pmt="100,200,300,400,500",muxpmt="110,120,,210,220,,310,320,,410,420",sdtdesc="Sub-Channel Name 1,Program Name 1,Sub-Channel Name 2,Program Name 2,Sub-Channel Name 3,Program Name 3,Sub-Channel Name 4,Program Name 4"},dst=192.168.2.111:1234} ################################# # Play all channels control Channel1 play control Channel2 play control Channel3 play control Channel4 play control MuxTS play

hiphin
New Cone
New Cone
Posts: 3
Joined: 13 Dec 2013 11:50

Re: VLM to MUX two Channels

Postby hiphin » 14 Dec 2013 10:11

Well, this is almost working version of CFG ... lack of assistance for setting PID first channel, does anyone have an idea?
(thereby to avoid internal streaming via 127.0.0.1)

Code: Select all

del all new Channel2 broadcast enabled loop setup Channel2 input http://192.168.3.11:31344 setup Channel2 output #duplicate{dst=bridge-out{id=210},select=video,dst=bridge-out{id=220},select=audio} new Channel3 broadcast enabled loop setup Channel3 input http://192.168.3.12:31344 setup Channel3 output #duplicate{dst=bridge-out{id=310},select=video,dst=bridge-out{id=320},select=audio} new Channel4 broadcast enabled loop setup Channel4 input http://192.168.3.13:31344 setup Channel4 output #duplicate{dst=bridge-out{id=410},select=video,dst=bridge-out{id=420},select=audio} new Channel5 broadcast enabled setup Channel5 input http://192.168.3.14:31344 setup Channel5 output #duplicate{dst=bridge-out{id=510},select=video,dst=bridge-out{id=520},select=audio} # Channel 1 without video and audio pid ... help new MuxTS broadcast enabled loop setup MuxTS input http://192.168.3.7:31344 setup MuxTS output #bridge-in{id-offset=0}:std{access=udp,mux=ts{es-id-pid,tsid=1,netid=610,program-pmt="100,200,300,400,500",muxpmt="110,120,,210,220,,310,320,,410,420,,510,520",sdtdesc="Sub-Channel Name 1,Program Name 1,Sub-Channel Name 2,Program Name 2,Sub-Channel Name 3,Program Name 3,Sub-Channel Name 4,Program Name 4,Sub-Channel Name 5,Program Name 5"},dst=192.168.2.111:1234} control Channel2 play control Channel3 play control Channel4 play control Channel5 play control MuxTS play

bhtuan
New Cone
New Cone
Posts: 2
Joined: 27 May 2014 05:51

Re: VLM to MUX two Channels

Postby bhtuan » 27 May 2014 05:59

The first channel should be liked this. I read the help file and relize that to set video, audio pid, we must set "no-es-id-pid".

Code: Select all

new Channel1 broadcast enabled loop setup Channel1 input "..." setup Channel1 output #standard{mux=ts{no-es-id-pid,tsid=1,netid=760,pid-video=110,pid-audio=120,pid-pmt=100,program-pmt="1",sdtdesc="Provider,Channel1"},dst=226.0.10.99:1234,access=udp}

Hirurgus
New Cone
New Cone
Posts: 3
Joined: 24 Apr 2015 10:23

Re: VLM to MUX two Channels

Postby Hirurgus » 24 Apr 2015 10:36

I have two udp streams with service pid, video pid and audio pid

I need multiplex its to one udp stream, where each stream has pids as it had... After that, UDP stream will put to PBI which will extract streams.

I tried conf VLM that there was, but always I have two streams with same pids.

My current config

# Input 1: File
new Channel1 broadcast enabled
setup Channel1 input "UDP://@238.2.1.80:1234"
setup Channel1 output #duplicate{dst=udp{id=4111},select=video,dst=bridge-out{id=4112},select=audio}

# Input 4: UDP (MPTS select program 501) Output: UDP
new Channel4 broadcast enabled
setup Channel4 input "udp://@238.2.1.81:1234"
setup Channel4 option program=501
setup Channel4 output #bridge=in:duplicate{dst=display,dst=std{access=udp{ttl=15},mux=ts,dst=238.2.1.208:1234}

# TS options
setup Channel4 option sout-ts-pid-audio=4141
setup Channel4 option sout-ts-pid-video=4142
setup Channel4 option sout-ts-tsid=1
setup Channel4 option sout-ts-netid=501
setup Channel4 option sout-ts-program-pmt="100,200"
setup Channel4 option sout-ts-muxpmt="4111,4112,,4141,4142"
setup Channel4 option sout-ts-sdtdesc="Broadcaster1,udp1,Broadcaster2,udp2"

# Launch everything
control Channel1 play
control Channel4 play

Help please.

intercooler
New Cone
New Cone
Posts: 5
Joined: 23 Aug 2010 13:00

Re: VLM to MUX two Channels

Postby intercooler » 22 Feb 2017 18:06

Hi guys,
after few years since started this thread, has anybody functional solution of this muxing?
Or, tried anybody modify these VLM config files to run under VLC v2.x.x?

THX


Return to “VLM”

Who is online

Users browsing this forum: No registered users and 9 guests