Skip to content

Commit

Permalink
[postprocessor/ffmpeg] Allow options for mp3
Browse files Browse the repository at this point in the history
Why?
Options like `preferredquality` are ignored when postprocessing mp3s.

What?
Remove `mp3` from the list of `filecodec` values to check for in the
"lossless" condition unless `preferredquality` is unspecified.
  • Loading branch information
a-rich committed Aug 17, 2023
1 parent 86e3cf5 commit e8bebe0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion youtube_dl/postprocessor/ffmpeg.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,10 @@ def run(self, information):
acodec = 'copy'
extension = 'm4a'
more_opts = ['-bsf:a', 'aac_adtstoasc']
elif filecodec in ['aac', 'flac', 'mp3', 'vorbis', 'opus']:
elif (
filecodec in ['aac', 'flac', 'vorbis', 'opus'] or
(filecodec == 'mp3' and self._preferredquality is None)
):
# Lossless if possible
acodec = 'copy'
extension = filecodec
Expand Down

0 comments on commit e8bebe0

Please sign in to comment.