MandrivaUsers.org : DVD Home Video...Updated Code! Sourceforged! - MandrivaUsers.org

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

DVD Home Video...Updated Code! Sourceforged! Capture, Transcode, Author, Image, Burn

#1 User is offline   santner 

  • Linux since 8/03
  • Group: Members
  • Posts: 212
  • Joined: 18-May 04

Posted 16 July 2004 - 01:01 PM

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]

Attached File(s)


This post has been edited by santner: 03 October 2004 - 01:47 PM

0

#2 User is offline   tyme 

  • Serial Slacker
  • View blog
  • Group: Platinum
  • Posts: 13,309
  • Joined: 24-October 02

Posted 16 July 2004 - 01:52 PM

you'll probably want "growisofs" instead of "mkisofs"
0

#3 User is offline   santner 

  • Linux since 8/03
  • Group: Members
  • Posts: 212
  • Joined: 18-May 04

Posted 16 July 2004 - 03:02 PM

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/>
0

#4 User is offline   tyme 

  • Serial Slacker
  • View blog
  • Group: Platinum
  • Posts: 13,309
  • Joined: 24-October 02

Posted 16 July 2004 - 03:49 PM

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.
0

#5 User is offline   santner 

  • Linux since 8/03
  • Group: Members
  • Posts: 212
  • Joined: 18-May 04

Posted 19 July 2004 - 02:30 PM

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/>
0

#6 User is offline   santner 

  • Linux since 8/03
  • Group: Members
  • Posts: 212
  • Joined: 18-May 04

Posted 19 July 2004 - 02:37 PM

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!!!
0

#7 User is offline   Michel 

  • MUB Addict
  • Group: Members
  • Posts: 845
  • Joined: 07-January 03

Posted 23 July 2004 - 07:14 AM

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.

This post has been edited by Michel: 23 July 2004 - 07:20 AM

0

#8 User is offline   santner 

  • Linux since 8/03
  • Group: Members
  • Posts: 212
  • Joined: 18-May 04

Posted 26 July 2004 - 03:30 PM

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.
0

#9 User is offline   Michel 

  • MUB Addict
  • Group: Members
  • Posts: 845
  • Joined: 07-January 03

Posted 21 August 2004 - 12:21 AM

I hope you are you using dvdauthor ... just to be sure ... :)/>. Maybe it doesn't suit your needs ... ?
0

#10 User is offline   santner 

  • Linux since 8/03
  • Group: Members
  • Posts: 212
  • Joined: 18-May 04

Posted 01 September 2004 - 07:34 PM

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/>
0

#11 User is offline   santner 

  • Linux since 8/03
  • Group: Members
  • Posts: 212
  • Joined: 18-May 04

Posted 27 September 2004 - 11:51 AM

Little behind schedlue. One more week and the new code will be posted.
0

#12 User is offline   santner 

  • Linux since 8/03
  • Group: Members
  • Posts: 212
  • Joined: 18-May 04

Posted 01 October 2004 - 11:35 AM

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/>

Attached File(s)


0

#13 User is offline   santner 

  • Linux since 8/03
  • Group: Members
  • Posts: 212
  • Joined: 18-May 04

Posted 03 October 2004 - 01:46 PM

I have added project to sourceforge.net. Going forward, this will be how I control, track and release new versions. Please visit the site at:

http://sourceforge.n...cts/dvdhomevid/

Enjoy! :P/>
0

#14 User is offline   santner 

  • Linux since 8/03
  • Group: Members
  • Posts: 212
  • Joined: 18-May 04

Posted 15 July 2005 - 04:34 PM

The sourceforge link is now: dvd-homevideo

I am in the process of creating a GUI using Java. Hoping for a release by September. Any and all feedback is welcomed...I can't make it better if no one tells me what is wrong! :P/>
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users