Thread: Tech FFmpeg duration
View Single Post
Old 10-27-2017, 08:01 AM  
Barry-xlovecam
It's 42
 
Industry Role:
Join Date: Jun 2010
Location: Global
Posts: 18,083
duration=$(%ffmpeg_path% -i %video_file% 2>&1 | grep "Duration"| cut -d ' ' -f 4 | sed s/,// | sed 's@..*@@g' | awk '{ split($1, A, ":")}'
#; split(A[3], B, ".")

echo $duration

; is an end next; next ...

This really needs to be in a bash script --then you don't need all the ;'s and it is a lot less confusing to work with IMO

Code:
#!/bin/bash
duration=$(%ffmpeg_path% -i %video_file% 2>&1 | grep "Duration"| cut -d ' ' -f 4 | sed s/,// | sed 's@..*@@g' | awk '{ split($1, A, ":")}'
#; split(A[3], B, ".")

echo $duration



see if it works now
Ladder up with the rest of the code
spaghetti is good for dinner -- that is one fuck of a one liner (I like ) but can get confusing.

gedit has a plugin that matches brackets {}
Barry-xlovecam is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote