How does OBS blend 4 streams from Droidcam and record to MP4?

Billius44

New Member
Hi there,

We are recording 3 video streams from Android Pixel phones using the Droidcam app and plugin.
There is also a 4th video stream from a USB webcam.
We have the 4 streams arranged as quadrants, and the 3 Android phones are recording the same event from 3 different angles.

Going through the footage frame-by-frame - in this case it's someone walking along a mat - we notice that each frame is slightly asynchronous.
e.g. camera 1 frame shows a slight foot movement, while cameras 2+3 show nothing
then camera 2 frame has movement, then camera 3
then it's 1+2 with nothing on 3, then 2+3 with nothing on 1, then it's 1+2+3 all showing movement!

There doesn't seem to be a repeat pattern to this, but eventually all movement is synced to within ~4 frames.

Can anyone shed light on whether this is an OBS thing, relating to how it blends streams together? or a Droidcam thing? Or even an encoding thing (we are encoding with Nvidia HVEnc, 1920+1080 60fps.

Thanks in advance.
 

Lawrence_SoCal

Active Member
Your mobile devices aren't common time sync'd locally (presumably) and you are sending the video over WiFi (right?)... yes, I wouldn't expect that to be all that synchronous. OBS Studio PC is Ethernet connected right? if no, fix that first

One, I'd use NDI PTZ cameras instead... but if stuck with your setup, I'd start troubleshooting/testing with USB to Ethernet adapters on the phones (and, and a local NTP time sync. And exclude the webcam ... that way you have 3 simultaneous videos coming over same connection using same tech/software, etc. Can you get those in sync? My recollection (on older OBS Studio versions was only the ability to adjust Audio sync .. not separately adjust a sync delay on various video sources) and I'm not aware of that changing (but don't take my word for it).
I do recommend using something like https://streamgeeks.us/fix-audio-sync-issue-in-obs/ to test [point all cameras to same source... ex running on tablet or laptop ]
 
Last edited:

AaronD

Active Member
My recollection (on older OBS Studio versions was only the ability to adjust Audio sync .. not separately adjust a sync delay on various video sources) and I'm not aware of that changing (but don't take my word for it).
There are Video Delay (Async) and Render Delay filters, under Audio/Video Filters and Effect Filters, respectively. Both have a single setting in ms, and do exactly as you'd expect. They delay the picture, but not the sound.

When I had my array of 4 cheap HDMI -> USB captures that refused to stay in sync with each other, I had one of those on all of them, and tweaked them every time so that they'd line up again. A single 4-input PCIe card fixed that.

I do recommend using something like https://streamgeeks.us/fix-audio-sync-issue-in-obs/ to test [point all cameras to same source... ex running on tablet or laptop ]
Seems to work well enough for me, to have someone wander in view of all the cameras, which often happens anyway, and watch their feet or whatever mannerisms they might have. Guitar strumming is too repetitive to be useful, unless you already know that you're within one cycle. Stairs are excellent, especially when you can see their feet on all the cameras, and thus know what step they're on.

I can tolerate a frame or two out of sync, but if you must be *exactly* in time, then at least use the tool that Lawrence linked to, and start thinking about how to get a master clock to everything instead of using all of their different internal ones.
 

Lawrence_SoCal

Active Member
Thanks Aaron for the update/correction here (and your voluminous recent postings!)

And yes on sync, there are many ways to get close .. easily enough... but if you have a bit of OCD ;^), there are means (like the sync video I listed) to get real close (to spot on) quickly.. whatever works best for one's environment, and variance tolerance. And for others beware that sync delays may vary over time depending on setup (like using WiFi)
 
Last edited:
Top