MCAP Video ingest in Python
This guide will walk you through the process of downloading a sample MCAP file, inspecting it to find video topics, and ingesting the video into Nominal.
Prerequisites
Make sure you have the following Python packages installed:
- huggingface_hub
- mcap
- nominal
You can install them all using:
Step 1: Download the Sample MCAP File
First, download a sample MCAP file using the huggingface_hub library.
Step 2: Inspect the MCAP File to Find Video Topics
Next, use the mcap library to inspect the MCAP file and identify available video topics.
This script will output the video topics available in the MCAP file, which you’ll use in the next step.
Step 3: Connect to Nominal
Before ingesting the video, ensure you’re connected to Nominal.
When using the Nominal client library, there are two primary ways of authenticating:
Storing credentials to disk
First, run the following in your terminal and follow on-screen prompts to insert the base_url and API key:
This will store your API key in a config file ~/.nominal.yml
.
The API key will automatically be used when using the client again.
Directly using credentials in your scripts
NOTE: you should never share your Nominal API key with anyone. We therefore recommend that you not save it in your code and/or scripts.
Step 4: Ingest the Video
Finally, upload the video to Nominal using a topic from the list.