|
|
2008-03-30
, 13:20
|
|
Posts: 103 |
Thanked: 157 times |
Joined on Feb 2007
@ Jyväskylä, Finland
|
#32
|

#!/bin/bash
#
# N800dvd.sh
#
# Usage: N800dvd.sh
#
TITLE=$1
clear
echo
echo ' ##################################################'
echo ' # #'
echo ' # Encode DVD for Nokia N800 #'
echo ' # #'
echo ' ##################################################'
echo
echo -n "DVD title number to be encoded? [$1]: "
read title_in
if [ "$title_in" != "" ]; then
TITLE=$title_in
fi
# Default values
ABR='128'
VBR='600'
ALANG='en'
AID='128'
SLANG='fi'
SID='1'
RES='400'
OUT=`echo -n "$TITLE" |sed 's/$/-N800.avi/g'`
VOP='0:0:0:0'
echo -n "Output file? [$OUT]: "
read out_in
if [ "$out_in" != "" ]; then
OUT=$out_in
fi
echo -n "Resolution (width)? [$RES]: "
read res_in
if [ "$res_in" != "" ]; then
RES=$res_in
fi
echo -n "Video bitrate? [$VBR]: "
read vbr_in
if [ "$vbr_in" != "" ]; then
VBR=$vbr_in
fi
echo -n "Audio bitrate? [$ABR]: "
read abr_in
if [ "$abr_in" != "" ]; then
ABR=$abr_in
fi
echo -n "Audio language code? [$ALANG]: "
read alang_in
if [ "$alang_in" != "" ]; then
ALANG=$alang_in
fi
echo -n "Subtitle language code? [$SLANG]: "
read slang_in
if [ "$slang_in" != "" ]; then
SLANG=$slang_in
fi
echo
echo "Crop black bars?"
echo "(y) Yes"
echo "(n) No"
echo -n "Select [n]: "
read crop
if [ "$crop" = "y" ]; then
echo
echo Press q to use that point as a croping value.
mplayer dvd://$TITLE -vf cropdetect -nosound -vo xv &>crop.tmp
sed -e :a -e '$q;N;4,$D;ba' crop.tmp > crop1.tmp
crop_line=$(sed q crop1.tmp)
crop_front=$(echo "$crop_line" | sed -re 's/^.+\=//')
VOP=$(echo "$crop_front" | sed s/..$//)
rm crop*.tmp 2>/dev/null
else
VOP='0:0:0:0'
fi
echo
echo Video crop area: $VOP
echo
echo ' ##################################################'
echo ' # #'
echo ' # Encoding (pass 1 of 2) #'
echo ' # #'
echo ' ##################################################'
echo
echo "Start time: $(date)"
rm -f divx2pass_$OUT.log 2>/dev/null
#nice -n 19 \
mencoder "dvd://$TITLE" \
-o "$OUT" \
-oac mp3lame -lameopts cbr:preset=$ABR -af volnorm=1 \
-passlogfile divx2pass_$OUT.log \
-vf field=0 \
-ovc lavc -lavcopts vcodec=mpeg4:vbitrate=$VBR:vpass=1:turbo \
-vf crop=$VOP,scale=$RES:-10 \
-ffourcc DIVX &>/dev/null \
-alang $ALANG -slang $SLANG \
-idx \
-subfont-text-scale 7 -spuaa 3 -subcp latin1 &>/dev/null
echo "End time: $(date)"
echo
echo ' ##################################################'
echo ' # #'
echo ' # Encoding (pass 2 of 2) #'
echo ' # #'
echo ' ##################################################'
echo
echo "Start time: $(date)"
#nice -n 19 \
mencoder "dvd://$TITLE" \
-o "$OUT" \
-oac mp3lame -lameopts cbr:preset=$ABR -af volnorm=1 \
-passlogfile divx2pass_$OUT.log \
-vf field=0 \
-ovc lavc -lavcopts vcodec=mpeg4:vbitrate=$VBR:mbd=2:vpass=2 \
-vf crop=$VOP,scale=$RES:-10 \
-ffourcc DIVX \
-alang $ALANG -slang $SLANG \
-idx \
-subfont-text-scale 7 -spuaa 3 -subcp latin1 &>/dev/null
rm -f divx2pass_$OUT.log 2>/dev/null
echo "End time: $(date)"
echo
echo ' ##################################################'
echo ' # #'
echo ' # Encoding completed #'
echo ' # #'
echo ' ##################################################'
echo
|
|
2008-03-30
, 18:48
|
|
|
Posts: 2,535 |
Thanked: 6,681 times |
Joined on Mar 2008
@ UK
|
#33
|
tablet-encode -o -m-alang -mzh -m-slang -men in.avi out.avi
| The Following User Says Thank You to Jaffa For This Useful Post: | ||
|
|
2008-03-30
, 19:38
|
|
Posts: 103 |
Thanked: 157 times |
Joined on Feb 2007
@ Jyväskylä, Finland
|
#34
|
* Auto-cropping using cropdetect is possible, but why've you got videos with encoded black bars in them anyway? ;-) I'll look into it for the next version.
Thank you for looking it.* Original aspect ratio can be maintained with --original-aspect (-o).
* -alang is passed through for auto-detected DVDs, based on $LANG. I'll look at doing it more often.
* --mencoder=ARGn should work, e.g.:
Code:tablet-encode -o -m-alang -mzh -m-slang -men in.avi out.avi
|
|
2008-03-30
, 19:41
|
|
|
Posts: 2,535 |
Thanked: 6,681 times |
Joined on Mar 2008
@ UK
|
#35
|
Yeah, those crappy 1:2.35 DVDs why they just don't make all those in 4:3 full screenThank you for looking it.
|
|
2008-05-22
, 16:04
|
|
|
Posts: 201 |
Thanked: 88 times |
Joined on Aug 2007
@ San Francisco, CA
|
#36
|

)
|
|
2008-05-23
, 08:50
|
|
|
Posts: 2,535 |
Thanked: 6,681 times |
Joined on Mar 2008
@ UK
|
#37
|
| The Following User Says Thank You to Jaffa For This Useful Post: | ||
|
|
2008-05-24
, 18:47
|
|
|
Posts: 201 |
Thanked: 88 times |
Joined on Aug 2007
@ San Francisco, CA
|
#38
|
#!/bin/bash
TEMPFILE=`mktemp`
rm $TEMPFILE
mplayer "$1" -ao pcm:fast:file=$TEMPFILE -vc null -vo null
~/bin/tablet-encode --preset mplayer -m-audiofile -m$TEMPFILE --gui $1 $2
rm $TEMPFILE
|
|
2008-07-15
, 08:17
|
|
Posts: 3 |
Thanked: 0 times |
Joined on Jul 2008
|
#39
|
You can use the new ~/.tablet-encode.conf feature to use these as standard, if desired.Code:tablet-encode -o -m-alang -mzh -m-slang -men in.avi out.avi
|
|
2008-07-15
, 12:21
|
|
|
Posts: 2,535 |
Thanked: 6,681 times |
Joined on Mar 2008
@ UK
|
#40
|
I can't seem to get the syntax of this file down. Could you post an example, converting the code above into the .tablet-encode.conf format as a further example?
$options{'original-aspect'} = 1;
$options{'mencoder'} = [qw(-alang zh -slang en)];
http://www.maemopeople.org/index.php...uch_improved_d
To set the default preset and to always enable 770-compatibility mode, create ~/.tablet-encode.conf and put in it:
$options{770} = 1; $defaultPreset = 'good';Let me know if you have any problems.
Andrew Flegg -- mailto:andrew@bleb.org | http://www.bleb.org