Skip to content

Instantly share code, notes, and snippets.

@shaposhnikoff
Created November 19, 2014 17:45
Show Gist options
  • Save shaposhnikoff/82064aeab8cba64832fb to your computer and use it in GitHub Desktop.
Save shaposhnikoff/82064aeab8cba64832fb to your computer and use it in GitHub Desktop.
duration
#!/bin/bash
echo 'select m_url,TIMESTAMPDIFF(SECOND, m_startTime, m_endTime) as time from sitramun2observer_FileCamera order by TIMESTAMPDIFF(SECOND, m_startTime, m_endTime) ;' | mysql -proot octopus > files.txt
while read line
do
echo ""
echo "Duration from database" `echo $line|awk '{print $2}'` "sec"
/opt/ffmpeg/ffprobe -v error -show_format -of flat=s=_ `echo $line|awk '{print $1}'` | egrep 'filename|duration'
echo ""
done <files.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment