Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Feature request: use ffprobe/avprobe to fetch extra metadata for use in _sort_formats #6055
Comments
|
Current behavior is correct. It's a good idea to extract higher quality audio from video+audio files. However, there's technical obstacles. AFAIK it's impossible to determine the audio quality in videos before actual downloading, for YouTube does not provide such information. If you know how, feel free to propose the method. |
|
Hi, Actually there are ways to determine the audio quality in videos before actual downloading: In JSON format:
In INI format:
In XML format:
Can you please consider reopening this issue ? Sebastien. |
|
I've tested your command on my FreeBSD virtual machine. The command is:
And the result can be found at https://gist.github.com/yan12125/550087c250f373ccdb25 |
|
How about |
|
Roughly the same - 3868948 bytes in |
|
Is it such a big deal downloading 3.2MiB (for ffprobe) instead of downloading the whole file ? |
|
BTW : What youtube url did you use for your test with ffprobe ? |
|
https://www.youtube.com/watch?v=NLYggpNyQuo - the video in your first post. I think it is. The command takes quite a few seconds for me. On slower networks, youtube-dl would look frozen. |
|
As youtube-dl is dedicated to downloading video files which by definition are big, I don't think testing on slow networks is a normal use case. |
|
it's indeed good in your case, but may not be always true for everyone. People may use youtube-dl just to download With another much smaller video https://www.youtube.com/watch?v=cbjMwKLE-RE, ffprobe still downloads 3335011 bytes. It's 31% of the whole video ( |
|
I understand. Why not add a special option just for my case :) But how about adding an option like "--probe-bestaudio" which, if passed on the command line, would call ffprobe to find the audio bitrate ? |
|
OK a new option may be fine. |
|
A side note: this feature depends on #7034. |
Hi, I have noticed that the "-f bestaudio" does not really download the best audio quality :
$ youtube-dl --ignore-config -o "%(title)s__%(format_id)s__%(id)s.%(ext)s" -f bestaudio --restrict-filenames https://www.youtube.com/watch?v=NLYggpNyQuo
[youtube] NLYggpNyQuo: Downloading webpage
[youtube] NLYggpNyQuo: Extracting video information
[youtube] NLYggpNyQuo: Downloading DASH manifest
[download] Kacou_Severin_-Le_secret_de_l_onction_1__140__NLYggpNyQuo.m4a has already been downloaded
[download] 100% of 136.33MiB
[ffmpeg] Correcting container in "Kacou_Severin_-Le_secret_de_l_onction_1__140__NLYggpNyQuo.m4a"
Using the options "-f best -x" gets a file with better audio quality :
$ youtube-dl --ignore-config -o "%(title)s__%(format_id)s__%(id)s.%(ext)s" -f best -x -k --restrict-filenames https://www.youtube.com/watch?v=NLYggpNyQuo
[youtube] NLYggpNyQuo: Downloading webpage
[youtube] NLYggpNyQuo: Extracting video information
[youtube] NLYggpNyQuo: Downloading DASH manifest
[download] Kacou_Severin_-Le_secret_de_l_onction_1__22__NLYggpNyQuo.mp4 has already been downloaded
[download] 100% of 375.25MiB
[avconv] Destination: Kacou_Severin_-Le_secret_de_l_onction_1__22__NLYggpNyQuo.m4a
$ avprobe Kacou_Severin_-Le_secret_de_l_onction_1__140__NLYggpNyQuo.m4a 2>&1 | grep Audio:
Stream #0.0(und): Audio: aac, 44100 Hz, stereo, fltp, 125 kb/s (default)
$ avprobe Kacou_Severin_-Le_secret_de_l_onction_1__22__NLYggpNyQuo.mp4 2>&1 | grep Audio:
Stream #0.1(und): Audio: aac, 44100 Hz, stereo, fltp, 191 kb/s (default)