Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--recode-video webm but mp4 video in same res is downloaded #5386

Closed
nemobis opened this issue Apr 9, 2015 · 4 comments
Closed

--recode-video webm but mp4 video in same res is downloaded #5386

nemobis opened this issue Apr 9, 2015 · 4 comments

Comments

@nemobis
Copy link

nemobis commented Apr 9, 2015

I want to download a Wikimedia Commons-supported video (VP8 or Theora video, Vorbis audio), using the best available quality from YouTube and recoding as little as possible. I think youtube-dl is the best tool available for the job (infinite gratitude) but perhaps I'm using it incorrectly.

I think this command line is supported, but the behaviour doesn't seem right. I've read #5298 (comment)

$ youtube-dl --title --continue --retries 4 --write-info-json --write-description --all-subs --ignore-errors -f bestvideo+bestaudio --audio-format vorbis --recode-video webm https://www.youtube.com/watch?v=zLFp5kEEaCo
[youtube] zLFp5kEEaCo: Downloading webpage
[youtube] zLFp5kEEaCo: Extracting video information
WARNING: video doesn't have subtitles
[youtube] zLFp5kEEaCo: Downloading DASH manifest
[info] Writing video description to: Ins Netz gegangen - Dr. Oliver Sander - Die Kooperation des Bundesarchivs mit Wikimedia-zLFp5kEEaCo.mp4.description
[info] Writing video description metadata as JSON to: Ins Netz gegangen - Dr. Oliver Sander - Die Kooperation des Bundesarchivs mit Wikimedia-zLFp5kEEaCo.info.json
[download] Destination: Ins Netz gegangen - Dr. Oliver Sander - Die Kooperation des Bundesarchivs mit Wikimedia-zLFp5kEEaCo.f136.mp4
[download] 100% of 286.62MiB in 00:38
[download] Destination: Ins Netz gegangen - Dr. Oliver Sander - Die Kooperation des Bundesarchivs mit Wikimedia-zLFp5kEEaCo.f141.m4a
[download] 100% of 69.37MiB in 00:12
[ffmpeg] Merging formats into "Ins Netz gegangen - Dr. Oliver Sander - Die Kooperation des Bundesarchivs mit Wikimedia-zLFp5kEEaCo.mp4"
WARNING: Your copy of avconv is outdated, update avconv to version 10-0 or newer if you encounter any errors.
[ffmpeg] Converting video from mp4 to webm, Destination: Ins Netz gegangen - Dr. Oliver Sander - Die Kooperation des Bundesarchivs mit Wikimedia-zLFp5kEEaCo.webm

The video did offer a webm of same quality, which AFAICS I could have avoided recoding:

$ youtube-dl -F https://www.youtube.com/watch?v=zLFp5kEEaCo
[youtube] zLFp5kEEaCo: Downloading webpage
[youtube] zLFp5kEEaCo: Extracting video information
[youtube] zLFp5kEEaCo: Downloading DASH manifest
[info] Available formats for zLFp5kEEaCo:
format code  extension  resolution note
171          webm       audio only DASH audio  113k , audio@128k (44100Hz), 24.16MiB
140          m4a        audio only DASH audio  129k , m4a_dash container, aac  @128k (44100Hz), 34.56MiB
141          m4a        audio only DASH audio  257k , m4a_dash container, aac  @256k (44100Hz), 69.37MiB
[...]
247          webm       1280x720   DASH video 1192k , 25fps, video only, 170.75MiB
136          mp4        1280x720   DASH video 2141k , 25fps, video only, 286.62MiB
[...]
22           mp4        1280x720   (best)
@dstftw
Copy link
Collaborator

dstftw commented Apr 9, 2015

bestvideo can't refer to multiple formats. In your case mp4 happened to be the bestvideo. If you want best webm quality use bestvideo[ext=webm].

The video did offer a webm of same quality

They have different bitrate according to metadata, therefore in any case can't be treated as of the same quality.

@dstftw dstftw closed this as completed Apr 9, 2015
@nemobis
Copy link
Author

nemobis commented Apr 9, 2015

Sergey M., 09/04/2015 16:09:

They have different bitrate according to metadata, therefore in any case
can't be treated as the same quality.

Bit rate isn't synonymous of quality, or is it in the case of YouTube?

I know I can force webm in the command line, but what happens if no webm
is available at the highest resolution? Will it fall back to mp4, or
download a lower res webm? (Sorry, I know I could just test it, but I
don't have such a video handy.)

@dstftw
Copy link
Collaborator

dstftw commented Apr 9, 2015

Bit rate isn't synonymous of quality

Feel free to suggest a better generic solution for guessing quality without downloading. We already utilize lots of metadata to tackle this task.

If there are no webm formats and you use best[ext=webm] it will fail. To fallback to best you should use best[ext=webm]/best.

@nemobis
Copy link
Author

nemobis commented Apr 9, 2015

Sergey M., 09/04/2015 16:26:

Feel free to suggest a better generic solution for guessing quality
without downloading. We already utilize lots of metadata
https://github.com/rg3/youtube-dl/blob/master/youtube_dl/extractor/common.py#L742
to tackle this task.

I know, I was asking the experts. :)

If there are no |webm| formats and you use |bestvideo[ext=webm]| it will
fail. To fallback to |bestvideo| you should use
|bestvideo[ext=webm]/bestvideo|.

Ok, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants