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

Timer for streaming #19166

Closed
gioreva opened this issue Feb 8, 2019 · 5 comments
Closed

Timer for streaming #19166

gioreva opened this issue Feb 8, 2019 · 5 comments
Labels

Comments

@gioreva
Copy link

@gioreva gioreva commented Feb 8, 2019

How can I record only a limited time, a streaming ?
30 minuts and stop.

@dstftw dstftw closed this Feb 8, 2019
@dstftw dstftw added the duplicate label Feb 8, 2019
@gioreva
Copy link
Author

@gioreva gioreva commented Feb 8, 2019

I don't want to cut a video.
I want to stop the download after half an hour, otherwise download indefinitely.
I plan the recording at a certain time, which lasts only half an hour.

@alexvong1995
Copy link
Contributor

@alexvong1995 alexvong1995 commented Feb 8, 2019

@gioreva

Can you provide an example? Right now I can only guess your requirement.

Assuming you have ffmpeg installed. Does the following shell command work for
you?

youtube-dl -o - -f best 'https://www.youtube.com/watch?v=BaW_jenozKc' | ffmpeg -i - -ss 0 -t 30:00 -c copy out.mkv

The above command downloads the first t minutes of the video
where 0 ≤ t ≤ 30 and then outputs it as out.mkv.

Does it work for you?

@gioreva
Copy link
Author

@gioreva gioreva commented Feb 8, 2019

This for windows ?
Your example download full video, then ffmpeg cut 30 mins
I need to record on the tv, streaming is unlimitated time.
I want to recorder documentari, 30/50 minutes, from continus channel.
youtube-dl http://tv.net:2300/user/password/channel -o ufo.avi

@alexvong1995
Copy link
Contributor

@alexvong1995 alexvong1995 commented Feb 16, 2019

@Caian
Copy link

@Caian Caian commented Oct 10, 2020

@gioreva gioreva notifications@github.com writes:
This for windows ?
No, it is not. But it can be easily changed to work for windows. First, download youtube-dl and ffmpeg https://www.ffmpeg.org/download.html.
Your example download full video, then ffmpeg cut 30 mins I need to record on the tv, streaming is unlimitated time. I want to recorder documentari, 30/50 minutes, from continus channel. youtube-dl -o ufo.avi
Then run the following command:
youtube-dl.exe -o - -f best "http://tv.net:2300/user/password/channel" | ffmpeg.exe -i - -ss 0 -t 30:00 ufo.mkv
Finally, the file can be played by vlc https://www.videolan.org/vlc/.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

Just adding to the answer...

Piping the output into ffmpeg causes a high CPU usage on low performance devices, like Raspberry Pi, that otherwise would not be present without the pipe.

A faster approach would be ffmpeg -vcodec copy -acodec copy so there is not transcoding.

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
4 participants
You can’t perform that action at this time.