Difference between revisions of "Automated DVD production"

From Organic Design wiki
m (See also)
m (See also)
 
(4 intermediate revisions by the same user not shown)
Line 20: Line 20:
 
==Packages==
 
==Packages==
 
  apt-get install debian-multimedia-keyring dvdauthor mjpegtools imagemagick toolame
 
  apt-get install debian-multimedia-keyring dvdauthor mjpegtools imagemagick toolame
 +
 +
==tovid==
 +
High level python scripts that tie it all together - probably won't need the make file any more.
 +
 +
==Makefile==
 +
Here is the basis of a Make file that will eventually perform the whole process from file encoding to burning. It does not work at the moment, but is well documented.
 +
 +
<pre>
 +
DVD_IMAGE=dvd.image
 +
 +
DESTINATION=vob/vob1.vob
 +
 +
menu/menu.mpg: menu/background.png ../common/spumux.xml buttons.png highlight.png selected.png
 +
dd if=/dev/zero bs=4 count=1920 | toolame -b 128 -s 48 /dev/stdin menu/audio.mp2
 +
 +
# toolame
 +
# -b bitrate in kbps
 +
# -s audio sample rate in kHz - 48kHz for DVD audio
 +
 +
convert menu/background.png -quality 8 menu/background.jpg
 +
jpeg2yuv -n 60 -I p -f 25 -j menu/background.jpg | mpeg2enc -n p -f 8 -o menu/background.m2v
 +
 +
# jpeg2yuv
 +
# -n number of frames to process
 +
# -I interlacing mode p = progressive
 +
# -f frame rate
 +
# -j file name or sequence (see man)
 +
 +
# mpeg2enc
 +
# -n norm (p|n|s) (pal|ntsc|secam)
 +
# -f format 8 = "DVD MPEG-2 for ’dvdauthor" (see man)
 +
# -o ouput filename
 +
 +
mplex -f 9 -o menu/background.mpg menu/background.m2v menu/audio.mp2
 +
 +
# mplex
 +
# -f format 9 = DVD, 8 = DVD with blank blocks
 +
# -o output filename
 +
# input video
 +
# input audio
 +
 +
spumux ../common/spumux.xml < menu_background.mpg > menu.mpg
 +
 +
# spumux
 +
# multiplexes subtitles into existing mpeg2 stream
 +
# output menu.mpg stream
 +
 +
pal:
 +
mencoder "$(SOURCE)" -of mpeg -vf scale=720:576,harddup -oac lavc -ovc lavc -lavcopts \
 +
acodec=ac3:abitrate=192:vcodec=mpeg2video:keyint=150:vbitrate=5000:aspect=4/3 \
 +
-mpegopts format=dvd -srate 48000 -ofps 25 -o "$(DESTINATION)"
 +
 +
# mencoder
 +
# vbitrate up to 400 - 9800 for DVD - long play vs image quality (bigger number)
 +
 +
clean:
 +
rm -rf test dvd.img vob/vob1.vob
 +
 +
dvd-structure: pal clean
 +
dvdauthor -o test -x xml/single.xml
 +
 +
dvd: dvd-structure
 +
mkisofs -dvd-video -o dvd.img test
 +
 +
 +
ntsc:
 +
mencoder "$(SOURCE)" -of mpeg -vf scale=720:480,harddup -oac lavc -ovc lavc -lavcopts \
 +
acodec=ac3:abitrate=192:vcodec=mpeg2video:keyint=150:vbitrate=5000:aspect=4/3 \
 +
-mpegopts format=dvd -srate 48000 -ofps 30000/1001 -o "$(DESTINATION)"
 +
 +
# <dvdauthor>
 +
#     <vmgm />
 +
#     <titleset>
 +
#         <titles>
 +
#             <pgc>
 +
#                 <vob file="video1.mpg" />
 +
#                 <vob file="video2.mpg" />
 +
#             </pgc>
 +
#         </titles>
 +
#     </titleset>
 +
# </dvdauthor>
 +
 +
</pre>
  
 
==See also==
 
==See also==
 +
*[http://www.sit.auckland.ac.nz/Video_encoding Video encoding]
 
*[http://www.debian-multimedia.org/faq.php Linux debian multimedia repository] - you'll need to add this to your sources.list to get all the good video packages.  
 
*[http://www.debian-multimedia.org/faq.php Linux debian multimedia repository] - you'll need to add this to your sources.list to get all the good video packages.  
 
*[http://dvdauthor.sourceforge.net/ dvdauthor]
 
*[http://dvdauthor.sourceforge.net/ dvdauthor]
Line 27: Line 111:
 
*[http://www.mir.com/DMG/Software/ y4mscaler]
 
*[http://www.mir.com/DMG/Software/ y4mscaler]
 
*[http://linuxcommand.org/man_pages/growisofs1.html growisofs]
 
*[http://linuxcommand.org/man_pages/growisofs1.html growisofs]
 +
*[http://www.live555.com/openRTSP openRTSP] is a video streaming server
 +
*[http://ffmpeg.mplayerhq.hu/ FFmpeg (encoding different formats) ]*[http://lame.sourceforge.net Lame ]
 +
*[http://liba52.sourceforge.net/ liba52 ]
 +
*[http://homepage.mac.com/johan/mov/mov.html movtoy4m and movtowav ]
 +
*[http://www.gnu.org/software/vcdimager/ vcdxbuild and vcdxgen ]
 +
*[http://dvdauthor.sourceforge.net/ dvdauthor ]
 +
*[http://cdrecord.berlios.de mkisofs ]
 +
*[http://liba52.sourceforge.net/ liba52 ]
 +
*[http://homepage.mac.com/johan/mov/mov.html movtoy4m and movtowav (QuickTime encoding material) ]
 +
*[http://www.gnu.org/software/vcdimager/ vcdxbuild and vcdxgen (S/VCD images) ]
 +
*[http://dvdauthor.sourceforge.net/ dvdauthor (DVD authorization) ]
 +
*[http://cdrecord.berlios.de mkisofs ]

Latest revision as of 20:24, 9 February 2009

It would be nice to generate DVD discs from video files or cameras in a simple automated way.

Video specs

  • mpeg2 av muxed stream
  • Bit rate from 4Mb/s - 10 Mb/s

Audio specs

  • mpeg1-layer2
  • AC3
  • PCM
  • Must be 48kHz sample rate

Input

  • A directory of video files numbered to indicate their order

Output

  • A DVD image file, or
  • A finished DVD if the machine has a DVD writer

Packages

apt-get install debian-multimedia-keyring dvdauthor mjpegtools imagemagick toolame

tovid

High level python scripts that tie it all together - probably won't need the make file any more.

Makefile

Here is the basis of a Make file that will eventually perform the whole process from file encoding to burning. It does not work at the moment, but is well documented.

DVD_IMAGE=dvd.image

DESTINATION=vob/vob1.vob

menu/menu.mpg: menu/background.png ../common/spumux.xml buttons.png highlight.png selected.png
	dd if=/dev/zero bs=4 count=1920 | toolame -b 128 -s 48 /dev/stdin menu/audio.mp2
	
	# toolame 
	# -b bitrate in kbps
	# -s audio sample rate in kHz - 48kHz for DVD audio
	
	convert menu/background.png -quality 8 menu/background.jpg
	jpeg2yuv -n 60 -I p -f 25 -j menu/background.jpg | mpeg2enc -n p -f 8 -o menu/background.m2v

	# jpeg2yuv
	# -n number of frames to process
	# -I interlacing mode p = progressive
	# -f frame rate
	# -j file name or sequence (see man)

	# mpeg2enc
	# -n norm (p|n|s) (pal|ntsc|secam)
	# -f format 8 = "DVD MPEG-2 for ’dvdauthor" (see man)
	# -o ouput filename
	
	mplex -f 9 -o menu/background.mpg menu/background.m2v menu/audio.mp2

	# mplex
	# -f format 9 = DVD, 8 = DVD with blank blocks
	# -o output filename
	# input video
	# input audio
	
	spumux ../common/spumux.xml < menu_background.mpg > menu.mpg

	# spumux
	# multiplexes subtitles into existing mpeg2 stream
	# output menu.mpg stream

pal:
	mencoder "$(SOURCE)" -of mpeg -vf scale=720:576,harddup -oac lavc -ovc lavc -lavcopts \
	acodec=ac3:abitrate=192:vcodec=mpeg2video:keyint=150:vbitrate=5000:aspect=4/3 \
	-mpegopts format=dvd -srate 48000 -ofps 25 -o "$(DESTINATION)"
	
	# mencoder
	# vbitrate up to 400 - 9800 for DVD - long play vs image quality (bigger number)

clean:
	rm -rf test dvd.img vob/vob1.vob

dvd-structure: pal clean
	dvdauthor -o test -x xml/single.xml

dvd: dvd-structure
	mkisofs -dvd-video -o dvd.img test


ntsc:
	mencoder "$(SOURCE)" -of mpeg -vf scale=720:480,harddup -oac lavc -ovc lavc -lavcopts \
	acodec=ac3:abitrate=192:vcodec=mpeg2video:keyint=150:vbitrate=5000:aspect=4/3 \
	-mpegopts format=dvd -srate 48000 -ofps 30000/1001 -o "$(DESTINATION)"

#	<dvdauthor>
#	    <vmgm />
#	    <titleset>
#	        <titles>
#	            <pgc>
#	                <vob file="video1.mpg" />
#	                <vob file="video2.mpg" />
#	            </pgc>
#	        </titles>
#	    </titleset>
#	</dvdauthor>

See also