Question / Help Video Cameras do not sync correctly using Media Source

ox64

New Member
I've so badly wanted to switch permanently from another program to OBS Studio, but this issue prevents me from doing so. OBS uses so much less CPU on my laptop versus the competitor.

I have three vaddio HD-USB cameras. These cameras are capable of sending video to a laptop via USB or network. I have chosen to use three network adapters, one is my onboard network adapter and two USB to ethernet adapters (USB 3.0 Gigabit LAN adapters from Whizzotech corp) and use the media source under OBS Studio for the scenes. These cameras have had their firmware flashed to provide an rtsp stream to OBS. The reason I am not using USB is because of the length limitation with USB and with ethernet I can connect cameras and have greater flexibility where to place them with the longer cable lengths. I get all three cameras set up in OBS and they are always out of sync with one another. Restarting OBS causes the sync differences to vary. Once in a blue moon they will all sync correctly, but when switching scenes a lot of time get out of sync.

When I add my PTZ camera as a media source in OBS, I use the following values:
Local file - Unchecked
Restart playback when source becomes active - Unchecked (If this is checked, the camera image never displays)
Input: rtsp://192.168.4.100:554/cam (each camera is on its own subnet and network adapter, so these are different for each camera)
Input Format: [blank]
Use hardware decoding when available - Unchecked
Advanced - Checked
Force Format Conversion - Checked (I thought this might have been the issue. I unchecked and still same results mentioned above)
Audio Buffer Size (frames) - 1
Video Buffer Size (frames) - 1
Frame Dropping Level - Default (Invalid Packets)
YUV Color Range - Auto

On the other unnamed program I use, the cameras always stay in sync using their feature that's for adding a media source, therefore I know it's possible to make this work and the cameras stay in sync. I just don't know if it's a setting I have wrong in OBS or if it's a problem with how OBS handles media sources. I dont know if it has something to do with how OBS is buffering the media source or what's going on.

Before someone mentions to use the delay filter to correct the sync issue, this does NOT work. If you get everything syncronized with the filters and close the program and restart, the cameras are all out of sync with each other again. The cameras also get out of sync sometimes when switching scenes, so adding delay filters is not a solution and too time consuming every few minutes and just doesn't fly with live broadcasting! :(

Any help is appreciated!

Log file:
https://gist.github.com/892af59427cebf2de13fd2da15f3965d
 

ox64

New Member
Sorry I forgot to include the settings on the PTZ cameras, this may be relevant as well. These are the same settings on all 3 cameras, with the exception of the IP is different and on their own subnet.
Vaddio ClearVIEW HD-USB PTZ 998-6990-000

Color space:
YUV 4.2.0

IP Streaming:
Video Resolution: 720p
Video Quality: High Quality(Best)
Protocol: RTSP Port 554
Streaming URL: cam


I've so badly wanted to switch permanently from another program to OBS Studio, but this issue prevents me from doing so. OBS uses so much less CPU on my laptop versus the competitor.

I have three vaddio HD-USB cameras. These cameras are capable of sending video to a laptop via USB or network. I have chosen to use three network adapters, one is my onboard network adapter and two USB to ethernet adapters (USB 3.0 Gigabit LAN adapters from Whizzotech corp) and use the media source under OBS Studio for the scenes. These cameras have had their firmware flashed to provide an rtsp stream to OBS. The reason I am not using USB is because of the length limitation with USB and with ethernet I can connect cameras and have greater flexibility where to place them with the longer cable lengths. I get all three cameras set up in OBS and they are always out of sync with one another. Restarting OBS causes the sync differences to vary. Once in a blue moon they will all sync correctly, but when switching scenes a lot of time get out of sync.

When I add my PTZ camera as a media source in OBS, I use the following values:
Local file - Unchecked
Restart playback when source becomes active - Unchecked (If this is checked, the camera image never displays)
Input: rtsp://192.168.4.100:554/cam (each camera is on its own subnet and network adapter, so these are different for each camera)
Input Format: [blank]
Use hardware decoding when available - Unchecked
Advanced - Checked
Force Format Conversion - Checked (I thought this might have been the issue. I unchecked and still same results mentioned above)
Audio Buffer Size (frames) - 1
Video Buffer Size (frames) - 1
Frame Dropping Level - Default (Invalid Packets)
YUV Color Range - Auto

On the other unnamed program I use, the cameras always stay in sync using their feature that's for adding a media source, therefore I know it's possible to make this work and the cameras stay in sync. I just don't know if it's a setting I have wrong in OBS or if it's a problem with how OBS handles media sources. I dont know if it has something to do with how OBS is buffering the media source or what's going on.

Before someone mentions to use the delay filter to correct the sync issue, this does NOT work. If you get everything syncronized with the filters and close the program and restart, the cameras are all out of sync with each other again. The cameras also get out of sync sometimes when switching scenes, so adding delay filters is not a solution and too time consuming every few minutes and just doesn't fly with live broadcasting! :(

Any help is appreciated!

Log file:
https://gist.github.com/892af59427cebf2de13fd2da15f3965d
 

Octopode

New Member
I have the same problem, have you found a solution? Otherwise, what is the other program that does work?
 

ox64

New Member
No Octopode, I have not found a solution yet unfortunately. If I do, I'll be sure to post it here.
 

rhussey3

New Member
I am experiencing the same issue, has there been any resolution too this? We are thinking of using HDMI,
 

Chris Poteet

New Member
I was getting ready to send out for quote a vaddio system. Some of the camera's have a gen lock feature. Is that a hardware device that would take all the camera's in before pushing out to OBS?
 

Tangential

Member
Since RTMP is not 'real time' it is going to be extremely difficult to get them in sync. The RTMP stream is delayed and its very hard for 2 systems to hit the same stream at the exact same time. Additionally lag may vary minutely between cameras with the encoding overhead. Since each camera will have different view, it is probable that their encoding times will very ever so slightly across time. I would be amazed if you could routinely sync these devices. Protocols like NDI and SRT are designed to minimize lag; RTMP/RTSP are not. You would be much better off using HDMI via encoders. You can get devices that will transport HDMI over cat 6E pretty cheaply. You'll still need an encoder but cabling will be easier.
 

ox64

New Member
Since RTMP is not 'real time' it is going to be extremely difficult to get them in sync. The RTMP stream is delayed and its very hard for 2 systems to hit the same stream at the exact same time. Additionally lag may vary minutely between cameras with the encoding overhead. Since each camera will have different view, it is probable that their encoding times will very ever so slightly across time. I would be amazed if you could routinely sync these devices. Protocols like NDI and SRT are designed to minimize lag; RTMP/RTSP are not. You would be much better off using HDMI via encoders. You can get devices that will transport HDMI over cat 6E pretty cheaply. You'll still need an encoder but cabling will be easier.
RTMP doesn't have to be 'real time' for my case. In fact, the small delay it introduces is a huge advantage but I won't go into that. The streams just need to be relatively the same and that's what I have. The concept with my hardware setup has worked perfectly for years in the competitor program and I have NO LAG and NO SYNC ISSUES in the cameras as they are identical and produce the same type of RTMP stream with the exact same amount of latency from each stream. I do appreciate the suggestion of using HDMI via encoders, but again I have a working setup that's not broke. It's more a wishlist that OBS fix the issue so I can get rid of the competitor program. If they don't want to fix it, that's fine, but it's clearly an OBS issue and can not be blamed on anything else.
 

ox64

New Member
RTMP doesn't have to be 'real time' for my case. In fact, the small delay it introduces is a huge advantage but I won't go into that. The streams just need to be relatively the same and that's what I have. The concept with my hardware setup has worked perfectly for years in the competitor program and I have NO LAG and NO SYNC ISSUES in the cameras as they are identical and produce the same type of RTMP stream with the exact same amount of latency from each stream. I do appreciate the suggestion of using HDMI via encoders, but again I have a working setup that's not broke. It's more a wishlist that OBS fix the issue so I can get rid of the competitor program. If they don't want to fix it, that's fine, but it's clearly an OBS issue and can not be blamed on anything else.
Maybe a more precise example would help explain that problem:
In the competitor program, when I switch to the RTMP stream, there's about 180ms of delay from the time of what is picked up by the camera to when it's seen on the preview or live screen. I have 3 cameras/3 RTMP streams. No matter which one I switch to ...it's always 180ms delay or so close that you can't see any desync between audio and video (yes the audio would have 180ms delay placed in to sync to the video. this is all acceptable for me).

In OBS the amount of delay constantly changes. It might be 220ms one time I switch to one camera, then another time I switch it's 160ms, another time 175ms. It's all over the place. So when you're trying to sync a single audio source to this, sometimes the scene is in sync, sometimes it's not.
 

tchads

New Member
Rather than start a new thread, I’ll add onto this one. If admin thinks it should be a new thread, let me know.
I’m in my 60‘s and new to streaming, but willing to learn. I’ve done my YT University courses and hope to graduate before I’m 70.

I‘ve taken over our church live stream from a third party vendor. We currently have a PTZOPTICS NDI camera borrowed earlier this year and two Winsafe UHV-500 (non NDI) cameras that are approx. 5 years old. All are connected to a PoE switch, using CAT 6. Audio is through a X32 Compact Mixer fed into a dedicated PC. The streaming is to YT using OBS.
The PTZOPTICS camera works fine, audio and video are in sync. No questions regarding this one.
The UHV camera video is slightly behind the PTZ one, not an issue. The audio for the UHV cameras is noticeably out of sync. I was hoping to use SRT protocol in place of NDI, but the cameras are not set up with it. Options I can see for IP Protocol are TCP/IP, HTTP, RTSP, RTMP, Onvif, DHCP. OBS is connected using RTMP or RTSP.

Can I add SRT to the UHV cameras, or is that a factory only option?
What would be the best output from the UHV cameras? I believe it’s set at VISCA over IP currently.
Can I set the audio sync separately for the PTZO and the UHV cameras even though there’s only one source? This is where I am struggling to get the audio synced.

I hesitate to make changes as I’m concerned I’ll screw something up and shut down the live stream.
thanks.
 
Top