Log in

View Full Version : Abdvde (A Better DVD Encoder)


Pages : 1 [2]

XAvAX
31st December 2009, 11:55
I'm on Exherbo, and there's no package for subtitle2vobsub. Also, none of the versions I found online were either maintained OR compilable. Thus, I modified abdvde_encode_subtitles to make use of mplayer's -vobsubout parameter, which eliminated the need for subtitle2vobsub.

function abdvde_encode_subtitles
{
echo "abdvde_encode_subtitles" >>"$LOG"
if ! $RIP_SUBTITLES; then
return
fi
printf "Encoding subtitle streams: "
case "$CONTAINER" in
"mkv")
for INDEX in `mplayer dvd://$TITLE -dvd-device "$INPUT" -v -vo null -nosound -frames 10 2>>"$LOG" | grep "( sid )" | sed -r "s/subtitle \\( sid \\): ([0-9]).*/\\1/"`; do
local SID="$INDEX"
INDEX=`mplayer dvd://$TITLE -dvd-device "$INPUT" -v -vo null -nosound -frames 10 2>>"$LOG" | grep "subtitle ( sid ): $SID"`
local LANGUAGE=`printf "$INDEX" | sed -r "s/.*language: ([a-z]+)/\\1/"`
if [ "$LANGUAGE" = "unknown" ]; then
LANGUAGE="und"
fi
local TRACK=$(( 32 + $SID ))
printf " $LANGUAGE"
mencoder -dvd-device "$INPUT" dvd://$TITLE -oac copy -ovc copy -o /dev/null -ifo "$TMP/extracted/VTS_01_0.IFO" -sid $SID -vobsubout "$TMP/mux/subtitles.$TRACK.$LANGUAGE"
done
;;
"ogm")
for STREAM in "$TMP/extracted/subtitles"*; do
if [ "$STREAM" = "$TMP/extracted/subtitles*" ]; then
break
fi
printf "$LANGUAGE ";
local TRACK=`printf "$STREAM" | sed -r "s/.*subtitles\\.([0-9]+)\\.([a-z]+)\\.ps1/\\1/"`
local LANGUAGE=`printf "$STREAM" | sed -r "s/.*subtitles\\.[0-9]+\\.([a-z]+)\\.ps1/\\1/"`
if [ "$STREAM" = "$TMP/extracted/subtitles/*" ]; then
break
fi
cat "$STREAM" | subtitle2pgm -o "$TMP/subtitles.$TRACK.$LANGUAGE"
case "$LANGUAGE" in
"en"|"fr"|"de") pgm2txt -v -f $LANGUAGE "$TMP/subtitles.$TRACK.$LANGUAGE";;
*) pgm2txt -v "$TMP/subtitles.$TRACK.$LANGUAGE";;
esac
ispell "$TMP"/subtitles*.txt
srttool -s -w -i "$TMP/subtitles.$TRACK.$LANGUAGE.srtx" -o "$TMP/mux/subtitles.$TRACK.$LANGUAGE.srt"
done
;;
esac
printf "\n"
}

I had to pull the case outside the loop to do it, but there might be a better way. I was just hacking it to get it running. Other than that, the filestat etc. problems addressed above were the only issues I found. Thanks for a great tool!

jajasdad
8th January 2010, 19:59
I have just noticed that x264 encoded files, using the default settings, now (V 2.01) appear to be much larger than before (V 1.6) with the defaults. Encoding in x264 before resulted in files approx 50 % smaller, now they are similar to the original mpeg2 VOBU

A simple test file was

VOBU 28.8 MB, x264 before 14.9 MB, x264 now 26.6 MB

I'd assume that the var X264_BITRATE="50%" would reduce the filesize by half in encoding. Is this no longer taking effect ?

Dinominant
8th January 2010, 20:23
One of the changes in 2.0.0.0 was to copy the streams unmodified by default. If you set the codec to x264 then it'll re-encode the video stream to 50% of the original bitrate just like 1.6 did.

# Which video codec to use. The default value is "copy"
# VIDEO_CODEC="copy"
VIDEO_CODEC="x264"

jajasdad
9th January 2010, 01:02
I had actually set the x264 parameter. Sorry was not clear when I mentioned defaults. Should have said defaults and x264. I can see it doing the 3 passes for x264, but still the bigger file.

Is there something I can check to see if the parameter is being passed when the encoding is performed. I had echoed the mkvmerge parameters previously when I had issues, but not sure what the appropriate line would be in your script.

pass.log has the following in the top line , I don't know if this has any clues or is the relevant part for the encoding, but I can see bitrate as an option mentioned below .

#options: 720x464 fps=24000/1001 cabac=1 ref=16 deblock=1:0:0 analyse=0x3:0x133 me=hex subme=7 brdo=0 mixed_ref=1 me_range=16 chroma_me=1 trellis=0 8x8dct=1 cqm=0 deadzone=21,11 chroma_qp_offset=0 threads=1 nr=0 decimate=1 mbaff=0 bframes=16 b_pyramid=1 b_adapt=1 b_bias=0 direct=3 wpredb=1 bime=0 keyint=120 keyint_min=1 scenecut=40 rc=2pass bitrate=1748 ratetol=1.0 rceq='blurCplx^(1-qComp)' qcomp=0.60 qpmin=10 qpmax=51 qpstep=4 cplxblur=20.0 qblur=0.5 ip_ratio=1.40 pb_ratio=1.30