Upload videos

Upload video

To upload video frames as images in an Image project:

sa.upload_video_to_project(
    project = "Project Name",
    video_path = "./video.mp4")

Upload a folder of videos

To upload a folder of videos:

sa.upload_videos_from_folder_to_project(
    project = "Project Name",
    folder_path = “./videos”)

Recusive upload

To enable recursive upload:

sa.upload_videos_from_folder_to_project(
    project = "Project Name",
    folder_path = "./videos", 
    exclude_file_patterns = ['mpg', 'ogg'], 
    recursive_subfolders = True)

📘

SuperAnnotate supports the following video file formats that HTML5 supports: OGG, WEBM, and MP4. Learn more about browser compatibility.

Exclude video formats from upload

To exclude certain video file formats from the upload:

sa.upload_videos_from_folder_to_project(
    project = "Project Name",
    folder_path = "./videos", 
    exclude_file_patterns = ['mpg', 'ogg'])

Set video frame rate

When you upload a video, it'll be split into frames (images). To set the frame rate:

sa.upload_video_to_project(
    project = "Project Name",
    video_path = "./video.mp4", 
    target_fps = 30)

📘

Frame rate

Frame rate (fps) is the number of frames that appear per second. The higher the frame rate, the more images will appear per second, and vice versa.

Trim video

To trim a video, specify the start time and end time in seconds:

sa.upload_video_to_project(
    project = "Project Name",
    video_path = "./video.mp4", 
    target_fps = 30,
    start_time = 10.0,
    end_time = 20.5)

To trim a video and specify the frame rate:

sa.upload_videos_from_folder_to_project(
    project = "Project Name",
    folder_path = "./videos", 
    exclude_file_patterns = ['mpg', 'ogg'], 
    recursive_subfolders = True,
    target_fps = 30,
    start_time = 10.0,
    end_time = 20.5)

Upload videos from an integrated cloud storage

To upload videos from an integrated cloud storage:

sa.attach_items_from_integrated_storage(
   project= "Project Name",
   integration= {integration_meta},
   folder_path= "storage_folder_name")

Learn how to create integrations.

Attach video URLs

You can attach video URLs to Video Projects only.

Method 1

Step 1: Create a CSV file containing the video URLs

To attach video URLs, first create a CSV file that contains the URLs. Use this template CSV file as a reference.

KeyRequired/OptionalValue
urlRequiredVideo URL
nameOptionalVideo name

📘

If the video name field is empty, a name ID will be generated based on the row ID and a random UUID.

Step 2: Attach video URLs via Python SDK

Link the videos to your project with this SDK command.

sa.attach_items(
    project = "Project Name", 
    attachments = "./videos.csv",
    annotation_status = "QualityCheck")
superannotatecli attach-video-urls --project “Project Name/Folder Name” --attachments “./videos.csv” --annotation_status “QualityCheck”

Method 2

You can also attach items via a list of URLs:

sa.attach_items(
    project = "Cars",
    attachments = [
        { "name": "16797.mp4", 
          "url": "https://test-1212.s3.amazonaws.com/50k2sep/0.jpg?AWSAccessKeyId=AKIA5BP2G2NHEPGBCUX2&Signature=oNlHqhZHiK5GzgWZi%2F46dIoQ%2B%2BA%3D&Expires=1651063405" },
        { "name": "16798.mp4", 
          "url": "https://test-1212.s3.amazonaws.com/50k2sep/1.jpg?AWSAccessKeyId=AKIA5BP2G2NHEPGBCUX2&Signature=bYWiGrW8ET56pUcTCrlqhF5EX%2BY%3D&Expires=1651063405" },
        { "name": "16799.mp4", 
          "url": "https://test-1212.s3.amazonaws.com/50k2sep/10.jpg?AWSAccessKeyId=AKIA5BP2G2NHEPGBCUX2&Signature=OXtzqrgAlEViDbTM5RHeOA%2BGBLk%3D&Expires=1651063405" }
    ],
    annotation_status="NotStarted"
)

Supported video file formats

SuperAnnotate supports the following video file formats that HTML5 supports: OGG, WEBM, and MP4. Learn more about browser compatibility.