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

Is it possible to abort if one of the formats is unavailable? #21488

Open
dark-penguin opened this issue Jun 21, 2019 · 2 comments
Open

Is it possible to abort if one of the formats is unavailable? #21488

dark-penguin opened this issue Jun 21, 2019 · 2 comments
Labels

Comments

@dark-penguin
Copy link

@dark-penguin dark-penguin commented Jun 21, 2019

Checklist

  • I'm asking a question
  • I've looked through the README and FAQ for similar questions
  • I've searched the bugtracker for similar questions including closed ones

Question

When I request a download from Youtube in formats "137,140" (for video and audio, without merging, because it is lengthy and useless), the following happens:

  • Trying to download 137... not available, whatever, moving on
  • Trying to download 140... success!

Your video is successfully downloaded!
(...but there is no video, only audio.)

Is it possible to do anything about this situation?

  • Maybe add an option to abort if one of the requested formats is not available?
  • Maybe add an option to disable merging when downloading in "137+140" form?
  • Maybe download the video in both formats at the same time, merging them on the fly, and then saving only the output file?
@chuckn408
Copy link

@chuckn408 chuckn408 commented Aug 28, 2019

* Maybe add an option to abort if one of the requested formats is not available?

I'll play around with a few ideas I have... I don't think something like that would be too hard.

* Maybe add an option to disable merging when downloading in "137+140" form?

Using "137,140" keeps its from merging-- whereas "137+140" merges.

* Maybe download the video in both formats at the same time, merging them on the fly, and then saving only the output file?

You could run 2 instances of youtube-dl and then use something like "ffmpeg -i someVid.mkv -i someAudio.mp3 MergedVid.mkv" to merge them.

Hope this helps!

@dark-penguin
Copy link
Author

@dark-penguin dark-penguin commented Aug 28, 2019

Using "137,140" keeps its from merging-- whereas "137+140" merges.

I know, but I wanted to avoid doing the merge afterwards while still requiring both inputs. This was a possible workaround idea, since "137,140" does not require both inputs.

The problem is, currently I need twice as much space (for the inputs and for the output), and a lot more time (first to download, then to merge). I just want to watch a video in my favorite player instead of YouTube's proprietary slow player!..

* Maybe download the video in both formats at the same time, merging them
on the fly, and then saving only the output file?

You could run 2 instances of youtube-dl and then use something like "ffmpeg -i someVid.mkv -i someAudio.mp3 MergedVid.mkv" to merge them.

How would this help with "on-the-fly" merging?.. Maybe if I find a way to redirect inputs with pipes, but I don't know how to redirect BOTH pipes with simple bash scripting... I think this would be easier to implement within youtube-dl . The audio stream is smaller and it's downloaded first, so it shouldn't take too much resources to keep it in a buffer and merge with the video stream as it's downloading.

Alternatively, how about this: download the audio stream first, saving it as a file like it's currently done, and then download the video stream, merging it on the fly?..

I guess the best solution would be to simply require both inputs in case of "137,140". Maybe add another notation (or option) that does not require, but requests them as it's currently done.

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.