Extract Video Frames To Images (Image Analyst)

Available with Image Analyst license.

Summary

Extracts video frame images and associated metadata from an FMV-compliant video stream. The extracted images can be added to a mosaic dataset or other tools and functions for further analysis.

Usage

  • This tool works with archived video data only. Live stream videos are not supported.

  • Images from an FMV-compliant video stream will be extracted and stored in a directory in TIFF, NITF, or JPEG format.

  • Metadata associated with the video imagery will be written to a comma-separated values file (.csv) in the same directory.

Parameters

LabelExplanationData Type
Input Video File

The input video file in any of the supported video file formats, including PS, TS, MPG, MPEG, MP2, MPG2, MPEG2, MP4, MPG4, MPEG4, H264, H265, VOB, and M2TS.

File
Output Folder

The file directory where the output images and metadata will be saved.

Folder
Image Type
(Optional)

Specifies the output image format.

  • JPEGThe output will be in JPEG image format.
  • TIFFThe output will be in TIFF image format. This is the default.
  • NITFThe output will be in NITF image format.
  • PNGThe output will be in PNG image format.
String
Maximum Overlap Percentage
(Optional)

The maximum overlap percentage between two images. If the overlap between a candidate image and the last image written to disk is greater than this value, the candidate image will be ignored. The default percentage is 100 percent, which writes all images to disk.

Double
Require Fresh Metadata
(Optional)

Specifies whether video frames with associated metadata will be extracted and saved.

  • Checked—Only video frames with associated metadata will be saved.
  • Unchecked—All video frames will be saved. This is the default.
Boolean
Minimum Time Between Features
(Optional)

The minimum time interval between video frames to be saved. If no value is specified, all video frames will be saved as images.

Time Unit

ExtractVideoFramesToImages(in_video, out_folder, {image_type}, {image_overlap}, {require_fresh_metadata}, {min_time})
NameExplanationData Type
in_video

The input video file in any of the supported video file formats, including PS, TS, MPG, MPEG, MP2, MPG2, MPEG2, MP4, MPG4, MPEG4, H264, H265, VOB, and M2TS.

File
out_folder

The file directory where the output images and metadata will be saved.

Folder
image_type
(Optional)

Specifies the output image format.

  • JPEGThe output will be in JPEG image format.
  • TIFFThe output will be in TIFF image format. This is the default.
  • NITFThe output will be in NITF image format.
  • PNGThe output will be in PNG image format.
String
image_overlap
(Optional)

The maximum overlap percentage between two images. If the overlap between a candidate image and the last image written to disk is greater than this value, the candidate image will be ignored. The default percentage is 100 percent, which writes all images to disk.

Double
require_fresh_metadata
(Optional)

Specifies whether video frames with associated metadata will be extracted and saved.

  • REQUIRE_FRESH_METADATAOnly video frames with associated metadata will be saved.
  • NO_REQUIRE_FRESH_METADATAAll video frames will be saved. This is the default.
Boolean
min_time
(Optional)

The minimum time interval between video frames to be saved. If no value is specified, all video frames will be saved as images.

Time Unit

Code sample

ExtractVideoFramesToImages example 1 (Python window)

This example extracts video frame images and associated metadata from a video stream and saves the data to a directory.

arcpy.ia.ExtractVideoFramesToImages(r"c:\test\video.ts", r"C:\temp2\outimages",
"TIFF", 100, "", "20 Seconds")
ExtractVideoFramesToImages example 2 (stand-alone script)

This example extracts video frame images and associated metadata from a video stream and saves the data to a directory.

import arcpy
from arcpy.ia import *

arcpy.CheckOutExtension("ImageAnalyst")

in_video = "c:\\test\\drone_vid.ts"
out_folder = "c:\\output"
outformat = "NITF"
maxoverlap = 100
requirefreshmeta = “REQUIRE_FRESH_METADATA” 
mintimebetween = "1 minute"


arcpy.ia.ExtractVideoFramesToImages(in_video, out_folder, outformat, maxoverlap,
requirefreshmeta, mintimebetween)

Environments

This tool does not use any geoprocessing environments.

Licensing information

  • Basic: Requires Image Analyst
  • Standard: Requires Image Analyst
  • Advanced: Requires Image Analyst

Related topics