media scwrypts v5 refactor
This commit is contained in:
20
scwrypts/media/ffmpeg/get-video-length-seconds.module.zsh
Normal file
20
scwrypts/media/ffmpeg/get-video-length-seconds.module.zsh
Normal file
@ -0,0 +1,20 @@
|
||||
#####################################################################
|
||||
|
||||
DEPENDENCIES+=(ffprobe)
|
||||
|
||||
#####################################################################
|
||||
|
||||
${scwryptsmodule}() {
|
||||
local FILENAME="$1"
|
||||
|
||||
[ "${FILENAME}" ] && [ -f "${FILENAME}" ] \
|
||||
|| ERROR "invalid or missing file '${FILENAME}'" \
|
||||
|| return 1
|
||||
|
||||
ffprobe \
|
||||
-v quiet \
|
||||
-show_entries format=duration \
|
||||
-of default=noprint_wrappers=1:nokey=1 \
|
||||
-i "${FILENAME}" \
|
||||
;
|
||||
}
|
Reference in New Issue
Block a user