mirror of
https://github.com/yt-dlp/yt-dlp
synced 2024-12-27 21:59:17 +01:00
[EmbedThumbnail] Add compat-option embed-thumbnail-atomicparsley
to force use of atomicparsley for embedding thumbnails in mp4 Related: #411
This commit is contained in:
parent
7e87e27c52
commit
e858a9d6d3
4 changed files with 8 additions and 4 deletions
|
@ -131,6 +131,7 @@ Some of yt-dlp's default options are different from that of youtube-dl and youtu
|
||||||
* Youtube channel URLs are automatically redirected to `/video`. Append a `/featured` to the URL to download only the videos in the home page. If the channel does not have a videos tab, we try to download the equivalent `UU` playlist instead. Also, `/live` URLs raise an error if there are no live videos instead of silently downloading the entire channel. You may use `--compat-options no-youtube-channel-redirect` to revert all these redirections
|
* Youtube channel URLs are automatically redirected to `/video`. Append a `/featured` to the URL to download only the videos in the home page. If the channel does not have a videos tab, we try to download the equivalent `UU` playlist instead. Also, `/live` URLs raise an error if there are no live videos instead of silently downloading the entire channel. You may use `--compat-options no-youtube-channel-redirect` to revert all these redirections
|
||||||
* Unavailable videos are also listed for youtube playlists. Use `--compat-options no-youtube-unavailable-videos` to remove this
|
* Unavailable videos are also listed for youtube playlists. Use `--compat-options no-youtube-unavailable-videos` to remove this
|
||||||
* If `ffmpeg` is used as the downloader, the downloading and merging of formats happen in a single step when possible. Use `--compat-options no-direct-merge` to revert this
|
* If `ffmpeg` is used as the downloader, the downloading and merging of formats happen in a single step when possible. Use `--compat-options no-direct-merge` to revert this
|
||||||
|
* Thumbnail embedding in `mp4` is done with mutagen if possible. Use `--compat-options embed-thumbnail-atomicparsley` to force the use of AtomicParsley instead
|
||||||
|
|
||||||
For ease of use, a few more compat options are available:
|
For ease of use, a few more compat options are available:
|
||||||
* `--compat-options all`: Use all compat options
|
* `--compat-options all`: Use all compat options
|
||||||
|
|
|
@ -391,8 +391,9 @@ class YoutubeDL(object):
|
||||||
compat_opts: Compatibility options. See "Differences in default behavior".
|
compat_opts: Compatibility options. See "Differences in default behavior".
|
||||||
Note that only format-sort, format-spec, no-live-chat,
|
Note that only format-sort, format-spec, no-live-chat,
|
||||||
no-attach-info-json, playlist-index, list-formats,
|
no-attach-info-json, playlist-index, list-formats,
|
||||||
no-direct-merge, no-youtube-channel-redirect,
|
no-direct-merge, embed-thumbnail-atomicparsley,
|
||||||
and no-youtube-unavailable-videos works when used via the API
|
no-youtube-unavailable-videos, no-youtube-channel-redirect,
|
||||||
|
works when used via the API
|
||||||
|
|
||||||
The following parameters are not used by YoutubeDL itself, they are used by
|
The following parameters are not used by YoutubeDL itself, they are used by
|
||||||
the downloader (see yt_dlp/downloader/common.py):
|
the downloader (see yt_dlp/downloader/common.py):
|
||||||
|
|
|
@ -268,6 +268,7 @@ def _real_main(argv=None):
|
||||||
'filename', 'format-sort', 'abort-on-error', 'format-spec', 'no-playlist-metafiles',
|
'filename', 'format-sort', 'abort-on-error', 'format-spec', 'no-playlist-metafiles',
|
||||||
'multistreams', 'no-live-chat', 'playlist-index', 'list-formats', 'no-direct-merge',
|
'multistreams', 'no-live-chat', 'playlist-index', 'list-formats', 'no-direct-merge',
|
||||||
'no-youtube-channel-redirect', 'no-youtube-unavailable-videos', 'no-attach-info-json',
|
'no-youtube-channel-redirect', 'no-youtube-unavailable-videos', 'no-attach-info-json',
|
||||||
|
'embed-thumbnail-atomicparsley',
|
||||||
]
|
]
|
||||||
compat_opts = parse_compat_opts()
|
compat_opts = parse_compat_opts()
|
||||||
|
|
||||||
|
|
|
@ -125,8 +125,9 @@ class EmbedThumbnailPP(FFmpegPostProcessor):
|
||||||
self.run_ffmpeg(filename, temp_filename, options)
|
self.run_ffmpeg(filename, temp_filename, options)
|
||||||
|
|
||||||
elif info['ext'] in ['m4a', 'mp4', 'mov']:
|
elif info['ext'] in ['m4a', 'mp4', 'mov']:
|
||||||
|
prefer_atomicparsley = 'embed-thumbnail-atomicparsley' in self.get_param('compat_opts', [])
|
||||||
# Method 1: Use mutagen
|
# Method 1: Use mutagen
|
||||||
if not has_mutagen:
|
if not has_mutagen or prefer_atomicparsley:
|
||||||
success = False
|
success = False
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
|
@ -145,7 +146,7 @@ class EmbedThumbnailPP(FFmpegPostProcessor):
|
||||||
success = False
|
success = False
|
||||||
|
|
||||||
# Method 2: Use ffmpeg+ffprobe
|
# Method 2: Use ffmpeg+ffprobe
|
||||||
if not success:
|
if not success and not prefer_atomicparsley:
|
||||||
success = True
|
success = True
|
||||||
try:
|
try:
|
||||||
options = ['-c', 'copy', '-map', '0', '-dn', '-map', '1']
|
options = ['-c', 'copy', '-map', '0', '-dn', '-map', '1']
|
||||||
|
|
Loading…
Reference in a new issue