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

[YoutubeDL] Make bestvideo+bestaudio/best default format when merger is available #5456

Closed

Conversation

dstftw
Copy link
Collaborator

@dstftw dstftw commented Apr 17, 2015

Closes #5447.

Pros:

  • Results in best overall quality.

Cons:

@dstftw dstftw changed the title [YoutubeDL] Make bestvideo+bestaudio/best default format when merger i... [YoutubeDL] Make bestvideo+bestaudio/best default format when merger is available Apr 17, 2015
@jaimeMF
Copy link
Collaborator

jaimeMF commented Apr 17, 2015

In some issue report someone commented saying that for videos in low resolution it's more convenient to just get the normal formats, since they have the same or better quality. Checking these cases would probably complicate the code too much and I don't think it's worth the effort.

Potential merge issues

We should make sure that the default formats work (otherwise users would get confused), I propose two alternatives:

  • If bestaudio and bestvideo are not compatible, we merge into a mkv file
  • Use bestvideo[mp4]+bestaudio[m4a]/bestvideo[webm]+bestaudio[webm]/mp4 instead, with this option we may not get the best quality (I think in some cases there's either a webm or mp4 with better resolution, but I'm not really sure).

With this change the YoutubeIE test fails, we have to change the format field in test/parameters.json.

Apart from the previous comments, I like the change and agree that bestvideo+bestaudio/best should be the default

@dstftw
Copy link
Collaborator Author

dstftw commented Apr 17, 2015

I think merging in mkv sounds reasonable since theoretically there may be a situation when there are no video/audio of compatible formats available. Moreover, general video+audio format selection will benefit from it as well.

@jaimeMF
Copy link
Collaborator

jaimeMF commented Apr 17, 2015

I also prefer defaulting to mkv. Some players may not support it, I don't think it's a big problem (it happens the same if some website only gives flv files), but some users may not like it.

We could also merge into mkv and use bestvideo[mp4]+bestaudio[m4a]/bestvideo[webm]+bestaudio[webm]/bestvideo+bestaudio/mp4, but that's quite ugly, I'd prefer to keep it as simple as possible.

# Merge incompatible formats into mkv
if not compatible_formats(requested_formats):
filename = os.path.splitext(filename)[0] + '.mkv'
self.report_warning('You have requested formats uncompatible for merge. '
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since bestvideo+bestaudio/best will be the default, maybe it's better to use to_screen.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? Uncompatible formats scenario is still expected to happen less often that compatible and can be treated as reasonable-to-warn-about.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, it's fine.

@jaimeMF
Copy link
Collaborator

jaimeMF commented Apr 19, 2015

Before merging this I think we should detect if the video has already been downloaded and merged. Currently if you don't use --keep-video, the files are redownloaded and merged again (if you prefer, I can try to implement it myself).

One issue with merging is that for long videos (like fEAyDNWaCto from #5298), ffmpeg takes a relatively long time to merge them. I don't know if we can do something to fix it.

@dstftw dstftw force-pushed the bestvideo+bestaudio/best-by-default branch from 0730511 to 2faab85 Compare April 19, 2015 14:11
@dstftw
Copy link
Collaborator Author

dstftw commented Apr 19, 2015

I've added basic check for already merged file. Feel free to tweak it if that's not what you expected.

@jaimeMF
Copy link
Collaborator

jaimeMF commented Apr 19, 2015

I have written an alternative in #5469, we have to use a temporary file with ffmpeg, otherwise we can end with a partial video if we cancel the merging.
(If you like it we can merge it to master directly or you cherry pick it in your branch, as you prefer)

@dstftw
Copy link
Collaborator Author

dstftw commented Apr 19, 2015

Ok, lets just merge both to master.

2015-04-19 21:03 GMT+06:00 Jaime Marquínez Ferrándiz <
[email protected]>:

I have written an alternative in #5469
#5469, we have to use a temporary
file with ffmpeg, otherwise we can end with a partial video if we cancel
the merging.
(If you like it we can merge it to master directly or you cherry pick it
in your branch, as you prefer)


Reply to this email directly or view it on GitHub
#5456 (comment).

@jaimeMF
Copy link
Collaborator

jaimeMF commented Apr 19, 2015

Cherry picked everything except the last commit (feccf29, 81cd954 and 70947ea). Nice work!

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

Successfully merging this pull request may close these issues.

Document and make default --format='bestvideo+bestaudio/best'
2 participants