I want to make a function in c, that will capture video under Linux. I embedded ffmpeg
command via system()
in my c program, which captures video. ffmpeg
terminates by pressing [q]. How can I include termination into my c program.
This function is part of a server.c program. When client requests for termination, I want video cature function to terminate. Is this possible?
#include<stdio.h>
#include <string.h>
main()
{
char command[180];
sprintf(command, "ffmpeg -f v4l2 -r 25 -s 640x480 -i /dev/video0 out.avi");
system(command);
}