Skip to contents

Package

What tidymedia is for, and how its three kinds of function fit together.

tidymedia tidymedia-package
tidymedia: Media File Preprocessing and Metadata for the 'tidyverse'

Concepts

Background on arguments that many functions share.

audio_stream audio-tracks audio_indices
Audio track and audio input indices

Time limits

Set a time limit on one call, or on the rest of a function. A program that hangs then stops that call, not the R session.

with_timeout()
Set a time limit for one call
local_timeout()
Set a time limit for the rest of a function

Direct commands

Pass your own arguments to FFmpeg, FFprobe or MediaInfo. Use these for anything that tidymedia does not cover.

ffmpeg()
Run a raw FFmpeg command
ffprobe()
Send a command to the FFprobe program
mediainfo()
Run a MediaInfo command

Pipeline functions

Build an FFmpeg command one step at a time, then compile it or run it.

ffm_files()
Specify Files in an FFmpeg Pipeline
ffm_trim()
Trim the Duration of the FFmpeg Pipeline
ffm_seek()
Cut a Continuous Section from an FFmpeg Pipeline by Seeking
ffm_drop()
Drop Streams from an FFmpeg Pipeline
ffm_crop()
Crop Frames in an FFmpeg Pipeline
ffm_scale()
Scale (Resize) Frames in an FFmpeg Pipeline
ffm_fps()
Set the Frame Rate in an FFmpeg Pipeline
ffm_codec()
Set Codecs in an FFmpeg Pipeline
ffm_map()
Set the Stream Mapping in an FFmpeg Pipeline
ffm_copy()
Copy the codecs and map all streams
ffm_pixel_format()
Set the Pixel Format in an FFmpeg Pipeline
ffm_hstack()
Horizontally Stack Multiple Videos in an FFmpeg Pipeline
ffm_vstack()
Vertically Stack Multiple Videos in an FFmpeg Pipeline
ffm_overlay()
Overlay One Video on Another in an FFmpeg Pipeline
ffm_concat()
Concatenate Multiple Inputs in an FFmpeg Pipeline
ffm_drawbox()
Draw a Colored Box on the Videos in an FFmpeg Pipeline
ffm_loudnorm()
Normalize Loudness in an FFmpeg Pipeline
ffm_output_options()
Add Raw Output Options to an FFmpeg Pipeline
ffm_compile()
Compile the tidymedia pipeline into an FFmpeg command
ffm_run()
Run the FFmpeg Pipeline
ffm_batch()
Run an FFmpeg Pipeline Over Many Files
ffm_jobs()
Build a Jobs Table From a Directory
print(<tidymedia_ffm>)
Print an FFmpeg pipeline

Task functions

Do a common job in one call. Each one is built from the pipeline functions.

extract_frame()
Extract a single frame from a video
extract_frame_batch()
Extract Still Frames From Many Videos From a Jobs Table
sample_frames()
Sample frames from a video at a fixed rate
sample_frames_batch()
Sample frames from many videos at a fixed rate from a jobs table
extract_audio()
Extract the audio stream from a media file
extract_audio_batch()
Extract Audio From Many Files From a Jobs Table
separate_audio_video()
Split a media file into separate audio and video files
separate_audio_video_batch()
Separate Audio and Video for Many Files From a Jobs Table
convert_audio()
Extract or convert a media file's audio track
convert_audio_batch()
Convert the Audio of Many Files From a Jobs Table
normalize_audio()
Normalize a file's audio loudness (EBU R128)
normalize_audio_batch()
Normalize Many Files' Audio Loudness From a Jobs Table
crop_video()
Crop a video to a rectangular region
crop_video_batch()
Crop Many Videos From a Jobs Table
anonymize_video()
Cover fixed regions of a video with opaque boxes
anonymize_video_batch()
Anonymize Many Videos From a Jobs Table
strip_metadata()
Strip identifying metadata from a media file
strip_metadata_batch()
Strip Metadata From Many Files From a Jobs Table
format_for_web()
Re-encode a video for web playback
format_for_web_batch()
Re-encode Many Videos for the Web From a Jobs Table
standardize_video()
Standardize a video to a reproducible format
standardize_video_batch()
Standardize Many Videos From a Jobs Table
segment_video()
Segment Video
segment_video_batch()
Segment Many Videos From a Jobs Table
concatenate_videos()
Combine video files using the concat demuxer
concatenate_videos_batch()
Concatenate Many Videos From a Jobs Table
compare_videos()
Build a side-by-side comparison video
compare_videos_batch()
Build Many Comparison Videos From a Jobs Table
picture_in_picture()
Inset one video over another (picture-in-picture)
picture_in_picture_batch()
Inset One Video Over Another For Many Outputs From a Jobs Table

Checking outputs and recording runs

Check that an output has the properties you asked for, and record how the files in a batch were made.

verify_media()
Verify a Media File Against Expected Properties
ffm_manifest()
Read a Batch Provenance Manifest

Media metadata

Read container and stream metadata into tibbles.

probe_all()
Look up information about media files using FFprobe
probe_container() probe_streams() probe_video() probe_audio()
Shortcut functions for probing specific information
mediainfo_parameter()
Query a single parameter from a single MediaInfo section
mediainfo_query()
Query multiple parameters from a single MediaInfo section
mediainfo_template()
Describe media files by applying a MediaInfo template
get_duration()
Get the duration of a media file
get_frame_rate()
Get the video frame rate of a media file
get_width()
Get the video width of a media file
get_height()
Get the video height of a media file
get_sample_rate()
Get the audio sample rate of a media file

FFmpeg capabilities

List the codecs and encoders in your FFmpeg build, including hardware encoders.

ffmpeg_codecs()
Get a data frame of all installed codecs
ffmpeg_encoders()
Get a data frame of all installed encoders
hardware_encoder() has_hardware_encoder()
Hardware video encoders
refresh_ffmpeg_capabilities()
Forget what tidymedia remembers about your FFmpeg build

Program management

Find, set and install the FFmpeg and MediaInfo programs.

program_status()
Report which dependency programs tidymedia can find
find_ffmpeg() find_mediainfo() find_ffprobe() find_ffplay()
Find the location of a dependency program
set_program() set_mediainfo() set_ffmpeg() set_ffprobe() set_ffplay()
Set the location of a dependency program
unset_program()
Forget the location of a dependency program
install_on_win()
Install FFmpeg on Windows