Skip to main content
You can classify a video either from a file or a URL.
This section explains how to make a request using a file. For a URL, the process is similar, with the main difference being the endpoint to call in step 1.

Submission guidelines

Video analysis involves processing the video to extract specific frames. For this, the guidelines to follow are similar to those for images:
  • Send the video “closest” to the source to the system: this means, for example, not sending a video of a photo for photo analysis, or a video filmed from another video.
  • In the case of videos taken from social media, the most accurate results are obtained by sending videos without superimposed texts or modifications typical of social shares.
  • If available from other sources, avoid submitting social links due to the post-processing of various platforms.
During submission, it is possible to exclude morphing models. We advise against enabling the morphing model in the absence of faces to avoid the risk of false positives.

Frame extraction strategy selection

Only for videos, it is necessary to select a frame extraction strategy: these will then be analyzed by the detection models. The frame extraction strategies are described below:

Time-spaced

With this mode, N frames (depending on the “Maximum number of frames” selection) are extracted, equally spaced along the duration of the video. In order to enable this, you must add the following parameters:
frames controls how many frames to extract at least. You can select between 5, 10 and 30. A higher number of analyzed frames corresponds to a higher number of credits used for the analysis.

Key frames

  • Key frames - Default: with this mode, up to N iframes are extracted. These frames represent sudden scene changes in the video and are therefore potentially of interest for analyzing different scenes.
  • Key frames - Color: with this mode, up to N frames are extracted that represent the “average” frame of a scene, calculated based on the colors within the image.
  • Key frames - Flow: with this mode, up to N frames are extracted that represent the “stillest” frame of a scene, calculated relative to the previous frame of the scene.
frames controls how many frames to extract at least. You can select between 5, 10 and 30. A higher number of analyzed frames corresponds to a higher number of credits used for the analysis.

Faces

With this mode, the system looks for frames containing at least one face: starting from time-spaced sampling, it searches the video for frames with faces until it reaches the number of frames to analyze. It is the suggested strategy for face swap and morphing detection, together with with_morphing=true.
  • It is an alternative to key frames: when ensure_face_per_frame=true, key_frames and key_frames_method are ignored.
  • The search is time-limited: on videos where faces are rare or absent, fewer frames may be analyzed. Frames that are not analyzed are refunded once the analysis is complete.
  • The search may increase the processing time and, depending on your pricing plan, the cost of each frame.
Face extraction is a pricing plan feature: if your plan does not include it, ensure_face_per_frame is ignored and the video is analyzed with the other strategies.

Specific moments

If you already know which moments of the video are relevant (e.g. the seconds where a face appears or a suspicious scene starts), you can ask the system to analyze exactly those moments: one frame is extracted at each listed timecode.
  • Timecodes are comma-separated and in HH:MM:SS.mmm format (hours, minutes, seconds and milliseconds), measured from the beginning of the video. Duplicates are counted once.
  • When frames_timestamps is provided, it takes precedence over the other strategies: frames, key_frames, key_frames_method and ensure_face_per_frame are ignored.
  • One frame is charged for each distinct timecode. You can list up to 30 timecodes if your pricing plan lets you choose the number of frames, otherwise up to the default number of frames (10).
  • Timecodes beyond the end of the video are skipped; if none of them falls within the video, the classification ends with an error.
The same applies to the audio track of the video, analyzed with with_audio=true: with audio_timestamps the system analyzes a short audio chunk centred on each listed timecode instead of chunks spread over the whole track. Timecodes close enough to fall within the same chunk are analyzed together, and one audio chunk is charged for each distinct timecode (chunks that are not produced are refunded once the analysis is complete). You can list up to 30 audio timecodes if your pricing plan lets you choose the number of audio chunks, otherwise up to 5.
Specific moments are a pricing plan feature, enabled separately for frames and for audio: if your plan does not include them, frames_timestamps and audio_timestamps are ignored. Malformed timecodes or more timecodes than allowed are rejected with a 400 error.

Submit a video using the API

To classify a video, you need to make a POST request to /api/classification_video with the required parameters (for details on the parameters, refer to the API Reference section).
In the response you will receive the identifier of the classified video. To analyze specific moments of the video and of its audio track instead:

Retrieve the results

Use the provided identifier to retrieve the classification results by making a GET request to /api/classification_video/{identifier} (for details on how to structure this request, see the API Reference section).
The response will provide the classification results for the video in JSON format. For video classification, the video is divided into frames. In the response, you will find a results array that includes the classification outcomes for each model applied to each analyzed frame, and a verdicts array containing the results for each heuristic used.
The classification may not be finished yet! If the classification is not yet complete, continue sending the GET request until the result is available.

Smart Full Analysis

Smart Full Analysis is available for videos too: each analyzed frame is split into a targeted selection of high-value crops, chosen by a proprietary scoring algorithm, which are classified by the most advanced model of the Revelio family and combined into the verdict of the frame.
As for images, Smart Full Analysis is an advanced, smart version of the standard full analysis and of the heatmap: when it is enabled, it replaces them for each analyzed frame.
If Smart Full Analysis is included in your pricing plan, you can enable it by providing the argument with_smart_analysis=true:
If Smart Full Analysis is not included in your pricing plan, the with_smart_analysis parameter is ignored and the video is analyzed with the standard scope.

XAI (eXplainable AI)

Not just a verdict. Discover what the artificial intelligence observed to reach its decision. XAI – eXplainable AI is available for videos too: when it is enabled, it is applied to each analyzed frame. For every frame, the Revelio models do not just return a verdict, but also the information about the points of attention that characterized the classification, turned into three complementary tools:
  • Attention Map: a visual representation overlaid on the frame, which highlights the areas the model focused on the most;
  • Attention Graph: a graph showing the trend and the peaks of the attention of the model;
  • AI-Powered Explanation: a natural-language description of the regions that received the most attention, available in multiple languages.
Data Transfer Notice: Enabling this feature transfers your image data to our EU cloud infrastructure for model inference.The AI-powered explanations are generated with models that are not developed by identifAI.

Enable XAI using the API

XAI is governed by the same parameters used for images, available in the API used for video classification and in the API used for video classification from URL: If XAI is included in your pricing plan, you can enable it as follows:
If XAI is not included in your pricing plan, the with_xai parameter is ignored and the video is analyzed without XAI.
The AI-powered explanations must be enabled in your pricing plan too: if your plan includes XAI but not the AI-powered explanations, a request with with_llm_xai=true is rejected with a 403 error. An unsupported llm_xai_language is rejected with a 400 error. In both cases the request is rejected before the video is analyzed and no credits are consumed.

XAI maps and explanations in the results

As for images, the explanations list every XAI map of each model, with its AI-powered explanation, and are returned on the per-model results of each analyzed frame (results.images[].results[].explanations), with the same format used for images. The AI-powered explanations are deferred results, produced after the main analysis of the video: every analyzed frame in results.images has its own deferred_status, and description is null until the explanation of the map is available, when the AI-powered explanations were not requested, or when the explanation could not be generated.
The explanations are returned only by the single video classification result endpoint, and only if your pricing plan exposes the details of the models. The AI-powered explanations are charged for each analyzed frame, and the credits of the frames whose explanations cannot be generated are refunded.

Download the Attention Map and the Attention Graph

The Attention Map and the Attention Graph of each analyzed frame can be downloaded with the XAI map download endpoint, as for images, using the identifier of the frame in results.images:
When XAI is combined with the Smart Full Analysis, the heatmap of each frame can be downloaded as usual with the heatmap download endpoint, using the identifier of the frame.

Guidelines on interpreting the results

The results of the video contains both the global verdicts and the individual result on the single analyzed frames. We suggest looking at interpreting image result

Heatmaps on video

For heatmaps on video, the considerations are the same as those on images. The only addition is that to analyze the heatmap, you need to click on Frames and analyze the heatmap of each individual frame.

See also

Classify an image

Start an image classification and find out if your image is real or artificially generated!

Classify a speech

Find out how to start a speech classification and discover whether your speech is authentic or artificially generated