Advertisement
pintcat

fframes - frame counter which uses ffmpeg as parser

Apr 20th, 2021 (edited)
1,516
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.44 KB | Software | 0 0
  1. #!/bin/sh
  2.  
  3. . ffprogress.sh
  4.  
  5. FF_ARGS="-an -f null -y"
  6. FF_INPUT=$1
  7.  
  8. echo
  9. if ! FF_PROGRESS; then
  10.     printf "\n\033[0;31mError - $FF_ERROR\033[0;32m\n\n"
  11.     exit 1
  12. fi
  13. printf "\r\033[1B\033[1C\033[7m"
  14. grep -Eo 'frame= *[0-9]+ *' $FF_LOG | tail -n1
  15. printf "\033[0m\n\n"
  16. rm -f $FF_LOG
  17.  
  18.  
  19. # Original simplified ffmpeg command line:
  20. # ffmpeg -i $1 -an -f null -y /dev/null 2>&1 | grep -Eo 'frame= *[0-9]+ *' | grep -Eo '[0-9]+' | tail -1 -
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement