Quickstart Guide
Downloading the NIM
Download the Semantic Split C-RADIO NIM image with the following command.
The NIM image is 11.81 GB and the download time depends on your internet connection speed.
Prepare External Data Mounts for I/O
The Semantic Split C-RADIO NIM expects data that is local to the machine where the NIM is executing. Hence, the input videos must be locally accessible by the NIM and the output clips will be created in local storage. The user of the NIM is responsible for the management of that data. External data locations can be mounted for reading and writing purposes in the NIM (e.g., inputs can be read from and results will be written to these locations).
This NIM requires mounting at-least three external folders (i.e. folders existing outside of the NIM) at the following three locations inside the NIM:
/data: This location inside the NIM is the root where all input data will be accessed from./results: This location inside the NIM is the root where all results will be written to./opt/nim/cache: This location inside the NIM is used to store various files needed by the NIM that are downloaded and cached on the first run of the NIM.
Set the Ownership of Data Mounts
The Semantic Split C-RADIO NIM image uses the user-id 1000. To make sure the external data mounts for the cache, the data, and the results work properly inside the NIM, you must change the user and group of those folders and then use them for mounting in the docker command. Use the following commands on the host system where the NIM is supposed to launch, before launching it, to set the folder access permissions:
Launch the NIM
Use the following command to launch the Semantic Split C-RADIO NIM:
After the NIM is running, you should see an output similar to the following:
Check the NIM’s Health
Leave the current terminal open with the NIM running, open a new terminal, and use the following methods to query the health check end-point. This might take a couple of minutes.
Invoke By Using cURL
Expected Result if the NIM’s health is good:
Invoke By Using Python
Expected Result if the NIM’s health is good:
Submit a Video Splitting Request
The endpoint to split videos is /video_split, and it takes the following two body parameters:
-
input_paths- A list of paths to the raw videos.- These paths should be relative to the mount point
/data - The request must be formatted to the expected input data json format.
- These paths should be relative to the mount point
-
results_dir- a directory inside the NIM that points towards the folder where you want to store the transcoded output videos. This should be relative to the mount point/results
This is a blocking synchronous request. Results are only returned after all the videos are processed successfully. If the pipeline fails for any reason, a 500 internal server error message is returned and the NIM must be restarted to receive any further requests. To restart the NIM after a failure, see Troubleshooting.
There is a delay between when the NIM is started, and when it becomes ready to receive video split requests. Before you submit a video split request, check the health of the NIM to ensure that it is ready.
Invoke By Using cURL
Script to generate curl request
You can use the following bash script to generate a pre-formatted curl video splitting request provided that the following is true:
- The data folder on the host machine contains only valid input video files.
- How to call:
generate_json_request.sh <data folder on host machine> | tee json_request.sh
generate_request.sh
Invoke By Using Python
For complete documentation of the API specification of the Semantic Split C-Radio NIM, see API Reference.
Get Video Splitting Results
After a successful run of the video splitting pipeline, a JSON response consisting of various details about the results is returned. The JSON has the following structure:
- int: total_frames_processed : a count of all the frames processed in this run so far
- int: total_output_frames : a count of all the frames in the output clips generated by the pipeline
- dict: result
- keys are the path of the video
- values are a dictionary consisting of
- int: num_clips
- list[dict]: clip
- int: clip_span with start and end index
- str: clip path