Forrest logo
back to the ffprobe tool

ffprobe:tldr:b4c71

ffprobe: Display media duration.
$ ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 ${input-mp4}
try on your machine

This command is using the ffprobe tool to extract the duration of a video file in seconds.

Here is the breakdown of each component of the command:

  • ffprobe: It is a multimedia analysis tool used to inspect multimedia files.
  • -v error: This option sets the verbosity level of the output. In this case, it is set to "error" which means only error messages will be displayed.
  • -show_entries format=duration: This option specifies which information to extract from the multimedia file. In this case, it is requesting the duration of the file.
  • -of default=noprint_wrappers=1:nokey=1: This option specifies the output format of the extracted information. It sets the format to "default" with additional options to remove any unnecessary wrappers, such as the section headers, and remove the key name from the output.
  • ${input-mp4}: This is a placeholder for the input file name. You should replace ${input-mp4} with the actual file name or path to the input video file.

When you run this command with a valid input file, it will only display the duration of the video file in seconds, without any other unnecessary information.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the ffprobe tool