I would like to suggest command-line software that would open a file, capture video data from the Foundation Camera Board, write the data to the file, and close the file after receiving a termination signal. This method would would allow the user to interactively stop the video capture at any arbitrary time after starting the capture. A user-interactive session might look like the following example:
Code: Select all
$ vcap video.mp4 &
$ kill `ps | grep "grep" --invert-match | grep "vcap.sh video.mp4" | head -n 1 | awk '{print $1}'`;
Here "$ " represents a Linux command prompt, "vcap" is the name of the command, and "video.mp4" is the name of the file. The user would execute the first command to begin the video capture, wait for some time, and then execute the second command to end the video capture. The big deal here is that the software gives the user control over when to stop the video capture. Unfortunately, some command-line, video-capture commands do not provide the user with this capability.
This method would also allow the user to non-interactively stop the video capture after a predetermined time using a shell script like the following:
Code: Select all
#!/bin/bash
vcap $1 &
sleep $2
kill `ps | grep "grep" --invert-match | grep "vcap.sh video.mp4" | head -n 1 | awk '{print $1}'`;
With this script the user could capture video to a file for a specified time interval by entering the following commands at a Linux prompt:
Code: Select all
$ chmod +x vcap.sh
$ vcap.sh video.mp4 60 &
Here "vcap.sh" is the name of the shell script, "video.mp4" is the name of the file, and "60" is the number of seconds in the specified time interval.
The vcap program would trap the termination signal, close the video-capture file, and exit gracefully. Alternatively, the program could achieve the same functionality by monitoring a file. When the user or a shell script modified that file in a predetermined way then the program would treat that as a termination signal, close the video-capture file, and exit gracefully. Of course the video-capture program could also write to stdout and the user could redirect the output to a file using a command like the following:
This last method would give the user even more control and greater modularity for software developers. For instance the user could pipe the data through a "transcoder" program before saving it to the file.
Then any number of people could work on different transcoders without touching the code for the video-capture program. In the last example I am not sure how the transcoder would identify which bits of information were part of the data and which bits of information were part of the wrapper but this method would work well if it were actually possible.