Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Post History

66%
+2 −0
Q&A How to convert Flac to Mp3 with FFmpeg?

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...

posted 11mo ago by matthewsnyder‭  ·  edited 11mo ago by matthewsnyder‭

Answer
#2: Post edited by user avatar matthewsnyder‭ · 2023-06-11T23:29:55Z (11 months ago)
  • 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 by user avatar matthewsnyder‭ · 2023-06-11T23:29:33Z (11 months ago)
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
```