AVI to DVD - Page 3


Page 3 of 4 FirstFirst 1234 LastLast
Results 31 to 45 of 47

Thread: AVI to DVD

  1. #31
    Join Date
    Apr 2003
    Posts
    199
    If you use debian (maybe Ubuntu would work too) you can simply apt-get install vobcopy and then use it to copy dvds.

    Also, i made this script
    Code:
    mkdir $1_dvd_convert_files
    cp $1 $1_dvd_convert_files
    cd $1_dvd_convert_files
    xterm -e transcode -i $1 -y ffmpeg --export_prof dvd-ntsc --export_asr 2 -o movie -D0 -s2 -m movie.ac3 -J modfps=clonetype=3 --export_fps 29.97 && mplex -f 8 -o dvd_movie.mpg movie.m2v movie.ac3 && cp ~/scripts/dvdauthor.xml ./ && gedit dvdauthor.xml && dvdauthor -x dvdauthor.xml && mkisofs -dvd-video -udf -o dvd.iso DVD/
    and it works pretty good. maybe someone can use it, improve it, and post again.

    by "improve it" i was hoping someone might do two things,
    1. Make it detect (or ask) about 5.1 and then make the change for it.
    2. Make it so that if you right click on a video file in gnome and choose "open with..." then choose this script it would work. that is why i used "xterm -e", i was hopeing right click would work, but for some reason it dosn't. any ideas.

  2. #32
    Join Date
    Sep 2003
    Location
    Rochester, MN
    Posts
    3,604
    You probably just need to add a #!/bin/sh as the first line and make the file executable (chmod +x filename). As for the 5.1, I don't know since I don't have any 5.1 sound equipment so I've never worried about it.

  3. #33
    Join Date
    Oct 2002
    Location
    Binghamton NY
    Posts
    2,435

    another really really simple script

    Quote Originally Posted by je_fro
    Cool deal!
    I never understood why you split the movie, only to rejoin it later...
    Take a look here at a couple of mencoder scripts you might find useful to get around that, unless there's a reason that I don't know about...

    http://jeffrey.homelinux.org/RRweb/files/mencoder.html

    [EDIT] Oh, I get it...because it's an avi!!! [/EDIT]

    Okay, I know that most of you already know how to do this but this post is aimed at the newbie:

    I wrote (well, "assembled" is probably a better word) a script that combines almost all of these steps into one. I skipped the surround sound steps. None of the avi files that I was using had it, and my TV can't play them anyway.
    so here's the script. Obviously, all I've done is save myself a lot of time by copying the commands to a text editor, and seperating them with semicolons so that they'll run in sequence. It ain't rocket science.

    transcode -i movie.avi -y ffmpeg --export_prof dvd-ntsc --export_asr 3 -o movie -D0 -s2 -m movie.ac3 -J modfps=clonetype=3 --export_fps 29.97 ; mplex -f 8 -o dvd_movie.mpg movie.m2v movie.ac3 ; dvdauthor -x dvdauthor.xml ;
    Of course, I run the script in a directory that contains:
    1. The avi file, which I have renamed "movie.avi"
    2. the dvdauthor.xml file:

    <dvdauthor dest="DVD">
    <vmgm />
    <titleset>
    <titles>
    <pgc>
    <vob file="dvd_movie.mpg" chapters="0,15:00,30:00,45:00,1:00:00"/>
    </pgc>
    </titles>
    </titleset>
    </dvdauthor>
    3. An empty directory entitled "DVD"
    4. The script itself.
    and after the script has finished running, All that's left is to burn the actual DVD. I put the disk in the drive, and run:

    growisofs -Z /dev/dvd -dvd-video DVD/
    I could certainly have added the final command to the script, thus automating the whole process from beginning to end, but I would have to keep a blank DVD in the drive while the script was running.

    Now, I don't understand how this business of splitting and reassembling a file is exclusive to AVIs, but I have discovered that the exact same technique works fine for MPG files. For all I know, mpg files don't require this kind of splitting and reassembling, and there may be a simpler way to do it, but the following script works fine:

    transcode -i movie.mpg -y ffmpeg --export_prof dvd-ntsc --export_asr 3 -o movie -D0 -s2 -m movie.ac3 -J modfps=clonetype=3 --export_fps 29.97 ; mplex -f 8 -o dvd_movie.mpg movie.m2v movie.ac3 ; dvdauthor -x dvdauthor.xml ;
    To the Newbie, this is a big reason why Linux rocks at the command line. You take a sequence of commands, put them in a text file in order, seperate them with semicolons and spaces, save the file, and that's called a shell script. There are more sophisticated approaches to shell scripting, but frankly, I haven't learned them yet. What little I know is this: any command can be a shell script, and a sequence of individual commands separated by semicolons is called a compound command. That's all I've needed to know to automate scads of processes, saving me hours and hours of repetetive drudgery. Scripts, of course, can be saved, reused, and redited for different circumstances. I keep most of my scripts online in the "notepad" of my yahoo mail account, so I can always find them and access them from any online Linux system I happen to be running.

    The name of my script is avi2dvd, and this is how I run it. I run the command

    chmod a+x avi2dvd

    just once, to make the script executable, and from then on, all I have to do is type the command:

    ./avi2dvd

    From a directory that contains the four items listed above.
    Last edited by je_fro; 11-13-2006 at 12:26 AM.

  4. #34
    Join Date
    Sep 2005
    Posts
    681
    cool ill have try this soon. can't wait thanks for the post , best part is it all command line which i prefer , unless im booted in x windows
    "Software is like sex: it's better when its free."
    -LINUS TORVALDS

  5. #35
    Join Date
    Oct 2002
    Location
    Republic of Texas
    Posts
    5,898
    here you go blackbelt:
    Code:
    #!/bin/bash
    if [ -z "$1" ]; then
    echo -e "Enter the name of the mpeg-2 to author and burn.\n";
    else
    dvdauthor -o $1-TEMP $1 ;
    dvdauthor -o $1-TEMP -T ;
    growisofs -dvd-compat -Z /dev/dvdburner -dvd-video $1-TEMP ;
    sleep 10 ;
    rm -rf $1-TEMP ;
    eject /dev/dvdburner
    fi
    Need help in realtime? Visit us at #linuxnewbie on irc.libera.chat

    Few of us will do as much for our fellow man as he has done.
    --Andrew Morton on RMS

  6. #36
    Join Date
    Oct 2002
    Location
    Binghamton NY
    Posts
    2,435
    Quote Originally Posted by je_fro
    here you go blackbelt:
    Code:
    #!/bin/bash
    if [ -z "$1" ]; then
    echo -e "Enter the name of the mpeg-2 to author and burn.\n";
    else
    dvdauthor -o $1-TEMP $1 ;
    dvdauthor -o $1-TEMP -T ;
    growisofs -dvd-compat -Z /dev/dvdburner -dvd-video $1-TEMP ;
    sleep 10 ;
    rm -rf $1-TEMP ;
    eject /dev/dvdburner
    fi
    Okay, so am i to take it that this is a script for making dvds out of mpgs?

  7. #37
    Join Date
    Oct 2002
    Location
    Republic of Texas
    Posts
    5,898
    yup...here's what I'm currently doing...

    dumpstream.sh
    Code:
    #!/bin/bash
    
    if [ -z "$1" ]; then
    
    echo -e "\nEnter arguments as follows: MovieName DeviceName\n";
    
    else
    
    mplayer dvd://`lsdvd -d /dev/$2 | grep Longest | cut -c 16-17` -dvd-device /dev/$2 -dumpstream -dumpfile 
    $1 ;
    
    fi
    myrequant.sh
    Code:
    #!/bin/bash
    if [ -z "$1" ]; then
    echo -e "Enter the name of the file to requantize.";
    else
    FILENAME=$1 ;
    tcextract -i $FILENAME -t vob -x mpeg2 > $FILENAME.m2v ;
    tcextract -i $FILENAME -a 0 -x ac3 -t vob > $FILENAME.ac3 ;
    VSIZE=$(ls -l $FILENAME.m2v | awk '{print $5}') ;
    ASIZE=$(ls -l $FILENAME.ac3 | awk '{print $5}') ;
    ADIFF=$( echo "4700000000 - $ASIZE" | bc -l ) ;
    FACTOR=$( echo "$VSIZE / $ADIFF" | bc -l ) ;
    RQFACTOR=$( echo "$FACTOR * 1.04" | bc -l )
    echo $FILENAME ;
    echo $VSIZE ;
    echo $ASIZE ;
    echo $ADIFF ;
    echo $FACTOR ;
    echo $RQFACTOR ;
    tcrequant -i $FILENAME.m2v -o $FILENAME.shrunk.m2v -f $RQFACTOR
    mplex -f 8 -o $FILENAME.mpg $FILENAME.shrunk.m2v $FILENAME.ac3
    fi
    exit
    growdvd.sh
    Code:
    #!/bin/bash
    if [ -z "$1" ]; then
    echo -e "Enter the name of the mpeg-2 to author and burn.\n";
    else
    dvdauthor -o $1-TEMP $1 ;
    dvdauthor -o $1-TEMP -T ;
    growisofs -dvd-compat -Z /dev/dvdburner -dvd-video $1-TEMP ;
    sleep 10 ;
    rm -rf $1-TEMP ;
    eject /dev/dvdburner
    fi
    so I'll pop in a dvd that I bought and make a legal backup by doing:

    dumpstream.sh Movie dvd
    (the movie is usually more than 4.3G in size, so I'll run
    myrequant.sh Movie
    growdvd.sh Movie

    The device names are unique to my system (like /dev/dvdburner) so you may need to modify using hdc or hdd or whatever...
    Need help in realtime? Visit us at #linuxnewbie on irc.libera.chat

    Few of us will do as much for our fellow man as he has done.
    --Andrew Morton on RMS

  8. #38
    Join Date
    Oct 2002
    Location
    Republic of Texas
    Posts
    5,898
    P.S. I make it 3 scripts because there is sometimes trouble at certain steps in the process...you could roll it all into one, but you'll burn coasters every now and then...
    Need help in realtime? Visit us at #linuxnewbie on irc.libera.chat

    Few of us will do as much for our fellow man as he has done.
    --Andrew Morton on RMS

  9. #39
    Join Date
    Sep 2005
    Posts
    681
    I have problems iwth my video and audio. they seem to be out of sync.. i am using
    transcode , faac and MP4Box. i am outputing transcode into avi and wav then converting wave to mpa. i am encoding it for my ipod in case your wondering. once i get them both in sync i have it working fine.....
    "Software is like sex: it's better when its free."
    -LINUS TORVALDS

  10. #40
    Join Date
    Sep 2005
    Posts
    681
    dvd_reader.c) no support for DVD reading configured - exit.
    [transcode] (probe) suggested AV correction -D 0 (0 ms) | AV 0 ms | 0 ms
    [transcode] auto-probing source test.avi (ok)
    [transcode] V: import format | XviD RIFF data, AVI (V=ffmpeg|A=mp3)
    [transcode] V: AV demux/sync | (2) initial MPEG sequence / enforce frame rate
    [transcode] V: import frame | 512x384 1.33:1
    [transcode] V: bits/pixel | 0.382
    [transcode] V: decoding fps,frc | 23.976,1
    [transcode] V: Y'CbCr | YV12/I420
    [transcode] A: import format | 0x55 MPEG layer-3 [48000,16,2] 132 kbps
    [transcode] A: export format | 0x1 PCM [48000,16,2] 1536 kbps
    [transcode] V: encoding fps,frc | 29.970,4
    [transcode] A: bytes per frame | 6408 (6406.400000)
    [transcode] A: adjustment | -1600@1000
    [transcode] V: IA32/AMD64 accel | sse (sse 3dnowext 3dnow mmxext mmx asm C)
    tc_memcpy: using sse for memcpy
    [transcode] V: video buffer | 10 @ 512x384
    [import_mp3.so] v0.1.4 (2003-08-04) (audio) MPEG
    [import_ffmpeg.so] v0.1.12 (2004-05-07) (video) ffmpeg: MS MPEG4v1-3/MPEG4/MJPEG
    [export_xvid4.so] v0.0.5 (2003-12-05) (video) XviD 1.0.x series (aka API 4.0) | (audio) MPEG/AC3/PCM
    [import_mp3.so] MP3->PCM
    [import_mp3.so] tcextract -a 0 -i "test.avi" -x mp3 -d 0 | tcdecode -x mp3 -d 0 -z 48000
    tc_memcpy: using sse for memcpy
    [export_xvid4.so] Reading configuration from '/root/.transcode/xvid4.cfg'
    [export_xvid4.so] Reading config section 'features' from '/root/.transcode/xvid4.cfg'
    [export_xvid4.so] Reading config section 'quantizer' from '/root/.transcode/xvid4.cfg'
    [export_xvid4.so] Reading config section 'cbr' from '/root/.transcode/xvid4.cfg'
    [export_xvid4.so] Reading config section 'vbr' from '/root/.transcode/xvid4.cfg'
    [encoder.c] Delaying audio (0)
    a problem i think i am seeing is my encoder.c is gettind delayed is the reason my video are out of sync. and if so how do i fix this ?
    "Software is like sex: it's better when its free."
    -LINUS TORVALDS

  11. #41
    Join Date
    Oct 2002
    Location
    Republic of Texas
    Posts
    5,898
    if it's slightly out of sync you can pass the -O option to mplex...
    (man mplex)
    Last edited by je_fro; 11-28-2006 at 04:19 AM.
    Need help in realtime? Visit us at #linuxnewbie on irc.libera.chat

    Few of us will do as much for our fellow man as he has done.
    --Andrew Morton on RMS

  12. #42
    Join Date
    Sep 2005
    Posts
    681
    yeah it is out of sync.. I cant use mplex . i need to use MP4Box to encode it to mp4 . mplex doesnt suport that file format.
    "Software is like sex: it's better when its free."
    -LINUS TORVALDS

  13. #43
    Join Date
    Sep 2005
    Posts
    681
    ok heres the code i am using to divide audio and video
    transcode -i test.avi --export_asr 2 --export_par 2 -F mpeg4 -y xvid,wav -o test.avi -M 2 -N 0x1 --export_fps 29.97 -m test.wav modfps=clonetype=3transcode
    i had to rencode it with higher frame rate because it was coded at 24 FPS which my ipod doesnt support. has to be 29.97

    i then code the wave file to m4a

    faac -w test.wav
    this makes test.m4a
    now i put them together

    MP4Box test.mp4 -add test.avi#video -add test.m4a
    i have no clude where my SYNC problem is happening from MP4Box or is it from transcode. I think its from transcode because the audio is getting delayed . any ideas how to get these both in sync. the audio and video arnt way off but are off a few seconds. thanks
    "Software is like sex: it's better when its free."
    -LINUS TORVALDS

  14. #44
    Join Date
    Sep 2005
    Posts
    681
    figure it out. its a process to get it working. if i use ffmpeg first then use transcode i can get it to sync correctly .....
    "Software is like sex: it's better when its free."
    -LINUS TORVALDS

  15. #45
    Join Date
    Oct 2002
    Location
    Binghamton NY
    Posts
    2,435
    I love this technique, to which I owe some beautiful no-nonsense DVDs. Thought it might be a nice time to give this thread a bump.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •