1.) Plug camcorder into computer
2.) Start my program(./main.o dirname minutes seconds)
3.) Go to bed
4.) Wake up in the morning with my new home video dvd
Here is my main program, main.c:
CODE
#include <stdio.h>
#include <stdlib.h>
#include <sys/unistd.h>
#include <signal.h>
int main(int argc, char **argv)
{
int minutes, seconds, total;
char grab_sh[128] = {'\0'};
char conv_dvd_sh[128] = {'\0'};
FILE *pipe;
int pid[1];
if(argc != 4)
{
printf("Usage: dvd directory minutes seconds");
exit(1);
}
minutes = atoi(argv[2]);
seconds = atoi(argv[3]);
total = (minutes * 60) + seconds + 5;
sprintf(grab_sh,"/mnt/Video1/grab.sh %s &",argv[1]); /* This allows me to send the user-defined directory
from the command line to grab.sh */
system(grab_sh);
/* Pause while data is downloaded from camcorder for user specified amount of time */
sleep(total);
pipe = popen("ps ux | awk '/dvgrab/ && !/awk/ {print $1}'","r"); // find the pid of dvgrab
fscanf(pipe,"%d",&pid); // read in the pid of dvgrab to 'pid'
kill(pid[0],SIGINT); // send interrupt signal to dvgrab because user specified time is up
sprintf(conv_dvd_sh,"/mnt/Video1/conv-dvd.sh %s",argv[1]); /* This allows me to send the user-defined directory
from the command line to conv-dvd.sh */
system(conv_dvd_sh); // Call conv-dvd.sh
return 0;
}
#include <stdlib.h>
#include <sys/unistd.h>
#include <signal.h>
int main(int argc, char **argv)
{
int minutes, seconds, total;
char grab_sh[128] = {'\0'};
char conv_dvd_sh[128] = {'\0'};
FILE *pipe;
int pid[1];
if(argc != 4)
{
printf("Usage: dvd directory minutes seconds");
exit(1);
}
minutes = atoi(argv[2]);
seconds = atoi(argv[3]);
total = (minutes * 60) + seconds + 5;
sprintf(grab_sh,"/mnt/Video1/grab.sh %s &",argv[1]); /* This allows me to send the user-defined directory
from the command line to grab.sh */
system(grab_sh);
/* Pause while data is downloaded from camcorder for user specified amount of time */
sleep(total);
pipe = popen("ps ux | awk '/dvgrab/ && !/awk/ {print $1}'","r"); // find the pid of dvgrab
fscanf(pipe,"%d",&pid); // read in the pid of dvgrab to 'pid'
kill(pid[0],SIGINT); // send interrupt signal to dvgrab because user specified time is up
sprintf(conv_dvd_sh,"/mnt/Video1/conv-dvd.sh %s",argv[1]); /* This allows me to send the user-defined directory
from the command line to conv-dvd.sh */
system(conv_dvd_sh); // Call conv-dvd.sh
return 0;
}
Here is where I am at. When dvgrab gathers the data from the camcorder, it comes out looking A LOT darker. I didn't use to have this problem with an older version of dvgrab, so I am not sure about the new version which I think is 1.4 or something.
I believe that transcode is doing a fine job based on the fact that the A/V sync is good and the video looks identical to the .avi file from dvgrab.
I also believe that dvdauthor is working correctly because I ran isoinfo and the file structure looked good.
I don't think that mkisofs is right because when I try to play the image with mplayer the audio is slooooooowwwwwweeeeeeddddd way down. Sounds kinda creepy.
Finally, I haven't tried to burn yet because I already have enough coasters from the old days.
I have attached the shell scripts grab.sh and conv-dvd.sh as text files.
I know that this is long winded, but I think it is a good project and hopefully there are others out there that could benefit from it also.
[moved from Software by spinynorman]