Site Map - skip to main content

Hacker Public Radio

Your ideas, projects, opinions - podcasted.

New episodes every weekday Monday through Friday.
This page was generated by The HPR Robot at


hpr4287 :: Schedule audio recordings on the command line

Kevie talks about scheduling a recording with a Cron task using ffmpeg

<< First, < Previous, , Latest >>

Thumbnail of Kevie
Hosted by Kevie on Tuesday, 2025-01-07 is flagged as Clean and is released under a CC-BY-SA license.
CLI, audio, streaming, radio, recording, ripping, music. 2.
The show is available on the Internet Archive at: https://archive.org/details/hpr4287

Listen in ogg, spx, or mp3 format. Play now:

Duration: 00:11:56

general.

TuxJam co-host Kevie does a follow up show to episode 4249 with a look at scheduling a stream recording using crontab and the ffmpeg command. The two things that we will need to set this up are the audio stream url and the time of the show.

To set this up we need to go setup a new Cron task: crontab -e and navigate to the bottom of the file.

The first thing that it will expect you to enter is the timing for this task, this will be written as * * * * * with the information needed being converted into an appropriate number:

minute hour day of month month day of week
(0-59) (0-23) (1-31) (1-12) (0-7)
* * * * *

Then we need to enter ffmpeg -i followed by the stream URL.

It is important that we include the duration of the recording, so that this doesn't output a huge file. To set the time enter -t HH:MM:SS making sure to replace the HH(hours) MM(minutes) and SS(seconds) with numbers.

Almost done. The last thing we need to do is to enter the location for the file to go along with the name /path/filename.ogg.

So in short form the command is * * * * * ffmpeg -i https://streamurl -t HH:MM:SS /path/filename.ogg.

The example used in the show for Dan Lynch's Mid Week Pick and Mix: 00 19 * * 4 ffmpeg -i https://arrowestream.radioca.st/;?ver=737183.mp3 -t 02:00:00 ~/Recordings/DanLynchPickMix.ogg


Comments

Subscribe to the comments RSS feed.

Comment #1 posted on 2025-01-07 12:06:29 by Kevie

example radio stream

The URL https://arrowestream.radioca.st/;?ver=737183.mp3 streamed from the command line but failed when using ffmpeg substitute this for https://tinyurl.com/4pd3txdc and it works fine.

Comment #2 posted on 2025-01-08 08:32:15 by Henrik Hemrin

Inspiring episode

This was an inspiring episode Kevie! It starts thoughts of when I can have use of it.

As you said, the computer must be turned on in order to have the scheduled recording to record. It got me thinking of the Termux app for Android based phones. I have not tested, but I thinking of that it might work to get this command line recording to work on the phone.

Also the Transistor app for Android phones was interesting, I like the app after my first trials.

Leave Comment

Note to Verbose Commenters
If you can't fit everything you want to say in the comment below then you really should record a response show instead.

Note to Spammers
All comments are moderated. All links are checked by humans. We strip out all html. Feel free to record a show about yourself, or your industry, or any other topic we may find interesting. We also check shows for spam :).

Provide feedback
Your Name/Handle:
Title:
Comment:
Anti Spam Question: What does the letter P in HPR stand for?