dstftw
changed the title
[YoutubeDL] Make `bestvideo+bestaudio/best` default format when merger i...[YoutubeDL] Make `bestvideo+bestaudio/best` default format when merger is availableApr 17, 2015

This comment has been minimized.

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

This comment has been minimized.

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.

This comment has been minimized.

This comment has been minimized.

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.

This comment has been minimized.

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)

This comment has been minimized.

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)

Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.