Sunday, May 5, 2024
 Popular · Latest · Hot · Upcoming
24
rated 0 times [  24] [ 0]  / answers: 1 / hits: 20577  / 3 Years ago, fri, august 20, 2021, 7:12:21

My latest challenge is finding out the correct way to convert several .flac files to 320k .mp3's. Does anyone know how to do this, maybe with avconv, without using an elaborate python script, decompressing the files to .wav first, or any other complicated scheme?


More From » avconv

 Answers
3

First of all you must make sure that it's installed.



sudo apt-get install libav-tools


It should have lame and flac codecs, now is just create a bash script to finish the job:



$ cat > flac2mp3


Here the shell will wait for your commands, copy and paste this:



#!/bin/bash
[[ $# == 0 ]] && set -- *.flac
for f; do
avconv -i "$f" -qscale:a 0 "${f[@]/%flac/mp3}"
done


Now press Ctrl + D. Make your script executable chmod +x flac2mp3. Now go you can use it like this:



./flac2mp3 /path/with/all/my/flacs/*.flac


You can also copy the script to somewhere in your PATH and then cd to the directory with the flacs and execute it.






With regards to the following parameter used above:



-qscale:a 0


will not actually give you a exact 320k file, although it is probably the best setting to use anyway. The suggested settings actually give a target bitrate of 245 kbits/s with a range of 220-260. If you really wanted 320k mp3s you would have to go to CBR and use:



-c:a libmp3lame -b:a 320k


but you would need great ears to notice the difference...



Reference:




[#28139] Friday, August 20, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
atereress

Total Points: 79
Total Questions: 106
Total Answers: 119

Location: Federated States of Micronesia
Member since Sun, May 16, 2021
3 Years ago
atereress questions
Wed, Aug 4, 21, 03:15, 3 Years ago
Sat, Apr 16, 22, 17:34, 2 Years ago
Thu, Dec 22, 22, 05:56, 1 Year ago
Sun, May 15, 22, 15:59, 2 Years ago
;