Ubuntu – Recording a YouTube live stream using VLC

cronstreamingvideovideo-recordingvlc

I'm trying to set VLC to record a live stream on YouTube using cron. Vlc records videos that aren't live streaming just fine, but when the stream is live VLC records at most only 24 seconds. Why does it stop there? How can I get it to record more?

The lines I have in my crontab file were adapted from the answer to this question:

35 21 20 3 * cvlc --sout file/ts:/path/to/directory/file.mp4 <link to video>
37 21 20 3 * sh -c "killall cvlc; killall vlc"

Best Answer

For livestreams I would recommend using livestreamer instead of VLC. Recording with livestreamer is a breeze, e.g.:

livestreamer <livestream-url> best -o vod.mp4

livestreamer supports dozens of different streaming providers and works very reliably, even with spotty streams.

For installation instructions check out this answer by @henry.

Related Question