Advertisement
iconoclasthero

opus.book 2022.02.26

Feb 26th, 2022
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.78 KB | None | 0 0
  1. #!/bin/bash
  2. #set -x
  3. #trap read debug
  4. # init
  5.  
  6. shopt -s extglob
  7. scriptname="$(realpath $0)"
  8.  
  9. function editscript(){
  10. echo "scriptname: $scriptname"
  11. if [[ "$1" == "edit" ]]; then
  12. (/usr/bin/nano "$scriptname")
  13. exit
  14. fi
  15. }
  16.  
  17. function pause(){
  18. read -p "$*"
  19. }
  20.  
  21. editscript "$1"
  22.  
  23. if [ -n "$1" ];
  24. then
  25. # ffmpeg -n -nostdin -hide_banner -loglevel error -stats -i "$1" -acodec libopus -b:a 17k "${1%.*}".opus
  26. ffmpeg -n -nostdin -hide_banner -loglevel error -stats -i "$1" -filter_complex "compand=attacks=0:decays=0.12:points=-70/-900|-40/-90|-35/-37|-21/-18|1/-1|20/-1:soft-knee=0.03:gain=1.00:volume=-90, firequalizer=gain_entry='entry(0,-99);entry(140,0);entry(1000,0);entry(8000,1);entry(10500,4);entry(12000,5);entry(14500,-4);entry(19000,-20)', volume=1.0" -c:a libopus -b:a 17k -frame_duration:a 60 "${1%.*}".opus
  27. else
  28. for file in *.@(flac|mp3|wav|m4?|ogg) ; do
  29. # ffmpeg -n -nostdin -hide_banner -loglevel error -stats -i "$file" -acodec libopus -b:a 17k "${file%.*}".opus
  30. # ffmpeg -n -nostdin -hide_banner -loglevel error -stats -i "$file" -filter_complex "compand=attacks=0:decays=0.12:points=-70/-900|-40/-90|-35/-37|-21/-18|1/-1|20/-1:soft-knee=0.03:gain=1.00:volume=-90, firequalizer=gain_entry='entry(0,-99);entry(140,0);entry(1000,0);entry(8000,1);entry(10500,4);entry(12000,5);entry(14500,-4);entry(19000,-20)', volume=1.0" -c:a libopus -b:a 16384 -frame_duration:a 60 -application voip "${file%.*}".opus
  31. # ffmpeg -n -nostdin -hide_banner -loglevel error -stats -i "$file" -filter_complex "compand=attacks=0:decays=0.12:points=-70/-900|-40/-90|-35/-37|-21/-18|1/-1|20/-1:soft-knee=0.03:gain=1.00:volume=-90, firequalizer=gain_entry='entry(0,-99);entry(140,0);entry(1000,0);entry(8000,1);entry(10500,4);entry(12000,5);entry(14500,-4);entry(19000,-20)', volume=1.0" -c:a libopus -b:a 17k -frame_duration:a 60 -application voip "${file%.*}".opus
  32. ffmpeg -n -nostdin -hide_banner -loglevel error -stats -i file:"$file" -filter_complex "compand=attacks=0:decays=0.12:points=-70/-900|-40/-90|-35/-37|-21/-18|1/-1|20/-1:soft-knee=0.03:gain=1.00:volume=-90, firequalizer=gain_entry='entry(0,-99);entry(140,0);entry(1000,0);entry(8000,1);entry(10500,4);entry(12000,5);entry(14500,-4);entry(19000,-20)', volume=1.0" -c:a libopus -b:a 17k file:"${file%.*}".opus
  33. # ffmpeg -n -nostdin -hide_banner -loglevel error -stats -i file:"$file" -c:a libopus -b:a 17k file:"${file%.*}".opus
  34.  
  35. # ffmpeg -n -i "$file" -acodec libopus -b:a 17k "${file%.*}".opus
  36. # ffmpeg -n -i "$file" -acodec libopus -ar 16000 -b:a 24k "${file%.*}".opus
  37. done
  38. fi
  39.  
  40.  
  41. if [ -n "$1" ];
  42. then
  43. echo mediaduration "${1#*.}" `mediaduration "${1#*.}"`
  44. echo mediaduration opus `mediaduration opus`
  45. else
  46. echo mediaduration "${file#*.}" `mediaduration "${file#*.}"`
  47. echo -e "mediaduration opus `mediaduration opus`\n"
  48. fi
  49.  
  50.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement