Video Resolution of Mosaic Inputs with libVLC

This forum is about all development around libVLC.
SaundersB
Blank Cone
Blank Cone
Posts: 16
Joined: 30 Dec 2016 15:44

Video Resolution of Mosaic Inputs with libVLC

Postby SaundersB » 10 Jan 2017 18:43

Good morning,

I have a question about specifying the individual broadcast inputs resolution for a mosaic. Currently, when I load a static file twice as two independent inputs, I'm seeing them at a fixed resolution. I set the resolution in the output, but it doesn't affect the resolution. I read:
"Since vlc 2.0, the mosaic options must be passed in the command line, and not in the vlm file."
[0]

How would I pass resolution specific settings for the individual video inputs? I've attempted the options to no avail. Any help is appreciated. Thank you.

Code: Select all

void Mosaic::configure_double_input_mosaic() { /* new Camera1 broadcast enabled setup Camera1 input "C:\root\src\vlc_player_project\vlc_streaming_server_windows\res\vid\test.flv" setup Camera1 output #mosaic-bridge{id=1,width=512,height=384} */ // Create a new instance of libVLC. vlc = libvlc_new(0, NULL); char* input_options[] = {"width=800", "height=450"}; libvlc_vlm_add_broadcast(vlc, "FirstCam", "C:\\root\\src\\vlc_player_project\\vlc_streaming_server_windows\\res\\vid\\test.flv", "#duplicate{dst=mosaic-bridge{id=1,width=200,height=200},select=video,dst=bridge-out{id=1},select=audio}", 0, NULL, true, 0); libvlc_vlm_add_broadcast(vlc, "SecondCam", "C:\\root\\src\\vlc_player_project\\vlc_streaming_server_windows\\res\\vid\\test.flv", "#duplicate{dst=mosaic-bridge{id=2,width=900,height=900},select=video,dst=bridge-out{id=2},select=audio}", 0, NULL, true, 0); /* new mosaic broadcast enabled setup mosaic input test.flv setup mosaic option image-fps=25/1 setup mosaic option image-duration=-1 setup mosaic output #transcode{sfilter=mosaic,vcodec=mp4v,vb=8500,fps=25,scale=1}:bridge-in{delay=400,id-offset=100}:duplicate{access=udp,url=localhost,dst=display} */ char* mosaicOptions[] = { "image-fps=25/1", "image-duration=-1", "mosaic-height=900", "mosaic-width=1600", "mosaic-alpha=255", "mosaic-xoffset=250", "mosaic-keep-picture --no-media-library --mosaic-rows=2 --mosaic-cols=2 --mosaic-position=0 --mosaic-order=\"1,2\" --mosaic-position=1" }; //libvlc_vlm_add_broadcast(vlc, "mosaic", quadruple_input_background_path, "#transcode{sfilter=mosaic,vcodec=mp4v,vb=800,fps=25,scale=1}:bridge-in{delay=400,id-offset=100}:duplicate{dst=http{dst=:56789/Mosaic},dst=display}", 1, mosaicOptions, true, false); libvlc_vlm_add_broadcast(vlc, "mosaic", quadruple_input_background_path, "#transcode{sfilter=mosaic,vcodec=mp4v,vb=8500,fps=25,scale=0.25}:bridge-in{delay=400,id-offset=100}:duplicate{dst=http{dst=:56789/Mosaic},dst=display}", 0, NULL, true, 0); /* control Camera1 play control Camera2 play control mosaic play */ libvlc_vlm_play_media(vlc, "FirstCam"); libvlc_vlm_play_media(vlc, "SecondCam"); libvlc_vlm_play_media(vlc, "mosaic"); }

[0] https://wiki.videolan.org/VLC_HowTo/Make_a_mosaic/

SaundersB
Blank Cone
Blank Cone
Posts: 16
Joined: 30 Dec 2016 15:44

Re: Video Resolution of Mosaic Inputs with libVLC

Postby SaundersB » 10 Jan 2017 20:50

FYI to anybody else that has the same problem as me.

I ended up figuring out how to add the command line switched to the mosiac. The trick is to add the {} brackets after mosaic in the transcode command. There you can set your parameters. Hope this helps somebody.

Code: Select all

libvlc_vlm_add_broadcast(vlc, "mosaic", double_input_background_path, "#transcode{sfilter=mosaic{width=1600,height=450,mosaic-height=450, mosaic-width=1600, mosaic-alpha=255, mosaic-xoffset=0, mosaic-keep-picture, no-media-library, mosaic-rows=1, mosaic-cols=2 , mosaic-position=0, mosaic-order=1,2, mosaic-position=1},vcodec=mp4v,vb=2000,fps=15}:duplicate{dst=display}", 2, mosaicOptions, true, false);


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 15 guests