mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-30 12:01:28 +00:00
[ffmpeg] convert format ext to ffmpeg output formats codes
This commit is contained in:
parent
f34294fa0c
commit
a755f82549
|
@ -6,7 +6,7 @@
|
|||
import re
|
||||
|
||||
from .common import FileDownloader
|
||||
from ..postprocessor.ffmpeg import FFmpegPostProcessor
|
||||
from ..postprocessor.ffmpeg import FFmpegPostProcessor, EXT_TO_OUT_FORMATS
|
||||
from ..compat import compat_str
|
||||
from ..utils import (
|
||||
cli_option,
|
||||
|
@ -197,7 +197,7 @@ def _call_downloader(self, tmpfilename, info_dict):
|
|||
else:
|
||||
args += ['-f', 'mp4', '-bsf:a', 'aac_adtstoasc']
|
||||
else:
|
||||
args += ['-f', info_dict['ext']]
|
||||
args += ['-f', EXT_TO_OUT_FORMATS.get(info_dict['ext'], info_dict['ext'])]
|
||||
|
||||
args = [encodeArgument(opt) for opt in args]
|
||||
args.append(encodeFilename(ffpp._ffmpeg_filename_argument(tmpfilename), True))
|
||||
|
|
|
@ -25,6 +25,19 @@
|
|||
)
|
||||
|
||||
|
||||
EXT_TO_OUT_FORMATS = {
|
||||
"aac": "adts",
|
||||
"m4a": "ipod",
|
||||
"mka": "matroska",
|
||||
"mkv": "matroska",
|
||||
"mpg": "mpeg",
|
||||
"ogv": "ogg",
|
||||
"ts": "mpegts",
|
||||
"wma": "asf",
|
||||
"wmv": "asf",
|
||||
}
|
||||
|
||||
|
||||
class FFmpegPostProcessorError(PostProcessingError):
|
||||
pass
|
||||
|
||||
|
|
Loading…
Reference in a new issue