mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-15 21:53:21 +00:00
Compare commits
No commits in common. "96623ab5c6cea59c22395a47f00a13d334de6106" and "c220d9efc892a5d94feaeb803e5f5f0a85fd2146" have entirely different histories.
96623ab5c6
...
c220d9efc8
@ -1542,9 +1542,9 @@ The available fields are:
|
|||||||
|
|
||||||
All fields, unless specified otherwise, are sorted in descending order. To reverse this, prefix the field with a `+`. Eg: `+res` prefers format with the smallest resolution. Additionally, you can suffix a preferred value for the fields, separated by a `:`. Eg: `res:720` prefers larger videos, but no larger than 720p and the smallest video if there are no videos less than 720p. For `codec` and `ext`, you can provide two preferred values, the first for video and the second for audio. Eg: `+codec:avc:m4a` (equivalent to `+vcodec:avc,+acodec:m4a`) sets the video codec preference to `h264` > `h265` > `vp9` > `vp9.2` > `av01` > `vp8` > `h263` > `theora` and audio codec preference to `mp4a` > `aac` > `vorbis` > `opus` > `mp3` > `ac3` > `dts`. You can also make the sorting prefer the nearest values to the provided by using `~` as the delimiter. Eg: `filesize~1G` prefers the format with filesize closest to 1 GiB.
|
All fields, unless specified otherwise, are sorted in descending order. To reverse this, prefix the field with a `+`. Eg: `+res` prefers format with the smallest resolution. Additionally, you can suffix a preferred value for the fields, separated by a `:`. Eg: `res:720` prefers larger videos, but no larger than 720p and the smallest video if there are no videos less than 720p. For `codec` and `ext`, you can provide two preferred values, the first for video and the second for audio. Eg: `+codec:avc:m4a` (equivalent to `+vcodec:avc,+acodec:m4a`) sets the video codec preference to `h264` > `h265` > `vp9` > `vp9.2` > `av01` > `vp8` > `h263` > `theora` and audio codec preference to `mp4a` > `aac` > `vorbis` > `opus` > `mp3` > `ac3` > `dts`. You can also make the sorting prefer the nearest values to the provided by using `~` as the delimiter. Eg: `filesize~1G` prefers the format with filesize closest to 1 GiB.
|
||||||
|
|
||||||
The fields `hasvid` and `ie_pref` are always given highest priority in sorting, irrespective of the user-defined order. This behaviour can be changed by using `--format-sort-force`. Apart from these, the default order used is: `lang,quality,res,fps,hdr:12,vcodec:vp9.2,channels,acodec,size,br,asr,proto,ext,hasaud,source,id`. The extractors may override this default order, but they cannot override the user-provided order.
|
The fields `hasvid` and `ie_pref` are always given highest priority in sorting, irrespective of the user-defined order. This behaviour can be changed by using `--format-sort-force`. Apart from these, the default order used is: `lang,quality,res,fps,hdr:12,codec:vp9.2,size,br,asr,proto,ext,hasaud,source,id`. The extractors may override this default order, but they cannot override the user-provided order.
|
||||||
|
|
||||||
Note that the default has `vcodec:vp9.2`; i.e. `av1` is not preferred. Similarly, the default for hdr is `hdr:12`; i.e. dolby vision is not preferred. These choices are made since DV and AV1 formats are not yet fully compatible with most devices. This may be changed in the future as more devices become capable of smoothly playing back these formats.
|
Note that the default has `codec:vp9.2`; i.e. `av1` is not preferred. Similarly, the default for hdr is `hdr:12`; i.e. dolby vision is not preferred. These choices are made since DV and AV1 formats are not yet fully compatible with most devices. This may be changed in the future as more devices become capable of smoothly playing back these formats.
|
||||||
|
|
||||||
If your format selector is `worst`, the last item is selected after sorting. This means it will select the format that is worst in all respects. Most of the time, what you actually want is the video with the smallest filesize instead. So it is generally better to use `-f best -S +size,+br,+res,+fps`.
|
If your format selector is `worst`, the last item is selected after sorting. This means it will select the format that is worst in all respects. Most of the time, what you actually want is the video with the smallest filesize instead. So it is generally better to use `-f best -S +size,+br,+res,+fps`.
|
||||||
|
|
||||||
|
@ -1 +0,0 @@
|
|||||||
# Empty file needed to make devscripts.utils properly importable from outside
|
|
@ -1669,8 +1669,8 @@ class InfoExtractor:
|
|||||||
regex = r' *((?P<reverse>\+)?(?P<field>[a-zA-Z0-9_]+)((?P<separator>[~:])(?P<limit>.*?))?)? *$'
|
regex = r' *((?P<reverse>\+)?(?P<field>[a-zA-Z0-9_]+)((?P<separator>[~:])(?P<limit>.*?))?)? *$'
|
||||||
|
|
||||||
default = ('hidden', 'aud_or_vid', 'hasvid', 'ie_pref', 'lang', 'quality',
|
default = ('hidden', 'aud_or_vid', 'hasvid', 'ie_pref', 'lang', 'quality',
|
||||||
'res', 'fps', 'hdr:12', 'vcodec:vp9.2', 'channels', 'acodec',
|
'res', 'fps', 'hdr:12', 'channels', 'codec:vp9.2', 'size', 'br', 'asr',
|
||||||
'size', 'br', 'asr', 'proto', 'ext', 'hasaud', 'source', 'id') # These must not be aliases
|
'proto', 'ext', 'hasaud', 'source', 'id') # These must not be aliases
|
||||||
ytdl_default = ('hasaud', 'lang', 'quality', 'tbr', 'filesize', 'vbr',
|
ytdl_default = ('hasaud', 'lang', 'quality', 'tbr', 'filesize', 'vbr',
|
||||||
'height', 'width', 'proto', 'vext', 'abr', 'aext',
|
'height', 'width', 'proto', 'vext', 'abr', 'aext',
|
||||||
'fps', 'fs_approx', 'source', 'id')
|
'fps', 'fs_approx', 'source', 'id')
|
||||||
|
@ -3588,8 +3588,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
|
|||||||
formats.extend(self._extract_storyboard(player_responses, duration))
|
formats.extend(self._extract_storyboard(player_responses, duration))
|
||||||
|
|
||||||
# source_preference is lower for throttled/potentially damaged formats
|
# source_preference is lower for throttled/potentially damaged formats
|
||||||
self._sort_formats(formats, (
|
self._sort_formats(formats, ('quality', 'res', 'fps', 'hdr:12', 'channels', 'source', 'codec:vp9.2', 'lang', 'proto'))
|
||||||
'quality', 'res', 'fps', 'hdr:12', 'source', 'vcodec:vp9.2', 'channels', 'acodec', 'lang', 'proto'))
|
|
||||||
|
|
||||||
info = {
|
info = {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
|
@ -139,8 +139,7 @@ class EmbedThumbnailPP(FFmpegPostProcessor):
|
|||||||
if not success:
|
if not success:
|
||||||
success = True
|
success = True
|
||||||
atomicparsley = next((
|
atomicparsley = next((
|
||||||
# libatomicparsley.so : See https://github.com/xibr/ytdlp-lazy/issues/1
|
x for x in ['AtomicParsley', 'atomicparsley']
|
||||||
x for x in ['AtomicParsley', 'atomicparsley', 'libatomicparsley.so']
|
|
||||||
if check_executable(x, ['-v'])), None)
|
if check_executable(x, ['-v'])), None)
|
||||||
if atomicparsley is None:
|
if atomicparsley is None:
|
||||||
self.to_screen('Neither mutagen nor AtomicParsley was found. Falling back to ffmpeg')
|
self.to_screen('Neither mutagen nor AtomicParsley was found. Falling back to ffmpeg')
|
||||||
|
@ -113,20 +113,15 @@ class FFmpegPostProcessor(PostProcessor):
|
|||||||
f'ffmpeg-location {location} does not exist! Continuing without ffmpeg', only_once=True)
|
f'ffmpeg-location {location} does not exist! Continuing without ffmpeg', only_once=True)
|
||||||
return {}
|
return {}
|
||||||
elif os.path.isdir(location):
|
elif os.path.isdir(location):
|
||||||
dirname, basename, filename = location, None, None
|
dirname, basename = location, None
|
||||||
else:
|
else:
|
||||||
filename = os.path.basename(location)
|
basename = os.path.splitext(os.path.basename(location))[0]
|
||||||
basename = next((p for p in programs if p in filename), 'ffmpeg')
|
basename = next((p for p in programs if basename.startswith(p)), 'ffmpeg')
|
||||||
dirname = os.path.dirname(os.path.abspath(location))
|
dirname = os.path.dirname(os.path.abspath(location))
|
||||||
if basename in self._ffmpeg_to_avconv.keys():
|
if basename in self._ffmpeg_to_avconv.keys():
|
||||||
self._prefer_ffmpeg = True
|
self._prefer_ffmpeg = True
|
||||||
|
|
||||||
paths = {p: os.path.join(dirname, p) for p in programs}
|
paths = {p: os.path.join(dirname, p) for p in programs}
|
||||||
if basename and basename in filename:
|
|
||||||
for p in programs:
|
|
||||||
path = os.path.join(dirname, filename.replace(basename, p))
|
|
||||||
if os.path.exists(path):
|
|
||||||
paths[p] = path
|
|
||||||
if basename:
|
if basename:
|
||||||
paths[basename] = location
|
paths[basename] = location
|
||||||
return paths
|
return paths
|
||||||
|
Loading…
Reference in New Issue
Block a user