Index Talk:HOWTO Create a DVD

From Gentoo Linux Wiki

Jump to: navigation, search

I think it should be mentioned that there are different requirements for a NTSC versus a PAL DVD. This[1] pretty much walks you through that. DVD sound can (should) be 48000Hz and the mpeg video bitrate should be dependent on the length of the movie and the size of your discs. Also, growisofs can completely replace the usage mkisofs and cdrecord-ProDVD with a single command. These changes can be made by anyone, I'll be back to implement them for certain at a later date.

The definitive document is available at:

http://www.transcoding.org/cgi-bin/transcode?Tutorials/Authoring_PC_Media_To_DVD

Contents

[edit] transcode command line 2

Yes, mpeg isn't the codec of choice. It's a old bbmpeg port, transcode starts with. mjepg-tools are famous for quality and its my codec of choice (since I am most familiar with how to tweak it). But if you start encoding to dvd, you should use ffmpeg and the profiling support from transcode. ffmpeg is know to produce good results and will speed-up the encoding process a lot.

Following that advice it should reduce the command line to something like:

transcode -i <Film.whatSoEver> -y ffmpeg --export_prof dvd-(ntsc/pal) -o new_film

the profiling support should care about resampling of sound and any clip/crop adjustments.

In spite tcmplex (port of same old bbmpeg) is still in transcode, you should try mplex (mjpeg-tools) for muxing as it is well known to cooperate with dvdauthor.

The syntax used by the OP is AFAIK from Rick Harris post in the multimedia forum, but Rick has updated that info in the forums and at his homepage to follow up the development of transcode and the tools needed.

Further the OP is quite lucky, that his hardwware box seems to cover 44100 Hz on DVD. As mentioned above that can easily break compatibility as 48000 (mpeg2, ac3, dts, pcm) is reqested.

mpeg1 at smallest sizes (352x288(240) is also a valid spec on dvd, but I ran into problems as dvdauthor probably doesn't know that, when tried it last time.

The information on this wiki is outdated (regarding the mpeg codec regulars of transcode-users skip using it for about 3 years now;)) but unfortunately I have no time to make me familiar with all this wiki editing, to correct it on my own, sorry. :(.

[edit] Request for help

Ok, I started this article. I'm not that knowledgeable so I need some help. Please contribute all you can. I will start working on this at home next week once I am in my new apartment and can actually use my good machine. Dgrant 22:17, 4 Apr 2005 (GMT)


[edit] Mencoder

By: Joseph Miller (see http://www.calcmaster.net for contact information)

MPlayer-1.0pre7 (with mencoder) now supports mpeg2 encoding properly and I have found it to be a better tool for me to do encoding with. I particularly had problems with transcode when using the Quicktime Sorenson format, but mencoder supports this just fine.

  1. for creating NTSC DVD's (NTSC is the format used in the US and other countries)

ntsc = 29.97 (30000/1001) fps @ 720x480

  1. you can use mencoder to do everything in one step
mencoder movie.avi -of mpeg -vf scale=720:480,harddup -oac lavc -ovc lavc -lavcopts \
 acodec=ac3:vcodec=mpeg2video -mpegopts format=dvd -noskip -srate 48000 -ofps 30000/1001 -o movie.mpg

# -of means use mpeg file format (instead of avi)
# -vf scale=720:480 means use 720x480 which is NTSC resolution
# ,harddup is necessary for output to MPEG files (avoid problems with a/v sync) 
# -oac lavc means use libavcodec for encoding the audio (see lavcopts)
# -ovc lavc means use libavcodec for encoding the video (see lavcopts)
# -lavcopts are the options for libavcodec
#   acodec=ac3 is the audio codec used in DVD's
#   vcodec=mpeg2video is the MPEG 2 video that DVD's support
# -mpegopts format=dvd means to use dvd compatible mpeg
# -srate 48000 is an audio sampling rate of 48000Hz which is standard for DVD's
# -ofps 30000/1001 is the framerate (29.97) to be used for NTSC
# -o movie.mpg specifies that the output file should be movie.mpg

create the below file and name it dvdauthor.xml

<dvdauthor dest="dvd/">
	<vmgm />
	<titleset>
		<titles>
			<pgc>
				<vob file="movie.mpg" />
			</pgc>
		</titles>
	</titleset>
</dvdauthor>

run the command below to create the dvd directory structure in dvd/

dvdauthor -x dvdauthor.xml

make the iso for the dvd

mkisofs -dvd-video -o dvd.iso dvd/

Once this is done you can burn the dvd.iso to a DVD and play it in standard DVD player. I have read somewhere that some DVD players only read burned DVD's at a maximum of 2x (approximately 2.2MB/s).

You may want to cut down the bitrate of the video/audio to compress further at the expense of quality. Use the libavcodec option (lavcopts) abitrate=(audio bitrate) and vbitrate=(video bitrate) to choose the bitrates of each of these. See the example below.

mencoder movie.avi -of mpeg -vf scale=720:480,harddup -oac lavc -ovc lavc -lavcopts \
 acodec=ac3:vcodec=mpeg2video:abitrate=128:vbitrate=5000 -noskip -mpegopts format=dvd \
 -srate 48000 -ofps 30000/1001 -o movie.mpg

When creating mpeg files with mencoder don't forget to put the harddup filter at the end of the filter chain or you will end up with lots of lines like ERROR: SCR: 124664944, APTS: 120176640, DELTA=-0.049 secs and A/V sync problems.

Joseph, you are a genious. Thank you for that; I think this should go in the main article. I'll edit it in at the end of today if no one else does, since the transcode bit is basically a big "RTFM" for anyone unfamiliar with it. Thank you again.
In 3:2 pulldown soft telecine mode which I'd like use to convert my PAL DV Camcorder recordings to NTSC, I could not use harddup so far. In this mode, one uses progressive (or deinterlaced) frames at 24fps (like film), encode these 24 frames per second, and the mpeg muxer sets the field flags so that these 24 progressive frames get interlaced into 30 fields during decoding. It's the same telecine mode which is applied for putting feature films on NTSC DVDs. For this mode, I need to downsample the PAL video from 25 to 23.976 fps (-ofps 240000/1001) in order to be able to be able to use -mpegopts format=dvd:telecine. The delecine option requires -ofps 24 because the 3:2 pulldown algorithm only works from 24 to 30 fps. Whenever I added harddup and/or -noskip (recommended in the mencoder man page), video drifts away from dudio. It takes about 30 seconds to see the offset. I suspect that harddup may be incompatible with -ofps, but I am just guessing. I guess I may have to use some kind of 2-stage encoding to get that right, a first pass which converts to NTSC or to film frame rate with -ofps and a second pass which does the final mpeg encoding with harddup added. Maybe I can use the lossless huffyuv as intermediate vcodec to avoid the additional quality loss from another encoding/decoding generation. -- Bernhard Kaindl

[edit] lxdvdrip

I tried to copy a DVD with mplayer and transcode for ages and was never happy with the result. Until I found lxdvdrip [2]. Essentially it's just a frontend for transcode and streamdvd. The latter saves you lots of time though, because you don't have to rip the DVD to the harddisk and it only goes through the stream once ! So it scans the DVD, calculates the requant factor and then reads, requants and writes the VOBs all in one go. You guys should have a look at it. --kv3rk

[edit] mkisofs

I erased the package mkisofs because it is now contained in cdrtools Mrwoody

I added a stub tag because this HOWTO does not yet cover all areas. Especially part 2 is lacking, and I didn't see subtitles mentioned anywhere.

[edit] subtitles

Does anyone have an idea how to make the subtitles turned on automatically on a stand-alone player?

[edit] Things get duplicated, templates needed?

I thing this line:

mkdir -p /etc/portage/

should be removed and a link should be added for a general howto for package use flags. Maybe even the next line should be remove and just write that encode use flag is needed for mplayer. There are at least three ways how this can be achieved (/etc/make.conf or /etc/portage/package.use) and Gentoo is about choice, right?

So we only should say what needs to be done and point to a proper howto if a user doesn't already know how to do it (and he should because these are basics of using Gentoo). IMO text would be much easier to read.

This applies to all articles. In many places things are duplicated. Maybe there should be created a special template where someone could enter package name and useflags and another for package unasking.

Personal tools