Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Mon 24 Nov 2014, 10:13
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Multimedia
Script to rip DVD straight to AVI: Letitrip
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [23 Posts]   Goto page: 1, 2 Next
Author Message
steve_s


Joined: 26 May 2008
Posts: 1545
Location: Austin, TX, USA

PostPosted: Mon 01 Dec 2008, 10:54    Post subject:  Script to rip DVD straight to AVI: Letitrip
Subject description: Just a little script that might help
 

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. Wink

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

Code:

#!/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




letitrip-example.jpg
 Description   Screenshot of final result.
 Filesize   46.46 KB
 Viewed   5004 Time(s)

letitrip-example.jpg

Back to top
View user's profile Send private message Visit poster's website 
dejan555


Joined: 30 Nov 2008
Posts: 2716
Location: Montenegro

PostPosted: Mon 28 Dec 2009, 05:32    Post subject:  

Nice steve, mencoder is powerfull tool, has bunch of options to learn though.
What's the average filesize of converted 640x480 avi?

_________________
Dpup 487 | Puppy Gallery | My photo gallery | mtPaint works
Back to top
View user's profile Send private message Visit poster's website MSN Messenger 
steve_s


Joined: 26 May 2008
Posts: 1545
Location: Austin, TX, USA

PostPosted: Mon 28 Dec 2009, 10:10    Post subject:  

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...
Back to top
View user's profile Send private message Visit poster's website 
Roy

Joined: 31 Dec 2008
Posts: 443

PostPosted: Fri 05 Mar 2010, 03:24    Post subject:  

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
Back to top
View user's profile Send private message 
dejan555


Joined: 30 Nov 2008
Posts: 2716
Location: Montenegro

PostPosted: Fri 05 Mar 2010, 04:41    Post subject:  

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.)
_________________
Dpup 487 | Puppy Gallery | My photo gallery | mtPaint works
Back to top
View user's profile Send private message Visit poster's website MSN Messenger 
steve_s


Joined: 26 May 2008
Posts: 1545
Location: Austin, TX, USA

PostPosted: Fri 05 Mar 2010, 16:59    Post subject:  

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...
Back to top
View user's profile Send private message Visit poster's website 
technosaurus


Joined: 18 May 2008
Posts: 4378

PostPosted: Fri 05 Mar 2010, 18:48    Post subject:  

.. 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.

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
Roy

Joined: 31 Dec 2008
Posts: 443

PostPosted: Sat 06 Mar 2010, 13:53    Post subject:  

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
Back to top
View user's profile Send private message 
Roy

Joined: 31 Dec 2008
Posts: 443

PostPosted: Sun 07 Mar 2010, 05:32    Post subject:  

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
Back to top
View user's profile Send private message 
dejan555


Joined: 30 Nov 2008
Posts: 2716
Location: Montenegro

PostPosted: Sun 07 Mar 2010, 06:43    Post subject:  

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:
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

_________________
Dpup 487 | Puppy Gallery | My photo gallery | mtPaint works
Back to top
View user's profile Send private message Visit poster's website MSN Messenger 
Roy

Joined: 31 Dec 2008
Posts: 443

PostPosted: Sun 07 Mar 2010, 09:52    Post subject:  

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
Back to top
View user's profile Send private message 
dejan555


Joined: 30 Nov 2008
Posts: 2716
Location: Montenegro

PostPosted: Sun 07 Mar 2010, 10:05    Post subject:  

Then it has also different audio languages, not sure how to specify that, probably has multiple audio ids also. (-aid parameter?)
_________________
Dpup 487 | Puppy Gallery | My photo gallery | mtPaint works
Back to top
View user's profile Send private message Visit poster's website MSN Messenger 
Roy

Joined: 31 Dec 2008
Posts: 443

PostPosted: Sun 07 Mar 2010, 15:10    Post subject:  

Thanks, dejan555!

From the Mplayer manual:
Code:
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
Back to top
View user's profile Send private message 
Roy

Joined: 31 Dec 2008
Posts: 443

PostPosted: Fri 02 Apr 2010, 08:51    Post subject:  

Quote:
.. 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
Back to top
View user's profile Send private message 
steve_s


Joined: 26 May 2008
Posts: 1545
Location: Austin, TX, USA

PostPosted: Fri 02 Apr 2010, 12:11    Post subject:  

Roy wrote:
Quote:
.. 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? Cool
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 2 [23 Posts]   Goto page: 1, 2 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Multimedia
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0966s ][ Queries: 13 (0.0082s) ][ GZIP on ]