TVU Networks Export

Media export and thumbnail job submission — submit an export or thumbnail job with an optional idempotency uuid and callbackUrl webhook, then poll or receive the completed asset. Contract assembled from the 6 per-endpoint OpenAPI 3.0.1 exports TVU publishes on its own API documentation site.

Operations 6

POST /cut-json Trim a JSON edit list to a time range #
POST /estimate-video-size Estimate output file size before exporting #
POST /export Export a video clip #
POST /exportaudio Export an audio clip #
POST /longexport Export a long video clip in chunks #
POST /merge Merge multiple video files into one #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/export"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no email required.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

tvu-networks-export-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: TVU Networks — Export
  description: Export operations of the TVU Networks public HTTP API, assembled verbatim from the per-endpoint
    OpenAPI 3.0.1 exports TVU publishes on its own Apifox documentation site (https://docs.tvunetworks.cn/).
    Each operation body is the provider's own export; only grouping, servers[] and operationId backfill
    were added by API Evangelist.
  version: 1.0.0
  contact:
    name: TVU Networks
    url: https://www.tvunetworks.com/tvu-developer/
servers:
- url: https://api.tvunetworks.com
  description: Prod Env default server
paths:
  /cut-json:
    post:
      summary: Trim a JSON edit list to a time range
      deprecated: false
      description: 'Fetches a TVU MediaMind JSON timeline/edit-list from `jsonUrl`, trims it to the

        `markIn`–`markOut` window (milliseconds relative to the timeline origin), uploads

        the trimmed JSON to S3, and returns its URL. Useful for creating sub-clips of a

        JSON-based production without touching the underlying media files.


        This is a **synchronous** endpoint — it returns immediately with the result.


        **Constraint:** `markOut` must be strictly greater than `markIn`.


        The output file is written to `s3://<Bucket>/<uploadPath>/<fileName>_<timestamp>_<duration>.json`.

        If `Bucket` or `uploadPath` are omitted, the service attempts to derive the destination

        from the source `jsonUrl`''s bucket/path. `fileName` is treated as a base name; do not

        include `.json` unless that text should be part of the generated base name.


        ### Error Codes


        | Code | Message | Cause |

        |------|---------|-------|

        | `0` | success | Trimmed JSON is available at `jsonUrl` |

        | `3001` | The json/hls link exception, please check. | `jsonUrl` is unreachable or returns an
        invalid response |

        | `3002` | The json content format exception, please check. | JSON content does not match expected
        format |

        | `3003` | Failed parsing or initialization of JSON''s bucket, please contact the developer to
        check. | Cannot determine or connect to the destination bucket from the JSON URL |

        | `3004` | Newly generated json upload failed, please contact the developer to check. | Trimmed
        JSON file failed to upload to S3 |

        '
      operationId: cutJsonV2
      tags:
      - Export
      - Export
      parameters:
      - name: SID
        in: header
        description: ''
        example: 92575d36dcb631ac94745e6b157de17a5a13d65b31e44869f06854ab928dd80235d4daae8696b4a92a7be5f802c45a219648701fc9ca59f44e9c0f022d5d38a7
        schema:
          type: string
          default: 92575d36dcb631ac94745e6b157de17a5a13d65b31e44869f06854ab928dd80235d4daae8696b4a92a7be5f802c45a219648701fc9ca59f44e9c0f022d5d38a7
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CutJsonReqV2'
            example:
              jsonUrl: https://mma-video-new.s3.us-east-1.amazonaws.com/export/story.json
              markIn: 5000
              markOut: 65000
              fileName: story_trimmed
              Bucket: media-export-bucket
              Region: us-east-1
              uploadPath: trimmed/
      responses:
        '200':
          description: Trimmed JSON URL
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CutJsonRes'
              examples:
                success:
                  summary: success
                  value:
                    errorCode: 0
                    errorMessage: success
                    jsonUrl: https://media-export-bucket.s3.us-east-1.amazonaws.com/trimmed/story_trimmed_20231114_120000_60000.json
                bad_url:
                  summary: bad_url
                  value:
                    errorCode: 3001
                    errorMessage: The json/hls link exception, please check.
                    jsonUrl: ''
                format_error:
                  summary: format_error
                  value:
                    errorCode: 3002
                    errorMessage: The json content format exception, please check.
                    jsonUrl: ''
          headers: {}
          x-apifox-name: ''
      security: []
      x-apifox-folder: Export
      x-apifox-status: released
      x-run-in-apifox: https://app.apifox.com/web/project/4126232/apis/api-473290199-run
      x-source-doc: https://docs.tvunetworks.cn/api-473290199.md
  /estimate-video-size:
    post:
      summary: Estimate output file size before exporting
      deprecated: false
      description: "Probes the source recording to estimate the output file size (in bytes) for a given\n\
        time range without performing the actual export. Use this before calling `/export` to\nenforce\
        \ storage quotas, display progress previews, or guard against unexpectedly large\nexports.\n\n\
        This is a **synchronous** endpoint — it returns immediately with the result.\n\n**`recMode`**\
        \ selects the parsing path used by the service:\n- `1` - URL mode: `filePath` is an HTTP(S) HLS\
        \ playlist or MPD URL that can be\n  parsed into bucket, key, and region.\n- `0` - storage-info\
        \ mode: `filePath` is a relative MPD/HLS path under the `TS`\n  storage root described by `storageInfo`.\n\
        \n**`storageInfo`** is a Base64-encoded JSON array containing the cloud storage credentials\n\
        and configuration for the source recording. It is parsed by storage-info mode.\n\n### Error Codes\n\
        \n| Code | Message | Cause |\n|------|---------|-------|\n| `1000` | task created successfully\
        \ | Success; read `videoSize` |\n| `1018` | the request param abnormal. | Required field missing\
        \ or invalid (filePath, startTime, duration, recMode, storageInfo, or userAccount) |\n| `1019`\
        \ | init aws s3 sdk failed, please contact TVU Support. | Storage credentials invalid or unreachable\
        \ |\n| `1023` | (bucket connection failed) | Failed to connect to the source storage bucket |\n\
        | `1093` | verify required ts fail. | Source TS file check failed for the requested time range\
        \ |\n"
      operationId: estimateVideoSize
      tags:
      - Export
      - Export
      parameters:
      - name: SID
        in: header
        description: ''
        example: 92575d36dcb631ac94745e6b157de17a5a13d65b31e44869f06854ab928dd80235d4daae8696b4a92a7be5f802c45a219648701fc9ca59f44e9c0f022d5d38a7
        schema:
          type: string
          default: 92575d36dcb631ac94745e6b157de17a5a13d65b31e44869f06854ab928dd80235d4daae8696b4a92a7be5f802c45a219648701fc9ca59f44e9c0f022d5d38a7
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EstimateVideoSizeReq'
            example:
              filePath: https://mma-video-new.s3.us-east-1.amazonaws.com/ts/PRODUCER_RECORDINGS/source-001/live-001/1/play.m3u8
              startTime: 1700000000000
              duration: 30000
              recMode: 1
              storageInfo: W3sic3RvcmFnZV90eXBlIjoiczMiLCJzdG9yYWdlX25hbWUiOiJtbWEtdmlkZW8tbmV3Iiwic3RvcmFnZV9sb2NhdGlvbiI6InVzLWVhc3QtMSIsInN0b3JhZ2VfcHVycG9zZSI6IlRTIiwic3RvcmFnZV9yb290X2ZvbGRlciI6IiJ9XQ==
              userAccount: user@example.com
      responses:
        '200':
          description: Estimated file size
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EstimateVideoSizeRes'
              examples:
                success:
                  summary: success
                  value:
                    errorCode: 1000
                    errorMsg: ''
                    videoSize: 52428800
                error:
                  summary: error
                  value:
                    errorCode: 1093
                    errorMsg: verify required ts fail.
                    videoSize: 0
          headers: {}
          x-apifox-name: ''
      security: []
      x-apifox-folder: Export
      x-apifox-status: released
      x-run-in-apifox: https://app.apifox.com/web/project/4126232/apis/api-473290196-run
      x-source-doc: https://docs.tvunetworks.cn/api-473290196.md
  /export:
    post:
      summary: Export a video clip
      deprecated: false
      description: "Trims a video clip from a TVU high-resolution recording archive (HLS/MPD) and uploads\n\
        the result to a caller-specified cloud storage location.\n\nThis is a **long-polling** endpoint.\
        \ On the **first call**, the server registers the job\nand returns `errorCode: 1000` with a non-zero\
        \ `timeWait`. The client must re-submit the\n**identical request body** at `timeWait`-millisecond\
        \ intervals until `errorCode` reaches\na terminal state:\n- `1005` (Work Finish) — export succeeded;\
        \ read `videoPath`, `fileSize`, `videoDuration`.\n- Any other non-`1001` code — export failed;\
        \ read `errorMsg`.\n\n**Task identity** is derived from `fileName` (or an auto-generated hash\
        \ of\n`highResolutionMediaFilePath` + `startTime` + `duration` when omitted). Submitting the\n\
        same body while a job is in progress returns the current task state without spawning\na duplicate\
        \ job.\n\n**Key options**\n- `isDryrun` (default `true`) — validate the request without performing\
        \ the actual export.\n  Set to `false` to trigger a real export.\n- `isFrameLevel` — enable sub-GOP\
        \ frame-accurate cut points.\n- `isCover` — overwrite the output file if it already exists (default\
        \ `false`; returns\n  `1100` if the file exists and this flag is not set).\n- `withMetadataJson`\
        \ — also produce a companion JSON metadata sidecar alongside the video.\n- `audioPadding` / `videoPadding`\
        \ — prepend/append silent audio or black-frame padding.\n\n### Error Codes\n\n| Code | Message\
        \ | Cause |\n|------|---------|-------|\n| `1000` | task created successfully | Task registered;\
        \ begin polling (`timeWait` > 0) |\n| `1001` | work not finish. | Still processing — wait `timeWait`\
        \ ms and poll again |\n| `1004` | file already exist. | Source filename conflict (intermediate\
        \ state) |\n| `1005` | Work Finish | **Export completed successfully** (terminal, `timeWait` =\
        \ 0) |\n| `1017` | add user task fail. | Internal error creating the export job; retry |\n| `1018`\
        \ | the request param abnormal. | A required field is missing or invalid |\n| `1019` | init aws\
        \ s3 sdk failed, please contact TVU Support. | Destination storage credentials are invalid or\
        \ unreachable |\n| `1020` | tvu264 some error. | Video transcoding process failed |\n| `1021`\
        \ | upload file fail | Failed to upload the output file to cloud storage |\n| `1026` | file restore\
        \ error. | Source file is archived (Glacier); restore timed out |\n| `1031` | video export time\
        \ exceeds limit. | System-wide concurrent export quota reached; try later |\n| `1032` | the number\
        \ of user max export task exceeds limit. | This user has too many concurrent export jobs |\n|\
        \ `1035` | open or create file fail. | Server failed to open the output file for writing |\n|\
        \ `1042` | consume memory task num exceeds limit. | Server memory task limit reached; try later\
        \ |\n| `1046` | insufficient remaining free space | Server disk is full; contact TVU Support |\n\
        | `1050` | (locate source failed) | Cannot locate source TS segments for the requested time range\
        \ |\n| `1051` | (download temp ts error) | Failed to download temporary TS segments |\n| `1052`\
        \ | (exceed duration limit) | Clip duration exceeds the allowed maximum |\n| `1053` | (metadata\
        \ json error) | Failed to generate companion metadata JSON (`withMetadataJson=true`) |\n| `1084`\
        \ | from redis get user task fail. | Cache lookup failed; retry after a moment |\n| `1086` | get\
        \ source ts signature url fail. | Failed to generate a signed URL for the source media |\n| `1093`\
        \ | verify required ts fail. | Source TS file integrity check failed |\n| `1099` | Media processing\
        \ encountered an exception. Please retry... | Unexpected processing error; retry, then contact\
        \ TVU Support |\n| `1100` | export file already existed. | Output file exists and `isCover` was\
        \ not set to `true` |\n"
      operationId: publicExport
      tags:
      - Export
      - Export
      parameters:
      - name: SID
        in: header
        description: ''
        example: 92575d36dcb631ac94745e6b157de17a5a13d65b31e44869f06854ab928dd80235d4daae8696b4a92a7be5f802c45a219648701fc9ca59f44e9c0f022d5d38a7
        schema:
          type: string
          default: 92575d36dcb631ac94745e6b157de17a5a13d65b31e44869f06854ab928dd80235d4daae8696b4a92a7be5f802c45a219648701fc9ca59f44e9c0f022d5d38a7
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicExportReq'
            example:
              highResolutionMediaFilePath: https://mma-video-new.s3.us-east-1.amazonaws.com/ts/PRODUCER_RECORDINGS/source-001/live-001/1/play.m3u8
              startTime: 1700000000000
              duration: 30000
              userAccount: user@example.com
              fileName: clip_20231114_30s
              fileType: mp4
              isDryrun: false
              destination:
                cloudVendor: s3
                bucket: media-export-bucket
                region: us-east-1
                folder: export/
      responses:
        '200':
          description: Job status (poll again if `errorCode == 1001`)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicExportRes'
              examples:
                success:
                  summary: Export complete
                  value:
                    errorCode: 1005
                    errorMsg: Work Finish
                    isDryrun: false
                    timeWait: 0
                    videoPath: https://media-export-bucket.s3.us-east-1.amazonaws.com/export/clip_20231114_30s.mp4
                    fileSize: 52428800
                    videoDuration: 30000
                    thumbnailInfo:
                      url: https://mma-video-new.s3.us-east-1.amazonaws.com/ts/PRODUCER_RECORDINGS/source-001/live-001/source-001_live-001_1700000000000_30000.jpg
                      width: '1920'
                      height: '1080'
                    videoInfo:
                      url: https://media-export-bucket.s3.us-east-1.amazonaws.com/export/clip_20231114_30s.mp4
                      type: mp4
                      bitrate: 5000k
                      width: '1920'
                      height: '1080'
                      framerate: '29.97'
                      duration: '30'
                pending:
                  summary: Still processing — poll again
                  value:
                    errorCode: 1001
                    errorMsg: work not finish.
                    isDryrun: false
                    timeWait: 3000
                user_limit:
                  summary: User export quota exceeded
                  value:
                    errorCode: 1032
                    errorMsg: the number of user max export task exceeds limit.
                    timeWait: 0
          headers: {}
          x-apifox-name: ''
      security: []
      x-apifox-folder: Export
      x-apifox-status: released
      x-run-in-apifox: https://app.apifox.com/web/project/4126232/apis/api-473290194-run
      x-source-doc: https://docs.tvunetworks.cn/api-473290194.md
  /exportaudio:
    post:
      summary: Export an audio clip
      deprecated: false
      description: 'Extracts and encodes an audio-only clip from a TVU MediaMind media object and uploads

        the result to cloud storage. The source is identified by `sourceObjectId` (the internal

        TVU MediaMind object ID) rather than a raw file path; the service resolves the underlying

        storage location automatically.


        This is a **long-polling** endpoint — keep re-submitting the same body until

        `errorCode` is `1005` (terminal success, `status: 2`) or a non-`1001` error code.


        **Output format** is inferred from the `fileName` extension. The `mediaType` field is

        used to select the source media record returned by metadata lookup: use `"mma"` for

        high-resolution media; omit it or use another value for preview media.


        **Optional AI transcription** (`reTranscribe.switch: true`): after the audio file is

        exported, it is uploaded to an AI transcription service. The transcription group and

        language are set via `reTranscribe.groupId` and `reTranscribe.language`. If this upload

        fails, the job returns `1029` rather than `1005`.


        **Webhook**: set `callbackUrl` to receive an HTTP POST notification when the job

        completes instead of (or in addition to) polling.


        **Idempotency**: supply `uuid` to prevent duplicate jobs — re-submitting the same `uuid`

        returns the existing job''s state.


        ### Error Codes


        | Code | Message | Cause |

        |------|---------|-------|

        | `1000` | task created successfully | Task registered; begin polling (`timeWait` > 0) |

        | `1001` | work not finish. | Still processing — wait `timeWait` ms and poll again |

        | `1005` | Work Finish | **Audio export completed successfully** (terminal, `timeWait` = 0, `status`
        = 2) |

        | `1017` | add user task fail. | Task creation failed; retry |

        | `1018` | the request param abnormal. | Required field missing (sourceObjectId, etc.) |

        | `1020` | tvu264 some error. | Audio encoding failed |

        | `1021` | upload file fail | Failed to upload output audio to cloud storage |

        | `1029` | failed to upload audio to AI | AI transcription upload failed (only when `reTranscribe.switch=true`)
        |

        | `1031` | video export time exceeds limit. | System export quota reached |

        | `1032` | the number of user max export task exceeds limit. | User export limit reached |

        | `1033` | The bucket of the media is wrong. | Source media bucket is misconfigured |

        | `1081` | get storage fail. | Failed to retrieve storage configuration |

        | `1084` | from redis get user task fail. | Cache lookup error; retry |

        | `1099` | Media processing encountered an exception. Please retry... | Unexpected processing
        error |

        '
      operationId: exportAudioV2
      tags:
      - Export
      - Export
      parameters:
      - name: SID
        in: header
        description: ''
        example: 92575d36dcb631ac94745e6b157de17a5a13d65b31e44869f06854ab928dd80235d4daae8696b4a92a7be5f802c45a219648701fc9ca59f44e9c0f022d5d38a7
        schema:
          type: string
          default: 92575d36dcb631ac94745e6b157de17a5a13d65b31e44869f06854ab928dd80235d4daae8696b4a92a7be5f802c45a219648701fc9ca59f44e9c0f022d5d38a7
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExportAudioReqV2'
            example:
              startTime: 1700000000000
              duration: 60000
              sourceObjectId: '123456789012345678'
              fileName: audio_extract.flac
              sampleRate: 48000
              mediaType: mma
      responses:
        '200':
          description: Audio export status
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExportAudioResV2'
              examples:
                success:
                  summary: Export complete
                  value:
                    errorCode: 1005
                    errorMessage: Work Finish
                    status: 2
                    timeWait: 0
                    audioPath: https://mma-video-new.s3.us-east-1.amazonaws.com/export/audio_extract.flac
                pending:
                  summary: Still processing
                  value:
                    errorCode: 1001
                    errorMessage: work not finish.
                    status: 1
                    timeWait: 2000
                    audioPath: ''
          headers: {}
          x-apifox-name: ''
      security: []
      x-apifox-folder: Export
      x-apifox-status: released
      x-run-in-apifox: https://app.apifox.com/web/project/4126232/apis/api-473290197-run
      x-source-doc: https://docs.tvunetworks.cn/api-473290197.md
  /longexport:
    post:
      summary: Export a long video clip in chunks
      deprecated: false
      description: "Exports a long recording segment by automatically splitting it into sequential chunk\n\
        files and uploading each chunk to cloud storage as it completes. Designed for exports\nthat are\
        \ too long for a single `/export` call (e.g. hours of footage).\n\nThis is a **long-polling**\
        \ endpoint. On the **first call** the server registers the job\n(`errorCode: 1000`) and begins\
        \ splitting the total `duration` into sub-tasks of at most\n`maxChunkDuration` milliseconds each.\
        \ Re-poll the **identical request body** at\n`timeWait`-millisecond intervals to observe progress:\n\
        - `errorCode: 1001` — processing in progress; `videoList` may already contain\n  completed early\
        \ chunks.\n- `errorCode: 1005` — all chunks are done; `videoList` is complete.\n\n**Incremental\
        \ delivery**: each entry in `videoList` has an `isCompleted` flag.\nThe list grows poll-by-poll,\
        \ so clients can begin downstream processing on completed\nchunks before the overall job finishes.\n\
        \n`maxChunkDuration` controls the granularity/count of output files. Smaller values\nproduce more\
        \ chunks but allow faster incremental access.\n\n### Error Codes\n\n| Code | Message | Cause |\n\
        |------|---------|-------|\n| `1000` | task created successfully | Task registered; begin polling\
        \ (`timeWait` > 0) |\n| `1001` | work not finish. | Still processing — wait `timeWait` ms and\
        \ poll again |\n| `1004` | file already exist. | Source filename conflict (intermediate state)\
        \ |\n| `1005` | Work Finish | **All chunks exported successfully** (terminal, `timeWait` = 0)\
        \ |\n| `1017` | add user task fail. | Internal error creating the job; retry |\n| `1018` | the\
        \ request param abnormal. | A required field is missing or invalid |\n| `1019` | init aws s3 sdk\
        \ failed, please contact TVU Support. | Destination storage credentials are invalid |\n| `1031`\
        \ | video export time exceeds limit. | System export quota reached |\n| `1032` | the number of\
        \ user max export task exceeds limit. | User concurrent export limit reached |\n| `1037` | search\
        \ son dir info fail. | Failed to find source subdirectory information |\n| `1038` | subtask splitting\
        \ process failed. | Failed to split the duration into sub-tasks |\n| `1046` | insufficient remaining\
        \ free space | Server disk full |\n| `1050` | (locate source failed) | Cannot find source TS files\
        \ for the time range |\n| `1084` | from redis get user task fail. | Cache error; retry |\n| `1086`\
        \ | get source ts signature url fail. | Failed to sign source media URL |\n| `1093` | verify required\
        \ ts fail. | Source TS file check failed |\n| `1099` | Media processing encountered an exception.\
        \ Please retry... | Unexpected error |\n"
      operationId: publicLongExport
      tags:
      - Export
      - Export
      parameters:
      - name: SID
        in: header
        description: ''
        example: 92575d36dcb631ac94745e6b157de17a5a13d65b31e44869f06854ab928dd80235d4daae8696b4a92a7be5f802c45a219648701fc9ca59f44e9c0f022d5d38a7
        schema:
          type: string
          default: 92575d36dcb631ac94745e6b157de17a5a13d65b31e44869f06854ab928dd80235d4daae8696b4a92a7be5f802c45a219648701fc9ca59f44e9c0f022d5d38a7
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicLongexportReq'
            example:
              filePath: https://mma-video-new.s3.us-east-1.amazonaws.com/ts/PRODUCER_RECORDINGS/source-001/live-001/1/play.m3u8
              startTime: 1700000000000
              duration: 3600000
              maxChunkDuration: 600000
              userAccount: user@example.com
              fileName: long_clip_20231114
              fileType: ts
              destination:
                cloudVendor: s3
                bucket: media-export-bucket
                region: us-east-1
                folder: export/
      responses:
        '200':
          description: Job status (poll again if `errorCode == 1001`)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicLongexportRes'
              examples:
                success:
                  summary: All chunks complete
                  value:
                    errorCode: 1005
                    errorMsg: Work Finish
                    timeWait: 0
                    videoList:
                    - startTime: 1700000000000
                      duration: 600000
                      videoPath: https://media-export-bucket.s3.us-east-1.amazonaws.com/export/long_clip_20231114-1.ts
                      isCompleted: true
                    - startTime: 1700000600000
                      duration: 600000
                      videoPath: https://media-export-bucket.s3.us-east-1.amazonaws.com/export/long_clip_20231114-2.ts
                      isCompleted: true
                pending:
                  summary: First chunk done, more in progress
                  value:
                    errorCode: 1001
                    errorMsg: work not finish.
                    timeWait: 5000
                    videoList:
                    - startTime: 1700000000000
                      duration: 600000
                      videoPath: https://media-export-bucket.s3.us-east-1.amazonaws.com/export/long_clip_20231114-1.ts
                      isCompleted: true
          headers: {}
          x-apifox-name: ''
      security: []
      x-apifox-folder: Export
      x-apifox-status: released
      x-run-in-apifox: https://app.apifox.com/web/project/4126232/apis/api-473290195-run
      x-source-doc: https://docs.tvunetworks.cn/api-473290195.md
  /merge:
    post:
      summary: Merge multiple video files into one
      deprecated: false
      description: 'Concatenates an ordered list of S3 video segments into a single output file and uploads

        the result to the specified S3 destination. Segments are joined in `order` sequence

        without re-encoding where possible.


        This is a **long-polling** endpoint — keep re-submitting the **same body** until

        `ErrorCode == 0` (success) or a non-`1` error code. The task identity key is derived

        from the combination of `user_id` and the destination `full_path`.


        **Supported output formats**: `ts`, `mp4`, `mov`, `mkv`, `mxf`.

        JSON (`media_type = "json"`) source files are **not** supported; the job immediately

        returns `ErrorCode: 49`.


        **Note:** this endpoint uses a separate error code namespace (`0–99`) distinct from the

        `1000+` range used by `/export` and `/longexport`. The polling sentinel is `ErrorCode: 1`

        ("work not finish"), and the success terminal is `ErrorCode: 0`.


        ### Error Codes


        | Code | Message | Cause |

        |------|---------|-------|

        | `0` | success | Merge complete; read `VideoPath`/`VideoUrl` |

        | `1` | work not finish. | Still processing — wait `TimeWait` ms and poll again |

        | `17` | add user task fail. | Task creation failed; retry |

        | `20` | tvu264 some error. | Video transcoding/merge process failed |

        | `21` | (upload error) | Failed to upload merged output to cloud storage |

        | `22` | (S3 object error) | Cloud storage object is null; check bucket/region settings |

        | `25` | coding cancel. | Merge job was cancelled |

        | `31` | video export time exceeds limit. | System-wide merge quota reached |

        | `32` | the number of user max export task exceeds limit. | User concurrent merge limit reached
        |

        | `49` | not support merge and upload json. | JSON media type is not supported for merge |

        | `84` | from redis get user task fail. | Cache lookup failed; retry |

        | `93` | verify required ts fail. | Source file integrity check failed |

        '
      operationId: mergeVideo
      tags:
      - Export
      - Export
      parameters:
      - name: SID
        in: header
        description: ''
        example: 92575d36dcb631ac94745e6b157de17a5a13d65b31e44869f06854ab928dd80235d4daae8696b4a92a7be5f802c45a219648701fc9ca59f44e9c0f022d5d38a7
        schema:
          type: string
          default: 92575d36dcb631ac94745e6b157de17a5a13d65b31e44869f06854ab928dd80235d4daae8696b4a92a7be5f802c45a219648701fc9ca59f44e9c0f022d5d38a7
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MergeVideoReq'
            example:
              user_id: user@example.com
              source_file_list:
              - order: 1
                bucket: mma-video-new
                region: us-east-1
                video_path: export/part1.ts
              - order: 2
                bucket: mma-video-new
                region: us-east-1
                video_path: export/part2.ts
              destination:
                bucket: media-export-bucket
                region: us-east-1
                full_path: merged/final
                media_type: mp4
      responses:
        '200':
          description: Merge job status
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MergeVideoRes'
              examples:
                success:
                  summary: Merge complete
                  value:
                    ErrorCode: 0
                    ErrorMessage: success
                    VideoPath: merged/final.mp4
                    VideoUrl: https://media-export-bucket.s3.us-east-1.amazonaws.com/merged/final.mp4
                    TimeWait: 0
                pending:
                  summary: Still processing
                  value:
                    ErrorCode: 1
                    ErrorMessage: work not finish.
                    VideoPath: ''
                    VideoUrl: ''
                    TimeWait: 3000
                json_not_supported:
                  summary: JSON media type rejected
                  value:
                    ErrorCode: 49
                    ErrorMessage: not support merge and upload json.
                    TimeWait: 0
          headers: {}
          x-apifox-name: ''
      security: []
      x-apifox-folder: Export
      x-apifox-status: released
      x-run-in-apifox: https://app.apifox.com/web/project/4126232/apis/api-473290198-run
      x-source-doc: https://docs.tvunetworks.cn/api-473290198.md
components:
  schemas:
    PublicExportReq:
      type: object
      required:
      - highResolutionMediaFilePath
      - startTime
      - duration
      - userAccount
      properties:
        highResolutionMediaFilePath:
          type: string
          format: uri
          description: HTTP(S) URL to the high-resolution source HLS playlist (`play.m3u8`) or MPD (`stream.mpd`).
            Relative paths are not accepted by `/export`.
          examples:
          - https://mma-video-new.s3.us-east-1.amazonaws.com/ts/PRODUCER_RECORDINGS/source-001/live-001/1/play.m3u8
        startTime:
          type: integer
          format: int64
          description: Clip start position as a Unix timestamp in **milliseconds**.
          examples:
          - 1700000000000
        duration:
          type: integer
          format: int64
          description: Clip duration in **milliseconds**.
          examples:
          - 30000
        userAccount:
          type: string
          description: Email or identifier of the user making the req

# --- truncated at 32 KB (58 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/tvu-networks/refs/heads/main/openapi/tvu-networks-export-openapi.yml