Thursday, September 21, 2023
 Popular · Latest · Hot · Upcoming
rated 0 times [  30] [ 0]  / answers: 1 / hits: 42760  / 1 Year ago, thu, april 21, 2022, 9:17:42

I have a device that recording the video using the webcam with ffmpeg. It is working great,
when the recording is started I am getting the USR1 signal. And after stoping the recording we receive the USR2 signal.

But I want to stop the recording after 1 hour recording time.

I don't know but I think I have to pass the USR2 signal to the device after 1 hour.

So how can I do this...!!!

Thanks in advance.

More From » 12.04


Use the -t option. From man ffmpeg:

-t duration (input/output)

When used as an input option (before -i), limit the duration of data read from the input file.

When used as an output option (before an output filename), stop
writing the output after its duration reaches duration.

duration must be a time duration specification, see the Time duration
section in the ffmpeg-utils(1) manual

-to and -t are mutually exclusive and -t has priority.

Example that records for one hour:

ffmpeg -f v4l2 -i /dev/video0 -t 01:00:00 output

Or in seconds:

ffmpeg -f v4l2 -i /dev/video0 -t 3600 output

[#26413] Saturday, April 23, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.

Total Points: 477
Total Questions: 104
Total Answers: 100

Location: Rwanda
Member since Thu, Feb 10, 2022
2 Years ago