#include speed in your workflows
Our Jobs API offers a powerful video encoding infrastructure for developers to seamlessly integrate encoding jobs into their applications and workflows. It supports video encoding in a wide range of formats, codecs, and resolutions, while providing extensive customization options.
Leverage ByteNite Jobs API's scalability to streamline your video processing pipelines and deliver exceptional user experiences.
Get started
import requests
# CREATE JOB
create_job_body = {"name": "Test Job", "templateId": "video-transcoding@v0.2"}
create_resp = requests.post('http://api.bytenite.com/v1/customer/jobs', json=create_job_body, headers={'Authorization': access_token}).json()
job_id = create_resp['job']['id']
# -------------------------------
# SET DATA SOURCE AND DESTINATION
input_video_url = "https://storage.googleapis.com/video-test-public/input/bbb.mp4"
data_source_body={
"dataSource": {
"dataSourceDescriptor": "url",
"params": {
"@type": "type.googleapis.com/bytenite.data_source.HttpDataSource",
"url": input_video_url,
}
},
"dataDestination": {
"dataSourceDescriptor": "bucket",
"params": {}
}
}
requests.post(f'https://api.bytenite.com/v1/customer/jobs/datasource/{job_id}', json=data_source_body, headers={'Authorization': access_token}).json()
# -------------------------------
# SET ENCODING PARAMETERS
job_params_body={
"data": {
"output_code_template": "",
"output_template": "{{.job_name}}_{{.output_params.Aspect.Resolution.Height}}",
"outputs": [
{
"name": "",
"output_params": {
"aspect": {
"cropping": {
"bottom": 0,
"left": 0,
"right": 0,
"top": 0
},
"orientation": {
"flip": "",
"rotation": ""
},
"padding": {
"fill_color": "#000000",
"final_aspect_ratio": ""
},
"resolution": {
"aspect_ratio": "",
"avoid_upscaling": False,
"height": "480p"
}
},
"audio": {
"audio_bitrate": "192k",
"audio_channel": "2.0",
"audio_codec": "AAC",
"audio_sample_rate": "48khz"
},
"video": {
"bitrate": {
"buffer_size": "1200k",
"crf": 23,
"rate_control_mode": "constant_quality"
},
"codec": "libx264",
"codec_params": {
"level": "",
"preset": "slow",
"profile": "",
"tune": ""
},
"frame_rate": {
"fps": "",
"up_mode": "avoid"
}
}
},
"output_type": "mp4"
}
]
}
requests.post(f'https://api.bytenite.com/v1/customer/jobs/params/{job_id}', json=job_params_body, headers={'Authorization': access_token}).json()
# -------------------------------
# RUN JOB
requests.post(f'https://api.bytenite.com/v1/customer/jobs/run/{job_id}', json={}, headers={'Authorization': access_token}).json()
# -------------------------------
# GET RESULTS
requests.get(f'https://api.bytenite.com/v1/customer/jobs/{job_id}/results', headers={'Authorization': access_token}).json()['results']