Sovigall/bin/getInfo.sh
2015-02-02 10:52:34 +01:00

20 lines
747 B
Bash

#!/bin/bash/
finalDest=/srv/http/sovigall.local/videos/
pageCache=/srv/http/sovigall.local/pagecache/
convertingTool=/usr/bin/ffmpeg
video=$1
path="$finalDest$2"
duration=$(eval $convertingTool -i "$path""$video.webm" 2>&1 | grep Duration | awk '{print $2}' | tr -d ,)
heure=$(echo $duration | cut -d":" -f1)
minute=$(echo $duration | cut -d":" -f2)
seconde=$(echo $duration | cut -d":" -f3 | cut -d"." -f1)
total=$(($heure*3600 + $minute*60 + $seconde))
sizeOfVideo=$(eval $convertingTool -i "$path""$video.webm" 2>&1 | grep "Stream #0:0" | awk '{print $6}' | tr -d ,)
#createDate=$(stat -c %y "$path""$video.webm" 2>&1 | awk '{print$1}' | sed 's/[\-]//g')
echo "$total"
echo "$sizeOfVideo"
#echo "$createDate"
rm $pageCache*.html 2> /dev/null