Contact Sheet MGMs - AudiovisualMetadataPlatform/amp_documentation GitHub Wiki

  1. AMP: Audiovisual Metadata Platform
  2. Documentation
  3. For Developers
  4. MGM Adapters

Contact Sheet MGMs

  • About
    • The Contact Sheet MGMs are python based tools that take in a video and create a PNG image of contact sheet containing thumbnails of the frames from the video. There are the following types of Contact Sheets depending on how frames are extracted, 
      • Contact Sheet by Frame:
        • based on frame interval or quantity, depending on which parameter is supplied;
        • if both parameters are specified, then the total number of frames will be the lesser of video_length divided by frame_interval and frame_quantity.
      • Contact Sheet by Face: based on Face Recognition
      • Contact Sheet by Shot: based on shot detection
      • Contact Sheet by VOCR: based on video OCR
  • Source Code
    • galaxy/tools/video_tools/contact_sheet_*.xml: Tool configuration detailing tool execution, input file, output file, and labeling.
    • galaxy/tools/video_tools/contact_sheet-*.py: Python script to handle the input parameters and call the code to create the contact sheet. 
    • galaxy/tools/amp_json_schema/contact_sheet.py: schema for creation of the contact sheet
  • Dependencies

    • ffmpeg-python
  • Installation:

    • To run outside of Galaxy: $ pip install ffmpeg-python
    • To run with Galaxy: no extra installation needed, as the dependencies are included with python sif file.
  • Running the MGMs

    • The MGMs can be invoked from Galaxy UI as other tools. Users needs to supply the input video file plus some AMP JSON result files or frame interval/quantity information  (depending on the contact sheet type).
  • Inputs/Parameters (some apply to only certain contact sheets)
    • input_video: Video input file,** required for all Contact Sheets**
    • amp_shots: AMP Shot JSON to create frames from, required for Contact Sheet by Shot
    • amp_faces: AMP Facial Recognition JSON to create frames from, required for Contact Sheet by Face
    • frame_interval: Interval in seconds between frames. either the frame interval or quantity must be supplied for Contact Sheet by Frame, default 0 means not supplied
    • frame_quantity: Total number of frames to extract, either the frame interval or quantity must be supplied for Contact Sheet by Frame, default 0 means not supplied
    • columns:  Number of thumbnail columns of per row, optional, default is 4
    • width: Width of thumbnail image, optional, optional, default is 300
    • margin: Margin around each thumbnail, optional, optional, default is 10
    • padding:  Padding around each thumbnail, optional, optional, default is 3
  • Output
    • contact_sheet: Image file (PNG) containing the thumbnails of extracted frames from the video

Document generated by Confluence on Feb 25, 2025 10:39

⚠️ **GitHub.com Fallback** ⚠️