Script to rip DVD straight to AVI: Letitrip

Audio editors, music players, video players, burning software, etc.
Message
Author
User avatar
steve_s
Posts: 1595
Joined: Mon 26 May 2008, 13:29
Location: Austin, TX, USA
Contact:

Script to rip DVD straight to AVI: Letitrip

#1 Post by steve_s »

Each day I find more and more examples of how people don't think like me. Oh, well.

However, if, like me, you want to be able to watch DVD's on your little Pentium II laptop (IBM Thinkpad 600) every once in a while, then you need a quick way to rip movies from DVD's and shrink them down. The attached script is designed to do just that.

Unlike the rest of the world, Puppy Linux people tend to think more like I do, so someone may have already come up with another way to do this. If so, please chime in: I'd love to find ways to make my movie ripping easier.

I looked at pdvdrsab, but it ripped the movies in a format that I couldn't do a whole lot with if I wanted to edit them. Oh, and I had difficulty using -vob (it insisted I used -vf, which worked well. ) I also found pdvdrsab failed to rip for me much more frequently than mencoder did. Don't get me wrong; I still use pdvdrsab, but this script has helped make life easier.

I could (and sometimes do) rip movies using VLC media player, but that ripped them to an mpg format then I had to shrink them, etc. No matter the variations I used, VLC just didn't suit my needs.

So, after playing around with ffmpeg and mencoder, I came up with a little script that uses both of them and rips directly from the DVD, creates an .avi file (that can be played in the dreaded Windows Media Player if necessary and easily edited in Avidemux), and then uses mencoder to shrink down the .avi file, thus creating a total of two .avi files, one much smaller than the other.

What to do: if you want to run the script, this is the process I find easiest:

1. Initially, copy the script into geany (or whatever text editor you use), save it in your Movies folder, then, using rox-file manager, right click the script, changing the preferrences to make it executable ( you can do this other ways, but I find it is ridiculously easy in Puppy using rox to make scripts active, much easier than chmod'ing things).
2. Put in the dvd you want to rip in your dvd player.
3. Use your terminal and change directories to your movie directory.
4. Determine which chapter title on the dvd contains the actual movie (there are several ways to do this. You can search by each chapter using VLC media player to find the correct one if you want. I find the easiest and most successful way, most of the time, is to run pdvdrsab if you have it installed, tell it you are going to rip the dvd, then see which chapter it selects as the largest one. I then cancel pdvdrsab and run this script. Usually the correct title is 1).
5. Use your text editor (geany) to open "letitrip" and change the movie name and title number as needed (please read what few notes I've put on the script if you need any clarity). Then save it and close it.
6. In terminal type ./letitrip and the script will run. Of course, if you've saved the script under a different name, run it via that name.

The end result is two seperate movie files, both avi's, one much smaller than the other. Using gmplayer (a whole thread or two that can easily be found by searching this forum) I can play these smaller avi files with ease on the PII laptop.

If you don't like something about the script, then feel free to change, enhance, whatever. I just though: hey, it helps me, maybe it will help someone else. ;-)

*note: the line that contains the mencoder instructions is one line. The line that contains the ffmpeg instructions is one line.

Code: Select all

#!/bin/bash
###############################################
# LetItRip!
# This little script will rip from a dvd to a
# medium sized avi file then shrink it to a smaller
# avi file.  The final result will be two different 
# sized avi files.
###############################################

### here you can name the movie.  Use dashes for spaces leaving
### nothing blank.
mname=example-movie

### here you can number which block on the dvd the movie is contained,
### usually 1.
title=1

mencoder -aspect 4:3 dvd://$title -ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=694 -vf scale=640:480 -oac mp3lame -lameopts br=128:vol=7 -o $mname.avi

ffmpeg -i $mname.avi -f avi -s 232x158 -r 29.97 -ab 128 -ar 48000 -ac 2 -acodec libmp3lame -vcodec msmpeg4v2 $mname-small.avi




Attachments
letitrip-example.jpg
Screenshot of final result.
(46.46 KiB) Downloaded 5957 times

User avatar
dejan555
Posts: 2798
Joined: Sun 30 Nov 2008, 11:57
Location: Montenegro
Contact:

#2 Post by dejan555 »

Nice steve, mencoder is powerfull tool, has bunch of options to learn though.
What's the average filesize of converted 640x480 avi?
puppy.b0x.me stuff mirrored [url=https://drive.google.com/open?id=0B_Mb589v0iCXNnhSZWRwd3R2UWs]HERE[/url] or [url=http://archive.org/details/Puppy_Linux_puppy.b0x.me_mirror]HERE[/url]

User avatar
steve_s
Posts: 1595
Joined: Mon 26 May 2008, 13:29
Location: Austin, TX, USA
Contact:

#3 Post by steve_s »

dejan555 wrote:Nice steve, mencoder is powerfull tool, has bunch of options to learn though.
What's the average filesize of converted 640x480 avi?
Off the top of my head, 700-800mb, dejan555...that is the standard that most of my avi files are at; seems you have to compress a lot more to get less than favorable results past that point...

Roy
Posts: 451
Joined: Wed 31 Dec 2008, 18:31

#4 Post by Roy »

steve_s,

If you don't mind me bringing this up at such a late date, I'ld like to pose a quick question.

Which version of Puppy were you using with this script?

I like the idea of having two files -- with the smaller one probably being just about right for a small screen.

-Roy

User avatar
dejan555
Posts: 2798
Joined: Sun 30 Nov 2008, 11:57
Location: Montenegro
Contact:

#5 Post by dejan555 »

You can use on any version if you have mencoder and ffmpeg installed (or only mencoder if you want the first bigger file to be encoded only.)
puppy.b0x.me stuff mirrored [url=https://drive.google.com/open?id=0B_Mb589v0iCXNnhSZWRwd3R2UWs]HERE[/url] or [url=http://archive.org/details/Puppy_Linux_puppy.b0x.me_mirror]HERE[/url]

User avatar
steve_s
Posts: 1595
Joined: Mon 26 May 2008, 13:29
Location: Austin, TX, USA
Contact:

#6 Post by steve_s »

dejan555 wrote:You can use on any version if you have mencoder and ffmpeg installed (or only mencoder if you want the first bigger file to be encoded only.)
Yep, dejan got it. I've used it with 4.0 and up...

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#7 Post by technosaurus »

.. or you can use woo-ff on the vob file and specify your output file type (any that ffmpeg supports encoding) and optionally your width (it will automatically keep your aspect ratio - useful in mp4 players to prevent squishing and stretching) ... best of all mencoder is not needed only gtkdialog and only a 3kb pet

I haven't yet added direct from DVD without specifying the vob file or webcam and desktop support, I have the one-liners ready but not the gui integration yet.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

Roy
Posts: 451
Joined: Wed 31 Dec 2008, 18:31

#8 Post by Roy »

Thanks, guys.

I had a total of three blank one-time-writable discs, an external hard-drive full of Puppy.iso files, an assumption that this would require (MU's?) compilation of Mplayer+mencoder+... and worded my question above rather poorly.

Puppy 4.31 (my first selection) apparently does not have mencoder included by default. Using a borrowed laptop, I burned John Biles' TEENpup2009 on one of the remaining discs (thanks, John!) and steve_s' script gave me circa 600MB .avi files.

The script did not give an output of two separate files (one large and one small), but that's okay -- it was the smaller file I was after. Not recommended for a home theater, but perfectly usable on a small traveling netbook.

technosaurus, I'm afraid to admit that I have not even tried woo-ff yet, as I am currently running Gray's Boxpup 4.31 on a small netbook (sans an optical drive).

EDIT to remove extraneous comments: This script works on all discs as I just described, but multi-tasking on the current laptop while it is running causes glitches -- my bad! I am going to try to comment out the ffmpeg line and run the script again. The smaller file, naturally, strips out subtitles (Duh!).

steve_s, please accept my thanks once again for your work!

-Roy

Roy
Posts: 451
Joined: Wed 31 Dec 2008, 18:31

#9 Post by Roy »

Uh, Houston... I think I have a problem.

(Laughing) I just used this script on two DVD's. The first one performed perfectly, but the second one copied the entire .avi without subtitles OR english verbage....

So I now have two choices: Ask about any possible remedies -- or learn to speak French. (LOL)

Where and how does one set the language when using this?

-Roy

User avatar
dejan555
Posts: 2798
Joined: Sun 30 Nov 2008, 11:57
Location: Montenegro
Contact:

#10 Post by dejan555 »

Subtitles are not used in this script, if you want to add subtitles you have to add -sid parameter

Let me explain:
When you start DVD with mplayer then quit mplayer will output stats about titles chapters and subtitles in console window. Subtitles will be listed by id starting from 0.

So if english subtitle is on first id you just add -sid 0 to the mencoder line of script.

Code: Select all

mencoder -aspect 4:3 dvd://$title -ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=694 -vf scale=640:480 -oac mp3lame -lameopts br=128:vol=7 -o $mname.avi -sid 0
puppy.b0x.me stuff mirrored [url=https://drive.google.com/open?id=0B_Mb589v0iCXNnhSZWRwd3R2UWs]HERE[/url] or [url=http://archive.org/details/Puppy_Linux_puppy.b0x.me_mirror]HERE[/url]

Roy
Posts: 451
Joined: Wed 31 Dec 2008, 18:31

#11 Post by Roy »

Thanks, dejan555.

I'll give that a try. The thing that puzzles me is that, when watching the DVD straight from the drive via VLC or Xine, it is an English-language movie (with the exception of the very beginning, which is subtitled in English).

But, having no practical experience in backing up commercial media for longevity's sake (I'm not a pirate by hobby or trade), I've been kinda' shooting in the dark on this project.

-Roy

User avatar
dejan555
Posts: 2798
Joined: Sun 30 Nov 2008, 11:57
Location: Montenegro
Contact:

#12 Post by dejan555 »

Then it has also different audio languages, not sure how to specify that, probably has multiple audio ids also. (-aid parameter?)
puppy.b0x.me stuff mirrored [url=https://drive.google.com/open?id=0B_Mb589v0iCXNnhSZWRwd3R2UWs]HERE[/url] or [url=http://archive.org/details/Puppy_Linux_puppy.b0x.me_mirror]HERE[/url]

Roy
Posts: 451
Joined: Wed 31 Dec 2008, 18:31

#13 Post by Roy »

Thanks, dejan555!

From the Mplayer manual:

Code: Select all

You have to use -aid (audio ID) or -alang (audio language), -sid(subtitle ID) or -slang (subtitle language), for example:

mplayer -alang eng -slang eng example.mkv
mplayer -aid 1 -sid 1 example.mkv

To see which ones are available:

mplayer -vo null -ao null -frames 0 -v filename | grep sid
mplayer -vo null -ao null -frames 0 -v filename | grep aid
I tried -sid 0 -aid 0 on my first attempt and it still produced French (English is on the first audio id). Strangely, this did provided English subtitles -- but... French verbage?

My DVD's audio tracks are listed as 1) English, 3) French, and 4) English. Playing with different -aid values (0, 1, 2, 3) gave either no audio or French language. Subtitles are listed as 1, 4, or 5.

It might be that I just listed -sid and -aid in the wrong order, but "-alang eng" works by itself for English audio.

-Roy

Roy
Posts: 451
Joined: Wed 31 Dec 2008, 18:31

#14 Post by Roy »

.. or you can use woo-ff on the vob file
technosaurus, where exactly is the latest woo-ff.pet? I have one of your earliest versions, but my copy lacks many of the preset choices you talked about adding to a later version. Several forum searchs have only lead me to dead ends.

I see shinobar has done some work in this direction, too, but open parameter fields are a bit above my level of expertise. Selectable presets like the ones discussed in other (now missing?) threads are what I am looking for.

-Roy

User avatar
steve_s
Posts: 1595
Joined: Mon 26 May 2008, 13:29
Location: Austin, TX, USA
Contact:

#15 Post by steve_s »

Roy wrote:
.. or you can use woo-ff on the vob file
technosaurus, where exactly is the latest woo-ff.pet? I have one of your earliest versions, but my copy lacks many of the preset choices you talked about adding to a later version. Several forum searchs have only lead me to dead ends.

I see shinobar has done some work in this direction, too, but open parameter fields are a bit above my level of expertise. Selectable presets like the ones discussed in other (now missing?) threads are what I am looking for.

-Roy
I am really not trying to sound like one of those forum jerks (not this forum; other linux forums I've used), but is one of these it? 8)

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#16 Post by technosaurus »

The latest stable version is included in 44 pre alpha, however shinobar has started developing his own frontend with internationalization support (ffconvert http://www.murga-linux.com/puppy/viewtopic.php?t=54056) I am planning to provide patches and upgrades to his work, rather than maintain a separate project. What is the opposit of a fork? ... no we are not spooning!
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

Roy
Posts: 451
Joined: Wed 31 Dec 2008, 18:31

#17 Post by Roy »

Thanks, guys. As scripting and such is all above my head, I can only be grateful for your hard work which you have chosen to share. And it really is appreciated.

steve_s, you are certainly NOT a forum jerk in my mind, but your search results illustrate my point nicely. If I select the search result which specifically deals with technosaurus' woo-ff multimedia converter (mentioned earlier in this thread):
Puppy Linux Discussion Forum :: View topic - Woo-FF Video Converter
I download those that interest me and use Woo-ff to convert them to portable format so I can watch them in spare moments. ...
www.murga-linux.com/puppy/viewtopic.php?p=398963&sid... - Cached
I am directed to this forum's sign on page, followed by a message to the effect that the thread does not exist. *sigh*

-Roy

EDIT: Ahhh, if I select the 'Cached' result, it shows up! (Well, the second page of a two page thread.) Not too sure I understand that, but it is a different issue altogether. Thanks, steve_s!

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#18 Post by technosaurus »

the thread has been deleted... don't know why or by who... maybe because it is too close to woof?

I was in the middle of a code cleanup rewrite - here is my current "unstable" version - there may be some regressions though as I have not had time to finish it
Attachments
woo-ff.gz
(4.12 KiB) Downloaded 1446 times
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

Roy
Posts: 451
Joined: Wed 31 Dec 2008, 18:31

#19 Post by Roy »

Thanks, technosaurus.

Assuming I set this to executable and replace current /usr/bin/woo-ff (?) file, ... oh, wait -- it is a .gz which will install like a .pet, right?

Anyway, I'll figure it out and test it later this week. Multi-platform .avi's are my main target as I don't have an iPod or other fancy gear to test with.

-Roy

User avatar
steve_s
Posts: 1595
Joined: Mon 26 May 2008, 13:29
Location: Austin, TX, USA
Contact:

#20 Post by steve_s »

Thanks to dejan technosaurus and roy for the feedback! Love that about this forum: start a thread and there is so much knowledge here that I go back to the the same thread to try and see how to do subtitles..great job folks!

Post Reply