Compositing multiple streams from security cams into a grid

About encoding, codec settings, muxers and filter usage
signal15
New Cone
New Cone
Posts: 1
Joined: 13 Jul 2010 21:23

Compositing multiple streams from security cams into a grid

Postby signal15 » 13 Jul 2010 21:39

2 questions:

- I have 4 security cameras that stream with RTSP (mpeg4 or 3gpp) or HTTP (via ASF or MJPEG). They are 640x480 resolution, and I can view them all individually in VLC. I'd like to take all 4 streams, and put them in a 2x2 grid with a resolution of 1280x960, and restream them onto the network. I also need to ensure that the buffer size is small so the video is as real-time as possible. Right now, it's a 3 second delay, which is acceptable. It sounds like I might be able to do this using a combination of avsynth and vlc, but I couldn't figure out how. Is there any way to do this?

- Ultimately, I also want to be able to advertise this as a DLNA media server so I can view it on a PS3 and a WDTV Live Plus. It appears that neither of these devices support directly connecting to an RTSP stream, even when advertised through MediaTomb. VLC can see the Mediatomb advertisements and connect just fine though. Is there any way to get VLC to advertise directly via DLNA or some other method that will automatically be picked up by a PS3 and/or WDTV Live? I tried advertising and transcoding the video using vlc/PS3 Media Server. While it works, the video is 30+ seconds behind, even if I set the buffer size in PS3MS down to almost nothing.

thebluebishop
New Cone
New Cone
Posts: 6
Joined: 14 Jun 2010 03:37
VLC version: 1.1.0 RC
Operating System: Windows Vista
Location: Sevilla, España (Seville, Spain)

Re: Compositing multiple streams from security cams into a g

Postby thebluebishop » 14 Jul 2010 01:48

Hi. I can´t help with the second question, but I think you should try the "mosaic" filter in VLC for the first one. I´m using it to preview a 3x4 grid of streams/files/webcams from VoD with no issues apart from hardware limitations.

In VLC 1.0.5 this VLM file works fine:

Code: Select all

del all # ######################################################################################## # SE CREA UNA COMPOSICION MEDIANTE MOSAIC QUE CONTIENE: # # COMPOSICION: Salida final de la parrilla de previos # PREVIEWxx: Video, stream o imagen que tiene tamaño menor a la composicion y que se coloca en algun # lugar distinto de la misma, sobre el video principal. # ######################################################################################## # Se configuran parametros del background y de la composicion entera # ######################################################################################## new Composicion broadcast enabled # ######################################################################################## # Se define el background como el input de la composicion. Esta es la imagen que se mostrara cuando # todos los buses y PiP esten detenidos setup Composicion input "fake://" setup Composicion option fake-file="img/preview_background.jpg" setup Composicion option fake-file-reload=1 # ??? Pero tiene implicaciones en la estabilidad. CONSULTAR LA DOCUMENTACION DE VLC setup Composicion option fake-caching=50 # Tamano que se le va a dar a la imagen de background setup Composicion option fake-width=720 setup Composicion option fake-height=480 # Parametros del formato de video que se emula a partir de la imagen estatica setup Composicion option fake-fps=30 setup Composicion option fake-deinterlace # Tamano de la composicion completa y, por tanto, de los buses principales. setup Composicion option mosaic-width=720 setup Composicion option mosaic-height=480 # mosaic-position=2 permite colocar cada PiP en una posicion arbitraria, definida por los offsets setup Composicion option mosaic-position=2 # Orden para generar la composicion. En caso de usar offsets solo sirve para definir el orden de # estos a la hora de configurar las posiciones setup Composicion option mosaic-order=Preview01,Preview02,Preview03,Preview04,Preview05,Preview06,Preview07,Preview08,Preview09,Preview10,Preview11,Preview12 setup Composicion option mosaic-offsets=0,0,180,0,360,0,540,0,0,160,180,160,360,160,540,160,0,320,180,320,360,320,540,320 # Mantener relacion de aspecto tanto de la composicion como de los buses. setup Composicion option mosaic-keep-picture setup Composicion option mosaic-keep-aspect-ratio setup Composicion option no-fullscreen # ######################################################################################## setup Composicion output #transcode{deinterlace,sfilter='mosaic',vcodec=mp4v,vb=3500,acodec=none}:bridge-in{id-offset=100}:display # ######################################################################################## # GENERACION DE PREVIEWS # ######################################################################################## new Preview01 broadcast enabled new Preview02 broadcast enabled new Preview03 broadcast enabled new Preview04 broadcast enabled new Preview05 broadcast enabled new Preview06 broadcast enabled new Preview07 broadcast enabled new Preview08 broadcast enabled new Preview09 broadcast enabled new Preview10 broadcast enabled new Preview11 broadcast enabled new Preview12 broadcast enabled setup Preview01 input "rtsp://192.168.1.229:5554/cam01_prev" setup Preview01 output #mosaic-bridge{id=Preview01,width=180,height=160,alpha=200} setup Preview01 loop setup Preview02 input "rtsp://192.168.1.229:5554/cam02_prev" setup Preview02 output #mosaic-bridge{id=Preview02,width=180,height=160,alpha=200} setup Preview02 loop setup Preview03 input "rtsp://192.168.1.229:5554/cam03_prev" setup Preview03 output #mosaic-bridge{id=Preview03,width=180,height=160,alpha=200} setup Preview03 loop setup Preview04 input "rtsp://192.168.1.229:5554/cam04_prev" setup Preview04 output #mosaic-bridge{id=Preview04,width=180,height=160,alpha=200} setup Preview04 loop setup Preview05 input "rtsp://192.168.1.229:5554/cam05_prev" setup Preview05 output #mosaic-bridge{id=Preview05,width=180,height=160,alpha=200} setup Preview05 loop setup Preview06 input "rtsp://192.168.1.229:5554/cam06_prev" setup Preview06 output #mosaic-bridge{id=Preview06,width=180,height=160,alpha=200} setup Preview06 loop setup Preview07 input "rtsp://192.168.1.229:5554/cam07_prev" setup Preview07 output #mosaic-bridge{id=Preview07,width=180,height=160,alpha=200} setup Preview07 loop setup Preview08 input "rtsp://192.168.1.229:5554/cam08_prev" setup Preview08 output #mosaic-bridge{id=Preview08,width=180,height=160,alpha=200} setup Preview08 loop setup Preview09 input "rtsp://192.168.1.229:5554/cam09_prev" setup Preview09 output #mosaic-bridge{id=Preview09,width=180,height=160,alpha=200} setup Preview09 loop setup Preview10 input "rtsp://192.168.1.229:5554/cam10_prev" setup Preview10 output #mosaic-bridge{id=Preview10,width=180,height=160,alpha=200} setup Preview10 loop setup Preview11 input "rtsp://192.168.1.229:5554/cam11_prev" setup Preview11 output #mosaic-bridge{id=Preview11,width=180,height=160,alpha=200} setup Preview11 loop setup Preview12 input "rtsp://192.168.1.229:5554/cam12_prev" setup Preview12 output #mosaic-bridge{id=Preview12,width=180,height=160,alpha=200} setup Preview12 loop # ######################################################################################## # BLOQUE DE CONTROL INICIAL # ######################################################################################## control Composicion play control Preview01 play control Preview02 play control Preview03 play control Preview04 play control Preview05 play control Preview06 play control Preview07 play control Preview08 play control Preview09 play control Preview10 play control Preview11 play control Preview12 play
Sorry about the Spanish comments. The updated version of the VLM for 1.1.x will be in English. See if you can use it for your purpouses and tell us. I have no time to explain, but I expect you can guess how it works.

Hope it helps. Good luck.

Dani bISHOP.

P.S.: Remember: VLC 1.0.5. It has not been tested on 1.0.6 and above.


Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 2 guests