The timeout
command is built for precisely this. To run your cvlc
command for 1 minute:
timeout 1m cvlc-command
The time period can use the strings d for days, h for hours, m for minutes and s for seconds. If no time measurement letter is given, the default is seconds.
A useful option is --preserve-status
which will make the timeout command exit with the controlled command's status code, even if it is killed. If this option isn't used, the status code will be that of the controlled command if no timeout occurred, or 124 if the command timed out.
Another useful option if you need to be very sure the service has stopped is to use --kill-after=<time>
which will send another kill signal to the command if the command has not stopped by the new limit set by time