Generate video summary
The video summary feature lets users to extract concise, meaningful summaries from video content, enabling a quick understanding of key points without watching the entire video. This guide walks you through the process of using FastPix’s API to generate video summaries for new and existing media files.
Getting started
FastPix’s create media from URL and upload media from device API endpoints allow you to analyze video content and generate summaries when uploading new media.
If you want to enable video summary generation in your existing content that was previously uploaded, use the generate video summary API endpoint. See how.
Generating summary for new media
Step 1: Collect the URLs of the media files to upload to FastPix (pull via URL method) for which you want to generate a summary.
Step 2: Create a JSON request and send a POST request to the /on-demand endpoint.
When configuring the JSON request, ensure the following parameters are included:
- type: Specify whether the media is a video or audio file.
- url: Provide the HTTPS URL of the media file for which summary should be generated.
- generate: Set this to "true" to enable the summary generation process.
- summaryLength: Specify the desired summary length in words (e.g., 120). This determines how concise or detailed the summary will be.
Request body for creating new media from URL
{
"inputs": [
{
"type": "video",
"url": "https://static.fastpix.io/sample.mp4"
}
],
"summary": {
"generate": "true",
"summaryLength": 120
},
"accessPolicy": "public",
"maxResolution": "1080p"
}
Request body for creating new media by direct upload
If you are uploading media directly from device or local storage, the inputs section will contain the relevant upload details, and the structure would look like this:
{
"corsOrigin": "*",
"pushMediaSettings": {
"metadata": {
"key1": "value1"
},
"summary": {
"generate": "true",
"summaryLength": 120
},
"accessPolicy": "public",
"maxResolution": "1080p"
}
}
Key considerations
- Maximum summary length: 250 words.
- Minimum summary length: 30 words.
- If no specific
summaryLength
is provided, the default length will be 100 words.
Generating summary for existing media
If you wish to generate summary for media that has already been uploaded, use the generate video summary API endpoint and follow these steps:
Step 1: Collect the mediaId
for the existing media you want to generate a summary for.
Step 2: Create a JSON request and send a PATCH request to the /on-demand/<mediaId>/summary
endpoint. Replace <mediaId>
with the ID of the existing media.
Example request body:
{
"summary": {
"generate": "true",
"summaryLength": 120
}
}
Accessing summary results
Once the summary generation is complete for your media (video/audio), you can access the results via the video.mediaAI.summary.ready
event. This event contains the generated summary
in the summary field.
Example event response
{
"type": "video.mediaAI.summary.ready",
"object": {
"type": "mediaAI",
"id": "69f82b00-151c-45d4-942c-6eab719143b2"
},
"id": "449ffaa5-ba84-452a-b368-53da62d4641e",
"workspace": {
"id": "fd717af6-a383-4739-8d8c-b49aa732a8c0"
},
"data": {
"summary": "This is a brief summary of the video content, highlighting the key points and important aspects."
}
}
General considerations
- Ensure that the
mediaId
is correctly obtained for existing media when using the/on-demand/<mediaId>/summary
endpoint.\ - For more complex media content, you may need to adjust the
summaryLength
parameter to match the level of detail required for your use case.\ - The
accessPolicy
andmaxResolution
are optional parameters but can help manage access and media quality depending on your needs.
Use cases for video summaries
- E-learning platforms: Generate quick overviews of course modules.
- Corporate training: Summarize key takeaways from training sessions.
- Marketing teams: Extract highlights from webinars or product demos.
- Content review: Quickly assess the value of user-generated content.
Updated 16 days ago