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

Function to limit duration and/or size (for livestreams) #11206

Open
blackjack4494 opened this issue Nov 15, 2016 · 2 comments
Open

Function to limit duration and/or size (for livestreams) #11206

blackjack4494 opened this issue Nov 15, 2016 · 2 comments
Labels

Comments

@blackjack4494
Copy link

@blackjack4494 blackjack4494 commented Nov 15, 2016

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2016.11.14.1. If it's not read this FAQ entry and update. Issues with outdated version will be rejected.

  • I've verified and I assure that I'm running youtube-dl 2016.11.14.1

Before submitting an issue make sure you have:

  • 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

The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your issue


As said in the title youtube-dl is missing any function/parameter to limit the duration and/or the size.
I tried livestreamer before but it did not work at all with the livestream I was recording so I switched to youtube-dl (sorry for that much offtopic). That stream is running 24/7 without any break or so. But they change the title if another content/show starts (e.g. 10min 'news' then 30min 'talk' just a general example). Unfortunately there is also no way to only get audio for a livestream tho I think it should be at least possible to save only audio directly (but still receiving video+audio just drop the video and save only audio). I know there is '-x' but only for postprocessing that means I need to finish a download which will never happen with a 24/7 livestream. It would be nice to have an option to set a limit on the duration but more preferable at least the size.
Let's say we have an option like '--maxdl-filesize SIZE' -> '--maxdl-filesize 10.0m'
this will save the output so far into a file (it's best to use template then to get timecode/length).
I cannot say how difficulty it would be to make a prototype for that (I would do that on my own but I am also in lack of time). The best thing I thought about would be using a script that collects the information about the length of the shows then let it send ctrl-c to stop the download but before that already start a new youtube-dl process since it takes a little time for a new process to start the download. This would not be a perfect solution but a quick'n'dirty one. I haven't tested yet to continuously download the stream and directly use it while downloading in e.g. ffmpeg to split it into parts and as audio only (I am relating to this option --hls-use-mpegts).
Edit: Youtube is using Fragments. Maybe it's possible to start off with those at least.

@dstftw dstftw added the request label Nov 15, 2016
@blackjack4494
Copy link
Author

@blackjack4494 blackjack4494 commented Nov 15, 2016

Placeholder

Okay after an hour of research I find it pretty easy to look through the m3u8 downloading a single .ts (Transport Stream) file. Those have a length of 2sec each. After the download I can use ffmpeg on that using spefici parameters to drop the video and only convert the ts file with audio to something like mp4 (ofc mp3 makes more sense with only audio was just a quick test). This is at least a first step. I will probably pull the whole repo and make a module. Just a matter of time when I will make a pull request and contribute to this project :)

@joshka
Copy link

@joshka joshka commented Dec 5, 2016

Hi,
I'm interested in this feature for similar reasons. I'm adding a live stream extractor that generally deals with files about 3 hours in length. Even when choosing the minimum bitrate, the time to run this test is somewhat prohibitive.

@joshka joshka mentioned this issue Dec 5, 2016
4 of 4 tasks complete
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
3 participants
You can’t perform that action at this time.