-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Feature - RAAR record handler - Add effective recording duration #7
Feature - RAAR record handler - Add effective recording duration #7
Conversation
The duration of the recording will be added by the raar-record-handler, which adds the effective track duration to the file name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great otherwise, squash & merge!
bin/raar-record-handler.sh
Outdated
echo "Duration of recording is ${duration} seconds (${ffprobeOutput})" | ||
else | ||
echo "Unable to determine duration of recording" >&2 | ||
duration="0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If nobody actively looks at stderr, theses errors will remain unnoticed. The filenames will contain a duration of zero seconds and therefore will not be imported by raar. So it is important to get a notification in Zabbix if this fails. Can zabbix_sender be used for this?
When a notification is received, an administrator could manually check the length of the recording and adjust the filename accordingly, so it would be imported in the next run.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed and force-pushed - thanks @codez
The recording file will now be skipped if the duration couldn't be determined. E.g. ffprobe
exited with a non-zero exit status or the output doesn't look like an integer or float.
Skipping the recording file, won't trigger the existing zabbix_sender
command which in turn won't send a successful recording notification to the monitoring system. Thus, the monitoring system will trigger an alarm, as it's missing the last successful recording notification timestamp.
The failed recording file is still available within the rotter recording directory for a later analysis.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Determine the recording duration with the help of ffprobe. Add the rounded duration in seconds to the file name in the ISO 8601 duration format. For example, the original recording file name "2019-11-30T170000+0100.flac" will be renamed to "2019-11-30T170000+0100_PT3600S.flac", whereas 3600 is the duration in seconds for this recording. This implements radiorabe#6.
Updated the recording README with installation instructions for the ffprobe command which is used for determining the recording duration. Required for radiorabe#6.
abe4f39
to
f1ed085
Compare
Hi @codez, is there anything left you would like me to change or can we merge this PR? As soon as this has been merged, we should coordinate and plan the rollout to perform some live tests. |
Everything looks good. I do not have that much time in the next couple of weeks. Would it be possible to rollout this version just for one recorder first, so we would always have a fallback available? |
The following PR enhances the RAAR record handler script, so that it adds the effective recording duration to the final file name.
Previously,
rotter
was configured to add a fixed duration of 60 minutes to every file name (%%FT%%H%%M%%S%%z_060.flac
), regardless of the actual track duration.rotter
creates a new recording file at the start of the new hour. During the initial start or in case a recording fails, the recording file won't have a duration of 60 minutes. This PR addresses these edge-cases and ensures that the effective recording duration will be added to the final file name.rotter
will now be started without a fixed duration encoded into the file name. The record handler will then determine the recording duration with the help offfprobe
and add it to the recording file name in the ISO 8601 duration format in seconds.For example, a one hour (3600 seconds) rotter recording file
/var/lib/rotter/raar/2019-11-30T170000+0100.flac
will be renamed and moved to/var/tmp/raar/import/2019-11-30T170000+0100_PT3600S.flac
waiting for the RAAR importer to pick it up.This addresses #6