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

find the best format for video file and audio file in json #5475

Closed
hedii opened this issue Apr 20, 2015 · 1 comment
Closed

find the best format for video file and audio file in json #5475

hedii opened this issue Apr 20, 2015 · 1 comment

Comments

@hedii
Copy link
Contributor

@hedii hedii commented Apr 20, 2015

hi, this is not an issue, just an ask for some help.
I am writing a php app that works with youtube-dl json generated file.
What is the best way to find the best video file and the best audio file in the generated with --dump-json json file?
I see there is a 'preference' key, but several format have the same preference value.
How does youtube-dl selects the best audio and video before merging to an audio+video with ffmpeg, what are its criteria of selection in the json generated?

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Apr 20, 2015

Run youtube-dl with -f 'bestvideo+bestaudio/best' and if it's a YouTube video the video and audio formats will be stored in the requested_formats field (it's not documented, so we may change it).

All the DASH videos are sorted by different attributes, like resolution or bitrate, and something similar for the audio. (It's all done in the InfoExtractor._sort_formats method), so then we just pick the best one.

@jaimeMF jaimeMF closed this Apr 20, 2015
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
2 participants
You can’t perform that action at this time.