9 Commits

Author SHA1 Message Date
agibert
b9d49db500 - Fix 4.0.0-1 release date. 2010-02-17 11:19:34 +00:00
agibert
d7d7496111 - Add in 4.0.0-1 release entry:
- Add documentation into ReadMe.txt file.
2010-02-17 11:03:43 +00:00
agibert
4987b66352 - Improve documentation ! 2010-02-17 11:01:10 +00:00
agibert
3d6cf1a412 - Remove outdated barry_lyndon and cobra examples. 2010-02-16 14:59:03 +00:00
agibert
2b5d59a928 - Add in 4.0.0-1 release entry:
- Fix audio encoding in vfp mode and in 2a or 2s video mode,
	- Fix video aspect by using "-force-avi-aspect".
2010-02-16 14:38:56 +00:00
agibert
1e50d14892 - Fix audio encoding in fvp mode and 2a or 2s video mode,
- Fix video aspect by using "-force-avi-aspect".
2010-02-16 14:29:56 +00:00
agibert
b8429d3d99 - Fix broken audio compress only mode (audio=ap & video=n). 2009-10-20 07:08:49 +00:00
agibert
9e72c0a187 - Add x264 codec support,
- Add extra vcodec option support (vopts),
- Add volume control option.
2009-05-23 00:09:55 +00:00
agibert
4466a01b8c Add id support in -alang option. 2009-02-25 18:04:40 +00:00
5 changed files with 204 additions and 88 deletions

View File

@@ -1,7 +1,7 @@
# $RCSfile: ReadMe.txt,v $
# $Revision: 1.1 $
# $Revision: 1.2 $
# $Name: $
# $Date: 2004/06/05 13:29:40 $
# $Date: 2010/02/17 11:01:10 $
# $Author: agibert $
@@ -12,7 +12,113 @@ Welcome to DVD2DivX !
This little shell script is designed for automatise DVD ripping. It uses the great encoder program 'mencoder' from 'mplayer' package.
Please read the example file and the comment in the dvd2divx file.
It currently mainly support:
- direct or buffured extraction,
- mp3 audio encoding,
- none or one audio pass,
- audio resampling,
- audio volume correction,
- none, one or two video passes,
- lavc, xvid and x264 codecs,
- video resizing,
- video aspect correction,
- video de-interlacement,
- video quality setup profiles,
- subtitles,
- multi-threading.
Usage:
------
dvd2divx divx_root divx_title input dvd_device dvd_title chapter angle alang slang audio abr asrate stereo volume sub video vcodec vqual vbr crop xsize aspect deint threads vopts
input options:
input: input mode: d | db | dbo | b
d: read directly from disk,
db: bufferize and continue,
dbo: bufferize only,
b: read from a preexisting buffer
dvd_device: input device or file: - | /dev/dvd | ...
-: none
/dev/dvd: dvd device,
...
title: dvd title number
chapter: dvd chapter number
angle: dvd angle number
alang: audio language name or id: - | en | fr | 0 | 1 | ...
-: none,
en: english,
fr: french,
0: id 0,
1: id 1,
...
slang: subtitles language name or id: - | en | fr | 0 | 1 | ...
-: none,
en: english,
fr: french,
0: id 0,
1: id 1,
...
audio options:
audio: audio mode: ap | avp | fvp | n
ap: compress audio during audio pass
avp: compress audio during all video pass
fvp: compress audio during final video pass
n: use input audio stream)
abr: audio bit rate
asrate: audio sampling rate: - | xxx
-: no resampling
...: sampling rate
stereo: audio stereo mode: y | n
y: stereo
n: mono
volume: audio volume gain in db: - | ...
-: no change,
...: gain in db
subtitles option:
sub: subtitles mode: - | f | o
-: no subtitles,
f: file subtitles,
o: OSD subtitles
video options:
video: video mode: 1 | 2a | 2s | n
1: compress video in 1 pass,
2a: compress video in 2 assymetric passes,
2s: compress video in 2 symetric passes,
n: use input video stream
vcodec: video codec: - | lavc | xvid | x264
vquality: video quality profile: 0 | 1 | 2 | 3
0: realtime,
1: fast,
2: High quality,
3: very high quality
vbr: video bit rate
crop: cropping size: - | width:height:x:y
-: no cropping,
width:height:x:y: copping area
xsize: video x size: - | ...
aspect: video aspect: - | 4/3 | 16/9 | ...
deint: deinterlace video: y | n
threads: thread number: - | 1 | ...
vopts: extra video codec options: - | ...
Batch usage example:
--------------------
# divx_root divx_title input dvd_device dvd_title chapter angle alang slang audio abr asrate stereo volume sub video vcodec vqual vbr crop xsize aspect deint threads vopts
#---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
dvd2divx cobra 1 dbo /dev/cdrom1 10 1- 1 fr - - - - - - - - - - - - - - - -
dvd2divx cobra 1 b - - - - - - fvp 128 - n 10 - 2a xvid 3 1000 - 480 4/3 y 4 cartoon

View File

@@ -1,7 +1,7 @@
# $RCSfile: ReleaseNotes.txt,v $
# $Revision: 1.6 $
# $Revision: 1.10 $
# $Name: $
# $Date: 2009/01/06 00:17:12 $
# $Date: 2010/02/17 11:19:34 $
# $Author: agibert $
@@ -9,13 +9,22 @@
--------------------------------------------------------------------------------
dvd2divx V 4.0.0-1 - A. Gibert - 2000/01/05
dvd2divx V 4.0.0-1 - A. Gibert - 2010/02/17
--------------------------------------------------------------------------------
- Major code rewrite,
- New command line interface,
- Args major reorganisation,
- New video quality presetings (vqual).
- Add x264 codec support,
- New video quality presetings (vqual),
- Add crop support,
- Add OSD sub title support,
- Add extra vcodec option support (vopts),
- Add id support in alang option,
- Add volume control option,
- Fix audio encoding in vfp mode and in 2a or 2s video mode,
- Fix video aspect by using "-force-avi-aspect",
- Add documentation into ReadMe.txt file.

View File

@@ -1,15 +0,0 @@
#!/bin/bash
# dvd_device divx_root divx_title dvd_title chapter angle alang slang vcodec vbr abr xsize aspect stereo asrate deint buffer apass vpass threads
#--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
# Mono Instance
#dvd2divx - barry_lyndon 1 1 1-24 1 fr - - - - - - - - - o - - -
#dvd2divx - barry_lyndon 2 1 25- 1 fr - - - - - - - - - o - - -
#dvd2divx - barry_lyndon 1 - - - - - lavc 920 128 480 4/3 y - n s y 2 4
#dvd2divx - barry_lyndon 2 - - - - - lavc 920 128 480 4/3 y - n s y 2 4
#
# Multi Instance
dvd2divx - barry_lyndon 1 1 1-24 1 fr - - - - - - - - - o - - -
dvd2divx - barry_lyndon 2 1 25- 1 fr - lavc 920 128 480 4/3 y - n s y 2 4 &
dvd2divx - barry_lyndon 1 - - - - - lavc 920 128 480 4/3 y - n s y 2 4 &
wait

View File

@@ -1,34 +0,0 @@
#!/bin/bash
# dvd_device divx_root divx_title dvd_title chapter angle alang slang vcodec vbr abr xsize aspect stereo asrate deint buffer apass vpass threads
#--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#dvd2divx /dev/cdrom1 cobra 1 10 1- 1 fr - - - - - - - - - o - - -
#dvd2divx /dev/cdrom1 cobra 2 11 1- 1 fr - - - - - - - - - o - - -
#dvd2divx /dev/cdrom1 cobra 3 12 1- 1 fr - - - - - - - - - o - - -
#dvd2divx /dev/cdrom1 cobra 4 13 1- 1 fr - - - - - - - - - o - - -
#dvd2divx /dev/cdrom1 cobra 5 14 1- 1 fr - - - - - - - - - o - - -
#dvd2divx /dev/cdrom1 cobra 6 15 1- 1 fr - - - - - - - - - o - - -
#dvd2divx - cobra 1 - - - - - xvid 1000 128 480 4/3 n - y s y 2 4
#dvd2divx - cobra 2 - - - - - xvid 1000 128 480 4/3 n - y s y 2 4
#dvd2divx - cobra 3 - - - - - xvid 1000 128 480 4/3 n - y s y 2 4
#dvd2divx - cobra 4 - - - - - xvid 1000 128 480 4/3 n - y s y 2 4
#dvd2divx - cobra 5 - - - - - xvid 1000 128 480 4/3 n - y s y 2 4
#dvd2divx - cobra 6 - - - - - xvid 1000 128 480 4/3 n - y s y 2 4
#dvd2divx /dev/cdrom1 cobra 13 10 1- 1 fr - xvid 1000 128 480 4/3 n - y s y 2 4
#dvd2divx /dev/cdrom1 cobra 14 11 1- 1 fr - xvid 1000 128 480 4/3 n - y s y 2 4
#dvd2divx /dev/cdrom1 cobra 15 12 1- 1 fr - xvid 1000 128 480 4/3 n - y s y 2 4
#dvd2divx /dev/cdrom1 cobra 16 13 1- 1 fr - xvid 1000 128 480 4/3 n - y s y 2 4
#dvd2divx /dev/cdrom1 cobra 17 14 1- 1 fr - xvid 1000 128 480 4/3 n - y s y 2 4
#dvd2divx /dev/cdrom1 cobra 18 15 1- 1 fr - xvid 1000 128 480 4/3 n - y s y 2 4
#dvd2divx /dev/cdrom1 cobra 19 10 1- 1 fr - xvid 1000 128 480 4/3 n - y s y 2 4
#dvd2divx /dev/cdrom1 cobra 20 10 3- 1 fr - xvid 1000 128 480 4/3 n - y s y 2 4
#dvd2divx /dev/cdrom1 cobra 21 10 5- 1 fr - xvid 1000 128 480 4/3 n - y s y 2 4
#dvd2divx /dev/cdrom1 cobra 22 10 7- 1 fr - xvid 1000 128 480 4/3 n - y s y 2 4
#dvd2divx /dev/cdrom1 cobra 23 10 9- 1 fr - xvid 1000 128 480 4/3 n - y s y 2 4
#dvd2divx /dev/cdrom1 cobra 24 10 11- 1 fr - xvid 1000 128 480 4/3 n - y s y 2 4
#dvd2divx /dev/cdrom1 cobra 31 10 13- 1 fr - xvid 1000 128 480 4/3 n - y s y 2 4
dvd2divx - cobra pre2 11 1 1 fr - xvid 1000 128 480 4/3 n - y s y 2 4
dvd2divx - cobra post2 11 2- 1 fr - xvid 1000 128 480 4/3 n - y s y 2 4

114
dvd2divx
View File

@@ -5,9 +5,9 @@
# (C) 2004-2009 Arnaud G. Gibert
#-----------------------------------------------------------------------------------------------------------------------------------
# $RCSfile: dvd2divx,v $
# $Revision: 1.7 $
# $Revision: 1.12 $
# $Name: $
# $Date: 2009/02/17 08:29:55 $
# $Date: 2010/02/17 11:01:10 $
# $Author: agibert $
#-----------------------------------------------------------------------------------------------------------------------------------
@@ -32,10 +32,10 @@
# Usage exemple
#-----------------------------------------------------------------------------------------------------------------------------------
# #!/bin/bash
# # divx_root divx_title input dvd_device dvd_title chapter angle alang slang audio abr asrate stereo sub video vcodec vqual vbr crop xsize aspect deint threads
# #-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
# dvd2divx cobra 1 dbo /dev/cdrom1 10 1- 1 fr - - - - - - - - - - - - - - -
# dvd2divx cobra 1 b - - - - - - fvp 128 - n - 2a xvid 3 1000 - 480 4/3 y 4
# # divx_root divx_title input dvd_device dvd_title chapter angle alang slang audio abr asrate stereo volume sub video vcodec vqual vbr crop xsize aspect deint threads vopts
# #---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
# dvd2divx cobra 1 dbo /dev/cdrom1 10 1- 1 fr - - - - - - - - - - - - - - - -
# dvd2divx cobra 1 b - - - - - - fvp 128 - n 10 - 2a xvid 3 1000 - 480 4/3 y 4 cartoon
@@ -47,26 +47,27 @@ dvd_device=${4} # -|/dev/dvd|...
title=${5} #
chapter=${6} #
angle=${7} #
alang=${8} # en|fr|...
alang=${8} # -|en|fr|...|0|1|... (lang or id)
slang=${9} # -|en|fr|...|0|1|... (lang or id)
#------------------------------------------------------------------------------
audio=${10} # ap|avp|fvp|n (ap: compress audio during audio pass | avp: compress audio during all video pass | fvp: compress audio during final video pass | no: use input audio stream)
abr=${11} #
asrate=${12} # -|xxx (resample audio)
stereo=${13} # y|n
volume=${14} # -|... (volume gain)
#------------------------------------------------------------------------------
sub=${14} # -|f|o (-: no subtitles | f: file subtitles | o: OSD subtitles)
sub=${15} # -|f|o (-: no subtitles | f: file subtitles | o: OSD subtitles)
#------------------------------------------------------------------------------
video=${15} # 1|2a|2s|n (1: compress video in 1 pass | 2a: compress video in 2 assymetric passes | 2s: compress video in 2 symetric passes | no: use input video stream)
vcodec=${16} # -|lavc|xvid
vquality=${17} # 0|1|2|3 (0: realtime | 1: fast | 2: High quality | 3: very high quality)
vbr=${18} #
crop=${19} # -|width:height:x:y
xsize=${20} # -|...
aspect=${21} # -|4/3|16/9|...
deint=${22} # y|n
threads=${23} # -|1..
video=${16} # 1|2a|2s|n (1: compress video in 1 pass | 2a: compress video in 2 assymetric passes | 2s: compress video in 2 symetric passes | no: use input video stream)
vcodec=${17} # -|lavc|xvid|x264
vquality=${18} # 0|1|2|3 (0: realtime | 1: fast | 2: High quality | 3: very high quality)
vbr=${19} #
crop=${20} # -|width:height:x:y
xsize=${21} # -|...
aspect=${22} # -|4/3|16/9|...
deint=${23} # y|n
threads=${24} # -|1..
vopts=${25} # -|... # other vcodec options
#-----------------------------------------------------------------------------------------------------------------------------------
@@ -78,9 +79,9 @@ out_name=../$divx_root-$divx_title
echo "DivX: [$divx_name] title: ($title)"
echo "Input: [$input] device: [$dvd_device] title: ($title) chapter: ($chapter) angle: ($angle) alang: ($alang) slang: ($slang)"
echo "Audio: [$audio] abr: ($abr) asrate: ($asrate) stereo: ($stereo)"
echo "Audio: [$audio] abr: ($abr) asrate: ($asrate) stereo: ($stereo) volume: (${volume})"
echo "Sub: [$sub]"
echo "Video: [$video] vcodec: [$vcodec] vquality: [$vquality] vbr: ($vbr) crop: ($crop) xsize: ($xsize) aspect: ($aspect) deint: ($deint) threards: ($threads)"
echo "Video: [$video] vcodec: [$vcodec] vquality: [$vquality] vbr: ($vbr) crop: ($crop) xsize: ($xsize) aspect: ($aspect) deint: ($deint) threards: ($threads) vopts: [${vopts}]"
@@ -120,7 +121,20 @@ else
fi
fi
read_dvd_opt="$device_opt dvd://$title -chapter $chapter -dvdangle $angle -alang $alang $slang_opt"
if [ "$alang" != "-" ]
then
if [[ "$alang" == +([[:digit:]]) ]]
then
alang_opt="-aid $alang"
else
alang_opt="-alang $alang"
fi
else
alang_opt=""
fi
read_dvd_opt="$device_opt dvd://$title -chapter $chapter -dvdangle $angle $alang_opt $slang_opt"
read_buf_opt="$tmp_name"
case "$input"
@@ -153,7 +167,7 @@ if [ "$asrate" == "-" ]
then
aresample=""
else
aresample="-srate $asrate -af lavcresample=$asrate"
aresample="-srate $asrate -af-add lavcresample=$asrate"
fi
if [ "$stereo" == "y" ]
@@ -163,7 +177,14 @@ else
stereo_mode=3
fi
audio_comp_opt="-oac mp3lame -lameopts cbr:br=$abr:aq=0:mode=$stereo_mode $aresample"
if [ "${volume}" == "-" ]
then
vol_opt=""
else
vol_opt="-af-add volume=$volume:0"
fi
audio_comp_opt="-oac mp3lame -lameopts cbr:br=$abr:aq=0:mode=$stereo_mode $aresample $vol_opt"
audio_copy_opt="-oac copy"
if [ "$audio" != "n" ]
@@ -172,16 +193,21 @@ then
then
audio_opt1="$audio_comp_opt"
else
if [ "$audio" == "avp" ]
if [ "$video" != "n" ]
then
audio_opt1="$audio_comp_opt"
audio_opt2="$audio_comp_opt"
else
if [ "$audio" == "fvp" ]
if [ "$audio" == "avp" ]
then
audio_opt1="$audio_copy_opt"
audio_opt1="$audio_comp_opt"
audio_opt2="$audio_comp_opt"
else
if [ "$audio" == "fvp" ]
then
audio_opt1="$audio_copy_opt"
audio_opt2="$audio_comp_opt"
fi
fi
else
audio_opt1="$audio_comp_opt"
fi
fi
else
@@ -195,6 +221,8 @@ fi
# Video Setup
#-----------------------------------------------------------------------------------------------------------------------------------
gen_opt=""
video_lavc_header_11="-ovc lavc -lavcopts vcodec=mpeg4:vbitrate=$vbr"
video_lavc_header_21="-ovc lavc -lavcopts vcodec=mpeg4:vpass=1:vbitrate=$vbr"
video_lavc_header_22="-ovc lavc -lavcopts vcodec=mpeg4:vpass=2:vbitrate=$vbr"
@@ -213,6 +241,15 @@ video_xvid_body_1="turbo:vhq=0"
video_xvid_body_2="vhq=2:bvhq=1:chroma_opt:quant_type=mpeg"
video_xvid_body_3="chroma_opt:vhq=4:bvhq=1:quant_type=mpeg"
video_x264_header_11="-ovc x264 -x264encopts bitrate=$vbr"
video_x264_header_21="-ovc x264 -x264encopts pass=1:bitrate=$vbr"
video_x264_header_22="-ovc x264 -x264encopts pass=2:bitrate=$vbr"
video_x264_body_0=""
video_x264_body_1="subq=4:bframes=2:b_pyramid:weight_b"
video_x264_body_2="subq=5:8x8dct:frameref=2:bframes=3:b_pyramid:weight_b"
video_x264_body_3="subq=6:partitions=all:8x8dct:me=umh:frameref=5:bframes=3:b_pyramid:weight_b"
if [ "$video" != "n" ]
@@ -255,6 +292,7 @@ then
else
video_opt1=$video_opt1":aspect=$aspect"
video_opt2=$video_opt2":aspect=$aspect"
gen_opt="${gen_opt} -force-avi-aspect ${aspect}"
fi
if [ "$threads" != "-" ]
@@ -263,6 +301,12 @@ then
video_opt2=$video_opt2":threads=$threads"
fi
if [ "${vopts}" != "-" ]
then
video_opt1=$video_opt1":${vopts}"
video_opt2=$video_opt2":${vopts}"
fi
@@ -312,12 +356,18 @@ then
if [ "$video" == "1" ]
then
echo "Compressing DivX..."
mencoder $read_opt2 $audio_opt1 $video_opt1 $vf_opt -o $divx_name >$out_name.3.log 2>&1
mencoder $read_opt2 $gen_opt $audio_opt1 $video_opt1 $vf_opt -o $divx_name >$out_name.3.log 2>&1
else
echo "Compressing DivX pass 1..."
mencoder $read_opt2 $audio_opt1 $video_opt1 $vf_opt -o /dev/null >$out_name.3.log 2>&1
mencoder $read_opt2 $gen_opt $audio_opt1 $video_opt1 $vf_opt -o /dev/null >$out_name.3.log 2>&1
echo "Compressing DivX pass 2..."
mencoder $read_opt2 $audio_opt2 $video_opt2 $vf_opt -o $divx_name >$out_name.4.log 2>&1
mencoder $read_opt2 $gen_opt $audio_opt2 $video_opt2 $vf_opt -o $divx_name >$out_name.4.log 2>&1
fi
else
if [ "$audio" == "ap" ]
then
echo "Compressing DivX audio..."
mencoder $read_opt2 $gen_opt $audio_opt1 -ovc copy -o $divx_name >$out_name.3.log 2>&1
fi
fi