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

# Enhance a video from URL

> Starts a job that enhances a video hosted on an publicly accessible  URL,

for example: https://sample-videos.com/video321/mp4/720/big_buck_bunny_720p_1mb.mp4

If your videos are stored on S3 or another provider, you can directly start the enhancement job using this endpoint without needing to upload the video first.

> **⚠️ IMPORTANT:** Ensure that the video URL is either publicly accessible or [presigned](https://docs.aws.amazon.com/AmazonS3/latest/userguide/ShareObjectPreSignedURL.html) if stored privately on S3 or similar platforms. For presigned URLs, we recommend setting the signature expiry to at least 2 hours to avoid potential job failures.

## Supported URLs

We support direct URLs to video resources only. Third-party hosting platforms like YouTube, Instagram, Vimeo, or TikTok are not supported.

If the URL cannot be parsed as a video, the endpoint will return a status code of `400`.

> **⚠️ IMPORTANT**: Your account will be limited by the total storage of all enhanced and uploaded videos. While this limit will be set to a high number (1TB+), we highly recommend you delete the enhanced video after the enhanced video is copied to your server. This ensures you won't run into storage limit errors in the future.



## OpenAPI

````yaml https://backend.tensorpix.ai/api/schema/ post /api/jobs/from-url/
openapi: 3.1.0
info:
  title: TensorPix OpenAPI Documentation
  version: 1.1.0
  termsOfService: https://tensorpix.ai/terms-conditions
  contact:
    name: TensorPix Dev Team
    email: devs@tensorpix.ai
servers:
  - url: https://backend.tensorpix.ai
security: []
externalDocs:
  url: https://docs.tensorpix.ai
  description: Check out the full TensorPix documentation.
paths:
  /api/jobs/from-url/:
    post:
      tags:
        - jobs
      summary: Enhance a video from URL
      description: >-
        Starts a job that enhances a video hosted on an publicly accessible 
        URL,


        for example:
        https://sample-videos.com/video321/mp4/720/big_buck_bunny_720p_1mb.mp4


        If your videos are stored on S3 or another provider, you can directly
        start the enhancement job using this endpoint without needing to upload
        the video first.


        > **⚠️ IMPORTANT:** Ensure that the video URL is either publicly
        accessible or
        [presigned](https://docs.aws.amazon.com/AmazonS3/latest/userguide/ShareObjectPreSignedURL.html)
        if stored privately on S3 or similar platforms. For presigned URLs, we
        recommend setting the signature expiry to at least 2 hours to avoid
        potential job failures.


        ## Supported URLs


        We support direct URLs to video resources only. Third-party hosting
        platforms like YouTube, Instagram, Vimeo, or TikTok are not supported.


        If the URL cannot be parsed as a video, the endpoint will return a
        status code of `400`.


        > **⚠️ IMPORTANT**: Your account will be limited by the total storage of
        all enhanced and uploaded videos. While this limit will be set to a high
        number (1TB+), we highly recommend you delete the enhanced video after
        the enhanced video is copied to your server. This ensures you won't run
        into storage limit errors in the future.
      operationId: jobs_from_url_create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EnhanceVideo'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/EnhanceVideo'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/EnhanceVideo'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnhanceJobResponse'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
          description: ''
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthenticatedError'
          description: ''
        '402':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericError'
          description: ''
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
          description: ''
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitError'
          description: ''
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericError'
          description: ''
      security:
        - tokenAuth: []
components:
  schemas:
    EnhanceVideo:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        codec:
          allOf:
            - $ref: '#/components/schemas/CodecEnum'
          description: |-
            Codec used for the Enhanced video.

            * `libx264` - H264
            * `libx265` - HEVC/H265
            * `prores_ks` - Apple ProRes
        crf:
          type: integer
          maximum: 51
          minimum: 0
          description: >-
            Constant Rate Factor (CRF) is encoding quality of the output video.
            23 is a good starting value. Set to 20 or lower if you need very
            high quality encoding (increased file size), or higher than 25 if
            quality is not paramount (smaller file size). [Learn more about
            CRF](https://trac.ffmpeg.org/wiki/Encode/H.264#crf). 
        container:
          allOf:
            - $ref: '#/components/schemas/ContainerEnum'
          description: |-
            Container format of the Enhanced video.

            * `mov` - Mov
            * `mkv` - Mkv
            * `mp4` - Mp4
        chroma_subsampling:
          oneOf:
            - $ref: '#/components/schemas/ChromaSubsamplingEnum'
            - $ref: '#/components/schemas/BlankEnum'
        video_url:
          type: string
          format: uri
          description: >-
            Video URL. The URL must be accessible. Example:
            https://sample-videos.com/video321/mp4/720/big_buck_bunny_720p_1mb.mp4
          maxLength: 2048
          minLength: 1
        ml_models:
          type: array
          items:
            type: integer
        output_resolution:
          allOf:
            - $ref: '#/components/schemas/OutputResolutionEnum'
          minimum: -2147483648
          maximum: 2147483647
        grain:
          type: number
          format: double
          maximum: 1
          minimum: 0
          description: >-
            Grain amount to add to the enhanced video in range [0, 1]. 0 is
            default.
        input_video:
          type:
            - integer
            - 'null'
          readOnly: true
        comparison:
          type: boolean
          description: >-
            Flag which denotes if the output video will be side by side video of
            the original and enhanced video.
        stabilization_smoothing:
          type: integer
          maximum: 40
          minimum: 0
          description: >-
            If AI Stabilization filter is enabled, this parameter controls the
            intensity of stabilization. Ignored if AI Stabilization is disabled.
            Use higher values for very shaky videos, and lower strength for less
            shaky videos. Video may be zoomed in if the video is very shaky.
        target_fps:
          type: number
          format: double
          maximum: 240
          minimum: 1
          description: >-
            Target FPS for the enhanced video. If not provided, the original FPS
            will be used. If provided, should be greater than or equal to the
            original FPS. If lower, it will be set to the original FPS.
            **IMPORTANT**: Won't be applied if the FPS BOOST model isn't passed
            in `ml_models.`
        playback_speed:
          type: number
          format: double
          maximum: 1
          minimum: 0.1
          description: >-
            Playback speed of the video. 1.0 means the video will play at normal
            speed. 0.5 means the video will play at half speed with AI
            interpolated frames in between. **IMPORTANT**: Won't be applied if
            the SLOW MOTION model isn's passed in `ml_models.`
        sharpen_strength:
          type: number
          format: double
          maximum: 10
          minimum: 0
          description: >-
            If AI Sharpen filter is enabled, this parameter controls the
            intensity of sharpening. Ignored if AI Sharpen filter is disabled.
        cost_usd:
          type: string
          format: decimal
          pattern: ^-?\d{0,6}(?:\.\d{0,4})?$
          readOnly: true
          description: Job cost in 🪙 Credits.
        preview:
          type: boolean
          default: false
        start_frame:
          type:
            - integer
            - 'null'
          maximum: 2147483647
          minimum: 0
          description: Cuts the video starting from this frame before enhancing it.
        end_frame:
          type:
            - integer
            - 'null'
          maximum: 2147483647
          minimum: 1
          description: Cuts the video ending on this frame before enhancing it.
      required:
        - cost_usd
        - id
        - input_video
        - ml_models
        - video_url
    EnhanceJobResponse:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        cost_usd:
          type: string
          format: decimal
          pattern: ^-?\d{0,6}(?:\.\d{0,4})?$
          description: Job cost in 🪙 Credits.
        input_video:
          type:
            - integer
            - 'null'
        status:
          allOf:
            - $ref: '#/components/schemas/StatusEnum'
          description: |-
            Job's status

            * `0` - In Queue
            * `1` - Processing
            * `2` - Finished
            * `-1` - Failed
            * `-2` - Canceled
          minimum: -2147483648
          maximum: 2147483647
      required:
        - cost_usd
        - id
    ValidationError:
      type: object
      properties:
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
        non_field_errors:
          type: array
          items:
            type: string
      required:
        - errors
        - non_field_errors
    UnauthenticatedError:
      type: object
      properties:
        detail:
          type: string
      required:
        - detail
    GenericError:
      type: object
      properties:
        detail:
          type: string
      required:
        - detail
    ForbiddenError:
      type: object
      properties:
        detail:
          type: string
      required:
        - detail
    RateLimitError:
      type: object
      properties:
        detail:
          type: string
      required:
        - detail
    CodecEnum:
      enum:
        - libx264
        - libx265
        - prores_ks
      type: string
      description: |-
        * `libx264` - H264
        * `libx265` - HEVC/H265
        * `prores_ks` - Apple ProRes
    ContainerEnum:
      enum:
        - mov
        - mkv
        - mp4
      type: string
      description: |-
        * `mov` - Mov
        * `mkv` - Mkv
        * `mp4` - Mp4
    ChromaSubsamplingEnum:
      enum:
        - yuv420p
        - yuv422p
        - yuv444p
        - yuv420p10le
        - yuv422p10le
        - yuv444p10le
      type: string
      description: |-
        * `yuv420p` - 8-bit 4:2:0
        * `yuv422p` - 8-bit 4:2:2
        * `yuv444p` - 8-bit 4:4:4
        * `yuv420p10le` - 10-bit 4:2:0
        * `yuv422p10le` - 10-bit 4:2:2
        * `yuv444p10le` - 10-bit 4:4:4
    BlankEnum:
      enum:
        - ''
    OutputResolutionEnum:
      enum:
        - -1
        - 640
        - 720
        - 854
        - 1280
        - 1920
        - 2048
        - 2560
        - 3840
      type: integer
      description: |-
        * `-1` - No Resize
        * `640` - 360p
        * `720` - SD
        * `854` - HQ
        * `1280` - 720p
        * `1920` - 1080p
        * `2048` - 2K
        * `2560` - QHD
        * `3840` - 4K
    StatusEnum:
      enum:
        - 0
        - 1
        - 2
        - -1
        - -2
      type: integer
      description: |-
        * `0` - In Queue
        * `1` - Processing
        * `2` - Finished
        * `-1` - Failed
        * `-2` - Canceled
  securitySchemes:
    tokenAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Token-based authentication with required prefix "Token"

````