Jump to content

DVD Home Video...Updated Code! Sourceforged!


santner
 Share

Recommended Posts

This is my goal:

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:

#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;
}

 

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. :D :D

 

[moved from Software by spinynorman]

grab.txt

conv_dvd.txt

Edited by santner
Link to comment
Share on other sites

I have considered this, but the reason that I went with mkisofs is that I wanted to make the image first, test it and then burn it.

 

My understanding is that growisofs only burns the image directly to the disc, and therefore I would not be able to test it first.

 

Although I have been known to be wrong a time or two before. :P

Link to comment
Share on other sites

actually, you're right, eh. you probably do want mkisofs

 

you might want to look at this has it may contain helpful info. keep in mind, though, that that's partially specific to gentoo linux so you'd have to pick and choose what is relevant to your system.

Link to comment
Share on other sites

I did some testing with the camcorder this weekend and found that the darkness of the video is of course, my fault. I needed to adjust the exposure and/or use the backlight function when shooting with very bright backgrounds. :oops:

 

I did a test run of some Easter video and used growisofs for the imaging/burning and it worked perfectly! The video quality is fabulous compared to the VCD's I use to make. The only dissapointment is HOW LONG it takes to transcode the video which is a factor of my arguments to transcode which are demanding in and of themselves, but mostly because of my somewhat ancient hardware(1.2GHz athlon, 384MB of ram).

 

However for the simplicity of it all, I was very happy with the outcome. Next, I want to be able to add a little flash to the dvd with some menus, background pictures and possibly some music. I'll keep posting here as I learn more. :D

Link to comment
Share on other sites

BTW, the shell scripts are not mine. I took them from: DVD HowTo

 

If you use growisofs instead of mkisofs, just comment out the mkisofs line in conv-dvd.sh and uncomment the growisofs line. I think that I also added the full path to the directory at the end of that line and got rid of the label option. It looks more like:

 

growisofs -speed=4 -Z /dev/hdd -dvd-video /mnt/Video1/$name/$name/

 

where $name is the name of the directory that you originally specify. It is '/$name/$name' because of the way the shell scripts are set up. A little odd, but it works. :P

 

Please reply if you have anything to add!!!

Link to comment
Share on other sites

Did you compile transcode and all ithe programs it depends on yourself? They can use specific instructions of your computer like 3DNOW, SSE, ... to make it go faster. The speed increase can be significant. Example:

 

I converted a 3 hour divx to an mpeg-2-video. I also upscaled the video using the bi-cubic algorithm (hopefully the name is ok). It took almost 30 hours I think to do that without some optimisation(s). Then I recompiled the upscaling algorithm which could use special instuctions ( you need the nasm-package for it I believe) and the time got reduced to around 16-18 hour ... withouth upscaling it was half the time I think: 8 hours or so. Not sure though about the 8 hours

 

Maybe you did recompile ... but just to let you know ... it would be best to recompile all packages transcode depends on ... with these apps it can make a difference ...

 

btw .. I have an athlon thunderbird 900 Mhz with 128 MB ram.

Edited by Michel
Link to comment
Share on other sites

Thanks for the info. I'll put it on my list...

 

Currently I am learning the dvd file structure so that I can add a menu to my home videos automatically through a shell script. I'll post back when it's done.

Link to comment
Share on other sites

  • 4 weeks later...
  • 2 weeks later...

I have recently updated the main program to be more 'gnu' like. I also added some functionality which allows a menu to be created automatically with some optional background music. :headbang:

 

I want to run one more test with it before I post the code here, so probably within a week or so I'll have the latest version of the code posted. So far though, I am very pleased with the results. It's nice to plug in the camcorder, specify a few options and x hours later have a perfectly burned DVD home video with menus, music, etc.

 

Please provide feedback if you have used this code, I would enjoy your comments and suggestions! :D

Link to comment
Share on other sites

  • 4 weeks later...

PLEASE TRY TO BREAK THIS CODE. Then let me know as much detail as possible so that I can try to make this code as robust as possible.

 

To Do: For the next release I would like to create a configure.sh file to help the user understand the importance of dependencies and which ones they are missing.

 

Please provide feedback, my email is listed in the README file. Good and bad, I don't care I just want to know if anyone else uses this and if they do how it has worked for them.

 

The README file contains a ton of information, please read!

 

Enjoy!!! :D :D :D :D :D :D :D :D

dvdhomevid_0.1.tar.gz

Link to comment
Share on other sites

  • 9 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...