FlightHub Sync
  1. Live stream forwarding
FlightHub Sync
  • FlightHub
    • FlightFub Webhook
    • ENV
    • Error Code
    • Live stream forwarding
      • Start Stream Forwarding
        POST
      • Stop Stream Forwarding
        DELETE
      • Get Stream Forwarding Channel Transcoder
        GET
    • Task distribution
      • Get Flight Task Files List
      • Create Flight Task
      • Commands During the Flight Task
      • Flight Task Trajectory Acquisition
      • Project Equipment Topology
      • Get Flight Task Details
    • Get Organization Project List
      GET
    • Get Project Device List
      GET
    • Push Event Notification and Map Annotation
      POST
    • Get Temporary Upload Token
      POST
    • Notify of Route File Upload
      POST
    • Get File Information and Download Address
      GET
  1. Live stream forwarding

Start Stream Forwarding

POST
/manage/api/v1.0/stream-converters

Request

Header Params
X-Organization-Key
string 
required
Organization-Key
Default:
{{organization_key}}
Body Params application/json
region
string 
required
When creating a Converter region, make sure the region you set is in the same region as your CDN origin site. Currently the following regions are supported: CN, AP, NA.
converter_name
string 
required
The name of the running transcoder cannot be repeated
sn
string  | null 
required
SN serial number of the stream source device, such as dock SN or aircraft SN
camera
string 
required
Format: {{type}}-{{subtype}}-{{gimbalindex}}(165-0-7) Reference: https://developer.dji.com/doc/cloud-api-tutorial/en/overview/product-support.html
video
string 
required
Fixed fill ("normal-0").
idletimeout
integer 
optional
Deprecated (no longer recommended), the maximum length of time (in seconds) that a Converter is idle. Idle means that the live source is offline, such as when the dock is shut down or the aircraft is disconnected from the dock. When the Converter is idle for longer than idleTimeout, the Converter is automatically destroyed and the streaming stops. The value range is [5,300]. The default value is 300.
video_quality
string 
optional
{"0":"Adaptive","1":"Smooth","2":"Standard definition","3":"High definition","4":"Ultra-high definition"}
bypass_option
object 
optional
url
string 
RTMP address (not concatenated)
optional
If you fill in this url, it will overwrite the configuration of rtmp_url. This url must start with "rtmp://" and is a complete retweet address. This address will not be concatenated with other fields.
rtmp_url
string 
optional
This rtmp_url must start with "rtmp://" and will be concatenated with path as the retweet address. For example, if "rtmp_url" is set to "rtmp://xxx", the actual retweet address is "rtmp://xxx/{{device_sn}}_{{camera_id}}".
If rtmp_url is not filled in, RTMP Server must be configured on the organization management page of FlightHub 2, otherwise the interface will report an error.
Example
{
  "region": "en",
  "converter_name": "test",
  "sn": "6QCD0000000000",
  "camera": "165-0-7",
  "video": "normal-0",
  "idle_timeout": 500,
  "video_quality": 0,
  "bypass_option": {
    "url": "rtmp://xx.xx.xx"
  },
  "rtmp_url": "rtmp://xx.xx.xx"
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST '/manage/api/v1.0/stream-converters' \
--header 'X-Organization-Key;' \
--header 'Content-Type: application/json' \
--data-raw '{
    "region": "en",
    "converter_name": "test",
    "sn": "6QCD0000000000",
    "camera": "165-0-7",
    "video": "normal-0",
    "idle_timeout": 500,
    "video_quality": 0,
    "bypass_option": {
        "url": "rtmp://xx.xx.xx"
    },
    "rtmp_url": "rtmp://xx.xx.xx"
}'

Responses

🟢200成功
application/json
Body
code
integer 
required
message
string 
required
data
object 
required
code
integer 
required
message
string 
required
data
object 
required
converter_id
string 
required
Converter ID
create_ts
integer 
required
Unix timestamp (seconds) when the Converter was created
update_ts
integer 
required
Unix timestamp (in seconds) when the Converter configuration was last updated
converter_state
string 
required
Converter running status: connecting: Connecting to Agora streaming server and CDN server. running: Streaming in progress. failed: Streaming failed.
Example
{
  "code": 0,
  "message": "OK",
  "data": {
    "code": 0,
    "message": "OK",
    "data": {
      "converter_id": "160FDCB4E94171AB9F7A86A5F5B1C990",
      "create_ts": 1704167612,
      "update_ts": 1704167612,
      "converter_state": "running"
    },
    "converter_id": "160FDCB4E94171AB9F7A86A5F5B1C990",
    "create_ts": 1704167612,
    "update_ts": 1704167612,
    "converter_state": "running"
  }
}
🟠401未授权
Previous
Error Code
Next
Stop Stream Forwarding
Built with