Video plus data streaming with racecapture: Difference between revisions

(Created page with "==Install ubuntu 22.x== Install ubuntu 22 in the typical way. * Select Automatic Login without password ==Disable keyring popup== [https://linuxconfig.org/how-to-disable-keyring-popup-on-ubuntu Disable the keyring popup] ==Install dependencies== <pre> sudo apt-get install v4l-utils tk gstreamer1.0-plugins-bad gstreamer1.0-libav </pre> ==Enable access to RaceCapture serial port== <pre> sudo adduser $USER dialout sudo echo "ATTRS{idVendor}==16d0, ATTRS{idProduct}==07f1,...")
 
 
(120 intermediate revisions by the same user not shown)
Line 1: Line 1:
==Install ubuntu 22.x==
=Introduction=
Install ubuntu 22 in the typical way.
This guide shows you how to add video+data livestreaming to your existing RaceCapture system.
* Select Automatic Login without password
 
After following this guide, you will have:
* 2-camera video with picture-in-picture
* Rich, realtime graphics overlay
* Broadcast to youtube or your preferred streaming provider via an in-vehicle cellular hotspot
* Local video recording
 
=System Overview=
Video+data streaming is enabled by using a separate streaming/encoding device. As RaceCapture supports multiple simultaneous connections, an existing dashboard can be retained.
[[image:RaceCapture video+data livestreaming system diagram.png]]
 
==Cost==
The cost for adding video+data livestreaming to your RaceCapture system can range '''between 0 and 800 USD''', depending on the parts you may already have on hand.
 
==How hard is it to setup?==
'''This project requires following instructions''', including:
* Installing an operating system
* Typing computer commands
* Plugging in cables
* Editing configuration files
* Selecting options in an application
 
This ability is within the realm of someone with moderate computer skills. If the instructions seem daunting, find someone to help you along.
 
* For those who crave convenience, we will also be offering a pre-packaged setup that take care of most of the setup steps.
 
==Production State==
Since it is based on existing RaceCapture technology (RaceCapture hardware and RaceCapture app), the core of the system is very stable.
 
New components that add video rendering, encoding, and streaming will be improved through your testing feedback and rounds of updates.
 
As of this writing, several existing RaceCapture users have put the system through it's paces with great results.
 
So far we were very pleased with the stability and performance, and we will continue to improve the system through software updates.
 
===A demonstration===
Here's the Session from the inaugural test (with sub optimal camera exposure settings and low quality microphone)
 
<youtube>zVUJwnGoCnI&t=2990s</youtube>
 
===Experimental===
While we consider this '''experimental''' - it is also a free software upgrade for a system that was never originally designed for this purpose.
 
With your testing help we can steadily improve it and ultimately provide an incredibly cost effective yet very full-featured and high performance system that rivals solutions costing upwards of $5000 USD.
 
=Parts you will need=
==Your existing RaceCapture system==
The RaceCapture system will provide access to your car's sensor data (CAN bus or analog sensors), high performance GPS, Accelerometer / Gyro sensors, lap timing and other motorsport related statistics.
===Compatible Systems===
* Any current or previous RaceCapture or PodiumConnect system will work.
[[image:racecapture_pro_mk4_connectors_1024.jpg|520px]]
[[Image:PodiumConnect_MK2_3quarter_1024.jpg|270px]]
[[Image:rct_mk3_3quarter.jpg|300px]]
 
==Rendering/Streaming computer==
A tiny form-factor computer is used to receive data from RaceCapture and is responsible for video+data overlay, encoding, and broadcasting the video to youtube or similar streaming platform.
===Recommended===
* [https://www.amazon.com/gp/product/B0BCVCZDH3 Beelink SER5]
The Beelink SER5 is our recommended choice as it is powerful, cost effective, and provided in a compact and lightweight form factor.
 
[[image:beelink_ser5_micro_pc.jpg|500px]]
 
===Alternatives===
A micro system with an Intel I5-6500 through I5-7600 + SSD + 8GB RAM is an acceptable option as well. This may be a system you already have or a surplus system you can get at minimum cost.
* Look for these options:
** SSD (required for ruggedness - smallest size is fine).
** Smallest RAM option is fine (typically 8GB)
** Included WiFi - for connection versatility
====Candidates====
* Dell Optiplex 7050 micro desktop: [https://www.ebay.com/sch/i.html?_nkw=Dell+Optiplex+7050+Micro+Desktop+Computer&_sacat=0 Ebay search] (nice because most have wifi)
[[image:dell-optiplex-7050.jpg|510px]]
* HP EliteDesk 800 G3 Mini: [https://www.ebay.com/sch/i.html?_nkw=HP+EliteDesk+800+G3+Desktop+Mini&_sacat=0 Ebay search]
[[image:HP-elitedesk-800.jpg|550px]]
 
==12v DC to DC converter==
A 12v-19v DC to DC converter is needed to power the rendering/broadcasting computer in the vehicle. This converter avoids needing an AC inverter in the car, making for a clean installation.
* '''Tips''':
** Choose a device that has sufficient power capacity (100W minimum)
===Recommended===
These have been tested to work:
* [https://www.amazon.com/gp/product/B07TT2F95L KFD 100W universal car charger]
[[image:KFD-100W-DC-to-DC-converter-12v-to-19v.jpg|500px]]
* '''Tips''':
** We recommend cutting the cigar lighter connection and hard-wiring the power to a 15A circuit. (center conductor is positive).
 
==Cameras==
You will need 1 or 2 cameras for capturing and rendering video.
===Recommended Camera Kit===
Autosport Labs will soon provide a camera kit that provides high quality imaging, a compact and ruggedized IP65 form-factor, and the perfect 110 degree field of view.
 
[[image:RaceCapture_video+data_livestreaming_windshield_mount.jpg|600px]]
 
[[image:RaceCapture_video+data_livestreaming_gopro_camera_mount.jpg|600px]]
 
===Assembling the Camera Kit===
Using the supplied hardware, insert the nut into the camera clamp using a pair of small pliers.  Then, use the included screw to clamp the camera to the mount.
 
[[image:RaceCapture_video+data_livestreaming_gopro_camera_mount_clamp_insert_nut.jpg|600px]]
 
[[image:RaceCapture_video+data_livestreaming_gopro_camera_mount_clamp_screw_attached.jpg|600px]]
 
Then, assemble the camera clamp into ball and socket windshield mount, or the GoPro mount. (1 of each style is included in the kit)
 
====Ball and Socket windshield mount====
[[image:RaceCapture_video+data_livestreaming_gopro_camera_mount_clamp_ball_and_socket_mount.jpg|600px]]
 
[[image:RaceCapture_video+data_livestreaming_gopro_camera_mount_clamp_ball_and_socket_mount_assembled.jpg|600px]]
 
====GoPro style mount====
[[image:RaceCapture_video+data_livestreaming_gopro_camera_mount.jpg|600px]]
 
===Alternatives===
Most any USB camera (such as a webcam) can be used. These are commonly found on [https://www.amazon.com/s?k=usb+webcam Amazon] or [https://www.ebay.com/sch/i.html?_nkw=usb+webcam&_sacat=0 Ebay].
* '''Tips''':
** Logitech is a good, high quality option
** Find a camera that offers a 1/4-20 threaded camera mount for a secure rollbar attachment to minimize vibration.
 
==Microphone==
A microphone is needed for capturing audio.
* Candidates:
** USB microphone - you can use a separate USB microphone, especially if you get one that offers higher quality.
** Analog microphone - you can use an analog microphone that attaches to the front headset input of the micro PC.  Make sure you get a microphone that has the 4-ring connector for proper operation.
** Microphone embedded in one of the cameras - if one of your your cameras has its own microphone, you can use that as an audio source.
 
===Using the Microphone included with the kit===
The kit provides a USB microphone with good audio quality.
[[image:RaceCapture_video+data_livestreaming_microphone.jpg|600px]]
 
==Display Emulator==
You'll need a display emulator to plug into the streamer while running on track. This tricks the computer into thinking a monitor is attached, allowing the streamer to run.
 
[[image:hdmi_display_emulator.jpg|300px]]
 
The following have been tested:
* [https://www.amazon.com/gp/product/B06XSY9THQ HDMI emulator] - use this for the Beelink Micro PC
* [https://www.amazon.com/gp/product/B075PTQ4NH DisplayPort emulator] - use this for the HP or Dell Micro PCs
 
==Hotspot/Router==
Most any hostspot should work, but for the best performance and reliability, these options should be considered:
* Hard-wired ethernet connection, for direct connection to the micro computer.
* External antenna connection - a hotspot that offers external antenna will boost performance by allowing you to use a high-gain roof-mount antenna.
 
Suggested units that offer direct hardwired connection:
* [https://www.amazon.com/NETGEAR-Broadband-Modem-LM1300-Always/dp/B0BKTSMQFF Netgear LM1300]
* [https://www.amazon.com/Teltonika-RUT950-LTE-4G-Router/dp/B00TKFKLCI Teltonika RUT950]
* [https://www.amazon.com/Peplink-Pepwave-Cellular-Router-MAX-BR1-MINI-LTE-US-T/dp/B01MR5YKF9 Pepwave BR1]
 
=Setup=
Connect a keyboard, mouse, and monitor to the rendering/streaming computer and prepare to install Ubuntu:
==Install ubuntu 22 LTS==
[https://ubuntu.com/download/desktop/thank-you?version=22.04.2&architecture=amd64 Download Ubuntu Desktop] and follow the instructions to install to a USB flash drive.
* '''Notes''' To install, you will need to configure the system's BIOS to boot first from the USB flash drive.
** Beelink: Repeatedly press 'delete' on the keyboard right after power up.
** HP: Repeatedly press F10 after power up
** Dell: Repeatedly press F2 after power up
 
===OS configuration options===
* '''Important -''' Install Ubuntu with the following options
** During installation, choose the option to download / install updates, including "third-party software for graphics, WiFi, and additional media formats"
** Choose the option to erase the hard drive and perform a complete install.
** Select Login Automatically
** When prompted for your account's username, make sure you specify a password. This will allow you to easily switch between streaming mode and maintenance mode.
 
[[image:ubunut_setup_options.jpg]]
 
After the installation is complete, the computer will reboot into the standard desktop.


==Disable keyring popup==
==Disable keyring popup==
[https://linuxconfig.org/how-to-disable-keyring-popup-on-ubuntu Disable the keyring popup]
From the desktop: log out, and log back in using with the password you created during the installation step.  


==Install dependencies==
Then, [https://linuxconfig.org/how-to-disable-keyring-popup-on-ubuntu Disable the keyring popup] using these instructions. Observe the security notes in this guide.
<pre>
* '''Notes'''
sudo apt-get install v4l-utils tk gstreamer1.0-plugins-bad gstreamer1.0-libav
** The log-out/log-in step is important - don't skip it!
</pre>
** Disabling the keyring is important; it prevents a popup dialog when the RaceCapture app automatically starts.


==Enable access to RaceCapture serial port==
==Run the installer==
From the Ubuntu desktop, open a terminal and enter the following commands, pressing <enter> after each line:
<pre>
<pre>
sudo adduser $USER dialout
sudo apt install curl
sudo echo "ATTRS{idVendor}==16d0, ATTRS{idProduct}==07f1, MODE=0666" | sudo tee /etc/udev/rules.d/70-autosportlabs.racecapture.rules
curl -sL bit.ly/3RL9Yoj | bash
</pre>
</pre>
==Hide Ubuntu Top bar==
[https://www.maketecheasier.com/hide-top-bar-ubuntu/ Hide top bar]


==Hide side bar==
This will automatically install the RaceCapture app and video streamer, related software dependencies, and set up configuration file templates.
<pre>
sudo apt install gnome-shell-extensions
</pre>
Now run extensions tool, set Ubuntu Dock -> OFF


==Download the latest RaceCapture app for Linux==
==Reboot==
[http://podium.live/software http://podium.live/software]
Reboot the computer once it is complete with the installation. It should automatically launch the RaceCapture app.


==Extract the RaceCapture app archive==
==Edit RaceCapture settings==
<pre>
Edit these RaceCapture settings for proper operation when streaming
tar -xzf <downloaded filename>
===App Preferences===
</pre>
Navigate to Setup / App Preferences:
==Launch RaceCapture app==
<pre>
./run_racecapture_linux.sh
</pre>
 
==Enable fullscreen mode & Default dashboard mode==
* Go to Setup / App Preferences
* set Fullscreen -> ON
* set Fullscreen -> ON
* Set Startup Screen -> Dashboard
* Set Startup Screen -> Dashboard
* Turn off Session Recording
[[image:racecapture-video-data-livestreaming-app-settings.jpg]]
===Dashboard Preferences===
Navigate to the Dashboard, then press the gear icon in the upper right of the dashboard, select "More Settings" and set the following:
* Turn off Pit stop timer
* Turn off pit-to-car alerts
* Turn off remote dashboard navigation (scroll to bottom)
[[image:racecapture-video-data-livestreaming-dashboard-settings.jpg]]
[[image:racecapture-video-data-livestreaming-disable-remote-dashboard-navigation.jpg]]


==Plug in camera(s)==
==Plug in camera(s)==
Line 48: Line 212:


==Plug in USB microphone==
==Plug in USB microphone==
* Plug USB microphone into a USB port
* Plug USB microphone into a USB port.
 
Note: if using the Beelink, plug into one of the USB ports on the rear of the system.
 
==Connect RaceCapture==
Your current RaceCapture system already supports multiple connections, so you can continue using your dashboard (e.g. Android tablet via Bluetooth) when adding this video+data streaming capability.
===Via USB (overall best option)===
This is the best option for connecting RaceCapture to the streaming computer. Just connect a USB cable between the rendering/streaming system and RaceCapture. RaceCapture will automatically connect.
===Via WiFi===
If you're already using the USB connection for a Raspberry Pi dash, you can configure the rendering/streaming system to connect to RaceCapture via WiFi.
====Configure as Client====
If you are already using WiFi to connect the rendering/streaming system to your hotspot, you will need to configure RaceCapture to connect to the same hotspot via the WiFi client settings. In this configuration, everything shares the same network created by the hotspot.
* '''Note''': Due to system limitations, your hotspot must be up and running before RaceCapture attempts to connect to it via WiFi.
====Access Point connection (best WiFi option)====
If you are connecting the rendering/streaming system to the hotspot via ethernet, then you can connect the rendering/streaming system directly to RaceCapture's WiFi Access Point. The system will receive data from RaceCapture via WiFi, and broadcast the video+data stream to the hotspot via ethernet.


==Configure Dashboard==
==Configure dashboard video options==
* Press Settings Gear Icon, go to More Settings / Camera Preferences
* Press Settings Gear Icon, go to More Settings / Camera Preferences


Select /dev/video0 for Camera1, and /dev/video2 for Camera2
Select /dev/video0 for Camera #1, and /dev/video2 for Camera #2
 
[[image:racecapture-video-data-livestreaming-camera-settings.jpg]]


==Create a test dashboard==
==Create a test dashboard==
Line 64: Line 244:


* '''Note''' If the cameras are reversed, you can swap the camera mappings in the main dashboard settings under More Settings / Camera Preferences
* '''Note''' If the cameras are reversed, you can swap the camera mappings in the main dashboard settings under More Settings / Camera Preferences
Editing the dashboard is very easy - see this demo for an example:
<youtube>r4mxA-fhJn0</youtube>
==Exiting the RaceCapture app==
To get back to the regular Ubuntu desktop, press ctrl-t, type :quit and press <enter>.
At the login screen, select your username and press the small gear icon in the lower right to select the Ubuntu desktop.
To switch back to streaming mode, log out, press the small gear icon in the lower right and select the RaceCapture streaming option. Log in, and you will be streaming again.
* '''Note''': The system will persist the last option you pick - so if you reboot or power cycle, it will automatically enter streaming mode.
=Video Streaming / recording=
To configure your streaming settings, switch back to the regular Ubuntu Desktop.
Then, edit the video-config.ini - you'll find the file on the desktop. Edit this with the standard text editor by double-clicking it.
==Example default video-config.ini file==
<pre>
[capture]
# specify the id number of the audio device, or the name of the audio
# device as reported by arecord -l
audio_device=USB Audio Device
[local_recording]
video_dir=$HOME/Videos
segment_length_sec=60
[streaming]
# replace <your-streaming-key> with the actual key provided by youtube
streaming_url=rtmp://a.rtmp.youtube.com/live2/<your-streaming-key>
# bitrate in kbps
bitrate=4500
</pre>
==Video Streaming==
===Streaming Key / URL===
If using Youtube: Set the streaming key as provided by youtube. Or, you can specify a custom URL.
===Bitrate===
Specified in kbps. Specify a lower number to conserve bandwidth, at the cost of quality.
<pre>
[streaming]
# replace <your-streaming-key> with the actual key provided by youtube
streaming_url=rtmp://a.rtmp.youtube.com/live2/<your-streaming-key>
bitrate=4500
</pre>
* '''Note''': Typical numbers are 2000 - 6000
==Local recording==
If video_dir is set and points to a valid directory, local video recording will also be enabled.
Videos for the current session are stored in a timestamped directory name under the configured video directory. Videos are saved as fixed-length segments to protect against file corruption due to sudden power loss, similar to how dashcams operate.
If the system experiences sudden power loss, the video currently being written to will be corrupt and unreadable. Therefore, it is important to keep the video segment length reasonably short.
After the session is complete, a full video can be made by using commonly available software to assemble all of the files.
<pre>
[local_recording]
video_dir=$HOME/Videos
segment_length_sec=60
</pre>
===Notes===
* Configure video_dir to the location where you want to save your video files.
* Configure segment_length_sec for the desired segment length size. If not specified, the default is 60 seconds '''Note,  keep this value reasonably short''' - sudden power loss will result in corruption in the last written file.
==Microphone==
We recommend using a USB microphone.
Edit the video-config.ini to specify the microphone device you are using.
===Specifying microphone by device name (recommended)===
To configure your USB microphone by device name, open a terminal window on the streamer and issue this command:
<pre>
arecord -l
</pre>
Example output (yours may be different)
<pre>
streamer@streamer:~/logs$ arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: Generic_1 [HD-Audio Generic], device 0: ALC897 Analog [ALC897 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Generic_1 [HD-Audio Generic], device 2: ALC897 Alt Analog [ALC897 Alt Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: acp [acp], device 0: DMIC capture dmic-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 3: Device [USB PnP Sound Device], device 0: USB Audio [USB Audio]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
</pre>
In this case, the USB microphone is named '''USB PnP Sound Device''' - so the video-config.ini can be updated as follows:
<pre>
[capture]
audio_device=USB PnP Sound Device
</pre>
* '''Note''': the default video-config.ini is pre-configured as '''USB PnP Sound Device''', which matches the USB microphone we provide in our pre-made kits.
===Specifying microphone by device ID (alternative, not recommended)===
You can also specify the numeric ID of the audio device. In the above example, the ID is 3
<pre>
[capture]
audio_device=3
</pre>
* '''Note''': This is not normally recommended because the order of the USB IDs may change every time the streamer boots up.
=First Test=
Once your streaming key has been set and saved, log out and log back into the streamer by selecting the RaceCapture streaming mode on the login page using the gear icon in the lower right.
Check your youtube livestream to see if you are receiving video. If not, try restarting the system and let the streamer launch cleanly after a fresh reboot.
=Maintenance/Troubleshooting=
==Open a terminal window==
(advanced mode) You can open a terminal window while RaceCapture is streaming by entering the following command.
* Press ctrl+t, then type c, then press <enter>
The screen will split into two equal windows; the new window will be a terminal where you can perform debugging steps, such as viewing log files, etc.
* '''Note''': The more user-friendly alternative is to just log out and log back in to the Ubuntu desktop.
==Log out==
You can log out of the current session to access the original Ubuntu desktop to perform additional maintenance.
* Press ctrl-t, then type :quit, then press <enter>
Once you've logged out, you can log back into the Ubuntu desktop by pressing the gear icon in the lower right, and select Ubuntu.
To get back to the RaceCapture full-screen app mode, select "RaceCapture livestreaming" from this menu; this is the window manager that is configured to run RaceCapture in full-screen mode.
==Inspecting Logfiles==
Log files are located in the logs directory under the user's home directory. Log files are named with the date they were created.
===Video streamer log file===
The log files for the video streamer agent have information about the video streamer's connection and activity. You can open it to see any helpful error messages regarding streaming.
===RaceCapture log file===
The RaceCapture log file will have potentially useful information for debugging the operation of the RaceCapture app.
=Extras=
==Mount for Beelink micro PC==
We have designed a cage-style mount for the Beelink Micro PC. This allows convenient surface mounting of the PC.
* Download STL file for 3D printing: [[file:Beelink_SER5_mount.zip]]
[[image:beelink_cage_mount.jpg]]

Latest revision as of 17:55, 11 June 2024

Introduction

This guide shows you how to add video+data livestreaming to your existing RaceCapture system.

After following this guide, you will have:

  • 2-camera video with picture-in-picture
  • Rich, realtime graphics overlay
  • Broadcast to youtube or your preferred streaming provider via an in-vehicle cellular hotspot
  • Local video recording

System Overview

Video+data streaming is enabled by using a separate streaming/encoding device. As RaceCapture supports multiple simultaneous connections, an existing dashboard can be retained. RaceCapture video+data livestreaming system diagram.png

Cost

The cost for adding video+data livestreaming to your RaceCapture system can range between 0 and 800 USD, depending on the parts you may already have on hand.

How hard is it to setup?

This project requires following instructions, including:

  • Installing an operating system
  • Typing computer commands
  • Plugging in cables
  • Editing configuration files
  • Selecting options in an application

This ability is within the realm of someone with moderate computer skills. If the instructions seem daunting, find someone to help you along.

  • For those who crave convenience, we will also be offering a pre-packaged setup that take care of most of the setup steps.

Production State

Since it is based on existing RaceCapture technology (RaceCapture hardware and RaceCapture app), the core of the system is very stable.

New components that add video rendering, encoding, and streaming will be improved through your testing feedback and rounds of updates.

As of this writing, several existing RaceCapture users have put the system through it's paces with great results.

So far we were very pleased with the stability and performance, and we will continue to improve the system through software updates.

A demonstration

Here's the Session from the inaugural test (with sub optimal camera exposure settings and low quality microphone)

Provided ID could not be validated.

Experimental

While we consider this experimental - it is also a free software upgrade for a system that was never originally designed for this purpose.

With your testing help we can steadily improve it and ultimately provide an incredibly cost effective yet very full-featured and high performance system that rivals solutions costing upwards of $5000 USD.

Parts you will need

Your existing RaceCapture system

The RaceCapture system will provide access to your car's sensor data (CAN bus or analog sensors), high performance GPS, Accelerometer / Gyro sensors, lap timing and other motorsport related statistics.

Compatible Systems

  • Any current or previous RaceCapture or PodiumConnect system will work.

Racecapture pro mk4 connectors 1024.jpg PodiumConnect MK2 3quarter 1024.jpg Rct mk3 3quarter.jpg

Rendering/Streaming computer

A tiny form-factor computer is used to receive data from RaceCapture and is responsible for video+data overlay, encoding, and broadcasting the video to youtube or similar streaming platform.

Recommended

The Beelink SER5 is our recommended choice as it is powerful, cost effective, and provided in a compact and lightweight form factor.

Beelink ser5 micro pc.jpg

Alternatives

A micro system with an Intel I5-6500 through I5-7600 + SSD + 8GB RAM is an acceptable option as well. This may be a system you already have or a surplus system you can get at minimum cost.

  • Look for these options:
    • SSD (required for ruggedness - smallest size is fine).
    • Smallest RAM option is fine (typically 8GB)
    • Included WiFi - for connection versatility

Candidates

  • Dell Optiplex 7050 micro desktop: Ebay search (nice because most have wifi)

Dell-optiplex-7050.jpg

HP-elitedesk-800.jpg

12v DC to DC converter

A 12v-19v DC to DC converter is needed to power the rendering/broadcasting computer in the vehicle. This converter avoids needing an AC inverter in the car, making for a clean installation.

  • Tips:
    • Choose a device that has sufficient power capacity (100W minimum)

Recommended

These have been tested to work:

KFD-100W-DC-to-DC-converter-12v-to-19v.jpg

  • Tips:
    • We recommend cutting the cigar lighter connection and hard-wiring the power to a 15A circuit. (center conductor is positive).

Cameras

You will need 1 or 2 cameras for capturing and rendering video.

Recommended Camera Kit

Autosport Labs will soon provide a camera kit that provides high quality imaging, a compact and ruggedized IP65 form-factor, and the perfect 110 degree field of view.

RaceCapture video+data livestreaming windshield mount.jpg

RaceCapture video+data livestreaming gopro camera mount.jpg

Assembling the Camera Kit

Using the supplied hardware, insert the nut into the camera clamp using a pair of small pliers. Then, use the included screw to clamp the camera to the mount.

RaceCapture video+data livestreaming gopro camera mount clamp insert nut.jpg

RaceCapture video+data livestreaming gopro camera mount clamp screw attached.jpg

Then, assemble the camera clamp into ball and socket windshield mount, or the GoPro mount. (1 of each style is included in the kit)

Ball and Socket windshield mount

RaceCapture video+data livestreaming gopro camera mount clamp ball and socket mount.jpg

RaceCapture video+data livestreaming gopro camera mount clamp ball and socket mount assembled.jpg

GoPro style mount

RaceCapture video+data livestreaming gopro camera mount.jpg

Alternatives

Most any USB camera (such as a webcam) can be used. These are commonly found on Amazon or Ebay.

  • Tips:
    • Logitech is a good, high quality option
    • Find a camera that offers a 1/4-20 threaded camera mount for a secure rollbar attachment to minimize vibration.

Microphone

A microphone is needed for capturing audio.

  • Candidates:
    • USB microphone - you can use a separate USB microphone, especially if you get one that offers higher quality.
    • Analog microphone - you can use an analog microphone that attaches to the front headset input of the micro PC. Make sure you get a microphone that has the 4-ring connector for proper operation.
    • Microphone embedded in one of the cameras - if one of your your cameras has its own microphone, you can use that as an audio source.

Using the Microphone included with the kit

The kit provides a USB microphone with good audio quality. RaceCapture video+data livestreaming microphone.jpg

Display Emulator

You'll need a display emulator to plug into the streamer while running on track. This tricks the computer into thinking a monitor is attached, allowing the streamer to run.

Hdmi display emulator.jpg

The following have been tested:

Hotspot/Router

Most any hostspot should work, but for the best performance and reliability, these options should be considered:

  • Hard-wired ethernet connection, for direct connection to the micro computer.
  • External antenna connection - a hotspot that offers external antenna will boost performance by allowing you to use a high-gain roof-mount antenna.

Suggested units that offer direct hardwired connection:

Setup

Connect a keyboard, mouse, and monitor to the rendering/streaming computer and prepare to install Ubuntu:

Install ubuntu 22 LTS

Download Ubuntu Desktop and follow the instructions to install to a USB flash drive.

  • Notes To install, you will need to configure the system's BIOS to boot first from the USB flash drive.
    • Beelink: Repeatedly press 'delete' on the keyboard right after power up.
    • HP: Repeatedly press F10 after power up
    • Dell: Repeatedly press F2 after power up

OS configuration options

  • Important - Install Ubuntu with the following options
    • During installation, choose the option to download / install updates, including "third-party software for graphics, WiFi, and additional media formats"
    • Choose the option to erase the hard drive and perform a complete install.
    • Select Login Automatically
    • When prompted for your account's username, make sure you specify a password. This will allow you to easily switch between streaming mode and maintenance mode.

Ubunut setup options.jpg

After the installation is complete, the computer will reboot into the standard desktop.

Disable keyring popup

From the desktop: log out, and log back in using with the password you created during the installation step.

Then, Disable the keyring popup using these instructions. Observe the security notes in this guide.

  • Notes
    • The log-out/log-in step is important - don't skip it!
    • Disabling the keyring is important; it prevents a popup dialog when the RaceCapture app automatically starts.

Run the installer

From the Ubuntu desktop, open a terminal and enter the following commands, pressing <enter> after each line:

sudo apt install curl
curl -sL bit.ly/3RL9Yoj | bash

This will automatically install the RaceCapture app and video streamer, related software dependencies, and set up configuration file templates.

Reboot

Reboot the computer once it is complete with the installation. It should automatically launch the RaceCapture app.

Edit RaceCapture settings

Edit these RaceCapture settings for proper operation when streaming

App Preferences

Navigate to Setup / App Preferences:

  • set Fullscreen -> ON
  • Set Startup Screen -> Dashboard
  • Turn off Session Recording

Racecapture-video-data-livestreaming-app-settings.jpg

Dashboard Preferences

Navigate to the Dashboard, then press the gear icon in the upper right of the dashboard, select "More Settings" and set the following:

  • Turn off Pit stop timer
  • Turn off pit-to-car alerts
  • Turn off remote dashboard navigation (scroll to bottom)

Racecapture-video-data-livestreaming-dashboard-settings.jpg

Racecapture-video-data-livestreaming-disable-remote-dashboard-navigation.jpg

Plug in camera(s)

Plug in 1 or 2 cameras into the USB port

  • Note: Remember the ports the cameras are plugged into, and keep this consistent during use.

Plug in USB microphone

  • Plug USB microphone into a USB port.

Note: if using the Beelink, plug into one of the USB ports on the rear of the system.

Connect RaceCapture

Your current RaceCapture system already supports multiple connections, so you can continue using your dashboard (e.g. Android tablet via Bluetooth) when adding this video+data streaming capability.

Via USB (overall best option)

This is the best option for connecting RaceCapture to the streaming computer. Just connect a USB cable between the rendering/streaming system and RaceCapture. RaceCapture will automatically connect.

Via WiFi

If you're already using the USB connection for a Raspberry Pi dash, you can configure the rendering/streaming system to connect to RaceCapture via WiFi.

Configure as Client

If you are already using WiFi to connect the rendering/streaming system to your hotspot, you will need to configure RaceCapture to connect to the same hotspot via the WiFi client settings. In this configuration, everything shares the same network created by the hotspot.

  • Note: Due to system limitations, your hotspot must be up and running before RaceCapture attempts to connect to it via WiFi.

Access Point connection (best WiFi option)

If you are connecting the rendering/streaming system to the hotspot via ethernet, then you can connect the rendering/streaming system directly to RaceCapture's WiFi Access Point. The system will receive data from RaceCapture via WiFi, and broadcast the video+data stream to the hotspot via ethernet.

Configure dashboard video options

  • Press Settings Gear Icon, go to More Settings / Camera Preferences

Select /dev/video0 for Camera #1, and /dev/video2 for Camera #2

Racecapture-video-data-livestreaming-camera-settings.jpg

Create a test dashboard

  • Press the Settings gear icon, select Add Gauge
  • create a video gauge, and select Camera 1 as the source.
  • Resize to fit the dashboard.
  • create another video gauge, and select Camera 2 as the source.
  • Resize to be the picture-in-picture video window.
  • Add additional gauges as you see fit, such as an analog speed gauge, track map, etc.
  • Note If the cameras are reversed, you can swap the camera mappings in the main dashboard settings under More Settings / Camera Preferences

Editing the dashboard is very easy - see this demo for an example:

Exiting the RaceCapture app

To get back to the regular Ubuntu desktop, press ctrl-t, type :quit and press <enter>.

At the login screen, select your username and press the small gear icon in the lower right to select the Ubuntu desktop.

To switch back to streaming mode, log out, press the small gear icon in the lower right and select the RaceCapture streaming option. Log in, and you will be streaming again.

  • Note: The system will persist the last option you pick - so if you reboot or power cycle, it will automatically enter streaming mode.

Video Streaming / recording

To configure your streaming settings, switch back to the regular Ubuntu Desktop.

Then, edit the video-config.ini - you'll find the file on the desktop. Edit this with the standard text editor by double-clicking it.

Example default video-config.ini file

[capture]
# specify the id number of the audio device, or the name of the audio
# device as reported by arecord -l
audio_device=USB Audio Device

[local_recording]
video_dir=$HOME/Videos
segment_length_sec=60

[streaming]
# replace <your-streaming-key> with the actual key provided by youtube
streaming_url=rtmp://a.rtmp.youtube.com/live2/<your-streaming-key>

# bitrate in kbps
bitrate=4500

Video Streaming

Streaming Key / URL

If using Youtube: Set the streaming key as provided by youtube. Or, you can specify a custom URL.

Bitrate

Specified in kbps. Specify a lower number to conserve bandwidth, at the cost of quality.

[streaming]
# replace <your-streaming-key> with the actual key provided by youtube
streaming_url=rtmp://a.rtmp.youtube.com/live2/<your-streaming-key>
bitrate=4500
  • Note: Typical numbers are 2000 - 6000

Local recording

If video_dir is set and points to a valid directory, local video recording will also be enabled.

Videos for the current session are stored in a timestamped directory name under the configured video directory. Videos are saved as fixed-length segments to protect against file corruption due to sudden power loss, similar to how dashcams operate.

If the system experiences sudden power loss, the video currently being written to will be corrupt and unreadable. Therefore, it is important to keep the video segment length reasonably short.

After the session is complete, a full video can be made by using commonly available software to assemble all of the files.

[local_recording]
video_dir=$HOME/Videos
segment_length_sec=60

Notes

  • Configure video_dir to the location where you want to save your video files.
  • Configure segment_length_sec for the desired segment length size. If not specified, the default is 60 seconds Note, keep this value reasonably short - sudden power loss will result in corruption in the last written file.

Microphone

We recommend using a USB microphone. Edit the video-config.ini to specify the microphone device you are using.

Specifying microphone by device name (recommended)

To configure your USB microphone by device name, open a terminal window on the streamer and issue this command:

arecord -l

Example output (yours may be different)

streamer@streamer:~/logs$ arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: Generic_1 [HD-Audio Generic], device 0: ALC897 Analog [ALC897 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Generic_1 [HD-Audio Generic], device 2: ALC897 Alt Analog [ALC897 Alt Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: acp [acp], device 0: DMIC capture dmic-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 3: Device [USB PnP Sound Device], device 0: USB Audio [USB Audio]
  Subdevices: 0/1
  Subdevice #0: subdevice #0

In this case, the USB microphone is named USB PnP Sound Device - so the video-config.ini can be updated as follows:

[capture]
audio_device=USB PnP Sound Device
  • Note: the default video-config.ini is pre-configured as USB PnP Sound Device, which matches the USB microphone we provide in our pre-made kits.

Specifying microphone by device ID (alternative, not recommended)

You can also specify the numeric ID of the audio device. In the above example, the ID is 3

[capture]
audio_device=3
  • Note: This is not normally recommended because the order of the USB IDs may change every time the streamer boots up.

First Test

Once your streaming key has been set and saved, log out and log back into the streamer by selecting the RaceCapture streaming mode on the login page using the gear icon in the lower right.

Check your youtube livestream to see if you are receiving video. If not, try restarting the system and let the streamer launch cleanly after a fresh reboot.

Maintenance/Troubleshooting

Open a terminal window

(advanced mode) You can open a terminal window while RaceCapture is streaming by entering the following command.

  • Press ctrl+t, then type c, then press <enter>

The screen will split into two equal windows; the new window will be a terminal where you can perform debugging steps, such as viewing log files, etc.

  • Note: The more user-friendly alternative is to just log out and log back in to the Ubuntu desktop.

Log out

You can log out of the current session to access the original Ubuntu desktop to perform additional maintenance.

  • Press ctrl-t, then type :quit, then press <enter>

Once you've logged out, you can log back into the Ubuntu desktop by pressing the gear icon in the lower right, and select Ubuntu.

To get back to the RaceCapture full-screen app mode, select "RaceCapture livestreaming" from this menu; this is the window manager that is configured to run RaceCapture in full-screen mode.

Inspecting Logfiles

Log files are located in the logs directory under the user's home directory. Log files are named with the date they were created.

Video streamer log file

The log files for the video streamer agent have information about the video streamer's connection and activity. You can open it to see any helpful error messages regarding streaming.

RaceCapture log file

The RaceCapture log file will have potentially useful information for debugging the operation of the RaceCapture app.

Extras

Mount for Beelink micro PC

We have designed a cage-style mount for the Beelink Micro PC. This allows convenient surface mounting of the PC.

Beelink cage mount.jpg