Skip to content
This repository has been archived by the owner on Oct 22, 2023. It is now read-only.

Latest commit

 

History

History
54 lines (50 loc) · 1.85 KB

README.md

File metadata and controls

54 lines (50 loc) · 1.85 KB

Video-API

Description

This API is used to manage videos and their metadata. Plus, it allows user access processing status of videos.

Creation of a video

sequenceDiagram
    autonumber
    participant U as User
    participant A as API
    participant S3 as S3 Storage
    participant S as Processing Service
    U ->> A: POST /videos
    A ->> S3: Add video to video-pipeline bucket
    par S3 to Processing Service
        alt Video is not valid
        else Video is valid
            S3 ->> S: New video added
            activate S 
            Note over S: Start processing
            S ->> A: POST /processing/{videoId}/status : {statusEnum : PROCESSING}
            loop Processing steps
                alt Step is in error
                    break Processing
                        S ->> A: POST /processing/{videoId}/steps : {stepEnum (DOWNSCALING, LANG_IDENT, CAPTION, ANIMAL_DETECT), log}
                        A ->> S: 200 OK
                        S ->> A: POST /processing/{videoId}/status : {statusEnum : ERROR}
                        A ->> S: 200 OK
                    end
                else Step is not in error
                    S ->> A: POST /processing/{videoId}/steps : {stepEnum (DOWNSCALING, LANG_IDENT, CAPTION, ANIMAL_DETECT), log}
                    A ->> S: 200 OK
                end
            end
            deactivate S
            Note over S: Processing finished
            S ->> A: POST /processing/{videoId}/status : {statusEnum : PROCESSED}
            A ->> A: Video is ready to be streamed
        end
    and S3 to API
        alt Video is not valid
            S3 ->> A: Video is not valid
            A ->> U: 400 BAD REQUEST
        else Video is valid
            S3 ->> A: Video successfully added
            A ->> U: 201 CREATED
        end
    end
    U ->> A: GET /videos/{videoId}
    A ->> U: 200 OK
Loading