aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/options.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2021-05-22 13:54:12 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2021-05-22 15:20:42 +0530
commit81a23040ebf330a87a7eb842aa76884d5fc6e504 (patch)
tree4b77ed8dd1f91cc65376bbaf346844c83202e4bd /yt_dlp/options.py
parent857f63136d4f46b18353f8e50b07ff1394b79695 (diff)
downloadhypervideo-pre-81a23040ebf330a87a7eb842aa76884d5fc6e504.tar.lz
hypervideo-pre-81a23040ebf330a87a7eb842aa76884d5fc6e504.tar.xz
hypervideo-pre-81a23040ebf330a87a7eb842aa76884d5fc6e504.zip
[cleanup] Refactor ffmpeg convertors
Diffstat (limited to 'yt_dlp/options.py')
-rw-r--r--yt_dlp/options.py29
1 files changed, 20 insertions, 9 deletions
diff --git a/yt_dlp/options.py b/yt_dlp/options.py
index 812bee572..c72a7d5d0 100644
--- a/yt_dlp/options.py
+++ b/yt_dlp/options.py
@@ -5,7 +5,6 @@ import optparse
import re
import sys
-from .downloader.external import list_external_downloaders
from .compat import (
compat_expanduser,
compat_get_terminal_size,
@@ -18,11 +17,18 @@ from .utils import (
get_executable_path,
OUTTMPL_TYPES,
preferredencoding,
- REMUX_EXTENSIONS,
write_string,
)
from .version import __version__
+from .downloader.external import list_external_downloaders
+from .postprocessor.ffmpeg import (
+ FFmpegExtractAudioPP,
+ FFmpegSubtitlesConvertorPP,
+ FFmpegThumbnailsConvertorPP,
+ FFmpegVideoRemuxerPP,
+)
+
def _hide_login_info(opts):
PRIVATE_OPTS = set(['-p', '--password', '-u', '--username', '--video-password', '--ap-password', '--ap-username'])
@@ -1123,7 +1129,9 @@ def parseOpts(overrideArguments=None):
help='Convert video files to audio-only files (requires ffmpeg and ffprobe)')
postproc.add_option(
'--audio-format', metavar='FORMAT', dest='audioformat', default='best',
- help='Specify audio format: "best", "aac", "flac", "mp3", "m4a", "opus", "vorbis", or "wav"; "%default" by default; No effect without -x')
+ help=(
+ 'Specify audio format to convert the audio to when -x is used. Currently supported formats are: '
+ 'best (default) or one of %s' % '|'.join(FFmpegExtractAudioPP.SUPPORTED_EXTS)))
postproc.add_option(
'--audio-quality', metavar='QUALITY',
dest='audioquality', default='5',
@@ -1134,15 +1142,14 @@ def parseOpts(overrideArguments=None):
help=(
'Remux the video into another container if necessary (currently supported: %s). '
'If target container does not support the video/audio codec, remuxing will fail. '
- 'You can specify multiple rules; eg. "aac>m4a/mov>mp4/mkv" will remux aac to m4a, mov to mp4 '
- 'and anything else to mkv.' % '|'.join(REMUX_EXTENSIONS)))
+ 'You can specify multiple rules; Eg. "aac>m4a/mov>mp4/mkv" will remux aac to m4a, mov to mp4 '
+ 'and anything else to mkv.' % '|'.join(FFmpegVideoRemuxerPP.SUPPORTED_EXTS)))
postproc.add_option(
'--recode-video',
metavar='FORMAT', dest='recodevideo', default=None,
help=(
'Re-encode the video into another format if re-encoding is necessary. '
- 'You can specify multiple rules similar to --remux-video. '
- 'The supported formats are also the same as --remux-video'))
+ 'The syntax and supported formats are the same as --remux-video'))
postproc.add_option(
'--postprocessor-args', '--ppa',
metavar='NAME:ARGS', dest='postprocessor_args', default={}, type='str',
@@ -1250,11 +1257,15 @@ def parseOpts(overrideArguments=None):
postproc.add_option(
'--convert-subs', '--convert-sub', '--convert-subtitles',
metavar='FORMAT', dest='convertsubtitles', default=None,
- help='Convert the subtitles to another format (currently supported: srt|ass|vtt|lrc) (Alias: --convert-subtitles)')
+ help=(
+ 'Convert the subtitles to another format (currently supported: %s) '
+ '(Alias: --convert-subtitles)' % '|'.join(FFmpegSubtitlesConvertorPP.SUPPORTED_EXTS)))
postproc.add_option(
'--convert-thumbnails',
metavar='FORMAT', dest='convertthumbnails', default=None,
- help='Convert the thumbnails to another format (currently supported: jpg, png)')
+ help=(
+ 'Convert the thumbnails to another format '
+ '(currently supported: %s) ' % '|'.join(FFmpegThumbnailsConvertorPP.SUPPORTED_EXTS)))
postproc.add_option(
'--split-chapters', '--split-tracks',
dest='split_chapters', action='store_true', default=False,