### POST /v1/run-ffmpeg-command Source: https://docs.rendi.dev/quick-start Submits an FFmpeg command to Rendi for execution. This endpoint takes input files, desired output files, and the FFmpeg command string as parameters. ```APIDOC ## POST /v1/run-ffmpeg-command ### Description Submits an FFmpeg command to Rendi for execution. This endpoint takes input files, desired output files, and the FFmpeg command string as parameters. ### Method POST ### Endpoint https://api.rendi.dev/v1/run-ffmpeg-command ### Parameters #### Headers - **X-API-KEY** (string) - Required - Your Rendi API key. - **Content-Type** (string) - Required - Must be `application/json; charset=utf-8`. #### Request Body - **input_files** (object) - Required - A map of symbolic input file names to their URLs. - **in_1** (string) - URL of the first input file. - **output_files** (object) - Required - A map of symbolic output file names to their desired filenames. - **out_1** (string) - Desired name for the output file. - **ffmpeg_command** (string) - Required - The FFmpeg command to execute, using symbolic names for input and output files (e.g., `{{in_1}}`, `{{out_1}}`). ### Request Example ```json { "input_files": { "in_1": "https://storage.rendi.dev/sample/sample.avi" }, "output_files": { "out_1": "output1.gif" }, "ffmpeg_command": "-i {{in_1}} -vf \"select='lte(t,60)*gt(trunc(t/10),trunc(prev_t/10))',setpts='PTS*0.025',scale=trunc(oh*a/2)*2:320:force_original_aspect_ratio=decrease,pad=trunc(oh*a/2)*2:320:-1:-1\" -an -vsync vfr {{out_1}}" } ``` ### Response #### Success Response (200) - **command_id** (string) - The unique identifier for the submitted command. #### Response Example ```json { "command_id": "089dd36c-723c-4a0a-b68a-8e8cbcc1afd2" } ``` ``` -------------------------------- ### FFmpeg Command Configuration Example Source: https://docs.rendi.dev/api-reference/endpoint/run-ffmpeg-command This example demonstrates the configuration for an FFmpeg command, specifying input and output files, the FFmpeg command string with video processing filters, and execution parameters like max command run time and CPU core allocation. It utilizes Jinja2-like templating for input/output placeholders. ```yaml requiredProperties: - input_files - output_files - ffmpeg_command example: ffmpeg_command: >- -i {{in_1}} -vf "select='lte(t,60)*gt(trunc(t/10),trunc(prev_t/10))',setpts='PTS*0.025',scale=trunc(oh*a/2)*2:320:force_original_aspect_ratio=decrease,pad=trunc(oh*a/2)*2:320:-1:-1" -an -vsync vfr {{out_1}} input_files: in_1: https://storage.rendi.dev/sample/sample.avi max_command_run_seconds: 300 output_files: out_1: output1.gif vcpu_count: 8 ``` -------------------------------- ### FFmpeg Command for GIF Generation Source: https://docs.rendi.dev/quick-start This is a standard FFmpeg command used to generate a GIF from the first minute of a video. It specifies input and output files, video filters for frame selection and scaling, and disables audio. This command can be executed directly or passed to the Rendi API. ```bash ffmpeg -i https://storage.rendi.dev/sample/sample.avi -vf "select='lte(t,60)*gt(trunc(t/10),trunc(prev_t/10))',setpts='PTS*0.025',scale=trunc(oh*a/2)*2:320:force_original_aspect_ratio=decrease,pad=trunc(oh*a/2)*2:320:-1:-1" -an -vsync vfr output1.gif ``` -------------------------------- ### GET /v1/commands/{command_id} Source: https://docs.rendi.dev/quick-start Polls the status of a previously submitted command using its unique command ID. This allows you to track the execution progress and retrieve results once completed. ```APIDOC ## GET /v1/commands/{command_id} ### Description Polls the status of a previously submitted command using its unique command ID. This allows you to track the execution progress and retrieve results once completed. ### Method GET ### Endpoint https://api.rendi.dev/v1/commands/{command_id} ### Parameters #### Path Parameters - **command_id** (string) - Required - The unique identifier of the command to poll. #### Headers - **X-API-KEY** (string) - Required - Your Rendi API key. ### Response #### Success Response (200) - **command_id** (string) - The unique identifier for the command. - **status** (string) - The current status of the command (e.g., `QUEUED`, `PROCESSING`, `SUCCESS`, `FAILED`). - **command_type** (string) - The type of command executed (e.g., `FFMPEG_COMMAND`). - **total_processing_seconds** (number) - Total time in seconds the command took to process. - **ffmpeg_command_run_seconds** (number) - Actual seconds the FFmpeg process ran. - **vcpu_count** (integer) - Number of vCPUs allocated for the command. - **output_files** (object) - Details about the generated output files. - **[output_file_name]** (object) - Information about a specific output file. - **file_id** (string) - Unique ID of the stored file. - **storage_url** (string) - URL to access the stored output file. - **status** (string) - Status of the file storage (e.g., `STORED`). - **rendi_store_type** (string) - Type of storage used by Rendi. - **is_deleted** (boolean) - Indicates if the file has been deleted. - **size_mbytes** (number) - Size of the file in megabytes. - **file_type** (string) - MIME type of the file. - **file_format** (string) - Format of the file (e.g., `gif`). - **width** (integer) - Width of the media file. - **height** (integer) - Height of the media file. - **original_request** (object) - The original request payload submitted to the API. #### Response Example ```json { "command_id": "089dd36c-723c-4a0a-b68a-8e8cbcc1afd2", "status": "SUCCESS", "command_type": "FFMPEG_COMMAND", "total_processing_seconds": 8.333879, "ffmpeg_command_run_seconds": 5.734427452087402, "vcpu_count": 8, "output_files": { "out_1": { "file_id": "da09eaa7-904f-45e2-a727-74760b2696f6", "storage_url": "https://storage.rendi.dev/files/bb0e5c57-2721-4cc5-9453-ceeb2fa60e33/089dd36c-723c-4a0a-b68a-8e8cbcc1afd2/output1.gif", "status": "STORED", "rendi_store_type": "OUTPUT", "is_deleted": false, "size_mbytes": 0.3879680633544922, "file_type": "image", "file_format": "gif", "width": 568, "height": 320 } }, "original_request": { "input_files": { "in_1": "https://storage.rendi.dev/sample/sample.avi" }, "output_files": { "out_1": "output1.gif" }, "ffmpeg_command": "-i {{in_1}} -vf \"select='lte(t,60)*gt(trunc(t/10),trunc(prev_t/10))',setpts='PTS*0.025',scale=trunc(oh*a/2)*2:320:force_original_aspect_ratio=decrease,pad=trunc(oh*a/2)*2:320:-1:-1\" -an -vsync vfr {{out_1}}" } } ``` ``` -------------------------------- ### POST /v1/run-chained-ffmpeg-commands Source: https://docs.rendi.dev/examples Submits a request to execute a series of FFmpeg commands on specified input files to produce desired output files. It supports generating multiple outputs like thumbnails and GIFs. ```APIDOC ## POST /v1/run-chained-ffmpeg-commands ### Description This endpoint executes a sequence of FFmpeg commands to process input video files and generate specified output files. It's designed for batch processing and complex media transformations. ### Method POST ### Endpoint https://api.rendi.dev/v1/run-chained-ffmpeg-commands ### Parameters #### Request Body - **input_files** (object) - Required - A mapping of input file identifiers to their URLs. - **field** (string) - URL of the input file. - **output_files** (object) - Required - A mapping of output file identifiers to their desired filenames. - **field** (string) - Desired filename for the output file. - **ffmpeg_commands** (array) - Required - An array of FFmpeg command strings to be executed in sequence. - **command** (string) - An FFmpeg command. Input and output files can be referenced using the identifiers defined in `input_files` and `output_files` respectively (e.g., `{{in_1}}`, `{{out_1}}`). ### Request Example ```json { "input_files": { "in_1": "https://storage.rendi.dev/sample/sample.avi" }, "output_files": { "out_1": "thumbnail.jpg", "out_2": "output.gif" }, "ffmpeg_commands": [ "-i {{in_1}} -ss 00:17 -vframes 1 {{out_1}}", "-i {{in_1}} -vf \"select='lte(t,60)*gt(trunc(t/10),trunc(prev_t/10))',setpts='PTS*0.1',scale=trunc(oh*a/2)*2:80:force_original_aspect_ratio=decrease,pad=trunc(oh*a/2)*2:80:-1:-1\" -an -vsync vfr {{out_2}}" ] } ``` ### Response #### Success Response (200) - **command_ids** (array) - An array containing the ID of the submitted command job. #### Response Example ```json { "command_ids": ["963b85e1-0a2d-4fde-8565-634ae0b22b92"] } ``` ``` -------------------------------- ### Run FFmpeg Command via Rendi API (cURL) Source: https://docs.rendi.dev/quick-start This snippet demonstrates how to use cURL to send an FFmpeg command to the Rendi API for processing. It includes input files, output file definitions, and the FFmpeg command itself. The API key is required for authentication. The output is a JSON object containing a command_id for tracking. ```bash curl --location 'https://api.rendi.dev/v1/run-ffmpeg-command' \ --header 'X-API-KEY: ' \ --header 'Content-Type: application/json; charset=utf-8' \ --data '{ \ "input_files": { \ "in_1": "https://storage.rendi.dev/sample/sample.avi" \ }, \ "output_files": { \ "out_1": "output1.gif" \ }, \ "ffmpeg_command": "-i {{in_1}} -vf \"select='\'lte(t,60)*gt(trunc(t/10),trunc(prev_t/10))\'\',setpts='\'PTS*0.025\'\',scale=trunc(oh*a/2)*2:320:force_original_aspect_ratio=decrease,pad=trunc(oh*a/2)*2:320:-1:-1\" -an -vsync vfr {{out_1}}" \ }' ``` -------------------------------- ### Poll for FFmpeg Command Results (GET Request) Source: https://docs.rendi.dev/examples After submitting an FFmpeg command, use this GET request to poll the Rendi API for the status and results of the command execution. Replace `42c95292-d953-4b5a-8a58-cf1513363a33` with the actual `command_id` received from the initial submission. ```bash curl --request GET \ --url https://api.rendi.dev/v1/commands/42c95292-d953-4b5a-8a58-cf1513363a33 \ --header 'X-API-KEY: ' ``` -------------------------------- ### Generate multiple thumbnails from video Source: https://docs.rendi.dev/examples This endpoint allows you to generate multiple thumbnails from a video file by providing an FFmpeg command. It takes input files, specifies output file names, and defines the FFmpeg command to execute. ```APIDOC ## POST /v1/run-ffmpeg-command ### Description Generates multiple thumbnails from a video using a specified FFmpeg command. This endpoint is useful for extracting specific frames or segments of a video as image thumbnails. ### Method POST ### Endpoint https://api.rendi.dev/v1/run-ffmpeg-command ### Parameters #### Request Body - **input_files** (object) - Required - A map of input file identifiers to their URLs. - **in_1** (string) - Required - URL of the input video file. - **output_files** (object) - Required - A map of output file identifiers to their desired filenames. - **out_1** (string) - Required - Desired filename for the first thumbnail. - **out_2** (string) - Required - Desired filename for the second thumbnail. - **ffmpeg_command** (string) - Required - The FFmpeg command to execute. Use `{{input_file_identifier}}` and `{{output_file_identifier}}` for referencing files. ### Request Example ```json { "input_files": { "in_1": "https://storage.rendi.dev/sample/sample.avi" }, "output_files": { "out_1": "thumbnail1.jpg", "out_2": "thumbnail2.jpg" }, "ffmpeg_command": "-i {{in_1}} -filter_complex \"[0:v]split=2[first][second];[first]select='gte(t,10)'[thumb1];[second]select='gte(t,20)'[thumb2]\" -map [thumb1] -frames:v 1 {{out_1}} -map [thumb2] -frames:v 1 {{out_2}}" } ``` ### Response #### Success Response (200) - **command_id** (string) - The unique identifier for the executed command. #### Response Example ```json { "command_id": "f6bb88cb-83a9-4ea5-b763-078bff3431d4" } ``` ``` -------------------------------- ### POST /v1/run-ffmpeg-command Source: https://docs.rendi.dev/examples Submits a request to run a custom FFmpeg command on the Rendi platform. This endpoint is used to process video files, allowing for transformations like trimming and resolution changes. ```APIDOC ## POST /v1/run-ffmpeg-command ### Description Submits a request to run a custom FFmpeg command on the Rendi platform. This endpoint is used to process video files, allowing for transformations like trimming and resolution changes. ### Method POST ### Endpoint https://api.rendi.dev/v1/run-ffmpeg-command ### Parameters #### Request Body - **input_files** (object) - Required - A mapping of input file identifiers to their URLs. - **in_1** (string) - Required - URL of the first input file. - **output_files** (object) - Required - A mapping of output file identifiers to their desired filenames. - **out_1** (string) - Required - Desired filename for the first output file. - **out_2** (string) - Optional - Desired filename for the second output file. - **ffmpeg_command** (string) - Required - The FFmpeg command string to execute. Use `{{input_identifier}}` and `{{output_identifier}}` for file referencing. ### Request Example ```json { "input_files": { "in_1": "https://storage.rendi.dev/sample/sample.avi" }, "output_files": { "out_1": "output_320p.mp4", "out_2": "output_180p.mp4" }, "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}}" } ``` ### Response #### Success Response (200) - **command_id** (string) - A unique identifier for the submitted command. #### Response Example ```json { "command_id": "42c95292-d953-4b5a-8a58-cf1513363a33" } ``` ``` -------------------------------- ### Example Successful Webhook Payload (JSON) Source: https://docs.rendi.dev/webhooks This is an example of the JSON payload Rendi sends to your webhook URL when an FFmpeg command processing is completed successfully. It includes details about the command, output files, and the original request. ```json { "data": { "command_id": "123e4567-e89b-12d3-a456-426614174000", "status": "SUCCESS", "command_type": "FFMPEG_COMMAND", "vcpu_count": 8, "total_processing_seconds": 8.821761, "ffmpeg_command_run_seconds": 5.606014728546143, "output_files": { "out_1": { "file_id": "e9cf7551-4c7d-405f-9090-76e74fa90ab9", "size_mbytes": 1.0111198425292969, "duration": 2.74, "file_type": "image", "file_format": "gif", "codec": "gif", "pixel_format": "bgra", "mime_type": "image/gif", "storage_url": "https://storage.rendi.dev/temp_files/583b2877-15b7-48e3-8255-615991a945de/be603edd-5526-477c-98b1-fbf5f98a5a7b/output1.gif", "width": 284, "height": 160 } }, "original_request": { "input_files": { "in_1": "https://storage.rendi.dev/sample/sample.avi" }, "output_files": { "out_1": "output1.gif" }, "ffmpeg_command": "-i {{in_1}} -ss 00:00 -to 01:00 -vf select='lte(n\\,1)+gt(trunc(t/10),trunc(prev_t/10))',setpts='PTS*0.025',scale=trunc(oh*a/2)*2:160:force_original_aspect_ratio=decrease,pad=trunc(oh*a/2)*2:160:-1:-1 -an -vsync vfr {{out_1}}" } }, "timestamp": 1739130741156 } ``` -------------------------------- ### Generate Multiple Thumbnails from Video using FFmpeg Source: https://docs.rendi.dev/examples This JSON configuration defines the input video, desired output thumbnail filenames, and the FFmpeg command to extract two thumbnails at specific timestamps. It utilizes the `run-ffmpeg-command` endpoint. ```json { "input_files": { "in_1": "https://storage.rendi.dev/sample/sample.avi" }, "output_files": { "out_1": "thumbnail1.jpg", "out_2": "thumbnail2.jpg" }, "ffmpeg_command": "-i {{in_1}} -filter_complex \"[0:v]split=2[first][second];[first]select='gte(t,10)'[thumb1];[second]select='gte(t,20)'[thumb2]\" -map [thumb1] -frames:v 1 {{out_1}} -map [thumb2] -frames:v 1 {{out_2}}" } ``` -------------------------------- ### Run FFmpeg Command via Rendi API (cURL) Source: https://docs.rendi.dev/examples This cURL command demonstrates how to send a POST request to the Rendi API's `run-ffmpeg-command` endpoint. It includes the JSON payload for generating video thumbnails. ```bash curl --request POST \ --url https://api.rendi.dev/v1/run-ffmpeg-command \ --header 'Content-Type: application/json' \ --header 'X-API-KEY: ' \ --data '{ "input_files": { "in_1": "https://storage.rendi.dev/sample/sample.avi" }, "output_files": { "out_1": "thumbnail1.jpg", "out_2": "thumbnail2.jpg" }, "ffmpeg_command": "-i {{in_1}} -filter_complex \"[0:v]split=2[first][second];[first]select='\''gte(t,10)'\''[thumb1];[second]select='\''gte(t,20)'\''[thumb2]\" -map [thumb1] -frames:v 1 {{out_1}} -map [thumb2] -frames:v 1 {{out_2}}" }' ``` -------------------------------- ### POST /v1/run-ffmpeg-command Source: https://docs.rendi.dev/examples Submits an FFmpeg command to Rendi's API for processing. This endpoint is used to add SRT subtitles to a video by specifying input files, output files, and the FFmpeg command. ```APIDOC ## POST /v1/run-ffmpeg-command ### Description Submits an FFmpeg command to Rendi's API for processing. This endpoint is used to add SRT subtitles to a video by specifying input files, output files, and the FFmpeg command. ### Method POST ### Endpoint https://api.rendi.dev/v1/run-ffmpeg-command ### Parameters #### Request Body - **input_files** (object) - Required - An object containing the input file paths. Requires `in_video` and `in_srt`. - **in_video** (string) - Required - URL to the input video file. - **in_srt** (string) - Required - URL to the input SRT subtitle file. - **output_files** (object) - Required - An object specifying the output file name. - **out_1** (string) - Required - The desired name for the output video file. - **ffmpeg_command** (string) - Required - The FFmpeg command to execute. Use placeholders like `{{in_video}}` and `{{in_srt}}` for input files and `{{out_1}}` for the output file. ### Request Example ```json { "input_files": { "in_video": "https://storage.rendi.dev/sample/sample.avi", "in_srt": "https://storage.rendi.dev/sample/subtitles.srt" }, "output_files": { "out_1": "output.mp4" }, "ffmpeg_command": "-i {{in_video}} -ss 00:00 -to 01:00 -vf subtitles={{in_srt}} -c:v libx264 -crf 20 -c:a aac -b:a 192k {{out_1}}" } ``` ### Response #### Success Response (200) - **command_id** (string) - The unique identifier for the submitted command. #### Response Example ```json { "command_id": "059946cd-2e7c-41b8-8a27-0b992f516d4f" } ``` ``` -------------------------------- ### Rendi API Response: Successful Thumbnail Generation Source: https://docs.rendi.dev/examples This JSON represents a successful execution of the FFmpeg command for thumbnail generation. It details the output files, their metadata (size, dimensions, storage URL), processing time, and the original request. ```json { "output_files": { "out_1": { "file_id": "eba1a713-4631-4ccb-9ef8-b727a9f7f274", "size_mbytes": 0.08534908294677734, "file_type": "image", "file_format": "jpg", "storage_url": "https://storage.rendi.dev/temp_files/224ea098-5c10-419b-8a77-707d89443c56/f6bb88cb-83a9-4ea5-b763-078bff3431d4/thumbnail1.jpg", "width": 1280, "height": 720 }, "out_2": { "file_id": "d8278ca9-cede-4677-b8d2-374afc4604fc", "size_mbytes": 0.03953361511230469, "file_type": "image", "file_format": "jpg", "storage_url": "https://storage.rendi.dev/temp_files/224ea098-5c10-419b-8a77-707d89443c56/f6bb88cb-83a9-4ea5-b763-078bff3431d4/thumbnail2.jpg", "width": 1280, "height": 720 } }, "status": "SUCCESS", "original_request": { "input_files": { "in_1": "https://storage.rendi.dev/sample/sample.avi" }, "output_files": { "out_1": "thumbnail1.jpg", "out_2": "thumbnail2.jpg" }, "ffmpeg_command": "-i {{in_1}} -filter_complex \"[0:v]split=2[first][second];[first]select='gte(t,10)'[thumb1];[second]select='gte(t,20)'[thumb2]\" -map [thumb1] -frames:v 1 {{out_1}} -map [thumb2] -frames:v 1 {{out_2}}" }, "ffmpeg_command_run_seconds": 0.8197736740112305, "total_processing_seconds": 5.868829, "vcpu_count": 8, "command_type": "FFMPEG_COMMAND" } ``` -------------------------------- ### API Response on Successful Command Execution Source: https://docs.rendi.dev/examples This JSON object represents the successful completion of the chained FFmpeg commands. It includes the command ID, status, details of the generated output files (thumbnail and GIF) with their storage URLs and metadata, the original request parameters, and processing metrics. ```json { "command_id": "963b85e1-0a2d-4fde-8565-634ae0b22b92", "status": "SUCCESS", "output_files": { "out_1": { "file_id": "5a978607-8c20-4b3b-91db-b67516e7f274", "storage_url": "https://storage.rendi.dev/files/224ea098-5c10-419b-8a77-707d89443c56/963b85e1-0a2d-4fde-8565-634ae0b22b92/thumbnail.jpg", "status": "STORED", "rendi_store_type": "OUTPUT", "is_deleted": false, "size_mbytes": 0.02407360076904297, "file_type": "image", "file_format": "jpg", "width": 854, "height": 480 }, "out_2": { "file_id": "3f51e56e-18b1-4277-b0e8-42a2f4cf6bf4", "storage_url": "https://storage.rendi.dev/files/224ea098-5c10-419b-8a77-707d89443c56/963b85e1-0a2d-4fde-8565-634ae0b22b92/output.gif", "status": "STORED", "rendi_store_type": "OUTPUT", "is_deleted": false, "size_mbytes": 0.30026817321777344, "file_type": "image", "file_format": "gif", "width": 142, "height": 80 } }, "original_request": { "input_files": { "in_1": "https://storage.rendi.dev/sample/sample.avi" }, "output_files": { "out_1": "thumbnail.jpg", "out_2": "output.gif" }, "ffmpeg_commands": [ "-i {{in_1}} -ss 00:17 -vframes 1 {{out_1}}", "-i {{in_1}} -vf \"select='lte(t,60)*gt(trunc(t/10),trunc(prev_t/10))',setpts='PTS*0.1',scale=trunc(oh*a/2)*2:80:force_original_aspect_ratio=decrease,pad=trunc(oh*a/2)*2:80:-1:-1\" -an -vsync vfr {{out_2}}" ] }, "ffmpeg_command_run_seconds": 6.013741970062256, "total_processing_seconds": 20.55214, "vcpu_count": 8, "command_type": "FFMPEG_CHAINED_COMMANDS" } ``` -------------------------------- ### Get FFmpeg Command Status and Output (cURL) Source: https://docs.rendi.dev/quick-start This cURL command allows you to poll the Rendi API for the status of a previously submitted FFmpeg command using its unique command_id. The API key is required for authentication. The response is a JSON object detailing the command's status, processing time, and output file information once successful. ```bash curl --request GET \ --url https://api.rendi.dev/v1/commands/{command_id} \ --header 'X-API-KEY: ' ``` -------------------------------- ### API Key Authentication Header Source: https://docs.rendi.dev/api-reference/introduction Demonstrates how to authenticate API requests by providing an API Key in the `X-API-KEY` HTTP header. This is required for all API endpoint interactions. ```http --header 'X-API-KEY: ' ``` -------------------------------- ### GET /v1/commands/{command_id} Source: https://docs.rendi.dev/examples Retrieves the status and results of a previously submitted FFmpeg command using its unique command ID. ```APIDOC ## GET /v1/commands/{command_id} ### Description Retrieves the status and results of a previously submitted FFmpeg command using its unique command ID. ### Method GET ### Endpoint https://api.rendi.dev/v1/commands/{command_id} ### Parameters #### Path Parameters - **command_id** (string) - Required - The unique identifier of the command to retrieve. ### Response #### Success Response (200) - **output_files** (object) - Information about the generated output files. - **out_1** (object) - Details for the first output file. - **file_id** (string) - Unique identifier for the output file. - **size_mbytes** (number) - Size of the file in megabytes. - **duration** (number) - Duration of the video in seconds. - **file_type** (string) - Type of the file (e.g., 'video'). - **file_format** (string) - Format of the file (e.g., 'mp4'). - **storage_url** (string) - URL to access the stored file. - **width** (integer) - Width of the video in pixels. - **height** (integer) - Height of the video in pixels. - **codec** (string) - Video codec used. - **frame_rate** (number) - Frame rate of the video. - **bitrate_video_kb** (number) - Video bitrate in kilobits per second. - **bitrate_audio_kb** (number) - Audio bitrate in kilobits per second. - **is_varying_frame_rate** (boolean) - Indicates if the video has a varying frame rate. - **status** (string) - The current status of the command (e.g., 'SUCCESS', 'FAILED'). - **original_request** (object) - The original request payload submitted for this command. - **ffmpeg_command_run_seconds** (number) - Time taken for FFmpeg to run in seconds. - **total_processing_seconds** (number) - Total processing time in seconds. - **vcpu_count** (integer) - Number of vCPUs used for processing. - **command_type** (string) - The type of command executed (e.g., 'FFMPEG_COMMAND'). #### Response Example ```json { "output_files": { "out_1": { "file_id": "f775b15d-67e9-4235-b89f-4bb33c0a5f57", "size_mbytes": 2.2677812576293945, "duration": 30.0, "file_type": "video", "file_format": "mp4", "storage_url": "https://storage.rendi.dev/temp_files/224ea098-5c10-419b-8a77-707d89443c56/42c95292-d953-4b5a-8a58-cf1513363a33/output_320p.mp4", "width": 568, "height": 320, "codec": "h264", "frame_rate": 24.0, "bitrate_video_kb": 370.5654296875, "bitrate_audio_kb": 242.349609375, "is_varying_frame_rate": false }, "out_2": { "file_id": "9df00eca-3221-49c6-8a64-07850c9a5921", "size_mbytes": 29.620187759399414, "duration": 596.459, "file_type": "video", "file_format": "mp4", "storage_url": "https://storage.rendi.dev/temp_files/224ea098-5c10-419b-8a77-707d89443c56/42c95292-d953-4b5a-8a58-cf1513363a33/output_180p.mp4", "width": 320, "height": 180, "codec": "h264", "frame_rate": 24.0, "bitrate_video_kb": 160.955078125, "bitrate_audio_kb": 239.9833984375, "is_varying_frame_rate": false } }, "status": "SUCCESS", "original_request": { "input_files": { "in_1": "https://storage.rendi.dev/sample/sample.avi" }, "output_files": { "out_1": "output_320p.mp4", "out_2": "output_180p.mp4" }, "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}}" }, "ffmpeg_command_run_seconds": 19.58051347732544, "total_processing_seconds": 24.955581, "vcpu_count": 8, "command_type": "FFMPEG_COMMAND" } ``` ``` -------------------------------- ### POST /websites/rendi_dev/ffmpeg/run Source: https://docs.rendi.dev/api-reference/endpoint/run-chained-ffmpeg-commands Submits multiple FFmpeg commands to be executed sequentially. Input files can be shared between commands, and output files from earlier commands can be used as inputs for subsequent commands. ```APIDOC ## POST /websites/rendi_dev/ffmpeg/run ### Description Submits multiple FFmpeg commands to be executed sequentially. Input files can be shared between commands, and output files from earlier commands can be used as inputs for subsequent commands. ### Method POST ### Endpoint `/websites/rendi_dev/ffmpeg/run` ### Parameters #### Request Body - **ffmpeg_commands** (array[string]) - Required - A list of FFmpeg commands to be executed. Commands can reference input files using `{{input_key}}` and output files using `{{output_key}}`. - **input_files** (object) - Required - A mapping of keys to URLs for input files. - **key** (string) - URL of the input file. - **output_files** (object) - Required - A mapping of keys to desired output file names. - **key** (string) - Desired name for the output file. - **max_command_run_seconds** (integer) - Optional - Maximum time in seconds allowed for all commands to run. - **vcpu_count** (integer) - Optional - Number of vCPUs to allocate for command execution. ### Request Example ```json { "ffmpeg_commands": [ "-i {{in_1}} -i {{in_2}} -filter_complex \"[0:v][1:v]hstack=inputs=2[v]\" -map [v] {{out_1}}", "-i {{out_1}} -vframes 1 {{out_2}}" ], "input_files": { "in_1": "https://storage.rendi.dev/sample/big_buck_bunny_720p_5sec_intro.mp4", "in_2": "https://storage.rendi.dev/sample/big_buck_bunny_720p_5sec_outro.mp4" }, "output_files": { "out_1": "output_concatenated.mp4", "out_2": "thumbnail.jpg" }, "max_command_run_seconds": 300, "vcpu_count": 8 } ``` ### Response #### Success Response (200) - **command_id** (string) - A unique identifier for the submitted command. #### Response Example ```json { "command_id": "123e4567-e89b-12d3-a456-426614174000" } ``` #### Error Responses - **401 Unauthorized**: Invalid API key. - **403 Forbidden**: Account quota exceeded or plan does not support chained commands. - **422 Unprocessable Entity**: Validation error in the request payload. - **429 Too Many Requests**: Rate limit exceeded. ``` -------------------------------- ### Execute Video Combination Command via cURL (Bash) Source: https://docs.rendi.dev/examples This cURL command sends a POST request to the Rendi API's `/run-ffmpeg-command` endpoint to create a video from images and audio. It includes the necessary headers and the JSON payload containing input files and the FFmpeg command. The response will contain a `command_id` to track the job status. ```bash curl --request POST \ --url https://api.rendi.dev/v1/run-ffmpeg-command \ --header 'Content-Type: application/json' \ --header 'X-API-KEY: ' \ --data '{ \ "input_files": { \ "in_img_1": "https://storage.rendi.dev/sample/bbb-splash.png", \ "in_img_2": "https://storage.rendi.dev/sample/rodents.png", \ "in_img_3": "https://storage.rendi.dev/sample/evil-frank.png", \ "in_audio_1": "https://storage.rendi.dev/sample/Neon%20Lights.mp3" \ }, \ "output_files": { \ "out_1": "output.mp4" \ }, \ "ffmpeg_command": "-loop 1 -t 5 -i {{in_img_1}} -loop 1 -t 5 -i {{in_img_2}} -loop 1 -t 5 -i {{in_img_3}} -i {{in_audio_1}} -filter_complex \\\"[0:v][1:v][2:v]concat=n=3:v=1:a=0,format=yuv420p[v]\\\" -map [v] -map 3:a -c:v libx264 -c:a aac -shortest {{out_1}}" \ }' ```