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

Download video and audio from YouTube in a single step without muxing them together #3793

Closed
fturco opened this issue Sep 18, 2014 · 2 comments
Closed

Comments

@fturco
Copy link

@fturco fturco commented Sep 18, 2014

I currently download videos from YouTube with two steps: video stream first and then audio stream. I'd like instead to download video and audio streams from YouTube with a single invocation of the youtube-dl command, so the webpage needs to be fetched just one time. I also prefer not to mux streams them together with ffmpeg/avconv because I experienced synchronization issues in the past. Keeping them separate is fine for me because I use mplayer's -audiofile option, even if it's a little bit inconvenient. What I have in mind is something like this (for a 1080p Dash video and 128k Dash audio):

youtube-dl -f 137 -f 140 <youtube-url>

Instead of:

youtube-dl -f 137 <youtube-url>
youtube-dl -f 140 <youtube-url>

In the former example youtube-dl just ignores the first instance of the -f option and it only downloads the audio stream.

@phihag
Copy link
Contributor

@phihag phihag commented Sep 18, 2014

As is the convention for many shell programs, the latest option (-f) overwrites all before (this is useful because it allows you to easily overwrite default settings coming from a configuration file, an alias, or a programmatic invocation.

SInce youtube-dl 2014.09.18 (type youtube-dl -U to update), you can also download multiple formats, use a comma, as in youtube-dl -f 137/bestvideo,140/bestaudio. You don't need the /bestvideo part if you want youtube-dl to fail if that specific format is not available.

@phihag phihag closed this Sep 18, 2014
@fturco
Copy link
Author

@fturco fturco commented Sep 18, 2014

Excellent. I will try the last youtube-dl version after my next system update cycle.

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.