> ## 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 uploaded video

> Enhance the uploaded video. To upload the video, use the [upload videos endpoint](https://backend.tensorpix.ai/api/schema/redoc/#tag/videos/operation/videos_create). After the video is uploaded, use this endpoint to start the video enhancing job. Make sure to set the `input_video` attribute to the uploaded video's ID which is returned in the response of the [upload videos endpoint](https://backend.tensorpix.ai/api/schema/redoc/#tag/videos/operation/videos_create).


## AI filters

AI filters are called `ml-models` in the API docs as they are actually machine learning
models.

See the `/api/ml-models` to learn more about ML models selection. After choosing the appropriate models, pass the list of their IDs in the `ml_models` parameter. You should pass at least one AI filter.

## Free Preview Jobs

Free Previews will process a short segment of the video (10sec) and won't cost any 🪙 Credits. To enable Free Previews in a job, set the `preview = True`.

You can use the `start_frame` to set the starting frame of the Free Preview segment.
`end_frame` parameter is ignored if `preview = True`.

## Enhancing specific video segments

To process a whole video, don't specify `start_frame` and `end_frame` and set
`preview = False`.

To process a specific video segment, set the `start_frame` to the starting frame of the
  segment, and `end_frame` to the end frame of the segment. `end_frame` must
  be > `start_frame`.

## Stabilization

`stabilization_smoothing` parameter is ignored unless the AI Stabilization Filter is set as
one of the ML models.

## Sharpening

`sharpen_strength` parameter is ignored unless the AI Sharpen Filter is set as
one of the ML models.

## Post enhancing clean-up

> **⚠️ 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/
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/:
    post:
      tags:
        - jobs
      summary: Enhance uploaded video
      description: >-
        Enhance the uploaded video. To upload the video, use the [upload videos
        endpoint](https://backend.tensorpix.ai/api/schema/redoc/#tag/videos/operation/videos_create).
        After the video is uploaded, use this endpoint to start the video
        enhancing job. Make sure to set the `input_video` attribute to the
        uploaded video's ID which is returned in the response of the [upload
        videos
        endpoint](https://backend.tensorpix.ai/api/schema/redoc/#tag/videos/operation/videos_create).



        ## AI filters


        AI filters are called `ml-models` in the API docs as they are actually
        machine learning

        models.


        See the `/api/ml-models` to learn more about ML models selection. After
        choosing the appropriate models, pass the list of their IDs in the
        `ml_models` parameter. You should pass at least one AI filter.


        ## Free Preview Jobs


        Free Previews will process a short segment of the video (10sec) and
        won't cost any 🪙 Credits. To enable Free Previews in a job, set the
        `preview = True`.


        You can use the `start_frame` to set the starting frame of the Free
        Preview segment.

        `end_frame` parameter is ignored if `preview = True`.


        ## Enhancing specific video segments


        To process a whole video, don't specify `start_frame` and `end_frame`
        and set

        `preview = False`.


        To process a specific video segment, set the `start_frame` to the
        starting frame of the
          segment, and `end_frame` to the end frame of the segment. `end_frame` must
          be > `start_frame`.

        ## Stabilization


        `stabilization_smoothing` parameter is ignored unless the AI
        Stabilization Filter is set as

        one of the ML models.


        ## Sharpening


        `sharpen_strength` parameter is ignored unless the AI Sharpen Filter is
        set as

        one of the ML models.


        ## Post enhancing clean-up


        > **⚠️ 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_create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateJob'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CreateJob'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CreateJob'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateJob'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
          description: ''
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthenticatedError'
          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:
    CreateJob:
      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). 
        qscale:
          type: integer
          maximum: 32
          minimum: 0
          description: >-
            Represents the `qscale` parameter in ffmpeg. Used with ProRes codec.
            Set the value between 9 and 13 for optimal results. [Learn more
            about Qscale](https://trac.ffmpeg.org/wiki/Encode/VFX#Prores)
        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'
        preview:
          type: boolean
          description: >-
            Flag which denotes if job is free preview job or not. Free preview
            jobs are not charged but the output video is watermarked and only a
            short video segment is enhanced.
        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.
        input_video:
          type:
            - integer
            - 'null'
        output_video:
          type:
            - integer
            - 'null'
          description: >-
            Once the job is finished, the `output_video` attribute will be
            populated with the enhanced video metadata. If the job is canceled
            or it fails, the output_video attribute will remain null.
        owner:
          type: string
          format: email
          title: Email address
          readOnly: true
        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.
        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.
        prores_profile:
          allOf:
            - $ref: '#/components/schemas/ProresProfileEnum'
          minimum: -2147483648
          maximum: 2147483647
      required:
        - cost_usd
        - id
        - ml_models
        - owner
    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
    ForbiddenError:
      type: object
      properties:
        detail:
          type: string
      required:
        - detail
    RateLimitError:
      type: object
      properties:
        detail:
          type: string
      required:
        - detail
    GenericError:
      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
    ProresProfileEnum:
      enum:
        - -1
        - 0
        - 1
        - 2
        - 3
        - 4
        - 5
      type: integer
      description: |-
        * `-1` - Auto
        * `0` - Proxy
        * `1` - Lt
        * `2` - Standard
        * `3` - Hq
        * `4` - V4444
        * `5` - V4444Xq
  securitySchemes:
    tokenAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Token-based authentication with required prefix "Token"

````