My build of nnn with minor changes
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

5 роки тому
5 роки тому
5 роки тому
5 роки тому
12345678910111213141516171819202122232425262728293031
  1. #!/usr/bin/env sh
  2. # Description: Create an mp3 ringtone out of an audio file in any format
  3. # Needs user to provide start and end where to cut the file
  4. # Input file audio.ext results in audio_ringtone.mp3
  5. # Requires: date, ffmpeg
  6. #
  7. # Shell: POSIX compliant
  8. # Author: Arun Prakash Jana
  9. if [ -n "$1" ]; then
  10. echo -n "start (hh:mm:ss): "
  11. read start
  12. st=$(date -d "$start" +%s) || exit 1
  13. echo -n "end (hh:mm:ss): "
  14. read end
  15. et=$(date -d "$end" +%s) || exit 1
  16. if [ $st -ge $et ]; then
  17. echo "error: start >= end"
  18. exit 1
  19. fi
  20. interval=$(( $et - $st ))
  21. outfile=$(basename "$1")
  22. outfile="${outfile%.*}"_ringtone.mp3
  23. ffmpeg -i "$1" -ss "$start" -t "$interval" -vn -sn -acodec libmp3lame -q:a 2 "$outfile"
  24. fi