Video Metadata icon

Video Metadata

Extract metadata from video files using FFprobe

Overview

This node extracts metadata from video files using FFprobe, a powerful multimedia analysis tool. It supports obtaining video metadata from either binary data passed from a previous node or by downloading the video from a provided URL. The node can extract comprehensive metadata, video duration, or video resolution based on the selected operation. This is useful for workflows that require detailed video information for processing, cataloging, or analysis, such as media management systems, video content analysis, or automated video processing pipelines.

Use Case Examples

  1. Extract full metadata from a video file uploaded as binary data in a previous node.
  2. Download a video from a URL and extract its duration for reporting purposes.
  3. Get the resolution of a video file to decide on transcoding parameters.

Properties

Name Meaning
Input Mode Determines how the video file is provided to the node, either as binary data from a previous node or by downloading from a URL.
Video URL The URL of the video file to analyze, required if input mode is 'Download from URL'.
Binary Property The name of the binary property containing the video file, required if input mode is 'Binary Data'.
Include Raw Output Whether to include the complete raw FFprobe output in the result, providing detailed metadata beyond the summarized fields.
Output Property Name The name of the output property where the extracted metadata will be stored in the node's output JSON.

Output

JSON

  • metadata
    • filename - Name of the video file.
    • format - Short format name of the video container.
    • format_long - Long descriptive format name of the video container.
    • duration - Duration of the video in seconds.
    • duration_formatted - Duration formatted as HH:MM:SS.
    • size - Size of the video file in bytes.
    • size_mb - Size of the video file in megabytes.
    • bitrate - Bitrate of the video file in bits per second.
    • bitrate_kbps - Bitrate of the video file in kilobits per second.
    • video
      * codec - Video codec name.
      * codec_long - Long descriptive video codec name.
      * profile - Video codec profile.
      * width - Width of the video in pixels.
      * height - Height of the video in pixels.
      * resolution - Resolution of the video as width x height.
      * aspect_ratio - Display aspect ratio of the video.
      * fps - Frames per second of the video.
      * bitrate - Bitrate of the video stream in bits per second.
      * bitrate_kbps - Bitrate of the video stream in kilobits per second.
      * pixel_format - Pixel format of the video.
      * level - Video codec level.
      * color_space - Color space of the video.
      * color_range - Color range of the video.
    • audio
      * codec - Audio codec name.
      * codec_long - Long descriptive audio codec name.
      * sample_rate - Audio sample rate in Hz.
      * sample_rate_khz - Audio sample rate in kHz.
      * channels - Number of audio channels.
      * channel_layout - Audio channel layout.
      * bitrate - Bitrate of the audio stream in bits per second.
      * bitrate_kbps - Bitrate of the audio stream in kilobits per second.
    • streams_count
      * total - Total number of streams in the video file.
      * video - Number of video streams.
      * audio - Number of audio streams.
      * subtitle - Number of subtitle streams.
    • raw - Complete raw FFprobe output if 'Include Raw Output' is enabled.

Dependencies

  • FFprobe (ffprobe-static)
  • Node.js child_process module for executing FFprobe
  • Node.js fs and fs/promises modules for file handling
  • Node.js http and https modules for downloading video files

Troubleshooting

  • Invalid URL provided error: Ensure the video URL starts with 'http' or 'https' and is accessible.
  • File download failures: Check network connectivity and URL correctness; HTTP status codes other than 200 will cause errors.
  • Binary data issues: Verify the binary property name matches the input binary data property and that the data is a valid video file.
  • FFprobe execution errors: Ensure FFprobe is correctly installed and accessible; the node uses a static FFprobe binary.
  • Temporary file cleanup failures: The node attempts to delete temporary files after processing; permission issues may prevent this but do not affect metadata extraction.

Links

Discussion