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

Best video format inconsistency (720p60fps) #11200

Closed
domenix opened this issue Nov 15, 2016 · 4 comments
Closed

Best video format inconsistency (720p60fps) #11200

domenix opened this issue Nov 15, 2016 · 4 comments

Comments

@domenix
Copy link

@domenix domenix commented Nov 15, 2016

  • I've verified and I assure that I'm running youtube-dl 2016.11.14.1
  • At least skimmed through README and most notably FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other

When I try to download a video which is 720p and the best available framerate is 60fps, I expect it to download a video format with these attributes.
However, the output file is in 720p30fps when I run the command below.

Download debug
C:\Users\domenix>youtube-dl -v -o "C:\test\%(title)s" -f bestvideo+bestaudio https://www.youtube.com/watch?v=eLR3zKxpcso --merge-output-format mkv
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-v', '-o', 'C:\\test\\%(title)s', '-f', 'bestvideo+bestaudio', 'https://www.youtube.com/watch?v=eLR3zKxpcso', '--merge-output-format', 'mkv']
[debug] Encodings: locale cp1250, fs mbcs, out cp852, pref cp1250
[debug] youtube-dl version 2016.11.14.1
[debug] Python version 3.4.4 - Windows-10-10.0.10586
[debug] exe versions: ffmpeg N-81635-gbc7066f, ffprobe N-81635-gbc7066f
[debug] Proxy map: {}
[youtube] eLR3zKxpcso: Downloading webpage
[youtube] eLR3zKxpcso: Downloading video info webpage
[youtube] eLR3zKxpcso: Extracting video information
[youtube] eLR3zKxpcso: Downloading MPD manifest
[debug] Invoking downloader on <removed>
[download] Destination: C:\test\Multiplying with a Parabola!.f247
[download] 100% of 2.65MiB in 00:00
[debug] Invoking downloader on <removed>
[download] Destination: C:\test\Multiplying with a Parabola!.f251
[download] 100% of 1.92MiB in 00:00
[ffmpeg] Merging formats into "C:\test\Multiplying with a Parabola!.mkv"
[debug] ffmpeg command line: ffmpeg -y -i 'file:C:\test\Multiplying with a Parabola!.f247' -i 'file:C:\test\Multiplying with a Parabola!.f251' -c copy -map 0:v:0 -map 1:a:0 'file:C:\test\Multiplying with a Parabola!.temp.mkv'
Deleting original file C:\test\Multiplying with a Parabola!.f247 (pass -k to keep)
Deleting original file C:\test\Multiplying with a Parabola!.f251 (pass -k to keep)

As you can see it downloads format 251 and 247 then merges it into an mkv file.
The result of the command youtube-dl https://www.youtube.com/watch?v=eLR3zKxpcso -F can be seen below.

Available formats
[youtube] eLR3zKxpcso: Downloading webpage
[youtube] eLR3zKxpcso: Downloading video info webpage
[youtube] eLR3zKxpcso: Extracting video information
[youtube] eLR3zKxpcso: Downloading MPD manifest
[info] Available formats for eLR3zKxpcso:
format code  extension  resolution note
249          webm       audio only DASH audio   55k , opus @ 50k (48000Hz), 745.42KiB
250          webm       audio only DASH audio   75k , opus @ 70k (48000Hz), 1002.52KiB
171          webm       audio only DASH audio  112k , vorbis@128k (44100Hz), 1.52MiB
140          m4a        audio only DASH audio  129k , m4a_dash container, mp4a.40.2@128k (44100Hz), 1.80MiB
251          webm       audio only DASH audio  146k , opus @160k (48000Hz), 1.92MiB
278          webm       256x144    DASH video   64k , webm container, vp9, 15fps, video only, 368.70KiB
242          webm       426x240    DASH video   86k , vp9, 30fps, video only, 529.91KiB
160          mp4        256x144    DASH video  114k , avc1.4d400c, 15fps, video only, 696.17KiB
134          mp4        640x360    DASH video  121k , avc1.4d401e, 30fps, video only, 543.11KiB
243          webm       640x360    DASH video  152k , vp9, 30fps, video only, 939.68KiB
135          mp4        854x480    DASH video  205k , avc1.4d401f, 30fps, video only, 860.18KiB
133          mp4        426x240    DASH video  275k , avc1.4d4015, 30fps, video only, 1.57MiB
244          webm       854x480    DASH video  278k , vp9, 30fps, video only, 1.39MiB
136          mp4        1280x720   720p  376k , avc1.4d401f, 30fps, video only, 1.45MiB
298          mp4        1280x720   DASH video  435k , avc1.4d4020, 60fps, video only, 1.83MiB
302          webm       1280x720   DASH video  519k , vp9, 60fps, video only, 2.87MiB
247          webm       1280x720   720p  542k , vp9, 30fps, video only, 2.65MiB
17           3gp        176x144    small , mp4v.20.3,  mp4a.40.2@ 24k
36           3gp        320x180    small , mp4v.20.3,  mp4a.40.2
43           webm       640x360    medium , vp8.0,  vorbis@128k
18           mp4        640x360    medium , avc1.42001E,  mp4a.40.2@ 96k
22           mp4        1280x720   hd720 , avc1.64001F,  mp4a.40.2@192k (best)

Format 247 is indeed 720p30fps only.
Even though the obviously best video format would be 302, because it would deliver the 60fps stream, and it downloads of course if I specify -f 302+bestaudio as the quality.
I think the bestvideo attribute is not working as the name would suggest.

Further tests

I ran multiple tests on videos which maximum available quality is 720p60fps.
The first video downloaded as 720p60fps, as it should happen.

Commands for first video
C:\Users\domenix>youtube-dl -v -o "C:\test\%(title)s" -f bestvideo+bestaudio https://www.youtube.com/watch?v=KFnRWWslo24 --merge-output-format mkv
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-v', '-o', 'C:\\test\\%(title)s', '-f', 'bestvideo+bestaudio', 'https://www.youtube.com/watch?v=KFnRWWslo24', '--merge-output-format', 'mkv']
[debug] Encodings: locale cp1250, fs mbcs, out cp852, pref cp1250
[debug] youtube-dl version 2016.11.14.1
[debug] Python version 3.4.4 - Windows-10-10.0.10586
[debug] exe versions: ffmpeg N-81635-gbc7066f, ffprobe N-81635-gbc7066f
[debug] Proxy map: {}
[youtube] KFnRWWslo24: Downloading webpage
[youtube] KFnRWWslo24: Downloading video info webpage
[youtube] KFnRWWslo24: Extracting video information
[youtube] KFnRWWslo24: Downloading MPD manifest
[debug] Invoking downloader on <removed>
[download] Destination: C:\test\GoPro Hero Superview 720p 60fps..#.f298
[download] 100% of 101.29MiB in 00:10
[debug] Invoking downloader on <removed>
[download] Destination: C:\test\GoPro Hero Superview 720p 60fps..#.f140
[download] 100% of 3.89MiB in 00:00
[ffmpeg] Merging formats into "C:\test\GoPro Hero Superview 720p 60fps..#.mkv"
[debug] ffmpeg command line: ffmpeg -y -i 'file:C:\test\GoPro Hero Superview 720p 60fps..#.f298' -i 'file:C:\test\GoPro Hero Superview 720p 60fps..#.f140' -c copy -map 0:v:0 -map 1:a:0 'file:C:\test\GoPro Hero Superview 720p 60fps..#.temp.mkv'
Deleting original file C:\test\GoPro Hero Superview 720p 60fps..#.f298 (pass -k to keep)
Deleting original file C:\test\GoPro Hero Superview 720p 60fps..#.f140 (pass -k to keep)
[info] Available formats for KFnRWWslo24:
format code  extension  resolution note
249          webm       audio only DASH audio   48k , opus @ 50k (48000Hz), 1.41MiB
250          webm       audio only DASH audio   54k , opus @ 70k (48000Hz), 1.59MiB
171          webm       audio only DASH audio   81k , vorbis@128k (44100Hz), 2.31MiB
251          webm       audio only DASH audio  115k , opus @160k (48000Hz), 3.14MiB
140          m4a        audio only DASH audio  127k , m4a_dash container, mp4a.40.2@128k (44100Hz), 3.89MiB
160          mp4        256x144    DASH video  111k , avc1.4d400c, 15fps, video only, 3.34MiB
278          webm       256x144    DASH video  115k , webm container, vp9, 15fps, video only, 3.09MiB
133          mp4        426x240    DASH video  250k , avc1.4d4015, 30fps, video only, 7.50MiB
242          webm       426x240    DASH video  267k , vp9, 30fps, video only, 7.46MiB
243          webm       640x360    DASH video  475k , vp9, 30fps, video only, 13.19MiB
134          mp4        640x360    DASH video  611k , avc1.4d401e, 30fps, video only, 18.10MiB
244          webm       854x480    DASH video  863k , vp9, 30fps, video only, 24.00MiB
135          mp4        854x480    DASH video 1125k , avc1.4d401f, 30fps, video only, 33.69MiB
247          webm       1280x720   720p 1758k , vp9, 30fps, video only, 48.31MiB
136          mp4        1280x720   720p 2246k , avc1.4d401f, 30fps, video only, 67.29MiB
302          webm       1280x720   DASH video 3065k , vp9, 60fps, video only, 83.98MiB
298          mp4        1280x720   DASH video 3325k , avc1.4d4020, 60fps, video only, 101.29MiB
17           3gp        176x144    small , mp4v.20.3,  mp4a.40.2@ 24k
36           3gp        320x180    small , mp4v.20.3,  mp4a.40.2
43           webm       640x360    medium , vp8.0,  vorbis@128k
18           mp4        640x360    medium , avc1.42001E,  mp4a.40.2@ 96k
22           mp4        1280x720   hd720 , avc1.64001F,  mp4a.40.2@192k (best)

As it can be seen, it downloaded the best available formats.



The second video downloaded again as 720p60fps, as it should happen.

Commands for second video
C:\Users\domenix>youtube-dl -v -o "C:\test\%(title)s" -f bestvideo+bestaudio https://www.youtube.com/watch?v=zvJwA5Y2Ie8 --merge-output-format mkv
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-v', '-o', 'C:\\test\\%(title)s', '-f', 'bestvideo+bestaudio', 'https://www.youtube.com/watch?v=zvJwA5Y2Ie8', '--merge-output-format', 'mkv']
[debug] Encodings: locale cp1250, fs mbcs, out cp852, pref cp1250
[debug] youtube-dl version 2016.11.14.1
[debug] Python version 3.4.4 - Windows-10-10.0.10586
[debug] exe versions: ffmpeg N-81635-gbc7066f, ffprobe N-81635-gbc7066f
[debug] Proxy map: {}
[youtube] zvJwA5Y2Ie8: Downloading webpage
[youtube] zvJwA5Y2Ie8: Downloading video info webpage
[youtube] zvJwA5Y2Ie8: Extracting video information
[youtube] zvJwA5Y2Ie8: Downloading MPD manifest
[debug] Invoking downloader on <removed>
[download] Destination: C:\test\Test GoPro Hero 2014 with Superview 720p Real 60Fps.f298
[download] 100% of 411.70MiB in 00:38
[debug] Invoking downloader on <removed>
[download] Destination: C:\test\Test GoPro Hero 2014 with Superview 720p Real 60Fps.f251
[download] 100% of 16.98MiB in 00:02
[ffmpeg] Merging formats into "C:\test\Test GoPro Hero 2014 with Superview 720p Real 60Fps.mkv"
[debug] ffmpeg command line: ffmpeg -y -i 'file:C:\test\Test GoPro Hero 2014 with Superview 720p Real 60Fps.f298' -i 'file:C:\test\Test GoPro Hero 2014 with Superview 720p Real 60Fps.f251' -c copy -map 0:v:0 -map 1:a:0 'file:C:\test\Test GoPro Hero 2014 with Superview 720p Real 60Fps.temp.mkv'
Deleting original file C:\test\Test GoPro Hero 2014 with Superview 720p Real 60Fps.f298 (pass -k to keep)
Deleting original file C:\test\Test GoPro Hero 2014 with Superview 720p Real 60Fps.f251 (pass -k to keep)
[info] Available formats for zvJwA5Y2Ie8:
format code  extension  resolution note
249          webm       audio only DASH audio   49k , opus @ 50k (48000Hz), 5.86MiB
250          webm       audio only DASH audio   60k , opus @ 70k (48000Hz), 6.62MiB
171          webm       audio only DASH audio   86k , vorbis@128k (44100Hz), 10.16MiB
140          m4a        audio only DASH audio  129k , m4a_dash container, mp4a.40.2@128k (44100Hz), 15.99MiB
251          webm       audio only DASH audio  152k , opus @160k (48000Hz), 16.98MiB
160          mp4        256x144    DASH video  115k , avc1.4d400c, 15fps, video only, 13.60MiB
278          webm       256x144    DASH video  203k , webm container, vp9, 15fps, video only, 12.89MiB
242          webm       426x240    DASH video  236k , vp9, 30fps, video only, 26.59MiB
133          mp4        426x240    DASH video  250k , avc1.4d4015, 30fps, video only, 30.52MiB
243          webm       640x360    DASH video  422k , vp9, 30fps, video only, 46.54MiB
134          mp4        640x360    DASH video  628k , avc1.4d401e, 30fps, video only, 75.14MiB
244          webm       854x480    DASH video  808k , vp9, 30fps, video only, 86.91MiB
135          mp4        854x480    DASH video 1147k , avc1.4d401f, 30fps, video only, 137.84MiB
247          webm       1280x720   720p 1830k , vp9, 30fps, video only, 189.10MiB
136          mp4        1280x720   720p 2290k , avc1.4d401f, 30fps, video only, 275.31MiB
302          webm       1280x720   DASH video 3255k , vp9, 60fps, video only, 331.83MiB
298          mp4        1280x720   DASH video 3365k , avc1.4d4020, 60fps, video only, 411.70MiB
17           3gp        176x144    small , mp4v.20.3,  mp4a.40.2@ 24k
36           3gp        320x180    small , mp4v.20.3,  mp4a.40.2
43           webm       640x360    medium , vp8.0,  vorbis@128k
18           mp4        640x360    medium , avc1.42001E,  mp4a.40.2@ 96k
22           mp4        1280x720   hd720 , avc1.64001F,  mp4a.40.2@192k (best)

As it can be seen, it downloaded the best available formats.



The third video downloaded again as 720p60fps, as it should happen.

Commands for third video
C:\Users\domenix>youtube-dl -v -o "C:\test\%(title)s" -f bestvideo+bestaudio https://www.youtube.com/watch?v=stnf9bzE2ec --merge-output-format mkv
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-v', '-o', 'C:\\test\\%(title)s', '-f', 'bestvideo+bestaudio', 'https://www.youtube.com/watch?v=stnf9bzE2ec', '--merge-output-format', 'mkv']
[debug] Encodings: locale cp1250, fs mbcs, out cp852, pref cp1250
[debug] youtube-dl version 2016.11.14.1
[debug] Python version 3.4.4 - Windows-10-10.0.10586
[debug] exe versions: ffmpeg N-81635-gbc7066f, ffprobe N-81635-gbc7066f
[debug] Proxy map: {}
[youtube] stnf9bzE2ec: Downloading webpage
[youtube] stnf9bzE2ec: Downloading video info webpage
[youtube] stnf9bzE2ec: Extracting video information
[youtube] stnf9bzE2ec: Downloading MPD manifest
[debug] Invoking downloader on <removed>
[download] Destination: C:\test\Dakar Rally Stage 5 Highlights 2015 {720p 60fps}.f298
[download] 100% of 365.95MiB in 00:36
[debug] Invoking downloader on <removed>
[download] Destination: C:\test\Dakar Rally Stage 5 Highlights 2015 {720p 60fps}.f140
[download] 100% of 22.48MiB in 00:02
[ffmpeg] Merging formats into "C:\test\Dakar Rally Stage 5 Highlights 2015 {720p 60fps}.mkv"
[debug] ffmpeg command line: ffmpeg -y -i 'file:C:\test\Dakar Rally Stage 5 Highlights 2015 {720p 60fps}.f298' -i 'file:C:\test\Dakar Rally Stage 5 Highlights 2015 {720p 60fps}.f140' -c copy -map 0:v:0 -map 1:a:0 'file:C:\test\Dakar Rally Stage 5 Highlights 2015 {720p 60fps}.temp.mkv'
Deleting original file C:\test\Dakar Rally Stage 5 Highlights 2015 {720p 60fps}.f298 (pass -k to keep)
Deleting original file C:\test\Dakar Rally Stage 5 Highlights 2015 {720p 60fps}.f140 (pass -k to keep)
[info] Available formats for stnf9bzE2ec:
format code  extension  resolution note
249          webm       audio only DASH audio   53k , opus @ 50k (48000Hz), 8.55MiB
250          webm       audio only DASH audio   72k , opus @ 70k (48000Hz), 10.08MiB
171          webm       audio only DASH audio   97k , vorbis@128k (44100Hz), 14.79MiB
251          webm       audio only DASH audio  129k , opus @160k (48000Hz), 18.23MiB
140          m4a        audio only DASH audio  129k , m4a_dash container, mp4a.40.2@128k (44100Hz), 22.48MiB
160          mp4        256x144    DASH video  117k , avc1.4d400c, 30fps, video only, 19.74MiB
278          webm       256x144    DASH video  124k , webm container, vp9, 30fps, video only, 17.60MiB
133          mp4        426x240    DASH video  258k , avc1.4d4015, 30fps, video only, 43.59MiB
242          webm       426x240    DASH video  281k , vp9, 30fps, video only, 33.82MiB
243          webm       640x360    DASH video  499k , vp9, 30fps, video only, 58.28MiB
134          mp4        640x360    DASH video  638k , avc1.4d401e, 30fps, video only, 74.69MiB
244          webm       854x480    DASH video  863k , vp9, 30fps, video only, 95.59MiB
135          mp4        854x480    DASH video 1167k , avc1.4d401f, 30fps, video only, 148.02MiB
247          webm       1280x720   720p 1685k , vp9, 30fps, video only, 174.68MiB
136          mp4        1280x720   720p 2328k , avc1.4d401f, 30fps, video only, 288.26MiB
302          webm       1280x720   DASH video 2654k , vp9, 60fps, video only, 259.30MiB
298          mp4        1280x720   DASH video 3267k , avc1.4d4020, 60fps, video only, 365.95MiB
17           3gp        176x144    small , mp4v.20.3,  mp4a.40.2@ 24k
36           3gp        320x180    small , mp4v.20.3,  mp4a.40.2
43           webm       640x360    medium , vp8.0,  vorbis@128k
18           mp4        640x360    medium , avc1.42001E,  mp4a.40.2@ 96k
22           mp4        1280x720   hd720 , avc1.64001F,  mp4a.40.2@192k (best)

As it can be seen, it downloaded the best available formats.



Randomly selecting a few 720p60fps video from uploader after and before the problematic video, it seems like in the case of these videos, it always downloaded them in the best format available, except that one.

For example:

In the case of this video, these 720p formats are available:

247          webm       1280x720   720p 1506k , vp9, 30fps, video only, 7.75MiB
136          mp4        1280x720   720p 2313k , avc1.4d401f, 30fps, video only, 9.16MiB
302          webm       1280x720   DASH video 2659k , vp9, 60fps, video only, 12.23MiB
298          mp4        1280x720   DASH video 3474k , avc1.4d4020, 60fps, video only, 15.12MiB

When I download it with the command, it selects format 298, which is the best.

Although it worked for many videos, except the problematic one, it's not perfect if someone decides to archive the contents of the channel, and the problem probably persists on other videos from other uploaders as well, but I didn't find other examples though.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Nov 15, 2016

This is expected behavior. Bitrate takes higher precedence.

@dstftw dstftw closed this Nov 15, 2016
@domenix
Copy link
Author

@domenix domenix commented Nov 15, 2016

I don't think that's very intuitive then. Certainly not for the lay user.

One would expect that if they want to download a video in the best possible quality, which means it will be 60 fps instead of 30 fps (which is a very visible difference VS undetectable quality change because of bitrate difference), the fps should take precedence, not just depend on bitrate, which even if its lower than the bitrate of the stream with lower fps, may or may not cause visible worsening of video quality for the user.

IMHO the precedence should be FPS->Resolution->Bitrate.
For example, if somebody wants to archive an entire channel, and in the rare cases the software chooses a 30 fps stream instead of a 60 fps stream because it has higher bitrate, that's not expected behavior at all. The user looks through the files years later when the channel isn't available anymore, and finds that one valuable video is actually worse in quality, it doesn't look like that when he selected the best settings in the YT player.
Basically he should've tailored the command attributes for that channel, taking exceptional videos into consideration, but that defeats the purpose of automating, the whole point of this software.

I have zero python experience but later I will see if I can work around something, at least for my use.

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Nov 15, 2016

As the criteria for quality will never reach a consensus, #8125 is the way to go

@glenn-slayden
Copy link
Contributor

@glenn-slayden glenn-slayden commented Sep 7, 2017

Actually, as I noted here, for reasons particular to the specifics of the -f bestvideo task, bitrate is a provably poor choice.

In my experience, such (i.e., poor choices) should rarely be left to consensus.

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

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.