> ## Documentation Index
> Fetch the complete documentation index at: https://rendi.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Poll FFmpeg Command

> Get the status of a previously submitted FFmpeg command. Works for regular commands and chained commands.



## OpenAPI

````yaml GET /v1/commands/{command_id}
openapi: 3.1.0
info:
  title: FFmpeg Command API
  description: API for running FFmpeg in a cloud environment
  version: 1.0.0
servers:
  - url: https://api.rendi.dev
    description: Rendi - FFmpeg API
security: []
paths:
  /v1/commands/{command_id}:
    get:
      tags:
        - API
        - FFmpeg Commands
      summary: Get Command Status
      description: >-
        Get the status of a previously submitted FFmpeg command. Works for
        regular commands and chained commands.
      operationId: poll_command_v1_commands__command_id__get
      parameters:
        - name: command_id
          in: path
          required: true
          schema:
            type: string
            description: The UUID of the FFmpeg command to check status for
            title: Command Id
          description: The UUID of the FFmpeg command to check status for
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommandStatusResponse'
        '401':
          description: Invalid API key
          content:
            application/json:
              example:
                detail: Invalid authorization key
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: Rate limit exceeded
      security:
        - APIKeyHeader: []
components:
  schemas:
    CommandStatusResponse:
      properties:
        command_id:
          type: string
          title: Command Id
          description: Unique identifier for the submitted command
          examples:
            - 123e4567-e89b-12d3-a456-426614174000
        status:
          $ref: '#/components/schemas/CommandStatus'
          description: Current status of the FFmpeg command
          examples:
            - SUCCESS
        processing_stage:
          anyOf:
            - $ref: '#/components/schemas/CommandProcessingStage'
            - type: 'null'
          description: Current processing stage of the command
          examples:
            - DOWNLOADING
            - PREPARING_INPUT_FILES
            - FFMPEG_PROCESSING
            - UPLOADING
        command_type:
          $ref: '#/components/schemas/CommandType'
          description: Type of command that was run
          examples:
            - FFMPEG_COMMAND
            - FFMPEG_CHAINED_COMMANDS
        error_status:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Status
          description: Status of any error that occurred during command execution
          examples:
            - UNREACHABLE_INPUT_FILE
        error_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Message
          description: Error details if the command failed
          examples:
            - >-
              Input file url https://rendi.dev/example does not have a valid
              file name in its' end.
        total_processing_seconds:
          anyOf:
            - type: number
            - type: 'null'
          title: Total Processing Seconds
          description: >-
            Processing time, in seconds, since receiving the command, this
            includes network times, parsing times, and FFMPEG command execution
            time
        ffmpeg_command_run_seconds:
          anyOf:
            - type: number
            - type: 'null'
          title: Ffmpeg Command Run Seconds
          description: >-
            The exact time the specific FFMPEG command took on our servers, in
            seconds
        vcpu_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Vcpu Count
          description: Number of virtual CPUs used for the command
        output_files:
          anyOf:
            - additionalProperties:
                $ref: '#/components/schemas/RendiStoredFile'
              type: object
            - type: 'null'
          title: Output Files
          description: >-
            Dictionary mapping file aliases to their output file storage, for
            output folder, the key is 'OUTPUT_FOLDER'
          examples:
            - out_1:
                bitrate_audio_kb: 242.349609375
                bitrate_video_kb: 370.5654296875
                codec: h264
                duration: 30
                file_format: mp4
                file_id: f775b15d-67e9-4235-b89f-4bb33c0a5f57
                file_type: video
                frame_rate: 24
                height: 320
                is_varying_frame_rate: false
                mime_type: video/mp4
                pixel_format: yuv420p
                size_mbytes: 2.2677812576293945
                storage_url: >-
                  https://storage.rendi.dev/files/224ea098-5c10-419b-8a77-707d89443c56/42c95292-d953-4b5a-8a58-cf1513363a33/output_320p.mp4
                timebase: 1/25
                width: 568
              out_2:
                bitrate_audio_kb: 239.9833984375
                bitrate_video_kb: 160.955078125
                codec: h264
                duration: 596.459
                file_format: mp4
                file_id: 9df00eca-3221-49c6-8a64-07850c9a5921
                file_type: video
                frame_rate: 24
                height: 180
                is_varying_frame_rate: false
                mime_type: video/mp4
                pixel_format: yuv420p
                size_mbytes: 29.620187759399414
                storage_url: >-
                  https://storage.rendi.dev/files/224ea098-5c10-419b-8a77-707d89443c56/42c95292-d953-4b5a-8a58-cf1513363a33/output_180p.mp4
                timebase: 1/25
                width: 320
            - OUTPUT_FOLDER:
                file_count: 6
                file_format: zip
                file_type: zip
                is_deleted: false
                rendi_store_type: OUTPUT
                size_compressed_mbytes: 5.120238990783691
                size_mbytes: 6.900238990783691
                status: STORED
                storage_url: >-
                  https://storage.rendi.dev/files/.../41938bd7-3550-46d8-87c3-9d0b3200e7fb.zip
        original_request:
          type: object
          title: Original Request
          description: The original request that was sent to the server
          examples:
            - ffmpeg_command: >-
                -i {{in_1}} -ss 00:00 -to 00:30 -filter_complex
                "[0:v]split=2[vid1][vid2];[vid1]scale=trunc(oh*a/2)*2:320:force_original_aspect_ratio=decrease,pad=trunc(oh*a/2)*2:320:-1:-1[320p];[vid2]scale=trunc(oh*a/2)*2:180:force_original_aspect_ratio=decrease,pad=trunc(oh*a/2)*2:180:-1:-1[180p]"
                -map [320p] -map 0:a -c:a copy -c:v libx264 -preset medium
                {{out_1}}  -map [180p] -map 0:a -c:a copy -c:v libx264 -preset
                medium {{out_2}}
              input_files:
                in_1: https://storage.rendi.dev/sample/sample.avi
              max_command_run_seconds: 300
              output_files:
                out_1: output_320p.mp4
                out_2: output_180p.mp4
              vcpu_count: 8
        processing_quota_used:
          anyOf:
            - type: number
              minimum: 0
            - type: 'null'
          title: Processing Quota Used
          description: Amount of processing quota used in MB
          examples:
            - 12.5
        metadata:
          anyOf:
            - additionalProperties:
                anyOf:
                  - type: string
                  - type: integer
                  - type: number
                  - type: boolean
              type: object
              maxProperties: 10
              minProperties: 0
            - type: 'null'
          title: Metadata
          description: >-
            Metadata stored with the command, used for custom tracking and
            reporting
          examples:
            - key: value
      type: object
      required:
        - command_id
        - status
        - command_type
        - original_request
      title: CommandStatusResponse
      description: >-
        Response model for FFmpeg command status.


        Contains information about the command execution status, any errors that
        occurred,

        output files generated, and the original request details.
      example:
        command_id: 123e4567-e89b-12d3-a456-426614174000
        command_type: FFMPEG_COMMAND
        ffmpeg_command_run_seconds: 19.58051347732544
        metadata:
          key: value
        original_request:
          ffmpeg_command: >-
            -i {{in_1}} -ss 00:00 -to 00:30 -filter_complex
            "[0:v]split=2[vid1][vid2];[vid1]scale=trunc(oh*a/2)*2:320:force_original_aspect_ratio=decrease,pad=trunc(oh*a/2)*2:320:-1:-1[320p];[vid2]scale=trunc(oh*a/2)*2:180:force_original_aspect_ratio=decrease,pad=trunc(oh*a/2)*2:180:-1:-1[180p]"
            -map [320p] -map 0:a -c:a copy -c:v libx264 -preset medium
            {{out_1}}  -map [180p] -map 0:a -c:a copy -c:v libx264 -preset
            medium {{out_2}}
          input_files:
            in_1: https://storage.rendi.dev/sample/sample.avi
          max_command_run_seconds: 300
          output_files:
            out_1: output_320p.mp4
            out_2: output_180p.mp4
          vcpu_count: 8
        output_files:
          out_1:
            bitrate_audio_kb: 242.349609375
            bitrate_video_kb: 370.5654296875
            codec: h264
            duration: 30
            file_format: mp4
            file_id: f775b15d-67e9-4235-b89f-4bb33c0a5f57
            file_type: video
            frame_rate: 24
            height: 320
            is_varying_frame_rate: false
            mime_type: video/mp4
            pixel_format: yuv420p
            size_mbytes: 2.2677812576293945
            storage_url: >-
              https://storage.rendi.dev/files/224ea098-5c10-419b-8a77-707d89443c56/42c95292-d953-4b5a-8a58-cf1513363a33/output_320p.mp4
            timebase: 1/25
            width: 568
          out_2:
            bitrate_audio_kb: 239.9833984375
            bitrate_video_kb: 160.955078125
            codec: h264
            duration: 596.459
            file_format: mp4
            file_id: 9df00eca-3221-49c6-8a64-07850c9a5921
            file_type: video
            frame_rate: 24
            height: 180
            is_varying_frame_rate: false
            mime_type: video/mp4
            pixel_format: yuv420p
            size_mbytes: 29.620187759399414
            storage_url: >-
              https://storage.rendi.dev/files/224ea098-5c10-419b-8a77-707d89443c56/42c95292-d953-4b5a-8a58-cf1513363a33/output_180p.mp4
            timebase: 1/25
            width: 320
        processing_quota_used: 12.5
        status: SUCCESS
        total_processing_seconds: 24.955581
        vcpu_count: 8
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CommandStatus:
      type: string
      enum:
        - QUEUED
        - PROCESSING
        - PREPARED_FFMPEG_COMMAND
        - FAILED
        - SUCCESS
      title: CommandStatus
    CommandProcessingStage:
      type: string
      enum:
        - DOWNLOADING
        - PREPARING_INPUT_FILES
        - FFMPEG_PROCESSING
        - UPLOADING
      title: CommandProcessingStage
    CommandType:
      type: string
      enum:
        - FFMPEG_COMMAND
        - FFMPEG_CHAINED_COMMANDS
      title: CommandType
    RendiStoredFile:
      properties:
        file_id:
          type: string
          title: File Id
          description: Unique identifier for the stored file
          examples:
            - 987fcdeb-a89b-43d3-b456-789012345678
        storage_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Storage Url
          description: URL where the file is stored
          examples:
            - >-
              https://storage.rendi.dev/123e4567-e89b-12d3-a456-426614174000/output.avi
        status:
          anyOf:
            - $ref: '#/components/schemas/FileStatus'
            - type: 'null'
          description: Status of the file
          examples:
            - STORED
        rendi_store_type:
          anyOf:
            - $ref: '#/components/schemas/RendiFileStoreType'
            - type: 'null'
          description: Type of storage of the file in rendi
          examples:
            - STORED_FILE
        error_status:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Status
          description: Status of any error that occurred during file processing
          examples:
            - UNREACHABLE_INPUT_FILE
        external_error_message:
          anyOf:
            - type: string
            - type: 'null'
          title: External Error Message
          description: Error details if the file failed to be processed
          examples:
            - Input file url https://rendi.dev/example is not reachable.
        is_deleted:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Deleted
          description: Whether the file has been deleted
          examples:
            - false
        size_mbytes:
          anyOf:
            - type: number
            - type: 'null'
          title: Size Mbytes
          description: Size of the output file or folder in megabytes
          examples:
            - 15.2
        file_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: File Count
          description: Number of files in the output folder/playlist
          examples:
            - 5
        size_compressed_mbytes:
          anyOf:
            - type: number
            - type: 'null'
          title: Size Compressed Mbytes
          description: Size of the output compressed folder in megabytes
          examples:
            - 15.2
        original_file_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Original File Url
          description: URL of the original file
          examples:
            - https://somehwereonline.stored.com/file_to_store.mp4
        duration:
          anyOf:
            - type: number
            - type: 'null'
          title: Duration
          description: Duration of the media file in seconds
          examples:
            - 30.5
        file_type:
          anyOf:
            - type: string
            - type: 'null'
          title: File Type
          description: Type of the media file (video, audio, image, subtitles, etc.)
          examples:
            - video
        file_format:
          anyOf:
            - type: string
            - type: 'null'
          title: File Format
          description: Format/container of the media file
          examples:
            - avi
        width:
          anyOf:
            - type: integer
            - type: 'null'
          title: Width
          description: Width of the video in pixels
          examples:
            - 1920
        height:
          anyOf:
            - type: integer
            - type: 'null'
          title: Height
          description: Height of the video in pixels
          examples:
            - 1080
        codec:
          anyOf:
            - type: string
            - type: 'null'
          title: Codec
          description: Codec used for the media file
          examples:
            - msmpeg4v2
        timebase:
          anyOf:
            - type: string
            - type: 'null'
          title: Timebase
          description: How time is represented in the media file
          examples:
            - 1/25
        pixel_format:
          anyOf:
            - type: string
            - type: 'null'
          title: Pixel Format
          description: How the pixel data is stored in the media file
          examples:
            - yuv420p
        mime_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Mime Type
          description: MIME type of the media file
          examples:
            - video/mp4
        frame_rate:
          anyOf:
            - type: number
            - type: 'null'
          title: Frame Rate
          description: Frame rate of the video in frames per second
          examples:
            - 30
        bitrate_video_kb:
          anyOf:
            - type: number
            - type: 'null'
          title: Bitrate Video Kb
          description: Video bitrate in kilobits per second
          examples:
            - 4000
        bitrate_audio_kb:
          anyOf:
            - type: number
            - type: 'null'
          title: Bitrate Audio Kb
          description: Audio bitrate in kilobits per second
          examples:
            - 128
        video_profile_level:
          anyOf:
            - type: string
            - type: 'null'
          title: Video Profile Level
          description: Video profile level
          examples:
            - main
        is_varying_frame_rate:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Varying Frame Rate
          description: Whether the video has a variable frame rate
          examples:
            - false
      type: object
      required:
        - file_id
      title: RendiStoredFile
      description: >-
        Represents a file stored by rendi. Could either be an uploaded file or a
        file generated by running a command.


        This model contains metadata about files stored in rendi storage,
        including file details,

        media information, and storage location.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    FileStatus:
      type: string
      enum:
        - QUEUED
        - DOWNLOADING
        - DOWNLOADED
        - FAILED
        - STORED
      title: FileStatus
    RendiFileStoreType:
      type: string
      enum:
        - INPUT
        - OUTPUT
        - STORED_FILE
      title: RendiFileStoreType
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-KEY

````