Video Edits
Video Edits live within a project. They can use assets and video files to generate unique edits, and render on demand.
The video edit model
The video edit model uses the following structure:
- Name
video_edit_version
- Type
- string
- Description
Version identifier for the video edit format
- Name
video_output_format
- Type
- string
- Description
Output format of the video (e.g., mp4)
- Name
video_output_resolution
- Type
- string
- Description
Resolution specification for the output video
- Name
video_output_fps
- Type
- float
- Description
Frames per second for the output video
- Name
edit_name
- Type
- string
- Description
Name identifier for the edit project
- Name
video_output_filename
- Type
- string
- Description
Filename for the output video file
- Name
audio_overlay
- Type
- array
- Description
List of audio overlays to be applied to the video
- Name
video_series_sequential
- Type
- array
- Description
Sequential list of video segments that comprise the edit, each containing:
- Name
video_id
- Type
- string
- Description
Identifier for the source video
- Name
video_start_time
- Type
- string
- Description
Start timestamp for the video segment
- Name
video_end_time
- Type
- string
- Description
End timestamp for the video segment
- Name
type
- Type
- string
- Description
Type of media (e.g., "videofile")
- Name
audio_levels
- Type
- array
- Description
Audio level configurations for the segment, each containing:
- Name
audio_level
- Type
- string
- Description
Volume level for the audio (0.0 to 1.0)
- Name
start_time
- Type
- string
- Description
Start timestamp for the audio level application
- Name
end_time
- Type
- string
- Description
End timestamp for the audio level application
Rendering a video edit
To render a video edit, you must first create a project. From there you can then render a video by referencing any global video file or assets uploaded to the project.
Example
import videojungle
edit = {
"video_edit_version": "1.0",
"video_output_format": "mp4",
"video_output_resolution": "1920x1080",
"video_output_fps": 30,
"edit_name": "My First Edit",
"video_output_filename": "my_first_edit.mp4",
"audio_overlay": [],
"video_series_sequential": [
{
"video_id": "video_id_here",
"video_start_time": "00:00:00",
"video_end_time": "00:00:10",
"type": "videofile",
"audio_levels": [
{
"audio_level": "1.0",
"start_time": "00:00:00",
"end_time": "00:00:10"
}
]
}
]
}
vj = videojungle.Client(token="your_token_here")
prj = vj.projects.create(name="First Project", description="My first project")
edit = vj.projects.render_edit(prj, edit)
print(edit) # has edit['asset_id'] and edit['asset_key'], used to check status and download the video
video = vj.assets.download(edit['asset_id'], "my_first_edit.mp4")
print(f"Video generated and saved to: {video}")