# http://www.berklix.com/~jhs/dots/.acidriprc.src
# cd ~/.DOTS ; make .acidriprc
# Warning acidrip does not recognise either # or !
#	in 1st column as a comment delimeter, & just interprets every line
#	so the settings take value of last line, so this is filtered by
#	~/DOTS/Makefile
# See also
#	re. mencoder:	~/.mplayer/config
#	http://www.berklix.com/~jhs/
#		txt/dvd/acidrip/
#		txt/dvd/formats/
#		src/bsd/fixes/FreeBSD/ports/gen/multimedia/acidrip/files/
#	man lsdvd,
#	man mencoder.
#	/usr/ports/multimedia/acidrip
# -----------------------------------------------------------------------------
# Input Device or directory,
# Best specify a directory, though it still also reads the device.
dvd_device		= /cdrom
#	DEFAULT:	= /dev/acd0
#			= ./
#			= film.iso
#			= output_directory_from_vobcopy-m_slash_VIDEO_TS
# -----------------------------------------------------------------------------
filesize		= 1500
#	DEFAULT:	= 700
#			= 1500 is a good value to do a 1.5 hour film,
#				but reduce it for a DVD containing
#				6 half hour episodes, else one ends up with
#				6 x 1.2 G ie very little compression.
#			= 500 is good to set to for half hour episodes,
#			  though they come out at 540 Meg each.
# -----------------------------------------------------------------------------
# Output
filename		= %T-%N-%L-%wx%h
#	DEFAULT:	= /home/jhs/%T
#	Hover the mouse over & it lists what they mean.
# -----------------------------------------------------------------------------
audio_codec		= mp3lame
#	DEFAULT:	= mp3lame
# -----------------------------------------------------------------------------
audio_mp3lame_options	= abr:br=128
#	DEFAULT:	= abr:br=128
# -----------------------------------------------------------------------------
audio_lavc_options	= acodec=mp3:abitrate=128
#	DEFAULT:	= acodec=mp3:abitrate=128
# -----------------------------------------------------------------------------
# Output Formats:	See http://www.berklix.com/~jhs/txt/dvd/formats/
# -----------------------------------------------------------------------------
video_codec		= xvid
#	DEFAULT:	= lavc
#			= xvid
# xvid + file command after:
#	720x-2.avi:	RIFF (little-endian) data, AVI, 720 x 406, 25.00 fps,
#		video: XviD, audio: Dolby AC3 (stereo, 48000 Hz)
# lavc:
#	acidrip Video --> Options automatically acquires:
#		codec=mpeg4:vhq:v4mv:vqmin=2
# lavc + file command after:
#	720x-2.avi:	RIFF (little-endian) data, AVI, 720 x 406, 25.00 fps,
#		video: FFMpeg MPEG-4, audio: Dolby AC3 (stereo, 48000 Hz)
#	I had it at lavc when I generated "MPEG sequence, v2, program multiplex"
# -----------------------------------------------------------------------------
scale_enable		= 1
#	DEFAULT:	= 1
# -----------------------------------------------------------------------------
autoload		= 0
#	DEFAULT:	= 0
# -----------------------------------------------------------------------------
mpegfile		= 1
#	DEFAULT:	= 0
#	This is set to 1 by clicking General --> Filename .avi/.mpg to .mpg
#	I had it at 1 when I generated "MPEG sequence, v2, program multiplex"
# -----------------------------------------------------------------------------
eject			= 0
#	DEFAULT:	= 0
# -----------------------------------------------------------------------------
scale_auto		= 1
#	DEFAULT:	= 1
# -----------------------------------------------------------------------------
scale_height		= -2
#	DEFAULT:	= -2
#	See also scale_width.
#	I have seen all of: 720 x 404, 720 x 406, 720 x 540
#	Man acidrip mentions: 720x568 for PAL, 720x480 for NTSC)
# -----------------------------------------------------------------------------
scale_width		= 720
#	DEFAULT:	= 480
#	2009.10.23	= 720
#	This parameter is shown by file command on the .avi.
# -----------------------------------------------------------------------------
crop_enable		= 1
#	DEFAULT:	= 1
# -----------------------------------------------------------------------------
# language		= English -aid 128
language		= English
#	DEFAULT:	= English
#		Is "English" inappropriate to a DVD ? do I need "en"
#		See man acidrip.
#	2009.10.23 I had = 3
#		What could that have been ?
# "-aid 128" as used 2011.01.04:
#	It's probably a bad idea to leave this on all the time,
#	but useful at times, to select a different audio stream than default.
#	lsdvd showed:
#		Audio streams: 04.
#	with
#		Real sound effects I wanted on 1.
#		Unwanted music on 3 others.
#	Elta 8883 hardware player could play it on TV with just sound effects,
#		( though I probably had to select audio channel,
#		  & maybe Elta 8883 memorised that).
#	Some tool name forgotten:
#		"Found audio stream" in non sorted order: 129 128 130 131.
#	lsdvd -a
#		{ 4 x "Language: de - Deutsch",
#			3 x "Channels: 2" + 1 x "Channels: 6" }
#		Stream id: 0x80, 0x81, 0x82, 0x83
#	man mplayer # VOB(AC-3):	128-159	.... toggle tracks with '#'
#	mplayer		# default audio played with unwanted music
#	mplayer -aid 128 VTS_04*VOB	just wanted sound effects
#	mplayer -aid 129 VTS_04*VOB	faint sound effects + unwanted music
# -----------------------------------------------------------------------------
mencoder		= nice nice mencoder
#	DEFAULT:	= mencoder
# -----------------------------------------------------------------------------
mplayer			= mplayer
#	DEFAULT:	= mplayer
# -----------------------------------------------------------------------------
lsdvd			= lsdvd
#	DEFAULT:	= lsdvd
# -----------------------------------------------------------------------------
tooltips		= 1
#	DEFAULT:	= 1
# -----------------------------------------------------------------------------
video_passes		= 3
#	DEFAULT:	= 1
#			= 3
# -----------------------------------------------------------------------------
video_bitrate_lock	= 0
#	DEFAULT:	= 0
# -----------------------------------------------------------------------------
# JJLATER Try to generate as jes@ .vob: MPEG sequence, v2, program multiplex
# -----------------------------------------------------------------------------
lavc_options		= vcodec=mpeg4:vhq:v4mv:vqmin=2
#	DEFAULT:	= vcodec=mpeg4:vhq:v4mv:vqmin=2
# Fails:		= vcodec=mpeg2:vhq:v4mv:vqmin=2
#	Error:		"Cannot find codec 'mpeg2' in libavcodec"
# -----------------------------------------------------------------------------
# xvid_options
#	DEFAULT:	Not set.
#	If you specify eg
#		xvid_options = abcde it shows up as:
#	mencoder ... -xvidencopts abcde:bitrate=5000:pass=1 "
# xvid_options		= vcodec=mpeg2
#			  vcodec=mpeg2video
# -----------------------------------------------------------------------------
#	man mencoder also talks about: harddup & softskip.
#	-of mpeg
#	-mpegopts format=mpeg2
#	-noskip
# -----------------------------------------------------------------------------
total_blocks		= 1
#	DEFAULT:	= 1
# -----------------------------------------------------------------------------
overwrite		= 1
#	DEFAULT:	= 0
# -----------------------------------------------------------------------------
cache			= 1
#	DEFAULT:	= 0
#	It caches the last queued item first.
#	It caches all quedued tracks before encoding any into frameno.avi.
#	The format of cached files, file reported as:
#		MPEG sequence, v2, program multiplex
#	The cache size needed is same size as the DVD.
#	Cache is useful if one needs to remove DVD from a system quickly).
#	I checked umount does work after caching completed
#	The encoding does the (first queued =) lowest track number first.
#	Cache files auto delete after encoding.
# -----------------------------------------------------------------------------
cache_directory	= /av/video/tmp/acidrip-cache
#	DEFAULT:	= /tmp/
# -----------------------------------------------------------------------------
vf_pre_enable		= 1
#	DEFAULT:	= 1
# -----------------------------------------------------------------------------
audio_gain		= 0
#	DEFAULT:	= 0
# -----------------------------------------------------------------------------
vf_post_enable		= 0
#	DEFAULT:	= 0
# -----------------------------------------------------------------------------
vf_pre			= pp=de
#	DEFAULT:	= pp=de
# -----------------------------------------------------------------------------
del_cache		= 1
#	DEFAULT:	= 0
# -----------------------------------------------------------------------------
ppc_bug			= 0
#	DEFAULT:	= 0
# -----------------------------------------------------------------------------
compact			= 1
#	DEFAULT:	= 1
#	1 compacts to a smaller window while encoding
# -----------------------------------------------------------------------------
flickbook_preview	= 0
#	DEFAULT:	= 0
# -----------------------------------------------------------------------------
enforce_space		= 1
#	DEFAULT:	= 1
# -----------------------------------------------------------------------------
vobsubout		= 0
#	DEFAULT:	= 0
# -----------------------------------------------------------------------------
video_bitrate		= 0
#	DEFAULT:	= 0
#	2009.10.23	= 1721
# -----------------------------------------------------------------------------
ui_language		= English
#	DEFAULT:	= English
# -----------------------------------------------------------------------------
#	I guess 25.00 fps comes from mencoder by default.
# -----------------------------------------------------------------------------
#	Default output with no config file:
#		video: FFMpeg MPEG-4, audio: MPEG-1 Layer 3 (stereo, 48000 Hz)
#	What I've received from elsewhere:
#		~30 fps, video: XviD, audio: MPEG-1 Layer 3 (stereo, 48000 Hz
#	What I tend to produce:
#		video: XviD, audio: Dolby AC3 (stereo, 48000 Hz
# -----------------------------------------------------------------------------
# Log when I generated "MPEG sequence, v2, program multiplex" with lavc
#	I've ripped this 2 times, same output, 145,524,736 bytes,
#		plays OK for about 7 min 22 secs.
#	mencoder /av/title-8:07:12-720x-2-cache
#		-oac mp3lame
#		-lameopts abr:br=128
#		-alang English
#		-aid 128
#		-ovc frameno
#		-o frameno.avi
#	mencoder /av/title-8:07:12-720x-2-cache
#		-oac copy
#		-ovc lavc
#		-lavcopts vcodec=mpeg4:vhq:v4mv:vqmin=2:vbitrate=5000:vpass=1
#		-vf pp=de,crop=0:0:0:0,scale=720:-2
#		-alang English
#		-aid 128
#		-of mpeg
#		-o "/dev/null"
#	mencoder /av/title-8:07:12-720x-2-cache
#		-oac copy
#		-ovc lavc
#		-lavcopts vcodec=mpeg4:vhq:v4mv:vqmin=2:vbitrate=5000:vpass=2
#		-vf pp=de,crop=0:0:0:0,scale=720:-2
#		-alang English
#		-aid 128
#		-of mpeg
#		-o "title-8:07:12-720x-2.mpg"
# Log when I generated "MPEG sequence, v2, program multiplex" with xvid
#	Same 1st pass as above then:
#	I've ripped this 3 times, same output, 12,107,776
#	it plays for 56 seconds & exits.
#	mencoder /av/title-8-0:07:12-720x-2-cache
#		-oac copy
#		-ovc xvid
#		-xvidencopts bitrate=5000:pass=1
#		-vf pp=de,crop=0:0:0:0,scale=720:-2
#		-alang English
#		-aid 128
#		-of mpeg
#		-o "/dev/null"
#			Lots of ERROR: scr 98.832, dts 99.520, pts 50.040
#	mencoder /av/title-8-0:07:12-720x-2-cache
#		-oac copy
#		-ovc xvid
#		-xvidencopts bitrate=5000:pass=2
#		-vf pp=de,crop=0:0:0:0,scale=720:-2
#		-alang English
#		-aid 128
#		-of mpeg
#		-o "title-8-0:07:12-720x-2.mpg"
#			Lots of ERROR: scr 99.141, dts 99.840, pts 50.120
# Question: Where does output of pass1 go, that is used by pass2 ?
#	Does mencoder modify source data between pass1 & pass2 ?
# -----------------------------------------------------------------------------
# experiment with mpegfile = 1 video_codec = xvid
#	twice it has truncated on dev errors,
# Now rerunning with lavc mpg
# -----------------------------------------------------------------------------
# acidrip shows more file type info than the file command,
# the file type can not be mouse copied though, so manually copied example:
#    V: MPEG2 720x576 9800kbps
#    A: ffac3 384kbps @ 48kHz 2ch
# file *.vob just shows: MPEG sequence, v2, program multiplex
# -----------------------------------------------------------------------------
