+#!/usr/bin/env bash
+
+get_media_length() {
+ # Use ffprobe to get media container length in seconds (float)
+ # Usage: get_media_length arg1
+ # Input: arg1: path to file
+ # Output: stdout: seconds (float)
+ # Depends: ffprobe 4.1.8
+ # Ref/Attrib: [1] How to get video duration in seconds? https://superuser.com/a/945604
+ local file_in
+ file_in="$1";
+ if [[ ! -f $file_in ]]; then
+ die "ERROR:Not a file:$file_in";
+ fi;
+ ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 "$file_in";
+} # Get media container length in seconds via stdout
+
+# Author: Steven Baltakatei Sandoval
+# License: GPLv3+
\ No newline at end of file