Archive for the 'GNU/Linux' Category

DVD ripping under GNU/Linux

Friday, July 15th, 2005

First identify the part of the dvd containing the video:
-Most of the time this is dvd://1
-If not try try dvd://2, dvd://3 etc.
-The command would be mplayer dvd://1 -dvd-device /dev/hd*
-* is your adress of the dvdrom

Get all the information of the movie:
-mplayer dvd://1 -dvd-device /dev/hd* -vo null -ao null -frames 0 -v 2>&1 | grep sid >log.txt && mplayer dvd://1 -dvd-device /dev/hdd -vo null -ao null -frames 0 -v 2>&1 | grep aid >>log.txt

Use vobcopy to copy the disc:
-vobcopy -l -t video.vob
-Make sure you’re dvd-drive is mounted or it may complain
-Copy the .IFO file beloning to the movie part (dvd://number) from pathtodvd/VIDEO_TS/VTS_number_0.ifo

Detect the black borders:
-mplayer video.vob -vf cropdetect
-Skip through the video to let it do it’s work
-Note the suggested crop values in log.txt

Detect the filelength (for I never see the credits)
-mplayer video.vob -osdlevel 3
-Skip to the end, note down the time where the video ends in log.txt
-If you want to include the credits, please ignore this step, it will cost quality though

Run the first pass of Xvid (fast):
-mencoder video.vob -endpos hh:mm:ss -nosound -o pass1.avi -sws 2 -vf crop=xxx:xxx:xx:xx,scale=576:320 -ovc xvid -xvidencopts pass=1:chroma_me:max_bframes=2:bvhq=1:vhq=1:trellis
-Your endpos is in your log.txt
-The cropvalue in in your log.txt

If the size of the first pass is reasonable, you can encode the audio and then run the second pass.
-The size is reasonable if the resulting video-only file has to be about < =30% smaller.
-Don't forget some MB for the audio
-If the resulting file has to be bigger, increase the resolution in steps of 32. For example try 640:352. Rerun the first pass with changed settings.
-If the compression would be higher than 30%, rerun the first pass with a denoise filter or decide to go for 2 CD's. Recommended denoise filter: hqdn3d=2:1:3 (Put it right after cropping with a ",")
-Based on the amount the video has to compress, choose a quality for the audio. I recommend using vorbis for movies. For hard to compress movies use vorbis at q0, otherwise stick to q2, or with real good compression q4. (Higher has no usage, for you won't possibly hear, if you insist just use the AC3 file)

Encode the audio:
-mplayer -vo null -vc dummy -ao pcm -aofile 2channels.wav video.vob -aid 128
-oggenc -q2 2channels.wav
-vorbisgain 2channels.ogg (Pumping up the volume without distortion)
-The -aid number you want is in your log.txt

Rip the subtitles:
-mencoder video.vob -ifo movie.ifo -vobsubout subtitles -vobsuboutindex 0 -sid 0 -ovc frameno -nosound
-for every extra subtitle you want to rip, increase vobsuboutindex with 1. With sid you can specify the languages found in your log.txt
-One subtitle usually costs you about 1,5 MB (compressed)
-Best way to measure the final size is to mux the subtitles only in a matroska file --> see end of instructions

Compute the bitrate:
vbr=(totalsize-audiosize-subtitlesize)*fps*8/frames
vbr=(734003200-62861936)*25*8/150750
vbr=870926

-These are examplevalues
-Bitrate is quite good, usually an undersize of about 1-2 MB.
-We’ll use this bitrate for the second pass

Run the second pass:
mencoder video.vob -endpos hh:mm:ss -nosound -o pass2.avi -sws 2 -vf crop=xxx:xxx:xx:xx,scale=576:320 -ovc xvid -xvidencopts pass=2:bitrate=870926:chroma_me:max_bframes=2:bvhq=1:vhq=1:trellis

Now mux it all together and check for audio sync:
-Use mkvtoolnix (mmg to start)
-Open from mmg: pass2.avi, 2channel.ogg and subtitle.idx
-Set aspect-ratio of the video according the information outputted at the end of pass1/2
-Mux!
-Check if the audio is in sync with mplayer (mplayer pass2.mkv)
-Use control + or control - to see if it’s getting better
-Redo the muxing with an other audio offset. This is positive if you used control +.

Enjoy your new quality rip!

Linux newbies

Saturday, June 4th, 2005

How to spot a Linux user who (recently) switched from Windows?

When something goes wrong, he reinstalls the whole system.

Fun with archaic machines

Tuesday, April 5th, 2005

My PentiumII sidekick-machine, avatar, was supposed to receive a CPU upgrade today with a Celeron 633 MHz CPU, but alas, PCB revision which supports CPUs faster than 400 MHz must be at least v2.0 and my mobo is only v1.7. Crap.

avatar had a nice uptime of 88 days, but then the HDD failure happened and it’s offline since then. 300 MHz have really did a nice job running fluxbox over TightVNC and monitoring the network with Cacti, among other things, including doing the print serving job… I must get a new hard drive for it.

Gentoo experimental script repository

Sunday, March 27th, 2005

…sounds like a ton of fun.

Gentoo in comparison

Sunday, March 27th, 2005

Windows: A car with everything welded shut and you can only buy MS Gasoline and MS Oil.

Other Linux Distros: You can run any brand of Gas or Oil but your parts all come from the same company. You can tinker with the engine (compile your own software) but it voids your warranty. It comes with leather seats but they don’t match with the rest of the interior.

Gentoo Linux: The car comes to you in pieces and once assembled, you find yourself constantly tuning the carbs, checking exhaust back pressure, tuning mixtures. You can choose any kind of seat covering, but if it is leather, you have to shoot the cow yourself. But perhaps the car is easier to drive and add new parts.

;)

(from Gentoo Forums)

sendxmpp

Saturday, March 26th, 2005

Nice application for sending all kinds of text (ie. cron outputs and warnings on machines you administer) directly to your JID or even chatroom!

Example:
[code]cat SOMETHING | sendxmpp -u SRC-USERNAME -p SRC-PASSWORD -j SRC-SERVER -t -s “SUBJECT” DST-USERNAME@DST-SERVER[/code]

New category, thinking of blogging in english

Sunday, March 20th, 2005

I added a new category today, GNU/Linux. There I’ll post stuff related to OSS and GNU/Linux, Gentoo especially. I’m doing some thinking whether to blog in english or not. The reason is simple: english-speaking blog visitors. Most serbian-speaking people can understand English very well and therefore there shouldn’t be any problems. The only problem is my grammar, but this blogging in english can only help. So, see you soon with some new posts.