Post History
I see that this is self-answered, but I disagree that the answer provided is the best way. The best way is to properly utilize the Unix philosophy, by decomposing the problem into simpler sub-probl...
Answer
#2: Post edited
I see that this is a self-answer, but I disagree that the answer provided is the *best* way. The best way is to properly utilize the Unix philosophy, by decomposing the problem into simpler sub-problems.- It is probably not hard to figure out how to convert a single file `foo.flac` into `foo.mp3`. I'll use the other answer's command:
- ```
- ffmpeg -i foo.flac -c:a libmp3lame -b:a 128k foo.mp3
- ```
- Now you just need to get a list FLAC files and [apply the command to each one](https://linux.codidact.com/posts/288310#answer-288311):
- ```
- ls *.flac | parallel \
- ffmpeg -i {} -c:a libmp3lame -b:a 128k {.}.mp3
- ```
- I see that this is self-answered, but I disagree that the answer provided is the *best* way. The best way is to properly utilize the Unix philosophy, by decomposing the problem into simpler sub-problems.
- It is probably not hard to figure out how to convert a single file `foo.flac` into `foo.mp3`. I'll use the other answer's command:
- ```
- ffmpeg -i foo.flac -c:a libmp3lame -b:a 128k foo.mp3
- ```
- Now you just need to get a list FLAC files and [apply the command to each one](https://linux.codidact.com/posts/288310#answer-288311):
- ```
- ls *.flac | parallel \
- ffmpeg -i {} -c:a libmp3lame -b:a 128k {.}.mp3
- ```
#1: Initial revision
I see that this is a self-answer, but I disagree that the answer provided is the *best* way. The best way is to properly utilize the Unix philosophy, by decomposing the problem into simpler sub-problems. It is probably not hard to figure out how to convert a single file `foo.flac` into `foo.mp3`. I'll use the other answer's command: ``` ffmpeg -i foo.flac -c:a libmp3lame -b:a 128k foo.mp3 ``` Now you just need to get a list FLAC files and [apply the command to each one](https://linux.codidact.com/posts/288310#answer-288311): ``` ls *.flac | parallel \ ffmpeg -i {} -c:a libmp3lame -b:a 128k {.}.mp3 ```