Tuesday, September 28, 2021

USB 3D Camera Experimentation

USB 3D Camera Module

USB 3D Camera Module (parallal SBS)


UPDATED: 2021/09/29

For experimentation with 3D video, I purchased a USB Dual Synchronized 3D Camera Webcam Module from Amazon:

https://www.amazon.com/gp/product/B07MJFTYZ3

The camera module is intended for surveillance, but my uses are 3D stereoscopic capture. I'll discuss the different approaches I took to get the camera module to record 3D photos and videos. 

Camera Module

The camera module generates 960p 3D Stereo HD SBS output at 2560x960 pixels for both video and still photos. Video is 60 fps. The resolution is 1280x960 per eye, slightly better than the FujiFilm W3 3D camera video at 1280x720. There is no microphone for audio recording with the Webcam module and the camera lens is fixed focus M9 90 degrees. The image sensor is 1/3 inch CMOS OV9750. 

The camera lenses interaxial distance is 60 mm. This interaxial generates pleasing 3D images when the subject distance ranges from 2 to 6 feet depending on the background distance behind the subject. 

My task was to write or find software that will operate the camera over a wired USB connection. My goal is to capture 3D still images and video.

Write Code

First I wrote a code sketch with the Processing Foundation https://www.processing.org IDE using the Processing Video library to control the camera. Using Video capture sample code I could see the camera in a list available to the code, but could not turn on or display the video stream from the module. The code reports an internal data stream error.  This code does work for other 2D USB Webcams that I experimented on.

Here is the code for you to try with 2D USB cameras:

// USB 3D Camera video capture
// Java mode Processing IDE version 3.5.4
// Processing Video Library 2.0
// Library uses Gstreamer Version 1.16.2

import processing.video.*;

Capture cam;
int index = 1;

void setup() {
  //size(640, 240);
  //size(1280, 480); // for laptop display
  size(2560, 960);  // for USB 3D Camera screen size on a 2160p laptop display
  //size(1920,1080);
  frameRate(30);
  String[] cameras = Capture.list();

  if (cameras.length == 0) {
    println("There are no cameras available for capture.");
    exit();
  } else {
    println("Available cameras:");
    for (int i = 0; i < cameras.length; i++) {
      println("index="+ i + " "+cameras[i]);
    }

    // The camera can be initialized directly using an 
    // element from the array returned by list():
    println("using index="+ index+ " camera "+cameras[index]);;
    println("width="+width + " height="+height);
    cam = new Capture(this, width, height, cameras[index]);
    //cam.frameRate(60);
    cam.start();
  }
}

void draw() { 
  image(cam, 0, 0);
}

void captureEvent(Capture c) {
  cam.read();
}

Write Code Success

I reached out to Processing Video Library Github participants and Lucas Fredericks suggested a code fix in green highlight below, that works with the USB 3D Camera:

// USB 3D Camera video capture
// Java mode Processing IDE version 3.5.4
// Processing Video Library 2.0
// Library uses Gstreamer Version 1.16.2

import processing.video.*;

Capture cam;
int index = 1;

void setup() {
  //size(640, 240);
  size(1280, 480);
  //size(2560, 960);  // screen size that will fit 2160p laptop display
  //size(1920,1080);
  //frameRate(30);
  String[] cameras = Capture.list();

  if (cameras.length == 0) {
    println("There are no cameras available for capture.");
    exit();
  } else {
    println("Available cameras:");
    for (int i = 0; i < cameras.length; i++) {
      println("index="+ i + " "+cameras[i]);
    }

    // The camera can be initialized directly using an 
    // element from the array returned by list():
    println("using index="+ index+ " camera "+cameras[index]);;
    println("width="+width + " height="+height);
    //cam = new Capture(this, width, height, cameras[index]);
    cam = new Capture(this, width, height, "pipeline: ksvideosrc device-index=1 ! image/jpeg, width=2560, height=960, framerate=60/1 ! jpegdec ! videoconvert");
    cam.start();
  }
}

void draw() { 
  image(cam, 0, 0);
}

void captureEvent(Capture c) {
  cam.read();
}

Zoom

I tried the Zoom app on Windows 10 and with the settings menu found the 3D camera and saw video. I did not try it in a Zoom session. The camera module generates a SBS video stream.

VLC Media Player

Next I used open source VLC Media Player (version 3.0.16) running on Windows 10. In the main menu I initialized with menu item Media, Open Capture Device and made the settings captured in the screen shot below.



A mouse right click starts a recording (red record button) and again to stop recording (gray stop button). I played back the video full screen SBS and viewed with a stereoscope. Now I have a way to record videos in 3D using the Webcam.



Android Apps

I want to use my Android phone with the camera module. After trying several apps without success, I discovered UsbWebCamera app by Serenegiant on the Google play store. It has a subscription payment featue that may put off users, but I tried this version anyway, before discovering the UsbWebCameraPro version that I recommend to use instead.

With the paid versions you can set the camera resolution which you cannot do in the free version. This feature makes it possible to use this camera.

To connect the USB 3D Camera to my phone (Samsung S20) I used an OTG cable micro-USB male to USC-C male (Host end) manufactured by Cable Creation on Amazon. It is about 8 inches long, just the right size for use with my phone. 

Later I tried a less powerful Samsung S8 phone, but video was not captured successfully using the subscription version of the app. When I switched to the Pro version on the S8 I could record video successfully.

The UsbWebCamera settings are the following:

  • Resolution 2560x960 at 60 fps
  • Audio settings: Audio source Disabled (Disabled, mic, or USB Audio Input). Set to mic to use the phone's microphone during video recording.
  • Max video capture duration - using default 30 seconds
  • Still capture mode - PNG for uncompressed still image
  • Play shutter sound for photos

Camera Mount on a Phone Case

To use the camera with my phone I mounted in with rubber bands on the phone case. Using the volume up button I can capture either still photos or videos in 3D when in photo or video mode respectively.








Camera Mount on the OWL Viewer

I mounted the camera module on the back side of London Stereoscopic Company OWL Viewer: Virtual Reality Kit magnetic holding plate. https://shop.londonstereo.com/VRKIT.html

Looking through the lens you can see the camera view in stereo.


OWL Viewer with mounted Camera module 


OWL Viewer with camera module and S8 phone


Photo Example

Photo from Camera unedited

Aligned and Edited Photo

Anaglyph Aligned Photo

Stereo Photo Maker Screenshot during Alignment


YouTube Example

Resting Cat

https://youtu.be/z4_WwwX1fKs  (no 3D metadata applied, you need a stereoscope to view)

https://youtu.be/s7NEPUrfZrY (added 3D metadata for viewing in anaglyph and 3D TVs)

To add 3D metadata I used the following code in a Windows batch file invoking ffmpeg.  See  https://www.ffmpeg.org/

ffmpeg -i %1 -map 0 -c copy -metadata:s:v stereo_mode=left_right "%~n1.mkv"
ffmpeg -i "%~n1.mkv" -aspect 1280:960 -map 0 -c copy -strict -1 "%~n1_3D.mp4"
pause

Advantages

  1. The cameras are synced and run at 60 fps. This solves synchronization and wiring issues using separate dual cameras in a 3D camera rig.
  2. No microphone - use a higher quality external microphone for audio recording or use the phone microphone
  3. Near human eye separation distance

Disadvantages

  1. Low resolution, small sensor
  2. Fixed lens, not interchangeable
  3. With so many Android phone variations, your phone may not work with this camera module

Improvements

  • Build a small enclosure to house the camera module and clip on a phone case.


Conclusion

For me this was worthwhile experimentation because I learned more about 3D video and cameras. I'll be looking for a camera module like this in 4K and better lenses.



Friday, January 29, 2021

3D Shadow Photography

2D Photo of Ceiling Lamp and its Shadow

When I shoot a 3D photo of a scene, the shadow of the subject in the image has no volume, only depth. I realize this is because there is usually only one light source producing the shadow. In everyday stereo vision, shadows have no volume. 

There is one exception I am aware of and it is discussed in a Wikipedia article  "shadow". There is a sub-section about three-dimensional shadows https://en.wikipedia.org/wiki/Shadow#Three-dimensional_shadows. A shadow with volume may occur in a fog. Unfortunately the photo illustrating this was not shot in stereo. I recall seeing this phenomenon only twice, ever, so it is a very rare sight.

We create stereo images with two left and right eye cameras or one camera shooting sequential left and right eye images. By analogy I got the idea to use two flash strobes (simulating left/right eye) spaced apart to simulate stereoscopic shadow vision. In my first experiments, I created 3D photos with three-dimensional shadows by using two light sources and alternating between shooting left and right eye shadow photos with a static subject.

In the example photos of the ceiling lamp, the camera is stationary on a tripod, and two shots were taken using the left and right eye spaced off camera flash strobes to produce the shadows in the 3D photo. I used a PocketWizard Plus II to trigger each the flash strobe separately with two different channels. The left and right photos were aligned with Stereo Photo Maker. The ceiling lamp subject is 2D and its shadow is 3D. Here is the result:



In the above photo the shadow appears on the wall.

Here is the same photo with left and right eye views swapped.


In this photo the shadow appears in front of the ceiling lamp.

Here are the anaglyph 3D stereo versions:




Because the ceiling lamp is semi-transparent and not solid, the volume of the lamp is more apparent.

This was my first experiment with 3D shadows. Later I created 3D photos where both subject and its shadow are in 3D stereo and the shadow has volume. That discussion is for another blog posting.



Saturday, August 8, 2020

3D Photo Reel


I have been looking for alternative ways to show and distribute my 3D photos. The View-Master 3D reel inspired me to create an Android app that includes a stereo viewer and 3D media for presentation. I wanted an app that displays my media content on my glasses-free Rokit 3D Pro phone display. 


I wrote "3D Photo Reel Demo" Android app to explore the features most useful in the app viewer. One feature I wanted immediately was to be able to zoom (for very high resolution photo detail) and pan photos (for landscapes). Two finger expand and pinch perform zoom and shrink. Moving a finger in contact with the screen pans the image.

I noticed the 3D Photo app that came with the Rokit could not handle very high resolution photos because these photos were scaled down to a lower resolution for display. I want to display high resolution 3D photos and see the detail clearly. The disadvantage of working with high resolution photos is that the viewer is slow to load and process images. And you need a high end device with at least 4GB of RAM and fast processing hardware.






I thought the app might have some commercial applications too, for example, Real Estate listing 3D photos, product advertising, and virtual tours, to think of a few. Publishing photos as an app is a lower cost method than creating a View-Master reel.

I chose to include the 3D photo media with the app instead of downloading over the Internet.  With this design there is only a one time install setup without any additional steps for loading content. 



After getting the first version to work on the Rokit 3D Pro, I decided to expand the possible display devices. I added a mode selection feature for SBS, cross-eye SBS, half-width SBS, Above/Below, half-height Above/Below, Column (Rokit 3D) and Row Interlace, and Anaglyph variations. The SBS modes are for those skilled/lucky individuals who can free-view (left/right) or cross-eye view (right/left) side by side images.

Changing the mode for the display allows viewing on an external 3D TV or monitor (half-width SBS for example). To accomplish this I mirror the screen to my TV or connect via USB C. I also use Google ChromeCast Ultra connected to a 3D TV with good results to mirror a phone screen.

I have tested the app on various devices including the Sony XZ Premium (model G8142 modified to always display 4K with any app), Samsung S8 phone, and Samsung Chromebook Plus (configured to run Android apps). 

The app permits keyboard input either from a direct USB connection or a Bluetooth device/controller. A set of single key commands control various functions. I use this to help with debugging and it's also handy for remote control. The keyboard control features in the app are a super-set expanding what the GUI (graphical user interface) offers. The GUI is for novice first-time users while keyboard control is for advanced users. 

Function Key Mapping Tables

      Keyboard Input (USB or Bluetooth)

  • First Photo - MOVE_HOME, MEDIA_REWIND, "F"
  • Last Photo - MOVE_END, MEDIA_FAST_FORWARD, "L"
  • Next Photo - VOLUME_UP, Space Bar, TAB,  ENTER, MEDIA_NEXT
  • Previous Photo - VOLUME_DOWN, DEL, MEDIA_PREVIOUS, ESC
  • Slideshow (start/stop) - MEDIA_PLAY_PAUSE, "S"
  • Start Slideshow - MEDIA_PLAY
  • Stop Slideshow - MEDIA_STOP
  • Photo Information - "I", PERIOD
  • Zoom Cycle - "Z" 
  • Zoom In - "]"
  • Zoom Out - "["
  • Page In - PAGE_UP, ">"
  • Page Out - PAGE_DOWN, "<"
  • Reset Photo Position, Zoom, Parallax - "R", "0"
  • Swap Left/Right or Right/Left - "X"
  • Background Color Toggle- "B"
  • Menu - "M"
  • Mode Single Left - "1"
  • Mode Single Right - "2"
  • Mode Parallel SBS - "3"
  • Mode Parallel SBS Cross-Eye - "4"
  • Mode Parallel Half-Width SBS - "5"
  • Mode Above/Below - "6"
  • Mode Above/Below Half-Height - "7"
  • Mode Column Interlace - "8"
  • Mode Row Interlace - "9"
  • Mode Red/Cyan Anaglyph - "A"
  • Mode Color Anaglyph - "C"
  • Mode Dubois Anaglyph - "D"
  • Mode SPM Anaglyph - "J"
  • Parallax Screen Mode - "P"
  • Parallax Positive Step - "E"
  • Parallax Negative Step - "W"
  • Screenshot - "#"
  • Title Screen - "N"
  • Introduction Screen - "T"
  • Exit - BACK
Mouse Input (Wired or Bluetooth)
  • Left Button - Select On Screen Key or Move Photo
  • Right Button - 
  • Scroll Wheel - Zoom (not implemented)

Android TV Remote Control
  • Next Photo - CHANNEL_UP
  • Previous Photo - CHANNEL_DOWN
  • First Photo - MEDIA_REWIND
  • Last Photo - MEDIA_FAST_FORWARD
  • Zoom Cycle In and Out  - DPAD_CENTER
  • Move Photo Left - DPAD_LEFT
  • Move Photo Right - DPAD_RIGHT
  • Move Photo Up - DPAD_UP
  • Move Photo Down - DPAD_DOWN
  • Reset Photo Position, Zoom, Parallax - "0"
  • Mode Single Left - "1"
  • Mode Single Right - "2"
  • Mode Parallel SBS - "3"
  • Mode Parallel SBS Cross-Eye - "4"
  • Mode Parallel Half-Width SBS - "5"
  • Mode Above/Below - "6"
  • Mode Above/Below Half-Height - "7"
  • Mode Column Interlace - "8"
  • Mode Row Interlace - "9"
  • Mode Red/Cyan Anaglyph - PROG_YELLOW
  • Mode Color Anaglyph - PROG_BLUE
  • Mode Dubois Anaglyph - PROG_RED
  • Mode SPM Anaglyph - PROG_GREEN
  • Menu - CAPTIONS (subtitle)
  • Slideshow (start/stop) - MEDIA_PLAY_PAUSE
  • Slideshow Start - MEDIA_PLAY
  • Slideshow Stop - MEDIA_STOP
  • Photo Information - PERIOD
  • Exit - BACK

Friday, October 11, 2019

3D Camera With Bluetooth Remote Control

Twin Smartphone 3D Camera, Bluetooth Remote Controller, and OWL viewer

Twin Smartphone 3D Camera Lens in OWL viewer

Twin Smartphone 3D Camera in OWL viewer

During the summer 2019, I went to my first National Stereoscopic Association convention, 3D-Con, in Akron, Ohio, USA. It was a great experience. I learned a lot about 3D stereo photography, saw wonderful 3D Art, photos, and videos. I met expert 3D enthusiasts who graciously shared their knowledge and Art. 


3D Camera Phone Rig


Before attending the convention I was experimenting with making a 3D camera rig using twin smartphones mounted with magnets. During the convention my ideas for this 3D camera project came together and I was able to complete a working system upon my return home.

Convention vendors sold all kinds of 3D related gear and Art. At the London Stereoscopic Company booth they sold the "OWL - Stereoscopic Viewer" for viewing stereo cards. I bought my OWL viewer on-line a couple of years ago, but I found out they now offer a Virtual Reality kit that uses a magnetic board for securing a phone to the viewer. I bought the magnet board holding plate from LSC to hold my twin phones in the OWL.

My 3D camera rig consists of two identical Samsung Galaxy S6 smartphones mounted in portrait mode, side by side, in the OWL viewer and held in place by the magnet. I placed a adhesive metal sheet bracket on each phone case to cling to the magnet. One of the S6 phones was used before I upgraded and the other I bought used on EBay. I cut two openings in my OWL viewer for charging cables and a hole for a 1/4 inch tripod mount.

In the OWL the phone camera lenses appear above the OWL frame unobstructed. Looking through the OWL lenses you can see in stereo the camera screen images. This turns out to be a good way to preview the depth of the scene you want to capture. The preview helps you determine if you are too close or too far from your subject besides helping with composition framing. The OWL rig mounted smart phone camera lens separation (inter-axial) is 75 mm in portrait mode. By coincidence the FujiFilm FinePix Real 3D W3 camera has the same lens separation distance. See the rig photos above.


Camera App

Open Camera Remote App Icon

I could have used the Samsung camera app that came with the phone, but I wanted a wireless trigger for both focus and shutter controls.

At the convention there was a discussion group about using smartphones to capture 3D. The Hyper3DPhone app was identified as a possible app for twin Android smartphone cameras. It works by pairing two phones over a Bluetooth connection and triggering one phone sends a message to the other to also take a picture. Although it worked well for triggering two phones nearly simultaneously, its weakness was that I had to touch the camera screen to take a photo and there was a lack of camera control features I use in other camera apps.

For several years I have been extending features of the open source Android Open Camera app to include wireless remote control. My modified app is named Open Camera Remote and you can install it from the Google Play Store . My app uses WiFi broadcast messages to trigger focus and shutter remotely on multiple phones connected to a local area network. Newer versions of the camera app permit control using wired and wireless Bluetooth keyboards, mice, and other game controllers. In addition I added a tiny HTTP Web Server in the app retrieve photos and videos taken by the camera and stored on the phone. This was my choice for a camera app in my 3D OWL rig.


Wireless Focus/Shutter Trigger

3D Camera in Owl Viewer with Bluetooth controller work in progress.
With this 3D camera rig I use two Bluetooth camera controllers. The Open Camera Remote app also allows shutter control over WiFi for which I would need access to a local private WiFi network, and a third phone to use as a remote control trigger. WiFi has a longer range advantage over Bluetooth. 


Bluetooth Camera Remote Shutter


I used two Bluetooth camera shutter remotes as pictured above for my DIY controller. I needed two, one for each smartphone, because two phones cannot share the same Bluetooth remote connection. I took the circuit boards out of the remote and wired them to switches and battery power in a case shown below. 


Home-made Bluetooth Remote for Twin Cameras


The remote control circuit boards were wired to trigger simultaneously with the push of a single button switch. Two diode OR circuits permit a single switch for focus and another OR circuit for shutter release to bypass the built-in controller switches. The controller's large button does focus (volume up, Android key code 24) and the smaller button does shutter release (enter, Android key code 66). The camera app settings have to be set to use the volume up switch for focus.

Synchronization of the cameras is just OK with variable results. Good synchronization of the two cameras depends mostly on how long it takes for the cameras to focus before taking a picture. To make sure focus does not interfere with synchronization, first I touch the screen to select my subject that the camera will focus on. When both cameras are in focus, then I press the shutter button to take a picture. I use the focus switch to focus repeatedly on the subject to make sure focus is achieved before pressing the shutter control switch.

I got better synchronization when I placed the camera apps in manual focus mode. But I found it too cumbersome to make sure the focus distance was the same for each camera.

Here is a video demonstrating the 3D Camera in operation.





Viewing 3D Using the OWL

After taking a picture you can view it in 3D with the OWL by tapping the right bottom corner preview icon on each phone to launch your photo viewer of choice. I use the app I wrote 3D/VR Stereo Photo Viewer in 2D mode for viewing my photos. Other photo viewing apps work just as well. The Back button on the phone returns to the camera app.


3D Smartphone Camera Tripod Mount in OWL 3D Viewer

Since writing this blog last October, it's now mid May, 2020, I have used the rig with twin Samsung Galaxy S8 phones that have a much better camera with improved results. I also experimented with the 3D Stereo Photo Viewer app running on a Rokit 3D Pro phone to retrieve photos from the twin phones for display on its glasses free 3D display screen. That's another future blog posting.

Monday, August 19, 2019

WiFi Remote Capture


Updated 2019-08-28

Introduction


WiFi Remote Capture app is a companion app to Open Camera Remote. It triggers photo or video recording capture for multiple compatible phone cameras simultaneously when Open Camera Remote is active. It emulates wired focus and shutter control cables connected to multiple cameras.

The app transmits capture commands to all the Open Camera Remote apps running on phones that are connected to the same local WiFi network. You can use this app for 3D stereo photography, multi-camera angle video shoots, multi-camera VR panoramic image capture, etc. The local network must support Broadcast messages.

At a social gathering, party, photo shoot, or other group event all the participants need to use the Open Camera Remote app to take photos or videos and all participants have to connect to the same local WiFi network. With the WiFi Remote Capture app you can then trigger all the participants cameras nearly simultaneously to take pictures at the same instant.

The app works with two cameras:

Open Camera Remote App (phone camera)


The Open Camera Remote app listens for broadcast message commands when connected to a local WiFi network. The Open Camera Remote app should be set in either photo or video recording mode before capture with that mode.

The camera app is available at https://play.google.com/store/apps/details?id=net.sourceforge.opencameraremote


Samsung NX500/NX1 Cameras


These cameras have to be modified with NXKS2 firmware that runs a broadcast receiver server. The app will send camera focus/shutter and video record/pause/stop commands using broadcast message commands over a connected local WiFi network. See https://github.com/ajavamind/NX500Capture for information about the camera firmware updates and setup you need to control your NX camera from this app.

Operation

The Focus Hold button can be pressed and released several times and will cause the Open Camera Remote app to show the network address assigned to the mobile phone. This is a good indication that BROADCAST messages are reaching the Open Camera Remote app.

The button at the top of the display that shows the next filename to send to connected apps. You can toggle the button to send either a time stamp or number for the filename. The time stamp selection is recommended.

You can change to video or photo modes by pressing the three dots in the upper right corner of the display.

Press the shutter button to send a focus and then press again to send the shutter trigger message.

Helpful Information

It is necessary that you close and restart the WiFi Remote Capture and Open Camera Remote apps after you change your WiFi connection in Settings for all your devices using these apps.



Camera Synchronization

Here are some tips for triggering multiple camera phones (Open Camera Remote app) nearly simultaneously. These changes are not all necessary, but give you a chance to more closely synchronize all your phone cameras at the same time.

1. Use a local WiFi router network not connected to the Internet.

2. In Google Chrome, log off your account to prevent background operations from slowing down network signaling and processor time used by the camera app. This step is not required.

3. In Settings Turn on Airplane mode. This will turn off all radios. Next in Settings turn on WiFi only. This will let you use WiFi without any connections to your mobile phone carrier.

4. Exit all applications. Next, optimize using Settings->Device Maintenance->Battery->Save Power to put to sleep background apps.

5. Start the Open Camera Remote app.

6. Use a separate phone or tablet running WiFi Remote Capture for triggering your multiple phones.

7. Make sure each camera phone can focus on the subject(s). If a camera phone has to hunt to get into focus, it will be delayed and not fire its shutter with the other phones. This means use manual or auto-focus, not continuous focus options in the Open Camera Remote app.

When finished taking photos all your photos, be sure to restore your previous Settings by turning off Airplane mode and logging back into your Google Chrome account.

Troubleshooting

The Pixel XL phone with Google WiFi assistant has this feature turned on by default. This phone feature adds extra WiFi security and VPN that blocks standard IP BROADCAST messages. Please turn off WiFi Assistant and retry.

Chromebook blocks BROADCAST messages.

Some Telecom supplied WiFi routers, for security reasons, block BROADCAST messages on the routers local network. In this case you must use your own local WiFi router. When BROADCAST messages are not passed through your router, there is no indication of a failure, so the apps will just not work and there is no feedback that this is a problem.

Your WiFi signal may be competing with other routers on the same channel, causing interference and dropped shutter focus/trigger messages. To avoid interference, you will need to reconfigure your router channel to a quiet 2.4 GHz channel or 5 GHz channels. A WiFi Analyzer app can help you find a quiet channel for your router. Please see your router documentation explaining how to change the default WiFi channel. Make sure your phones have a strong enough WiFi signal at each phone location and WiFi signals are not blocked by walls, etc.

Thursday, August 8, 2019

Open Camera Remote





Last updated 2019_09_10
Previous update 2019_09_02



Introduction




Open Camera Remote is a free camera application for Android phones and tablets. It is a modified version of the full featured, open-source, free Open Camera application written by Mark Harman. For information about using the camera app features see Mark's website http://opencamera.org.uk/



Open Camera Remote adds features that give you remote control of your phone camera focus and shutter trigger over a local WiFi network. It does this by accepting broadcast control messages to operate focus and shutter release for the camera when sent by a separate companion application WiFi Remote Capture. The remote control camera feature is always on, waiting for a trigger, you only need to connect your phone to a compatible WiFi network.

The main goal of the Open Camera Remote app is to trigger multiple cameras and capture photos or videos nearly simultaneously from many phones running this app and all connected on the same local WiFi network. Depending on your local network configuration, the number of camera phones triggered can range from up to 253 or 4093 phones maximum.

Some example applications for the Open Camera Remote app are:
  • 3D Stereo photography using twin phone cameras
  • Multi-camera photos for 360 panorama and composite stitched shots
  • Multi-camera photo capture for 3D modeling
  • Multi-camera videos
  • Multi-photo 3D Lenticular image capture
  • Large group event or party activities for simultaneous photo or video capture
  • Photo booths using remote trigger with single or multiple cameras
  • Wild life photography where you cannot get close without disturbing your subject (for example a bird nest).
  • Multi-phone camera single or group selfies or environment shots.


Features


Remote Control

The camera app receives focus and shutter release control messages broadcast over a local WiFi network sent by the WiFi Remote Capture app. The message contains the filename to use for storing the photo or video in each receiving camera phone app. The Remote Capture app can send either time-stamp or numbers for the filename.

To help identify photos and videos from each phone, especially if you merge photos into a folder, you should set a filename suffix. Go to the gear Settings - More camera controls... enter Save photo suffix, Save video suffix. The suffix string appended to the filename helps you identify from which phone camera a photo or video was shot. This feature allows you to merge all the photos from multiple cameras into a single folder for editing without filename conflicts.

I use _l and _r for stereo left and right camera suffixes. For other multiple camera setups, I use a sequence _1, _2, etc. You can choose your own multi-camera photo identification strategy.

Sequential 3D Stereo Photography

You can take 3D Stereoscopic left and right eye photos using the "chacha" sequential capture method. Like the dance first you take the left eye photo, move about 2.5 inches (65 mm) to the right and then take the right eye photo. In the gear Settings select the 3D ChaCha Mode. When selected this option shows a red line on the left in the camera preview. After you take the left photo, the red line appears on the right side of the preview screen. The left and right eye photos have the fixed suffixes "_l"  and "_r" appended to the corresponding photo filename, overriding the settings suffix entered. The photos are stored in the Save Location you choose in gear Settings - More Camera Controls.

To help you align the right eye photo vertically with you left eye photo, select the Settings - Align With Last Photo option. When set this option shows the left eye photo in the camera preview so you can align with your right eye photo preview. You can place your phone in a stationary folded V-shaped cardboard rail to help with vertical alignment by sliding the camera phone in a level channel.

You can view your 3D photos directly by purchasing a 3D/VR Stereo Photo Viewer app and select this app as your photo viewer using the photo preview thumbnail button. The 3D viewer app also works with 2D photos and many formats of 3D photos, and can be used with Google Cardboard VR headsets. 

The 3D/VR Stereo Photo Viewer app has an option to launch the WiFi Remote Capture app from the viewer so you can trigger your twin camera phone rig. You will need to install the WiFi Remote Capture app on your phone.

The Open Camera Remote app does not align your left and right eye photos. For this you will need Stereo Photo Maker that runs on Windows or Mac computer or you can install the 3DSteroid Android app.

Note that the ChaCha option is independent of the remote control feature, and could be used at the same time. But I don't know a situation you might want to used these combined features except when your phone cameras move horizontally in unison.
  

Number Format For Filename


I also added an option that lets you select a time-stamp or number for the filename with the Time/Number format for filename option. There is also an option to reset the photo and video filename number. This is not used with remote control but is for another way to name photo or video filenames, besides a time-stamp.

HTTP Server


The app has a built-in minimal Web HTTP Server to help with listing and transferring photos or videos to another phone or computer on the local network. See below for more details.

Mouse Control

With version 1.46.6 I added the capability to use a wired mouse (connected to the USB phone port using an OTG [on-the-go] cable or a connected Bluetooth wireless mouse) to control the camera shutter with a left button click. The right mouse button will display the last photo. The mouse wheel allows zoom control of the camera.

You would use a wired mouse to your phone to take photos with a single phone camera mounted on a tripod when you don't want to use the WiFi remote feature.

Setup


For security reasons some local network WiFi routers block broadcast messages. This prevents Open Camera Remote from working as intended. For example, my Telecom Internet service provider modem and router blocks broadcast messages in my home local WiFi network. Public WiFi networks outside my home usually block broadcast messages too. 

The solution is to set up and use your own private WiFi network router that allows broadcast messaging. A private local WiFi network not connected to the Internet also has an advantage of faster simultaneous camera control because network messages are not delayed by other Internet traffic. All you have to do is change each of your phone's WiFi connection to your alternative network.

I also recommend you place your phone in "Airplane Mode" to turn off all radios in the phone, and then selectively turn on only WiFi and make your connection. This step is not required but it helps to give you more simultaneous camera triggers by avoiding delays.

For my local network I bought a tiny home/mobile WiFi router, TP-Link 150 Mbps Wireless N Nano Router (model No. TL-WR702N). It can be powered with a battery and taken wherever I go to shoot multiple simultaneous photos or videos. I do not connect it to the Internet. I use the default "Access Point Mode" and set up my own SSID network name, "Mobile Photo Net", and password with a laptop computer.  


TP-Link also sells a faster router, TP-Link 290A (model No. TL-WR902AC version 3.0). With this router, you can transfer photos faster from your phones using the built-in Web HTTP server provided in the Open Camera Remote app.

Each router has a CAT5 Ethernet port so you could have an Internet connection if you wish. But the strategy for simultaneous capture is to reduce competing internet messages that slow down camera response time. You may also want to shutdown other apps for the same reason. And if you may want to log out of other services too, like email and messaging. However these steps are not necessary, just an option to consider.


WiFi Remote Capture


The free companion app WiFi Remote Capture sends broadcast camera control messages. It uses a simple protocol documented at https://github.com/ajavamind/NX500Capture and describes the command format. Besides phones this app can trigger the Samsung NX500 and NX1 cameras remotely on the local network. The Samsung cameras have to install a firmware hack.

The WiFi Remote Capture app has focus and shutter buttons and can switch between photo and video modes. Use the focus button to toggle the phone display to show its URL.

The WiFi Remote Capture app also accepts Bluetooth connected device volume up key so you can use an external controller instead of tapping the screen. See Twin NX500 Camera 3D Stereo Rig Using Remote Capture

Using a Linux computer you can also send broadcast messages using the Bash command line to trigger phones on your local network. For example:
echo "V0003" | nc -w1 -u -b 192.168.1.255 8000
will capture a phone video and save to VID_0003_1.mp4 

And you can write  Python or Processing code to do the same.

To test to see if you can broadcast messages on your local network successfully, press the Remote Capture app, Focus button, several times. You should see the  phone's IP address displayed on each screen. This confirms your remote trigger. If you do not, there is something wrong with your WiFi connection or broadcast messages are blocked.


HTTP Server


Web Browser

With the app's built-in Web HTTP server you can transfer your photos or videos with a Web browser. This only works with your local network while the camera app is running while visible or in the background. Use the HTTP server at your own risk. 

Alternatively you can transfer your photos or videos to another phone or computer using a separate FTP app or other methods supplied by the phone manufacturer, and other apps in the Google Play Store.

By default the server is disabled. In gear Settings there is a option to turn on the HTTP server. 

Use the gear Settings - Pairing QR Code option to show the URL of the phone Web server as a QR code or text. To see a directory of the photos or videos, type in the text URL into a Web browser search line from another computer or phone. You should see a listing of each file. Click on the filename to download and display in the Browser download folder. I use Google Chrome. Unfortunately at this time the transfers can only be done one photo or video at a time.

With the QR Code display in Settings - Pairing QR Code you can scan the URL to avoid typing using a free Barcode Scanner app by the ZXing team. The app will automatically show the directory in a browser.

Viewing Photos with 3D/VR Stereo Photo Viewer


You can view and save your photos from the Open Camera Remote HTTP server directly with the 3D/VR Stereo Photo Viewer app. This viewer app has menu features to scan and Save QR Code URLs (using the external ZXing app) and store the URL for a single phone camera photo server, and left and right camera photo servers. Using the View URL Link menu selection in the viewer app you can transfer and view a photos directly from a Open Camera Remote app. There is also an option in the viewer Settings to automatically save transferred files in designated folders. It is recommended you use time-stamps exclusively to order your photos.

Troubleshooting

When the WiFi Remote Capture app cannot seem to trigger the Open Camera Remote app and you know your router supports broadcast messaging, you can try closing the Open Camera Remote app and restarting it. Closing and restarting the WiFi Remote Capture app may also help. When you change your WiFi connection these steps are necessary and required.


Open Source Code Attribution


The open source code for Open Camera Remote (modified from version 1.46 Open Camera, copyright 2013-2019 Mark Harman) is available at https://sourceforge.net/u/ajavamind/opencamera/ci/master/tree/
Open Camera also uses additional third party files see online help for full licences and attributions. Andy Modla wrote the modifications for Open Camera Remote, modifications copyright 2016-2019.

Released under the GPL v3 or later.

Google ZXing ARCODE license:
http://www.apache.org/licenses/LICENSE-2.0 

The Nanohttpd HTTP server is Copyright (c) 2012-2013 by Paul S. Hawke, 2001,2005-2013 by Jarno Elonen, 2010 by Konstantinos Togias All rights reserved.

Network library for processing that supports the UDP protocol was written and copyright by Andreas Schlegel, GNU Lesser General Public License version 2.1. http://www.sojamo.de/libraries/oscP5 
Modifications to this code were made by Andy Modla.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Redistribution of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

Redistribution in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

Neither the name of the NanoHttpd organization nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANT-ABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.