Advertisement
v1ral_ITS

Burn DVD From .mp4 [ terminal linux ]

May 2nd, 2018
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.48 KB | None | 0 0
  1. Packages for both programs are available for most Linux distributions and BSDs, so you can install them on your favorite OS easily. Compiling the programs from source isn't difficult, as long as you get their dependencies right. Both programs provide adequate documentation about the installation. You can burn the final files to a DVD disc with the help of the growisofs utility from the dvd+rw-tools suite.
  2.  
  3. Converting the files to MPEG-2
  4.  
  5. First, you must convert your file to MPEG-2 for the video and to AC3 for the audio, in order to be compliant with the DVD video specifications. If the audio on your file is already encoded in AC3 format, you can use it as is without re-encoding it. Run this command to check the audio format of the file:
  6.  
  7. mplayer -vo
  8.  
  9. dummy -ao
  10.  
  11. dummy -identify
  12.  
  13. your_video.avi 2>&1 | grep AUDIO_FORMAT | cut -d '=' -f 2
  14.  
  15. If it returns hwac3, the audio part of your file is encoded in AC3, and you can convert the file to MPEG-2 with the following command:
  16.  
  17. mencoder -oac
  18.  
  19. copy -ovc
  20.  
  21. lavc -of
  22.  
  23. mpeg -mpegopts
  24.  
  25. format=dvd -vf scale=720:576,harddup
  26.  
  27. \\-lavcopts vcodec=mpeg2video:vrc_buf_size=1835
  28.   :vrc_maxrate=9800:vbitrate=5000:keyint=15:aspect=16/9
  29.  
  30. \\-ofps 25 -o your_video.mpg your_video.avi
  31.  
  32. If it isn't encoded in AC3, run this command:
  33.  
  34. mencoder -oac lavc -ovc lavc -of
  35.  
  36. mpeg -mpegopts format=dvd -vf scale=720:576,harddup
  37.  
  38.  \\-srate 48000 -af lavcresample=48000
  39.  
  40. \\-lavcopts vcodec=mpeg2video:vrc_buf_size=1835
  41.    :vrc_maxrate=9800:vbitrate=5000:keyint=15:aspect=16/9:
  42.  
  43. \\acodec=ac3:abitrate=192 -ofps 25 -o your_video.mpg your_video.avi
  44.  
  45. The previous commands create an MPEG-2 file in phase-alternating line (PAL) format with an aspect ratio of 16:9. PAL is used in most of Europe (except France). If you want to create a National Television System Committee (NTSC) DVD, which is the North American video standard, replace scale=720:576 with scale=720:480, keyint=15 with keyint=18, and -ofps 25 with -ofps 30000/1001. If you don't have a wide-screen TV, you should encode your file with an aspect ratio of 4:3 by replacing aspect=16/9 with aspect=4/3.
  46.  
  47. For more information, check the MPlayer's man page, which provides detailed explanations about each option used in these commands.
  48.  
  49. This process should take some time to finish. My 1.5GHz Centrino laptop took about 25 minutes to convert a file with a one-hour runtime that was encoded in XviD.
  50.  
  51. Creating the DVD structure
  52.  
  53. Now you can use dvdauthor to create the layout of the DVD from the MPEG-2 file of your video. Although you can pass any options to dvdauthor directly from the command line, it's easier and more flexible to create an XML file with the appropriate options instead.
  54.  
  55. I split my hour-long video into six 10-minute chapters. Adjust the chapters= option for your video, or remove the option from your XML file if you don't want chapters.
  56.  
  57. Type dvdauthor -o dvd -x dvd.xml to create the layout of the DVD; the -o switch defines the output directory, and -x is used for the XML file. This command takes five to 10 minutes, depending on your video size and your CPU speed. Once it completes, you'll have a directory named dvd with two subdirectories: AUDIO_TS and VIDEO_TS. Before burning the video to a disc, you can check it by running mplayer dvd:// -dvd-device ./dvd.
  58.  
  59. If the video plays correctly, you can burn it onto a DVD disc with growisofs by running growisofs -dvd-compat -Z /dev/dvdrw -dvd-video ./dvd/. Make sure to replace /dev/dvdrw with the device name of your DVD recorder.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement