[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: debconf5 - videos of the talks and BOFs available



Scott M. Dier wrote:
> > I don't have a dual-layer burner so I've been burning a pair of
> > single-layer DVDs.  These have about 800 megabytes more space altogether
> 
> I wouldn't mind a two-disk-dual-layer config, or even a one single-layer 
> one dual-layer, etc.  I can master the DVDs myself (ie: the reencoding 
> and stuff) but would need the settings/source file to do this correctly 
> (ie:have no idea how to author, but know how to run the tools). :)

You can find the build files at
<http://womble.decadentplace.org.uk/software/debconf5-dvd-0.4.tar.bz2>,
as previously mentioned.  These include a Makefile so in theory it's as
simple as typing "make" and waiting a few hours.  Actually you need to
look at the requirements in the README file first.  I'm attaching a
patch which may or may not work to allow building NTSC DVDs as well,
though frankly the image processing it does is a kluge.  My first
attempt resulted in a video filter chain that didn't insert the
necessary extra frames when converting from 25 fps sources.  The options
given in the patch appear to correct this but I haven't had time to run
a full build using them yet.

(Note, dvdauthor may exit with an assertion failure if the timing of a
VOB is outside its tolerances, in which case the VOB must be
remultiplexed.  To make this happen, add it to the REMUX_VOBS variable
in the Makefile, delete it, and try again.  The patch makes make run
dvdauthor via strace so that if this happens you can look in
dvdauthor.strace to find out which file was at fault.)

Ben.

-- 
Ben Hutchings
Q.  Which is the greater problem in the world today, ignorance or apathy?
A.  I don't know and I couldn't care less.
diff -ur debconf5-dvd-0.4/Makefile debconf5-dvd/Makefile
--- debconf5-dvd-0.4/Makefile	2005-08-03 09:07:56.000000000 +0100
+++ debconf5-dvd/Makefile	2005-08-05 00:16:30.335211358 +0100
@@ -8,9 +8,10 @@
 
 # By default, this will generate single-layer disc images with video
 # at PAL resolutions. Define the variable NTSC if you want to generate
-# video at NTSC resolutions (currently this is broken; see TODO). 
-# Define the variable DUAL_LAYER if you want to generate dual-layer
-# disc images.
+# video at NTSC resolutions.  Define the variable DUAL_LAYER if you
+# want to generate a dual-layer disc image.  You will also need to
+# reduce VIDEO_BITRATE and/or AUDIO_BITRATE from their default values
+# of 300 and 96 to fit everything onto one dual-layer disc.
 
 # Temporary directory to build the DVD tree in - this will be erased
 # and created as needed.
@@ -47,7 +48,11 @@
 # Output codecs and bit rates
 VIDEO_CODEC := mpeg1video
 VIDEO_BITRATE := 300
-AUDIO_CODEC := mp2
+ifeq ($(STANDARD),pal)
+    AUDIO_CODEC := mp2
+else
+    AUDIO_CODEC := ac3
+endif
 AUDIO_BITRATE := 96
 
 # Source videos
@@ -170,19 +175,27 @@
 $(BUILD_DIR)/debconf5-video-%-$(STANDARD).iso : debconf5-%.dvdauthor
 	rm -rf $(DVD_TREE)
 	ln -sf $(BUILD_DIR) vobs
-	dvdauthor -o $(DVD_TREE) -x $<
+	strace -e open -o dvdauthor.strace dvdauthor -o $(DVD_TREE) -x $<
 	rm -f vobs
 	mkisofs -o $@ -dvd-video $(DVD_TREE) || (rm -f $@ ; false)
 	rm -rf $(DVD_TREE)
 
+ifeq ($(STANDARD),pal)
+    SCALE_COMMAND = cat $<
+    YSCALE := 1.0
+else
+    SCALE_COMMAND = pnmscale -xscale=1 -ysize=$(HEIGHT_HIRES) $<
+    YSCALE := 0.8333333333
+endif
+
 # Convert PPM to MPEG2.  This is needed for including still true-colour
 # images.
-# TODO: Scale or use different source PPMs for NTSC and PAL.
 $(BUILD_DIR)/%.mpeg2 : %.ppm
 	mkdir -p $(dir $@)
-	ppmtoy4m -v0 -n 1 -F $(FRAME_RATE_RATIO) -A $(PIXEL_ASPECT_RATIO) \
-	    -I p -S 420_mpeg2 <$<                                         \
-	    | mpeg2enc -v0 -f 8 -o $@
+	$(SCALE_COMMAND)                                                    \
+	| ppmtoy4m -v0 -n 1 -F $(FRAME_RATE_RATIO) -A $(PIXEL_ASPECT_RATIO) \
+	      -I p -S 420_mpeg2                                             \
+	| mpeg2enc -v0 -f 8 -a 2 -o $@
 
 # Convert MPEG2 to MPEG2 PS
 %.vob : %.mpeg2
@@ -196,13 +209,14 @@
 	./make-menu-vob -w $(WIDTH_HIRES) -h $(HEIGHT_HIRES)         \
 	    -n 255,255,255 -i 175,44,14 -s 255,0,0                   \
 	    -f /usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf \
-	    -m $< -b $(BUILD_DIR)/menu-background.mpeg2 -o $@
+	    -m $< -b $(BUILD_DIR)/menu-background.mpeg2 -o $@        \
+	    --yscale $(YSCALE)
 
 # Generic mencoder options.
 MENCODER_FLAGS = $(NOSKIP) -mc 1 -of mpeg -ovc lavc -oac $(AUDIO_CODEC_TYPE) \
     -mpegopts format=dvd:reorder:vframerate=$(FRAME_RATE):vaspect=$(FRAME_ASPECT_RATIO) \
     -lavcopts vcodec=$(VIDEO_CODEC):vbitrate=$(VIDEO_BITRATE):vratetol=100000:vqcomp=0.8:keyint=$(MAX_GOP):acodec=$(AUDIO_CODEC):abitrate=$(AUDIO_BITRATE) \
-    -ofps $(FRAME_RATE) -vf scale=$(SIZE),harddup $(RESAMPLE)
+    -ofps $(FRAME_RATE) -vf scale=$(SIZE) -vf-add harddup $(RESAMPLE)
 
 # Default values for mencoder options that need to be overridden for some files.
 NOSKIP := -noskip
@@ -224,8 +238,6 @@
 # Convert all sources to MPEG2 PS.
 $(BUILD_DIR)/%.vob : %.mpeg
 	$(MENCODER_COMMANDS)
-$(BUILD_DIR)/%.vob : %.mpg
-	$(MENCODER_COMMANDS)
 $(BUILD_DIR)/%.vob : %.avi
 	$(MENCODER_COMMANDS)
 
@@ -276,6 +288,7 @@
 endif
 
 # These need to be remultiplexed due to bad frame timing.
+ifeq ($(STANDARD),pal)
 REMUX_VOBS := $(addprefix $(BUILD_DIR)/dc5video.debian.net/, \
 	2005-07-11/07-Debian_Release_Management-Andreas_Barth.vob \
 	2005-07-12/02-Software_in_the_Public_Interest_Workshop-Benjamin_Mako_Hill.vob \
@@ -284,15 +297,39 @@
 	2005-07-14/06-Autobuilding_Experimental-Andreas_Barth.vob \
 	2005-07-15/03-Debian_Women_and_Women_in_Free_Software-Erinn_Clark_Magni_Onsoien.vob \
 	2005-07-17/Cross_Compiling_Debian_from_Scratch-Timo_Savola.vob )
+else
+REMUX_VOBS := $(addprefix $(BUILD_DIR)/dc5video.debian.net/, \
+	2005-07-09/09-Getting_Involved_as_an_End_User-Alexander_Schmehl.vob \
+	2005-07-11/07-Debian_Release_Management-Andreas_Barth.vob \
+	2005-07-12/05-OpenOffice.org_in_Debian-Chris_Halls_Rene_Engelhard.vob \
+	2005-07-14/06-Autobuilding_Experimental-Andreas_Barth.vob \
+	2005-07-15/01-Documentation_in_Debian-Takatsugu_Nokubi.vob \
+	2005-07-15/02-Freezing_HEL_Over-Scott_James_Remnant.vob \
+	2005-07-15/03-Debian_Women_and_Women_in_Free_Software-Erinn_Clark_Magni_Onsoien.vob )
+endif
+ifeq ($(AUDIO_CODEC),mp2)
+    MPEGDEMUX_AUDIO_STREAM := -s 0xc0
+else
+    ifeq ($(AUDIO_CODEC),ac3)
+        MPEGDEMUX_AUDIO_STREAM := -s 0xbd -p 0x80 -a
+    else
+        $(error "Don't know how to extract audio streams")
+    endif
+endif
+MPEGDEMUX_VIDEO_STREAM := -s 0xe0
+
 $(REMUX_VOBS) : $(BUILD_DIR)/%.vob : %.mpeg
 	mkdir -p $(dir $@)
 	(mencoder $(MENCODER_FLAGS) -o $@.temp $< || rm -f $@.temp) \
 	    2>&1 >/dev/null | egrep -v $(MENCODER_JUNK) ;           \
 	test -f $@.temp
-	mpegdemux -d -s 0xe0 $@.temp $(BUILD_DIR)/$*.mpeg
-	mpegdemux -d -s 0xc0 $@.temp $(BUILD_DIR)/$*.mp2
-	mplex -v0 -f 8 -o $@ $(BUILD_DIR)/$*.mpeg $(BUILD_DIR)/$*.mp2
-	rm -f $@.temp $(BUILD_DIR)/$*.mpeg $(BUILD_DIR)/$*.mp2
+	mpegdemux -d $(MPEGDEMUX_VIDEO_STREAM) $@.temp $(BUILD_DIR)/$*.mpeg
+	mpegdemux -d $(MPEGDEMUX_AUDIO_STREAM) $@.temp $(BUILD_DIR)/$*.$(AUDIO_CODEC)
+	mplex -v0 -f 8 -o $@ $(BUILD_DIR)/$*.mpeg $(BUILD_DIR)/$*.$(AUDIO_CODEC)
+	rm -f $@.temp $(BUILD_DIR)/$*.mpeg $(BUILD_DIR)/$*.$(AUDIO_CODEC)
+
+%.mpeg : %.mpg
+	ln -s $(notdir $<) $@
 
 # Download missing files, if enabled.
 ifdef DOWNLOAD
diff -ur debconf5-dvd-0.4/make-menu-vob debconf5-dvd/make-menu-vob
--- debconf5-dvd-0.4/make-menu-vob	2005-07-27 20:25:55.000000000 +0100
+++ debconf5-dvd/make-menu-vob	2005-08-04 00:25:09.000000000 +0100
@@ -64,7 +64,9 @@
     import getopt, os, os.path
 
     try:
-        opt_list, arg_list = getopt.getopt(args, 'w:h:m:b:o:n:i:s:f:')
+        opt_list, arg_list = getopt.getopt(args,
+                                           'w:h:m:b:o:n:i:s:f:',
+                                           ['xscale=', 'yscale='])
         if len(arg_list) != 0:
             raise getopt.GetoptError('unexpected non-option arguments given')
         opts = {}
@@ -79,6 +81,8 @@
         high_colour_text = opts['-i']
         sel_colour_text = opts['-s']
         font_name = opts['-f']
+        xscale = float(opts.get('--xscale', 1.0))
+        yscale = float(opts.get('--yscale', 1.0))
     except (getopt.GetoptError, KeyError, ValueError):
         usage()
         return 0
@@ -113,12 +117,19 @@
         if line[0] in '#\n':
             continue
 
-        args = line.split(' ', 4)
+        args = line.strip().split(' ', 4)
         tcode, x, y, size, text = \
                args[0], int(args[1]), int(args[2]), int(args[3]), args[4]
         if tcode not in 'BCT':
             raise Exception('invalid menu entry type code: ' + tcode)
 
+        # Fudge for supporting different TV standards: scale the dimensions.
+        # Really we should apply both xscale and yscale to the font, but GD
+        # assumes square pixels.
+        size = int(size * yscale)
+        x = int(x * xscale)
+        y = int(y * yscale)
+
         norm_image.string_ttf(font_name, size, 0, (x, y), text, norm_colour)
 
         if tcode != 'T':
@@ -127,9 +138,12 @@
                                   high_colour)
             sel_image.string_ttf(font_name, size, 0, (x, y), text, sel_colour)
 
-            # Update button dimensions
+            # Update and validate button dimensions
             _, _, new_x1, new_y1, _, _, new_x0, new_y0 = \
                norm_image.get_bounding_rect(font_name, size, 0, (x, y), text)
+            if new_x0 < 0 or new_y0 < 0 or new_x1 >= width or new_y1 >= height:
+                raise Exception(
+                    'text "' + text + '" does not fit within the frame')
             x0, y0 = min(x0, new_x0), min(y0, new_y0)
             x1, y1 = max(x1, new_x1), max(y1, new_y1)
 
diff -ur debconf5-dvd-0.4/README debconf5-dvd/README
--- debconf5-dvd-0.4/README	2005-08-02 21:38:04.000000000 +0100
+++ debconf5-dvd/README	2005-08-04 18:48:47.083383132 +0100
@@ -9,6 +9,7 @@
 - mjpegtools (availale from Marillat)
 - mpegdemux
 - mkisofs
+- netpbm (for NTSC only)
 - python
 - python-gd
 - ttf-bitstream-vera

Reply to: