How to create a dvd from the command line.

Forum Forums General Tips and Tricks How to create a dvd from the command line.

  • This topic has 3 replies, 3 voices, and was last updated Jan 13-7:50 am by Anonymous.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #5109
    Member
    sleekmason

      Howdy all,

      Thought I would share a How-to I just wrote on creating a DVD from the command line, with a bash script to automate it. I bought a TomTom Cheap that creates mp4’s and needed to put them on disk. How to Make a DVD from the Terminal Hope it is useful to somebody.

      #5111
      Anonymous

        Thanks, and THANKS (your Fluxbox Blog is already in my bookmarks) http://sleekmason.wordpress.com/category/fluxbox/

        #5119
        Member
        sleekmason

          Here is the script that I am using to automate this. UPDATED 1-14-18

          To get started, you will need to install a few tools as root. You probably already have most of these if you are using AntiX Full.

          apt-get install ffmpeg dvdauthor genisoimage rename geany rox-filer

          You will also need to create a new directory ‘~/Videos’ if not already there:
          mkdir ~/Videos

          And a text file that will be used to string your videos together before transcoding.
          geany cam.txt
          Inside cam.txt place:

          # this is a comment
          file '01.mp4'
          file '02.mp4'
          file '03.mp4'
          file '04.mp4'
          file '05.mp4'
          file '06.mp4'
          file '07.mp4'
          file '08.mp4'
          file '09.mp4'
          file '10.mp4'
          file '11.mp4'

          Save and close the file. This should stay in your home directory to be called by the script.

          This will be used by ffmpeg to string all of your videos together into one movie. During the process of making the DVD, the cam.txt file will be copied to ‘~/Videos’ to be adjusted for use there by matching the number of videos you are wanting to use, with the same on the list.

          Here is the script to be placed in /usr/local/bin
          Make a text file called ‘vid1.sh’

          Change the permissions to make it executable:
          sudo chmod a+rx vid1.sh

          Put this inside:

          #!/bin/bash
          rox-filer ~/Videos
          echo "               ***********************************************"
          echo "               ***********************************************"
          echo "               **                                           **"
          echo "               **                                           **"
          echo "               **    PUT ANY MOVIES YOU WISH TO MAKE INTO   **"
          echo "               **     A DVD INTO ~/VIDEOS AND HIT RETURN    **"
          echo "               **                                           **"
          echo "               **                                           **"
          echo "               **                                           **"
          echo "               ***********************************************"
          echo "               ***********************************************"
          read -p "PRESS ENTER TO CONTINUE" ;
          cd ~/Videos ;
          rename 's/.+/our $i; sprintf("%02d.mp4", 1+$i++)/e' * ;
          cp ~/cam.txt ~/Videos ;
          echo "               ***********************************************"
          echo "               ***********************************************"
          echo "               **                                           **"
          echo "               **  CHECK THE CAM.TXT LIST AND ADJUST THE    **"
          echo "               **    NUMBER OF VIDEOS TO MATCH THE LIST,    **"
          echo "               **             PUT IN NEW DVD+R              **"
          echo "               **              PRESS RETURN                 **"
          echo "               **                                           **"
          echo "               **                                           **"
          echo "               ***********************************************"
          echo "               ***********************************************"
          leafpad ~/Videos/cam.txt ;
          read -p "PRESS ENTER TO CONTINUE" ;
          #read -n 1 -s -r -p "Press any key to continue"
          ffmpeg -f concat -i cam.txt -c copy Movie.mp4 ;
          cp ~/Videos/Movie.mp4 ~/Movies ;
          #This one for full
          ffmpeg -i Movie.mp4 -vf "pad=5/4*iw:5/4*ih:(ow-iw)/2:(oh-ih)/2" -b:v 8600k -target ntsc-dvd movievideo.mpg ;
          #This one is wide
          #ffmpeg -i Movie.mp4 -vf "pad=5/4*iw:5/4*ih:(ow-iw)/2:(oh-ih)/2" -b:v 8600k -target ntsc-dvd -aspect 16:9 movievideo.mpg
          mkdir dvd ;
          mv ~/Videos/movievideo.mpg ~/Videos/dvd ;
          cd ~/Videos/dvd ;
          export VIDEO_FORMAT=NTSC ;
          dvdauthor -o dvd/ -t movievideo.mpg ;
          dvdauthor -o dvd/ -T ;
          genisoimage -dvd-video -V HOMEVIDEO -o dvd.iso dvd/ ;
          mv ~/Videos/dvd/dvd.iso ~/Videos/dvd.iso ;
          rm -r ~/Videos/dvd &
          rm ~/Videos/*.mp4 &
          rm ~/Videos/cam.txt ;
          cd ~/Videos ;
          growisofs -dvd-video -Z /dev/sr0=dvd.iso ;
          echo "               **********************************************"
          echo "               **********************************************"
          echo "               *                                            *"
          echo "               *                                            *"
          echo "               *                                            *"
          echo "               *           YAY!  YOU MADE A DVD!!!          *"
          echo "               *                                            *"
          echo "               *                                            *"
          echo "               *                                            *"
          echo "               **********************************************"
          echo "               **********************************************" ;

          Move the file to /usr/local/bin

          Call the script by opening a terminal and:
          vid1.sh

          Or, better yet, just add this line to your “personal menu”
          [exec] (DVD Maker) {/usr/bin/lxterminal -e vid1.sh}

          When it gets to the return, Check the cam.txt inside~/Videos, and match the number of videos to the list. Then hit return. Dont forget to have a fresh disk in the drive!!

          • This reply was modified 6 years, 4 months ago by sleekmason.
          • This reply was modified 6 years, 4 months ago by sleekmason. Reason: Cleaned all of this up big time and added a few items to the code
          • This reply was modified 6 years, 4 months ago by sleekmason. Reason: Cleaned all of this up big time and added a few items to the code
          #5144
          Anonymous

            Nice…

          Viewing 4 posts - 1 through 4 (of 4 total)
          • You must be logged in to reply to this topic.