#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/wait.h>
int main(void)
{
pid_t pid_1, pid_2;
if(0 == (pid_1 = fork())) {
printf("I'm child1. my pid = %d, pid_father = %d\n", getpid(), getppid());
execl("/home/sdt/test/openRTSP", "openRTSP", "-u", "admin", "123456", "rtsp://192.168.1.88/H264?ch=1&subtype=0", (char *)0);
} else {
printf("I'm father. my pid = %d, first wait = %d, second wait = %d, pid_1 = %d, pid_2 = %d\n", getpid(), wait(NULL), wait(NULL), pid_1, pid_2);
}
return 0;
}