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. See 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. For the clearest image, position the camera 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. I built my birdhouses with windows measuring 1 by 2-1/2 inches (2.5 by 6.4 cm), not knowing whether this is an ideal size. I suggest experimenting with larger sizes than this for better light.

To distribute the light more evenly and prevent predators from seeing inside, use frosted or translucent 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.

Instead of acrylic, you can use Plastic Corrugated Board, Item # 10567988 from Michael's Stores. It is easy to cut with a hobby knife. For extra strength, glue two layers together with super glue with the corrugated lines running perpendicular to each other.

Windows can potentially let in too much light, causing the birdhouse to get hot like a greenhouse. If the box is out in full sun, be careful to keep the interior temperature reasonable. You can monitor the temperature with a Taylor 1-inch dial (or similar) thermometer inserted through a hole drilled in the side of the box. For more information on bird box temperature control, 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 birdhouse camera is designed 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.

Cameras can be powered by battery, but this requires recharging/swapping of batteries at regular intervals. A 12V motorcycle battery works for about 4 days.

Green Backyard Bird Box camera kit

The Green Backyard Bird Box Camera HD Network Cable Connection 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 the computer app and mobile app let you monitor the video, save video clips, and play stored clips. The computer app 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

Note: The video demonstration uses the slightly older CMS5 app, similar to the current VMS app. Some commands have changed but basic operation is the same.

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. I used HandBrake to make the video at the top of this web page.

These are the video formats produced by the camera tools:


Exterior camera

You can optionally use a second camera to see the outside of the birdhouse. You can watch the birds entering and leaving the box, and see interlopers or predators that trigger defensive behaviors inside the box. 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 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, no spaces):

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

Example (should be all in one line, no spaces):

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 VMS, click Device Manager, then click the pencil icon in the Operation column.

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

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

Example (should be all in one line, no spaces):

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". Some camera brands do not support RTSP, such as Blink.

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 from each of the four sides.

To make a white border around an inset source video, first create a white rectangle image file using a "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:

VMS Live View > right-click camera name > choose Remote Config > Encode Config

Compression: H.265X
Resolution: 720P
Quality: Good
FPS: 20
Stream Control: VBR
BitRate(Kb/s): [greyed out]
I Frame Interval: 2
Video/Audio:  [x]  [x]

Static Encode Config: main profile
Smart Encode: Stop

Reolink camera settings:

Reolink Windows tool > camera's gear icon > Camera - Stream

Clear
Resolution: 2560*1920
Frame Rate (FPS): 20
Max Bitrate (Kpbs): 2048

Fluent
Resolution: 640*480
Frame Rate (FPS): 7
Max Bitrate (Kpbs): 160

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 any of the following URLs:

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

To find out your_channel_name, go to YouTube Studio and click the magic wand (Customization) 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

The Customization page also lets you choose a handle.

Specify handle

End live streaming

To end live streaming:
  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've encountered the following issues in the past.

  • The camera goes offline and doesn't reconnect
  • Camera won't record to SD card
  • Live-streamed video and audio out of sync

  • The camera goes offline and doesn't reconnect

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

    The Ethernet connection at the camera is prone to corrosion due to exposure to moisture (rain, fog, dew) with voltage differences between connector pins. Disconnecting and reconnecting the cable might dislodge enough corrosion to re-establish the connection.

    If not, disconnect the cable from the PoE injector, disconnect the cable plug from the camera's socket, and examine the metal pins of both the plug and socket. Remove any visible corrosion by scraping the metal pins with a pointed tool or fine sandpaper. Blow away the dust, then put everything back together and see if if works.

    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 VMS app on your computer, in Live View mode, right-click the camera name, choose Remote Config, click Smart Alert, and under Motion Detect, make sure the Record box is checked. Also check the Sensitivity and Region settings, and the Record Config settings.

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

    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, version v1.1.
    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




    2024 Updates

    The birdhouse construction video recommends epoxy glue to install the skylight windows. I have since then found that epoxy resin is too brittle, resulting in cracks around the window as the wood expands and contracts with changes in humidity. Instead, use clear outdoor caulking. Allow a 1/8-inch (3 mm) gap between the acrylic window edge and the wood, and fill the gap with caulking. The flexible/stretchable caulking allows for wood expansion while keeping the gap sealed.

    I found an inexpensive and easy-to-use window material at Michael's Stores, Plastic Corrugated Board, Item # 10567988. You can cut it with a hobby knife. It's not as strong as acrylic, so for extra strength, glue two layers together with super glue with the corrugated lines running perpendicular to each other.

    I encourage experimenting with larger windows to provide more light, such as 1.5 or maybe even 2 inches wide, instead of just 1 inch -- let me know if the birds take up residence.

    For more information

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

    Green Backyard Tips for Bird Box Camera Installation



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