This function matches the metadata of videos and the metadata of the photo-identification to output video clips containing photo-identified individuals

getVideoClip(
  selected_metadata,
  output_extension = ".avi",
  timezone = NULL,
  fps = 1,
  trim_interval = NULL,
  output_video_codec = NULL,
  encoding_speed = "medium",
  export_video_folder = NULL,
  export_data_folder = NULL,
  export_data_filename = NULL,
  show_ffmpeg_on_console = FALSE
)

Arguments

selected_metadata

data frame with metadata of the drone videos included in the data frame containing the metadata of the photographs produced by the function selectVideos().

output_extension

c('.avi', '.mp4', '.mov')

timezone

string. Add the correct timezone where the drone videos were taken, as per the R base notation (for additional information, see help(timezomes)). Should this argument be left empty, the time zone will be assumed to be the same as the computer system.

fps

Integer. If the chosen output media is a video clip, output_media='clip', this parameter gives the rate (in frames per second) of the output video. The default is FPS=1 to export low-resolution videos with one frame per second.

trim_interval

Integer. If the chosen output media is a video clip, output_media='clip', this parameter gives the total number of seconds before and after the photo-identification event. The trimmed video duration will be 2*trim_interval, i.e. duration [-trim_interval, +trim_interval]. A suggested default is 180 secs (00:03:00) thus exporting a 6-min video clip.

output_video_codec

character. Set the codec used to convert the output video.

encoding_speed

character. Define encoding presets from FFmpeg. Faster speed produces larger files and slower speeds produces more compressed files. Choose from: ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow.

export_video_folder

full path of the destination folder where the clips of the drone videos should be saved at

export_data_folder

full folder path to where the data frame with the matched data should be exported to

export_data_filename

csv name for the export file (e.g. export_data_filename = 'drone_trimmed_videoclip_database.csv')

show_ffmpeg_on_console

logical. If TRUE, it prints the FFmpeg output on console.

Note

Requires FFmpeg. Please install it from [http://ffmpeg.org]

Author

Alexandre Machado, Mauricio Cantor

Examples

if (FALSE) getVideoClip(selected_metadata = selected_metadata, output_extension = '.avi', timezone = 'America/Sao_Paulo', fps = 1, trim_interval = 180, output_video_codec = 'libx264', encoding_speed = "medium", export_video_folder = '/Desktop/you/data', export_data_folder = '/Desktop/you/data', export_data_filename = 'drone_trimmed_videoclip_database.csv', show_ffmpeg_on_console = FALSE)