Genlock

StereoPi hardware discussion
Post Reply
Oteppi
Posts: 4
Joined: Thu Mar 19, 2020 5:52 pm

Genlock

Post by Oteppi »

Is StereoPI cameras Genlocked /framesynced? This is essential featue when captuing video.

stereomaton
Posts: 215
Joined: Tue May 21, 2019 12:33 pm
Location: France

Re: Genlock

Post by stereomaton »

As far as I understand, not strictly speaking.

However in practice the cameras are scanned with very low latency. In this post, a user shared videos taken from a plane drone. The vibrations of the machine interfere with the rolling-shutter of the camera and the resulting artifacts (image "wobbling") are in sync, which denotes a "perfect enough" synchronicity for me.

If it is not enough for you, you can theoretically use your solder iron to tick the two cameras by the same quartz to gain a little more sync and stability over time. The standard stability of the sync is already very good because the videos in question were in sync during the whole flight.
Stereophotographer and hacker
Despite my quite active participation in the forum, I am not in the StereoPi team
StereoPi (v1) Standard Edition + CM3Lite module + a few cameras

Oteppi
Posts: 4
Joined: Thu Mar 19, 2020 5:52 pm

Re: Genlock

Post by Oteppi »

I have been using two GoPro 4 Hero black cameras fitted in a 3D rig. I have been using a WiFi remote to take snapshots.
This works a pretty good when taking a still images. But when I record a video the video is unbearable to watch most of the times. I have been processing the videos by fixing the frame sync. I have been using a separate strobe flash as marker for finding the right frames for syncing. I can tell that if the time difference between two videos is more than half of the frame, the video will be unbearable to watch. When recording the videos, one out of ten recording times the frames will be synced close enough, so the result video is processable and even watchable. However, most of the tmes the video sync is out of sync about half of the fame. This kind of video is impossible to watch.
When using red/cyan or similar specs for watching, the half frame doesn't matter. But when I use a 3D projector and big screen for watching the videos, I will get a headache from the missframed videos.

stereomaton
Posts: 215
Joined: Tue May 21, 2019 12:33 pm
Location: France

Re: Genlock

Post by stereomaton »

I know what you are talking about. In practice, the sync error with StereoPi is by very far inferior to the framerate, so that the kind of problems you mention do not show up.
I'll try to capture a demo video with moving things so that you could check by yourself. Ask me again in a few days if I forgot.
Stereophotographer and hacker
Despite my quite active participation in the forum, I am not in the StereoPi team
StereoPi (v1) Standard Edition + CM3Lite module + a few cameras

Oteppi
Posts: 4
Joined: Thu Mar 19, 2020 5:52 pm

Re: Genlock

Post by Oteppi »

I'll try to capture a demo video with moving things
That's very kind of You

Is it possible to have this video encoded in FullSBS 1080p format? This would be the best format for watching it with projector.

User avatar
Realizator
Site Admin
Posts: 900
Joined: Tue Apr 16, 2019 9:23 am
Contact:

Re: Genlock

Post by Realizator »

Hi Oteppi and Stereomaton,
I agree with Stereomaton, that in 99% cases current sync is Ok. But if you want 100% sync, let me describe several approaches you can use:

1. Original V1/V2 cameras and pin-to-pin compatible clones
All that staff has no support for software controlled genlock. But you can do it in hardware way. You need to unsolder quartz on one camera, and solder wires from another camera to these contact points, like Arducam do on this photo:

Image

You can do it with any V1/V2 camera clones. In this case you'll get a hardware genlock using soldering way.

2. Special cameras with external sync support
Another way is to use a special modules, which allows you to use external sync. For example, SE-SB02 from Soho Enterprise (https://soho-enterprise.com/wp/wp-conte ... -1_1_0.pdf). These modules uses ribbon line, originally intended for the camera LED, to get sync signal. So you can send a sync signal to this pin to do a software controlled genlock.

3. Special assemblies
There are some ready-to-use couples of cameras. For example, you can find such assembly on the photo in this Arducam product: https://www.arducam.com/product/synchro ... 219-board/

Also today I received information from the Waveshare. They produce a line of cameras for NVidia Jetson and, luckily, all that IMX219-based modules works with the StereoPi (and other Compute Module based systems). So now they have this interesting board: http://www.waveshare.net/shop/IMX219-83 ... Camera.htm
Eugene a.k.a. Realizator

stereomaton
Posts: 215
Joined: Tue May 21, 2019 12:33 pm
Location: France

Re: Genlock

Post by stereomaton »

Hi Oteppi,

I never really used the video record part of SLP (which is the preinstalled system on StereoPi) and I have some trouble to use it.
The videos I did yesterday were swapped (and there was a very strange delay between the cameras as if the processing was not able to follow the capture rate).
I changed a few parameters and today it was OK, but almost every file were corrupted (well test files were OK and actual footage videos were corrupted with message "moov atom not found").
Perhaps should I find the default parameters to test again.

Sorry for the delay, I have to understand what happens and how to use it correctly.
Stereophotographer and hacker
Despite my quite active participation in the forum, I am not in the StereoPi team
StereoPi (v1) Standard Edition + CM3Lite module + a few cameras

User avatar
Realizator
Site Admin
Posts: 900
Joined: Tue Apr 16, 2019 9:23 am
Contact:

Re: Genlock

Post by Realizator »

Stereomaton, most frequent problem with the video recordings is a setting of the parameters, not supported by the cameras. Like FullHD at 42 FPS etc. So it is better to start with the default settings, and after that do a changes to test, if they works.
You see, in SLP we try to give more flexibility to users with the settings. But the opposite side of this approach is that user can set wrong settings. If we'll "lock" just a couple of right settings, it will reduce a freedom of settings. It is difficult to find a balance here...
Eugene a.k.a. Realizator

stereomaton
Posts: 215
Joined: Tue May 21, 2019 12:33 pm
Location: France

Re: Genlock

Post by stereomaton »

I had a bit of time today to shoot even if it was cloudy, cold and windy and that I had only the V1 cameras available. I realized that I use a crapy SD card and that can be what causes the issue (settings were in the capabilities of the cameras in the first test), so I lowered the video options.

So basically:
1) I shot in 1280x960, 3007 kb/s, 25.02 fps, decimated (HSBS)
2) I cut the resulting file in two videos which I upscaled and unsqueezed
3) I extracted one image at the same timecode from the two clips
4) I computed an homography to register the images (not perfect, but okay)
5) I applied the homography to all the images of the video
6) I cropped the resulting clips in 16:9 format and adjusted the window placement at the same time
7) I merged the two clips into one final video with MP4 frame-packing info

The quality is not the best you can do with StereoPi, but it is probably sufficient to judge of the synchronization. I was too close for the base I used, I hope it will not hurt your eyes. You will see some annoying compression artifacts and the alignment is not perfect, but it is nonetheless watchable despite the high speed of the acoustic/mechanical waves resonating in front of the camera. By looking closely, you can find some small rivalries, but it is hard to decide if they are due to error of synchronization, compression artifacts or misalignment of the clips.

Video: https://gofile.io/?c=TEXj4L
Stereophotographer and hacker
Despite my quite active participation in the forum, I am not in the StereoPi team
StereoPi (v1) Standard Edition + CM3Lite module + a few cameras

User avatar
Realizator
Site Admin
Posts: 900
Joined: Tue Apr 16, 2019 9:23 am
Contact:

Re: Genlock

Post by Realizator »

stereomaton wrote:
Sun Mar 29, 2020 11:33 pm
By looking closely, you can find some small rivalries, but it is hard to decide if they are due to error of synchronization, compression artifacts or misalignment of the clips.
Stereomaton, thank you for your experiment!
As for your notice - my experiments with the water shoots shows me, that reflections and flares on the water waves differs for the left and right camera (even if the distance from the camera to the waves is big enough). In a real life (or playing video) it is about unnoticeable, but you can find this difference in slow motion or on a separate frames (when you stop the video). It does not means lack of synchronization, it's just a reflection physics on an objects with a complex shape.
Eugene a.k.a. Realizator

stereomaton
Posts: 215
Joined: Tue May 21, 2019 12:33 pm
Location: France

Re: Genlock

Post by stereomaton »

Yes, I did not add this precision because it was too obvious to me to think about it. I talked about artifacts that are not reflections, for example in some flying droplets.
Stereophotographer and hacker
Despite my quite active participation in the forum, I am not in the StereoPi team
StereoPi (v1) Standard Edition + CM3Lite module + a few cameras

Post Reply