ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
132.31k stars 10.03k forks source link

Add an option to ignore PostProcessingError (was: --embed-thumbnail should warn, not error, on non-mp3/mp4) #9289

Open FGasper opened 8 years ago

FGasper commented 8 years ago
> youtube-dl -x --embed-thumbnail http://youtube.com/watch?v=Jj1KTPOqd_A
[youtube] Jj1KTPOqd_A: Downloading webpage
[youtube] Jj1KTPOqd_A: Downloading video info webpage
[youtube] Jj1KTPOqd_A: Extracting video information
[youtube] Jj1KTPOqd_A: Downloading thumbnail ...
[youtube] Jj1KTPOqd_A: Writing thumbnail to: 01-Kenny Wayne Shepherd Band - Deja Voodoo (Video)-Jj1KTPOqd_A.jpg
[download] Destination: 01-Kenny Wayne Shepherd Band - Deja Voodoo (Video)-Jj1KTPOqd_A.webm
[download] 100% of 4.31MiB in 01:11
[ffmpeg] Destination: 01-Kenny Wayne Shepherd Band - Deja Voodoo (Video)-Jj1KTPOqd_A.ogg
Deleting original file 01-Kenny Wayne Shepherd Band - Deja Voodoo (Video)-Jj1KTPOqd_A.webm (pass -k to keep)
ERROR: Only mp3 and m4a/mp4 are supported for thumbnail embedding for now.

A failure to embed a thumbnail should probably be treated as a nonfatal error, don’t you think?

Hrxn commented 8 years ago

Well, not necessarily..

Works as expected, I'd say. You have to specify a specific format that supports embedding, e.g: youtube-dl -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best'

FGasper commented 8 years ago

@Hrxn I would agree if I were asking for a specific format, but in my case I’m just wanting “best”, whichever that happens to be.

If I specify a format, won’t there be loss of quality from lossy compression? In the example you gave, if “best” were, say, WebM, there’d be a recompression, no?

At the end of the day, I want:

yan12125 commented 8 years ago

Currently all post-processing options, such as --extract-audio, --embed-subs, halt youtube-dl in case of errors. It's a good idea to tolerate these errors, but we need a new option but not changing the semantic of existing options.

FGasper commented 8 years ago

It’s especially annoying for playlist downloads since you might get a failure at track 5 of a 25-track playlist.

yan12125 commented 8 years ago

FYI: for playlists, --ignore-errors is handy.

Hrxn commented 8 years ago

If I specify a format, won’t there be loss of quality from lossy compression? In the example you gave, if “best” were, say, WebM, there’d be a recompression, no?

Well, depends on the source/site, technically.

But usually not. YouTube for example has a quite large selection of available formats, .webm being one of them, and there is nothing transcoded.

yan12125 commented 8 years ago

Never. There's no recompression unless --recode-video is used. The container may be changed in merging, but the streams are simply copied.

Hrxn commented 8 years ago

Maybe some sites re-encode on the fly, depending on the request. Could be, you can't tell for sure on the client side.

Not that I've ever heard of such an example, but still...

yan12125 commented 8 years ago

I assume @FGasper is talking about what happens in youtube-dl. Of course servers can do anything and we can't know.

FGasper commented 8 years ago

@Hrxn It’s not the transcoding that concerns me; it’s that youtube-dl would fetch a less-than-optimal format for the sake of embedding that thumbnail.

My own use case is that I always want the highest-quality audio. Then, add the thumbnail if that format allows.