Birdhouse Nest Box Camera Installation

Bird box window construction, interior/exterior cameras, live-streaming using OBS and YouTube




Live Stream     Video Clips

Traditional observation of cavity-nesting birds requires opening the nest to expose the eggs or nestlings. This can disturb the birds, at worst causing the adults to abandon the nest or the young to fledge before they're ready.

By installing a web camera inside the birdhouse, you can continuously observe nest-building, hatching, feeding, and fledging behavior without risk of disturbing the birds. You can live-stream the nest for public viewing and record the video stream for later review or research.
These are the cameras and software applications I use:

Birdhouse Interior Camera

Birdhouse Exterior Camera

Video Viewing & Processing Tools

Live-Streaming Tools

There may be similar products I haven't tried that are also good.



Birdhouse construction

To install the camera inside an existing birdhouse, cut a notch for the wire to come out and attach the camera to the ceiling or an inside wall. You can also cut some windows for better lighting, as the entrance hole alone is a poor light source.

For good image quality, the birdhouse should have windows that cast light toward the nest and away from the camera lens, as shown in the following video, "Birdhouse with ceiling webcam and natural-light windows."



Window positioning and lens flare

The camera should not be able to see any of the bright outdoors through windows or the entrance hole. Otherwise, it tries to adjust the exposure for both the inside and outside, making the inside too dark. You get the clearest image with the camera positioned to see only the inside.

To prevent lens flare, add pieces of black cardboard that block exterior light from shining onto the lens, including light sources just outside of the camera's field of view. Lens flare causes a foggy, washed-out look.

Window construction

The windows should be big enough to admit plenty of light, but small enough that the birds won't fear access by predators. Without a doing lot of careful experiments, it's not possible to know the ideal size. I built my birdhouses with windows measuring 1 by 2-1/2 inches (2.5 by 6.4 cm).

To distribute the light more evenly and prevent predators from seeing inside, use frosted or translucent acrylic windows, such as color 2447 acrylic. You can make clear windows frosty by sanding them with fine sandpaper. Alternatively, you can put waxed paper on the inside of the window.

Windows can potentially let in too much light, to the extent that the birdhouse works like a greenhouse. If the box is out in full sun, be careful to keep the interior temperature reasonable. For more information, see Sialis Beat the Heat and Cold.

If you would like to see the building plans for the birdhouse in the video, send a request to the email address at the end of this article.



Interior Camera

Although you can use a general-purpose webcam inside the birdhouse, a camera designed for this purpose is made small to easily fit inside and has its focus and infrared illumination optimized for close viewing.

Wi-Fi vs. PoE (Power over Ethernet)

Camera makers offer both Wi-Fi and PoE (Power over Ethernet) cameras. Both types require a wired connection for power:
To find out if Wi-Fi can reach your birdhouse, take your smartphone there and see how many bars you get when you connect to Wi-Fi. The more bars, the better.

In a PoE connection, a single Ethernet cable carries both data and power. A type of AC adaptor called a PoE injector "injects" the power into the cable. A PoE data connection is more reliable than Wi-Fi, but you need a physical pathway for a cable between your router and the birdhouse, for example, through a garage door, open window, or attic vent.

Green Backyard IP bird box camera kit

The Green Backyard IP bird box camera kit includes a camera, a PoE injector, and a 60-foot (20 m) Ethernet cable. You can buy a longer cable if needed, up to 300 ft (100 m). After you wire the camera, install the associated software applications:
Both applications let you monitor the video, save video clips, and play stored clips. The CMS5 application offers more controls and settings for configuring camera operation.

The following video introduces camera usage and video capture.

Capturing Video from the Green-Backyard camera

Video data formats

The software tools generate video data files in various formats. You can view videos in most formats using the free, open-source VLC media player. The tool also allows you to read in a video and write it out in a different format.

The HandBrake video transcoder is a free, open-source tool designed specifically to convert videos from one format to another, and to perform various changes. For example, you can resize a video to a different resolution for web publishing or convert just a specified time segment of a clip.

These are the video formats produced by the camera tools:


Exterior camera

You can optionally use a second camera to display the outside of the birdhouse. This is especially useful for seeing interlopers or predators that trigger defensive behaviors inside the birdhouse. You can choose from a variety of webcams and security cameras, any of which can serve well.

To prevent lens flare, make a lens hood or shade to block direct sunlight and bright skylight from shining directly into the lens.

To live-stream or record the exterior and interior views together in one frame, combine them in OBS Studio. Webcams typically have a wide-angle view, which you can crop in OBS.



Live-streaming on YouTube

To live-stream your camera views on YouTube, do the following:
  • Install and configure OBS Studio
  • Set quality-vs-data options
  • Create a YouTube account
  • Start live streaming
  • Set the live stream URL

Install and configure OBS Studio

OBS Studio is a free, open-source tool for video live streaming and recording. You specify the video input sources and how to display them in a workspace. You can crop and resize each video source and control its position in the workspace, and individually control the audio from each source.

OBS Studio tool


To prepare OBS Studio for streaming:
  1. Download, install, and open the OBS Studio tool.

  2. Click the Settings button, then the Video icon. Set both of the resolution fields to 1280x720, then click OK.

  3. At the bottom of the Sources box, click the "+" icon and choose Media Source.

  4. Under "Create New," enter a name for your source, like "Bird box cam 3", then click OK.

  5. In the Properties for "Bird box cam 3" dialog box, uncheck [ ] Local File.

  6. In the Input field, enter the Real Time Streaming Protocol (RTSP) string for your camera (see below), then click OK. The live video should appear in the workspace.

  7. Resize and move the video frame as needed to fill the desired part of the workspace.
Green Backyard RTSP string (put all this in one line):

rtsp://camera_ip_address:554
   /user=user_name
   &password=your_pswrd
   &channel=1
   &stream=0.sdp?real_stream

Example (put all this in one line):

rtsp://192.168.1.79:554
   /user=jane&password=sordfish
   &channel=1&stream=0.sdp?real_stream


To find out your Green Backyard camera IP address (IP domain), user name, and password, open CMS5, click Device Manager, then click the pencil icon next to your camera name.

Reolink RTSP string (put all this in one line):

rtsp://user_name:your_pswrd
   @camera_ip_address:554
   //h264Preview_01_main

Example (put all this in one line):

rtsp://jane:gulltung
   @192.168.1.63:554
   //h264Preview_01_main


To find out your Reolink camera IP address, user name, and password, open the Reolink Windows app and click the pencil-and-paper icon next to your camera name.

Other camera RTSP string:

Do a web search for "camera_brand_name RTSP".

To combine multiple sources in the workspace, repeat steps 3 through 7 for each source. Sources appearing higher in the Sources list are displayed in front of those lower in the list, like "layers" in PhotoShop.

To crop a source, right-click that source in the Sources box and choose Filters. At the bottom of the dialog box, under Effect Filters, click "+" and choose Crop/Pad. Specify a name such as "Crop1" and click OK. Then enter the number of pixels to crop off of each of the four sides.

To make a white border around an inset source video, first create a white rectangle image file using the Microsoft "Paint" tool. In OBS, add the image file as a source (Sources > + > Image). Resize the white rectangle and place it where you want in the workspace. In the Sources list, move the rectangle to the position between the two camera sources.

Set quality-vs-data options

You can specify the data stream intensity of the source devices and OBS Studio output stream. A more data-heavy stream can produce finer, more highly detailed images and less motion-blurring, at a cost of greater data usage.

For the OBS output that I live-stream on the Internet, I use a data rate of 2200 Kbps (kilobits per second). This is equivalent to 1 GB (gigabyte) per hour, similar to streaming movies on Netflix. Continuous 24/7 live-streaming at this rate uses 720 GB per month. Internet service providers often impose a monthly data cap of around 1,000 GB (1 Terabyte).

You can use the following settings as a starting point to determine the optimum configuration for your cameras, computer, and Internet service level.

Green Backyard camera settings:

CMS5 > Device Config > select camera > Encode Config

Compression: H.264
Resolution: 720P
Quality: Good
FPS: 20
Stream Control: CBR
BitRate(Kb/s): 2908
I Frame Interval: 2
Video/Audio:  [x]  [x]

Static Encode Config: main profile
H264+ Enable:  [ ]

Reolink camera settings:

Reolink Windows tool > Device Settings (magnifying-gear) icon > Record Encode

Stream Type: Clear
Record Audio:  [x]
Resolution: 2560*1920
Frame Rate (fps): 20
Maximum Bitrate (kpbs): 2048
H.264 Profile: Main

OBS Studio streaming settings:

OBS > Settings > Output > Streaming

Video Bitrate 2200 Kbps
Encoder: Hardware (your_computer's_encoder)
Audio Bitrate: 128
[ ] Enable Advanced Encoder Settings

Create a YouTube account

  1. If you don't already have a gmail account, create one at gmail.com.
  2. Go to YouTube Studio (studio.youtube.com) and log in.
  3. At the top, click the Create button and choose Go Live.

  4. Create Go Live

You might see the message "It takes 24 hours to activate your account for live streaming. Once activated, you can go live instantly." After a day, proceed with the next step.

Start live streaming

To prepare YouTube Studio (studio.youtube.com) to accept live streaming:
  1. Click the Create button and choose Go Live.
  2. Choose Right Now and Streaming Software.
  3. Set the Create Stream options as you want.
  4. To the right of the Stream Key field, click the Copy button.
YouTube live stream setup

In OBS Studio, to start live streaming:
  1. Open OBS Studio. It should display your video sources.
  2. At the bottom right, click the Settings button.
  3. In the Settings dialog box, click the Stream tab.
  4. Paste the key into the Stream Key field (click, Ctrl-v), then OK.
  5. Click the Start Streaming button. You should see streaming start in YouTube Studio.
To verify your live stream:
  1. Under a separate browser tab, open YouTube Studio.
  2. On the left, click the Content (YouTube play) button.
  3. At the top, click Live.
You should see your "Live now" video at the top. In future sessions, you'll also see your "Live replay" videos, archives of your past live streams.

Live Now & Live Replay

YouTube and OBS remember all your settings. The next time you want to live-stream, simply open the YouTube Studio live-streaming page and OBS, then click Start Streaming in OBS.

Set the live stream URL

With your live stream visibility set to Public, anyone can watch it using either of the following URLs:

  https://www.youtube.com/channel/your_channel_name/live
  
  https://www.youtube.com/c/custom_URL_name/live

To find out your_channel_name, go to YouTube Studio and click the magic wand icon on the left, then Basic Info at the top. Under Channel URL, the long gobbledygook string is your channel name. Below that, you can create a short Custom URL for your channel.

Basic Info
Channel Name and Custom URL

End live streaming

To end live streaming, do the following:
  1. In OBS, click the Stop Streaming button.
  2. In the YouTube Studio live page, click END STREAM.
  3. In the dialog box, click END to confirm.
  4. YouTube asks if you want to edit the video. Always choose DISMISS.
When you end the live stream, an archive of the stream is automatically saved as a "Live Replay" video under its own URL. To see a list of replay videos in YouTube Studio, click the Content button on the left, then Live at the top.

If you want to edit the archive video (for example, Title or Description), restart the live stream first. Otherwise, you edit your future live stream as well as the archive.

There is a limit of about 12 hours for each saved archive, so if you want to keep a continuous archive covering a days-long stream, you need to stop and restart the stream once every 12 hours.



Troubleshooting

I encountered the following issues with the Green Backyard camera, related apps, and live streaming.

  • The camera goes offline and doesn't reconnect
  • Camera won't record to SD card
  • Buzzing sound heard in audio
  • Camera clock falls behind
  • Live-streamed video and audio out of sync

  • The camera goes offline and doesn't reconnect

    To check the camera status, open CMS5, click Device Manager, and look in the Connect column. Sometimes the camera reconnects by itself. If not, you can recover by powering down the camera. Disconnect and then reconnect the Ethernet cable between the PoE injector and the camera.

    While the camera power is off, the camera's clock stops running. After power-up, update the clock time if you want it to be exact.

    Camera won't record to SD card

    You only need to install an SD card into the camera if you want to have the camera automatically record video clips when motion is detected in the camera view. This is explained in my instructional video, Capturing Video from the Green-Backyard Bird Box Camera.

    In the CMS5 app on your computer, choose Device Config, select camera, choose Video Detect, and make sure Record Enable box is checked. Also check all the Video Detect settings.

    If recording still doesn't work, open the iCSee app on phone, open camera page, tap gear icon, tap Smart Alarm, make sure Human Shape Detection is set to OFF, save changes. (As there are no tiny humans in the nesting box, all motion is ignored in that mode.)

    Buzzing sound

    You hear a constant buzz when you watch the live video with sound or play back a video recording. The microphone stub poking out of the camera back is getting interference from the adjacent Ethernet PoE cable.

    Using a small screwdriver, open the camera and tuck the microphone stub inside the camera, along the side that has space for it. Close the camera and replace the screws. The buzz should go away.

    Put microphone inside camera

    Camera clock falls behind

    Camera clock display

    The camera clock stops running when there's no power, but it remembers the stopped time when it restarts, so it falls behind by the duration of the power outage.

    Here's an easy way to set the camera clock to the current exact time:
    1. Open the iCSee app on your phone
    2. Tap your camera
    3. Tap the gear icon
    4. Tap "About"
    5. Scroll down and tap "Device Time"
    6. Under "Update Time," tap OK

    Live-streamed video and audio out of sync

    When you start streaming, the video and audio are wonderfully synchronized. However, after a while, you hear something first and then see the action, with a delay of 1 or 2 seconds or more.

    The video data steam takes longer for OBS to process than the audio stream. After a while, the video lags behind the audio due to the backlog of video data.

    To fix it, stop and restart the lagging input source. In the Sources list, click the "eye" icon to shut off the input stream, wait 2 seconds, and click it again to restart the stream. This clears out the data queue and restarts the video/audio stream, freshly synchronized.

    Eye icon in sources list

    So that you don't have to go running back to your computer every 15 minutes to click the "eye" icon, you can automate the process using the AutoHotKey application for Windows. First do the following in OBS:
    1. OBS Settings > Hotkeys
    2. Scroll down and find your input stream.
    3. Click in the Stop field and type Ctrl-Shift-F4
    4. Click in the Restart field and type Ctrl-Shift-F5
    5. Click OK.
    OBS hotkey settings

    Now you can use the keyboard shortcuts Ctrl-Shift-F4 and Ctrl-Shift-F5 to stop and restart the input stream. If you have multiple inputs, you can do the same for each one using a different key sequence, such as Ctrl-Shift-F6 and Ctrl-Shift-F7.

    To install and configure AutoHotKey:
    1. Download and install the AutoHotKey application.
    2. In a blank area of the desktop, right-click and choose New > AutoHotKey Script.
    3. A new AutoHotKey ".ahk" icon appears on your desktop. Change its name to ResetOBS.ahk

    4. AutoHotKey desktop icon

    5. Right-click the icon and choose Edit Script. The script is opened in Notepad.
    6. Open the text file ResetOBS.txt.
    7. Copy the whole block of text in the ResetOBS.txt file, then paste the text into the Notepad editor below the existing few lines of the script.
    8. Read the script so you can understand it. You might want to edit the numbers in the "SetTimer" and "Click" instructions.
    9. In Notepad, execute File > Save, then File > Exit.

    To use the script, double-click the ResetOBS.ahk icon. You hear 2 beeps, then the mouse moves to the upper-right area of your desktop and clicks there to bring the OBS window to the front, making it the current window (in case it's not already). Then it automatically types the keys to stop and restart the streams. It repeats all this once every 15 minutes.

    To stop the script from running, go to the green "H" icon in the system tray, right-click it, and choose Exit.

    Exit AutoHotKey


    For more information

    Nestwatch, the Cornell Lab of Ornithology, Installing a Nest Box Camera

    Green Backyard Tips for Bird Box Camera Installation



    © 2022 Gray Chang
    Comments? Questions? SFBayNestCam [at] gmail [dot] com