Could vlc make a video mosaic?

About encoding, codec settings, muxers and filter usage
alvsant
New Cone
New Cone
Posts: 3
Joined: 12 May 2005 13:00

Could vlc make a video mosaic?

Postby alvsant » 12 May 2005 13:02

Could vlc make a video mosaic streaming or playing?

xtophe
Big Cone-huna
Big Cone-huna
Posts: 1209
Joined: 24 Nov 2003 10:12
Location: Bristol, England

Postby xtophe » 12 May 2005 19:33

Yes, but:
-It's a bit tricky,
-Required the latest development version
-It's very cpu intensive

You should search in the vlc-devel mailing list archive for mosaic.

hth,
Xtophe

dionoea
Cone Master
Cone Master
Posts: 5157
Joined: 03 Dec 2003 23:09
Location: Paris, France

Postby dionoea » 13 May 2005 13:14

a sample vlm configuration file to make a mosaic:

Code: Select all

new tf1 broadcast enabled setup tf1 input udp://@239.255.2.60:1234 setup tf1 output #duplicate{dst=mosaic-bridge{id=1,height=144,width=180},select=video,dst=bridge-out{id=1},select=audio} new fr2 broadcast enabled setup fr2 input udp://@239.255.10.200:1234 setup fr2 output #duplicate{dst=mosaic-bridge{id=2,height=144,width=180},select=video,dst=bridge-out{id=2},select=audio} new TVEi broadcast enabled setup TVEi input udp://@239.255.6.9:1234 setup TVEi output #duplicate{dst=mosaic-bridge{id=3,height=144,width=180},select=video,dst=bridge-out{id=3},select=audio} new bg broadcast enabled #setup bg loop input /home/via/videolan/videolan_mp1v.ts setup bg input fake: setup bg output #switcher{files=/home/via/videolan/image_orange.uyvy,sizes=360x288,command=1}:transcode{sfilter=mosaic,vcodec=mp2v,vb=10000,scale=1}:bridge-in{delay=400,id-offset=100}:standard{access=udp,mux=ts,url=239.255.99.99,sap,group=Mosaic,name="[mosaic] TF1 - FR2 - TVEi"} control bg play control tf1 play control fr2 play control TVEi play
and the VLC command line to launch it

Code: Select all

./vlc $1 --color -I telnet --vlm-conf ../mosaic.vlm.conf --ttl 12 \ --mosaic-width 360 --mosaic-height 288 --udp-caching 800 \ --mosaic-keep-picture \ --mosaic-rows 2 --mosaic-cols 2 --mosaic-position 1 --mosaic-order 1,2,3
what it basically does :
take image_orange.uyvy as the background image
take 3 network streams as input
mix the video
add 1 audio channel per original network stream (or more if the original stream had more than one channel)
stream the resulting image/audio to a multicast ip address with an sap announce
Antoine Cellerier
dionoea
(Please do not use private messages for support questions)

alvsant
New Cone
New Cone
Posts: 3
Joined: 12 May 2005 13:00

Postby alvsant » 13 May 2005 13:29

Thanks, I´m going to test it now.

dionoea
Cone Master
Cone Master
Posts: 5157
Joined: 03 Dec 2003 23:09
Location: Paris, France

Postby dionoea » 13 May 2005 14:26

to generate the background image here is what i use: (you need it to be uyvy ...)

convert the original image (bmp, png, jpeg ...):

Code: Select all

convert -size 720x576 image.ext -resize 720x576 image.uyvy
test the image:

Code: Select all

display -size 720x576 image.uyvy
test using the image in VLC:

Code: Select all

./vlc --sout-switcher-files=videolan.uyvy --sout-switcher-sizes=720x576 \ --sout-switcher-command=1 --ttl 12 --sout "#switcher:display" fake:

(convert and display comme with the "imagemagick" package in linux debian)
Antoine Cellerier
dionoea
(Please do not use private messages for support questions)

alvsant
New Cone
New Cone
Posts: 3
Joined: 12 May 2005 13:00

Postby alvsant » 14 May 2005 21:52

This is what i´m looking for and runs well, thanks.

bXn
Blank Cone
Blank Cone
Posts: 46
Joined: 08 Jun 2005 09:14

Postby bXn » 08 Jun 2005 09:22

Is the use of an image as background mandatory ?

And another question: I read here http://wiki.videolan.org/index.php/Mosaic#Appendix that ffmpeg was
necessary, can someone confirm this ?

(I am trying to make a mosaic on Windows )

dionoea
Cone Master
Cone Master
Posts: 5157
Joined: 03 Dec 2003 23:09
Location: Paris, France

Postby dionoea » 08 Jun 2005 09:39

you can use another video stream as a background image.

ffmpeg isn't allways necessary, just highly recomended since it encodes/decodes most of the video codec you will use.
Antoine Cellerier
dionoea
(Please do not use private messages for support questions)

bXn
Blank Cone
Blank Cone
Posts: 46
Joined: 08 Jun 2005 09:14

Postby bXn » 08 Jun 2005 09:56

Ok thanks for the info.
It works ;o)

here's my working config :

Code: Select all

vlc --color -I telnet --vlm-conf mosaic.cfg --ttl 12 --udp-caching 800 --mosaic-width 360 --mosaic-height 288 --mosaic-keep-picture --mosaic-rows 2 --mosaic-cols 2 --mosaic-position 1 --mosaic-order 1,2 --------------------------- Fichier mosaic.cfg new channel1 broadcast enabled setup channel1 input "x.mpg" setup channel1 output #duplicate{dst=mosaic-bridge{id=1,height=144,width=180},select=video,dst=bridge-out{id=1},select=audio} new channel2 broadcast enabled setup channel2 input "y.mpg" setup channel2 output #duplicate{dst=mosaic-bridge{id=2,height=144,width=180},select=video,dst=bridge-out{id=2},select=audio} new background broadcast enabled setup background input "back.mpg" setup background output #transcode{sfilter=mosaic,vcodec=mp4v,acodec=mpga,vb=800,ab=128,deinterlace}:duplicate{dst=display,dst=standard{mux=ts,access=udp,url=192.168.1.53,sap,name="toto"}} control background play control channel1 play control channel2 play

Guest

Postby Guest » 14 Jun 2005 19:11

Don't we have to connect to the vlm via telnet?

Feivel
New Cone
New Cone
Posts: 9
Joined: 11 Jun 2005 13:11

Postby Feivel » 14 Jun 2005 20:51

Well, I got the last example running, but now I tried to set an image as background. What could be wrong with the following code:

new channel1 broadcast enabled
setup channel1 input "scrubs.avi"
setup channel1 output #duplicate{dst=mosaic-bridge{id=1,height=150,width=250},select=video,dst=bridge-out{id=1},select=audio}

new channel2 broadcast enabled
setup channel2 input "psilodump.mpeg"
setup channel2 output #duplicate{dst=mosaic-bridge{id=2,height=150,width=250},select=video,dst=bridge-out{id=1},select=audio}


new background broadcast enabled
setup background input fake:
setup background output #switcher{files=C:\Program Files\VideoLAN\vlc-test\new.uyvy,sizes=500x300,command=1}:transcode{sfilter=mosaic,vcodec=mp2v,vb=1000,scale=1}:bridge-in{delay=400,id-offset=100}:duplicate{dst=display}


control background play
control channel1 play
control channel2 play


I'm startin the vlc as you recommended, and I'm not getting any error but no display either.

dionoea
Cone Master
Cone Master
Posts: 5157
Joined: 03 Dec 2003 23:09
Location: Paris, France

Postby dionoea » 14 Jun 2005 22:56

are you using vlc 0.8.2 ? the --vlm-conf option doesn't exist in 0.8.1
Antoine Cellerier
dionoea
(Please do not use private messages for support questions)

Feivel
New Cone
New Cone
Posts: 9
Joined: 11 Jun 2005 13:11

Postby Feivel » 14 Jun 2005 23:19

Yes I'm using the newest version. And I succeeded in arranging 3 videos, but putting the .uyvy-file as the background-image did'nt show anything at all.

Btw., I don't really know, what the switcher-module and the bridge-in is. I'd like to understand everything, but it's kind of complicated and the documentation lacks some good examples.

Anyway, thanks for any kind of suggestions.

dionoea
Cone Master
Cone Master
Posts: 5157
Joined: 03 Dec 2003 23:09
Location: Paris, France

Postby dionoea » 15 Jun 2005 01:49

the switcher module is in fact being deprecated (even though its all new). In latest versions, you can do :
vlc fake: --fake-file image.png
That is quite simpler then the switcher solution. (And you just need a png or jpeg file ... :) )

the switcher module basically takes a list of image and makes a video out of them.

the bridge module takes several elementary streams and groups them.

I've added a small diagram to the wiki page to explain how the differents bricks fit together.
Antoine Cellerier
dionoea
(Please do not use private messages for support questions)

Feivel
New Cone
New Cone
Posts: 9
Joined: 11 Jun 2005 13:11

Postby Feivel » 16 Jun 2005 15:00

Thanks man! I will post again in case of success.

Feivel
New Cone
New Cone
Posts: 9
Joined: 11 Jun 2005 13:11

Postby Feivel » 18 Jun 2005 00:30

This fake: command is not working.

new channel1 broadcast enabled
setup channel1 input "one.avi"
setup channel1 output #duplicate{dst=mosaic-bridge{id=1,height=150,width=250},select=video,dst=bridge-out{id=1},select=audio}

new channel2 broadcast enabled
setup channel2 input "two.mpeg"
setup channel2 output #duplicate{dst=mosaic-bridge{id=2,height=150,width=250},select=video,dst=bridge-out{id=2},select=audio}



new background broadcast enabled
setup background input fake: --fake-file="C:\VLC\bg.jpg"
setup background output #transcode{sfilter=mosaic,vcodec=WMV2,vb=1000,scale=1}:bridge-in{delay=400,id-offset=100}:duplicate{dst=display}

This is not showing anything, but loading massive stuff into memory.
I'm really frustrated right now, because I can't find my mistake.
And I still think, that some modules are not documented at all.
This one gives just too little information:
http://wiki.videolan.org/index.php/VLC_ ... -line_help

dionoea
Cone Master
Cone Master
Posts: 5157
Joined: 03 Dec 2003 23:09
Location: Paris, France

Postby dionoea » 18 Jun 2005 00:48

the --fake-file option needs to be passed to vlc on the command line, not in vlm
Antoine Cellerier
dionoea
(Please do not use private messages for support questions)

Spider
Blank Cone
Blank Cone
Posts: 10
Joined: 20 Jun 2005 05:10
Location: Omsk, Russia
Contact:

Postby Spider » 21 Jul 2005 12:30

the switcher module is in fact being deprecated (even though its all new). In latest versions, you can do :
vlc fake: --fake-file image.png
That is quite simpler then the switcher solution. (And you just need a png or jpeg file ... :) )

Code: Select all

new background broadcast enabled setup background input fake: --fake-file image.jpg setup background output #transcode{sfilter=mosaic,vcodec=mp4v,vb=150}:bridge-in{delay=400,id-offset=100}:display
crached down with no message, just:
[00000078] main module debug: using packetizer module "rawvideo"
/X/bin/mosaic-vlc: line 8: 2623 Killed vlc -vvv --vlm-conf /X/bin/mosaic.vlm.conf --no-audio --no-sout-audio --color -I telnet --vout X11 --v4l-chroma "I420" --mosaic-width 800 --mosaic-height 600 --mosaic-keep-picture --mosaic-rows 2 --mosaic-cols 2 --mosaic-position 1 --mosaic-order 1,2,3

dionoea
Cone Master
Cone Master
Posts: 5157
Joined: 03 Dec 2003 23:09
Location: Paris, France

Postby dionoea » 21 Jul 2005 13:51

You should try this instead :

Code: Select all

new background broadcast enabled setup background input fake: setup background output #transcode{sfilter=mosaic,vcodec=mp4v,vb=150}:bridge-in{delay=400,id-offset=100}:display

Code: Select all

vlc -vvv --vlm-conf /X/bin/mosaic.vlm.conf --no-audio --no-sout-audio --color -I telnet --vout X11 --v4l-chroma "I420" --mosaic-width 800 --mosaic-height 600 --mosaic-keep-picture --mosaic-rows 2 --mosaic-cols 2 --mosaic-position 1 --mosaic-order 1,2,3 --fake-file image.jpg
Antoine Cellerier
dionoea
(Please do not use private messages for support questions)

Spider
Blank Cone
Blank Cone
Posts: 10
Joined: 20 Jun 2005 05:10
Location: Omsk, Russia
Contact:

Postby Spider » 21 Jul 2005 14:30

Can I view picture localy with out transcode?

dionoea
Cone Master
Cone Master
Posts: 5157
Joined: 03 Dec 2003 23:09
Location: Paris, France

Postby dionoea » 22 Jul 2005 09:24

sure :

Code: Select all

vlc fake: --fake-file image.png
Antoine Cellerier
dionoea
(Please do not use private messages for support questions)

Spider
Blank Cone
Blank Cone
Posts: 10
Joined: 20 Jun 2005 05:10
Location: Omsk, Russia
Contact:

Postby Spider » 22 Jul 2005 14:45

No! Not fake.
How to view mosaic localy with out transcode?

dionoea
Cone Master
Cone Master
Posts: 5157
Joined: 03 Dec 2003 23:09
Location: Paris, France

Postby dionoea » 22 Jul 2005 15:48

oh ... you need the transcode to do the mosaic. What you don't need to view it localy is the standard (or std). Just replace it with :display
Antoine Cellerier
dionoea
(Please do not use private messages for support questions)

Spider
Blank Cone
Blank Cone
Posts: 10
Joined: 20 Jun 2005 05:10
Location: Omsk, Russia
Contact:

Postby Spider » 22 Jul 2005 18:46

wou wou wou :)
1. I want to view mosaic localy on my display
2. Whow to view it with out transcode? I try to remove vcodec, but vlc process freezing with this way :(

dionoea
Cone Master
Cone Master
Posts: 5157
Joined: 03 Dec 2003 23:09
Location: Paris, France

Postby dionoea » 22 Jul 2005 19:49

you can't do a mosaic without transcode. (but you might want to try to transcode to raw data ... but i don't know how that works. never tried it)
Antoine Cellerier
dionoea
(Please do not use private messages for support questions)


Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 24 guests