projects
/
BK-2020-03.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix(user/):Fix flac converter script
[BK-2020-03.git]
/
user
/
convert_file_to_flac.sh
diff --git
a/user/convert_file_to_flac.sh
b/user/convert_file_to_flac.sh
index f21a0fc012261b20b9141b09bc510cf323c69c2b..c5540b16a208f295eee476ce90b52b99a2b85f23 100644
(file)
--- a/
user/convert_file_to_flac.sh
+++ b/
user/convert_file_to_flac.sh
@@
-1,8
+1,11
@@
#!/bin/bash
#!/bin/bash
-# Desc: Converts file readable by ffmpeg to FLAC audio f
ormat
+# Desc: Converts file readable by ffmpeg to FLAC audio f
ile
# Usage: convert_file_to_flac.sh [path]
# Usage: convert_file_to_flac.sh [path]
-# Version: 0.0.
1
+# Version: 0.0.
2
# Ref/Attrib: [1] Convert audio file to FLAC with ffmpeg? https://superuser.com/a/802126
# Ref/Attrib: [1] Convert audio file to FLAC with ffmpeg? https://superuser.com/a/802126
+# [2] How to specify flac compression level when converting with avconv? https://askubuntu.com/questions/544651/
+# [3] How can I extract audio from video with ffmpeg? https://stackoverflow.com/a/27413824
+# Depends: ffmpeg, ffprobe
declare -Ag appRollCall # Associative array for storing app status
declare -Ag fileRollCall # Associative array for storing file status
declare -Ag appRollCall # Associative array for storing app status
declare -Ag fileRollCall # Associative array for storing file status
@@
-213,8
+216,8
@@
main() {
if ! check_parsable_audio_ffprobe "$1"; then
die "FATAL:Not an audio file:$1"; fi;
if ! check_parsable_audio_ffprobe "$1"; then
die "FATAL:Not an audio file:$1"; fi;
- # Convert file to FLAC
- try ffmpeg -i "$1" -
f
"$1".flac
+ # Convert file to FLAC
. See [1], [2]
+ try ffmpeg -i "$1" -
vn -c:a flac -compression_level 12
"$1".flac
}; # main program
main "$@";
}; # main program
main "$@";