Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
dvd9-to-dvd5 w/transcode, dvdrip. dvdshrink.dvdbackup,lxdvdriip, and all else
I tried every program in existence but I still can't shrink and remultiplex the sound. The resulting shrunken file plays good with mplayer but there is no sound.
I see nobody replied to my email. Problem is that nobody ever shrank a dvd using lpcm and it worked. Would anybody please post an example. All I get is noise when I try it. Every dvd I play using mplayer is a 2 track lpcm. Never did see any that had an ac3 format.
I did what you said. My mplayer woukdn't compile anymore because libavcodec won't compile along with ffmpeg anymore with gcc-4, so I used a freshrpms rpm of mplayer which didn't have the -nogui option and an atrpms ffmpeg rpm. I had to change the -aid 128 to -aid 160 because the pcm codec range started with 160. When I tried to play the file mplayer died with this:
Too many audio packets in the buffer: (4096 in 8257536 bytes).
Maybe you are playing a non-interleaved stream/file or the codec failed?
For AVI files, try to force non-interleaved mode with the -ni option.
A: 4.9 V: 4.9 A-V: 0.029 ct: 0.048 144/144 17% 5% 0.8% 8 0
I tried -nosound option with mplayer and got this:
Audio: no sound
Starting playback...
VDec: vo config request - 720 x 480 (preferred csp: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
VO: [xv] 720x480 => 720x540 Planar YV12
No bind found for key JOY_AXIS2_PLUS
demux: File doesn't contain the selected audio or video stream.
V: 4.9 144/144 10% 1% 0.0% 0 0
I didn't calculate the requantization factor using audio size even though you refered to the equation in your FAQ since your FAQ implies it is possible to use just 1.5. Could this be the problem?
Recently I used StreamDVD to rip a file and the sound came out ac3 and no requantization was needed according to streamanalyze, but the one track I ripped didn't include part 4 of a 4 part movie and the movie dies using ogle in the beginning of part 3. 3 vobs were showing in the resultant VIDEO_TS directory that streamdvd created. This 2 directory rip I burned using yet another FAQ's info : " dvdrecord speed=1 -dao dev=ATA:0,0,0 mydvd.img" and it wouldn't even play in my cd player. I had a hard time recording mp3 files on cd and recently discovered "bashburn" would do it in case anybody has similar problems with their music and wants to burn their mp3s and take the burnt cd to work. Why is ripping dvd files a bummer?
This sounds made much more complicated than necessary. I have been ripping, converting to and from any format of video and sound for years on both Linux and Windows.
A/V creation and editing is a technical hobby yes but ripping a DVD is not that hard.
Let's start fresh and simple to help you out:
What is this movie you want to rip.
Then I will guide you step by step.
P.S The 1.5 factor is a good all around value that fits most of the time if you don't want to bother with calculating the right requant factor, but it still has nothing to do with the sound. Sound file size always has to be added to the final video program stream size (M2V) Otherwise you risk ending up with a file that is too large.
Not all movie need requantization, as long as they already fit on a DVD-R 4.7 gig (4.35gb actually or 4384 mb if you prefer.)
Yep that did it. That seemed like the most logical at first. But when I tried that on another computer I had, it split it into about 100 little mpeg files. This time it split it into 6 files: final.mpg, final1.mpg, final2.mpg, final3.mpg, final4.mpg, final5mpg. I think it split it into the 6 files because I ripped the whole dvd with menus and all. What's weird is final.mpg and final1.mpg are the same thing. So I just continued the process with final1.mpg-final5.mpg. I'm burning it now so we'll see.
Ok it just finished burning and I'm an idiot. I could have swore I read somewhere in the guide that you could rip the menus. Well I didn't have the menus but I did have the 5 videos, represented as chapters (main movie, behind the scenes, intro, etc.). Now when I go back and start over with just the main movie will it keep the proper chapters as it is on the original disc?
If you are using the 'dvrequant' script that came with tovid version 0.18a or 0.18b, then you can rip one title from the disc, with chapters. Don't use any of the development versions that have been posted here--many of them were hastily-written (mine were, anyway) and probably had lots of bugs.
Presumably, you will be ripping the main feature on the disc, but if you're dealing with multiple main features, you'll have to split it into several discs. The title chapters should be preserved, so that you end up with the same chapters as were in the original disc. I wrote that feature, so if it doesn't work, you can hold me responsible
Development has kind of stalled on tovid, and Steel_J can't really do much since I asked him to hold off until I can finish up some things in 'dvrequant'. A future version of 'dvrequant' will support rudimentary copying of everything on the disc - menus, navigation, and the works, but it probably won't work terribly well for most discs. With currently-available tools, it appears there is no way to extract navigation data (what button goes to what video/menu) from DVDs. Initially, the full-disc 'dvrequant' feature will give you a disc with all the titles, played in sequence, without any menus. If a way is developed to extract the necessary navigation data (someone figures it out and patches 'dvunauthor' to support it), then we will be much closer to full-disc shrinking.
I was just going back through this thread, reading stuff I missed:
Quote:
i just added a 3 click gui (COPY SHRINK BURN) thats all Screen shot http://tinypic.com/la9g6 of what i have so far if it wasn't for you id still be searching for a solution i was using vobcopy and vobstripper but your method works better.
That is sweet! I am totally going to steal your 3-step idea for my tovid GUI--it is exactly the simplifying concept I was looking for. For 'dvrequant', Copy/Shrink/Burn, for the tovid/makemenu/makexml combo, it's Author/Encode/Burn or something similar. If a direct-to-disk feature (for taking video from a V4L device or digital video camera) ever develops in tovid, it could be Capture/Convert/Burn, etc.
What language/API did you write the GUI in? If you get it to work with 'dvrequant', and are willing to GPL it, let me know and I will include it in the next tovid release. I'm even tempted to rewrite your GUI in wxPython, so it'll be consistent with tovid's GUI.
Great thanks for the tip about your script! But where do I start to use your script while following this guide? Do i still use DVD::Rip to rip the 5 or 6 VOB's of the main feature?
All right people, as WapCaplet explained, he is writting changes to my DVRequant script in an effort to make it the DVD ripping solution of the TOVID suite.
He asked me to to give him time and that is what's happenning now. If we both try to make devellopment advances separately and at the same time it is very hard to stay coherent and productive.
I put my very best, but limited programming skills into it, but now he has ideas and for now we are going to let him implement them and make a test release.
For all of you out there who want the: " basic functionnal rip the main title and 2 audio tracks of your choice" version of DVDRequant. It's version 0.17b.
It's pretty stable, tried tested and true and It's the one I use until we have something better. (it suits my needs very well)
So here it is for those who want it:
Code:
#! /bin/bash
# DVrequant script
# Will rip a DVD-9 disc with the title and audio of your
# choice and requantize it to fit on a DVD-R 4.7
# Steel_J 2005-02-13
# Additional code from WapCaplet 2005-02-06
# This software is licensed under GPL.
# Requirement: mplayer / libdvdcss / transcode / mjpegtools / dvdauhtor / cdrecord (mkisofs) / lsdvd / K3B
#===========================================================================
# DEFAULTS AND FUNCTION DEFINITIONS
# Take an integer number of seconds and format it as hours:minutes:seconds
# Echoes result to stdout, so in order to use the output as a "return value",
# call the function like this:
# RETURN_VALUE=$( format_time $NUM_SECONDS )
format_time ()
{
let "HMS_HOURS=$1 / 3600"
let "HMS_MINS=( $1 % 3600 ) / 60"
let "HMS_SECS=$1 % 3600 % 60"
[[ $HMS_HOURS -lt 10 ]] && HMS_HOURS="0${HMS_HOURS}"
[[ $HMS_MINS -lt 10 ]] && HMS_MINS="0${HMS_MINS}"
[[ $HMS_SECS -lt 10 ]] && HMS_SECS="0${HMS_SECS}"
echo "${HMS_HOURS}:${HMS_MINS}:${HMS_SECS}"
}
# Take a string containing a time (like "02:15:25.3") and
# format it as an integer number of seconds. Fractional seconds
# are truncated. Result is echoed to stdout, so to use the output
# as a "return value", call the function like this:
# RETURN_VALUE=$( unformat_time $TIME_STRING )
unformat_time ()
{
HMS_HOURS=$( echo $1 | sed -r -e 's/0?([0-9]+):0?([0-9]+):0?([0-9]+)(\.[0-9])?/\1/' )
HMS_MINS=$( echo $1 | sed -r -e 's/0?([0-9]+):0?([0-9]+):0?([0-9]+)(\.[0-9])?/\2/' )
HMS_SECS=$( echo $1 | sed -r -e 's/0?([0-9]+):0?([0-9]+):0?([0-9]+)(\.[0-9])?/\3/' )
let "TOT_SECONDS=$HMS_HOURS * 3600 + $HMS_MINS * 60 + $HMS_SECS"
echo $TOT_SECONDS
}
# Retrieve the chapter breaks from the specified track on the DVD.
# Echoes a string to stdout with a list of chapter-start times
# (i.e., "0, 1:53, 15:26, 1:23:15" etc.)
# To use output as a "return value", call the function like this:
# CHAPTER_START_TIMES=$( get_chapters $TITLE )
get_chapters ()
{
CH_LIST=$( lsdvd -c -t $1 2>&1 | grep "Chapter:" | \
sed -r -e 's/^.* Length: ([^,]+).*$/\1/' )
# Assemble the list
echo -n "0"
TOTAL_SECS=0
for CUR_CHAP in $CH_LIST; do
CUR_SECS=$( unformat_time $CUR_CHAP )
# Don't insert markers for 0-second chapters
if [[ $CUR_SECS -gt 0 ]]; then
let "TOTAL_SECS=$TOTAL_SECS + $CUR_SECS"
CUR_TIME=$( format_time $TOTAL_SECS )
echo -n ",$CUR_TIME"
fi
done
}
# Presentation
clear
version=0.17b
echo -e "===================="
echo -e "* DVRequant v${version} *"
echo -e "===================="
echo "Requirement: mplayer / libdvdcss / transcode / mjpegtools / dvdauhtor / cdrecord (mkisofs) / lsdvd / K3B"
echo " "
echo "K3B is optional but recommended"
echo " "
#============================================================================
# checking for needed software
if ! which mplayer >/dev/null ; then
echo " "
echo "mplayer is not detected";
echo "you need it installed. Exiting...";
echo " "
false; exit;
fi
if ! which transcode >/dev/null ; then
echo " "
echo "transcode is not detected";
echo "you need it installed. Exiting...";
echo " "
false; exit;
fi
if ! which mpeg2enc >/dev/null ; then
echo " "
echo "mjpegtools is not detected";
echo "you need it installed. Exiting...";
echo " "
false; exit;
fi
if ! which dvdauthor >/dev/null ; then
echo " "
echo "dvdauthor is not detected";
echo "you need it installed. Exiting...";
echo " "
false; exit;
fi
if ! which mkisofs >/dev/null ; then
echo " "
echo "cdrecord (mkisofs) is not detected";
echo "you need it installed. Exiting...";
echo " "
false; exit;
fi
if ! which lsdvd >/dev/null ; then
echo " "
echo "lsdvd is not detected";
echo "you need it installed. Exiting...";
echo " "
false; exit;
fi
if ! which /usr/*/libdvdcss.so.2* >/dev/null ; then
echo " "
echo "*************************************************************** "
echo "libdvdcss is not detected, you need it to complete the process.";
echo "*************************************************************** "
echo " "
echo "******************************************************************************** "
echo "The script will keep going but may exit with errors when trying to read the DVD. "
echo "******************************************************************************** "
echo " "
fi
#===========================================================================
# Create project folder and choose preferences
echo
echo "We will create a work folder called dv_output in the path of your choice."
echo "Make sure you have at least 14 gigabytes of space available."
echo " "
echo -n "Enter the path to create the directory (ex./home/bobby/video) >"
read -e loc
if [[ ! -d dv_output ]]; then
mkdir $loc/dv_output
else
echo "Directory $loc/dv_output already exists. Continuing."
fi
if [ "$loc" = "" ]; then
echo " "
echo "==== Error! You must choose a folder to work in. Exiting... ===="
echo " "
false; exit;
fi
#==========================================================================
# Define path to DVD device
echo "============================================"
echo "These are the optical devices on your system"
echo "============================================"
ls -l /dev/dvd /dev/cdrom*
echo " "
echo -n "Enter name of your DVD device (ex. /dev/dvd or /dev/hdc) >"
read -e dvd
if [ "$dvd" = "" ]; then
echo " "
echo "==== Error! You must enter a path to your DVD device. Exiting... ===="
echo " "
false; exit;
fi
#==========================================================================
# Ask the user which video title he wants to rip from DVD
# video stream sub-section
echo " "
echo "========================================== "
echo "These are all the video titles on the disc"
echo "========================================== "
echo " "
lsdvd -v $dvd | more
echo " "
echo -n "What title do you want to rip? (ex. 1, 2 or 3) >"
read -e title
echo " "
echo "===================== "
echo "You picked title >#" $title
echo "===================== "
lsdvd -t $title | more
#audio stream sub-section
echo " "
echo "============================================= "
echo "These are all the audio tracks for this title"
echo "============================================= "
echo " "
mplayer -dvd-device /dev/dvd dvd://$title -vo null -ao null -frames 0 -v | grep aid
CHAPTER_START_TIMES=$( get_chapters $title )
echo " "
echo -n "How many audio tracks do you want to rip? (Default is 1) >"
read aud_number
# Rip selected audio tracks and then video stream
if [ "$aud_number" = "" ]; then
echo " "
echo "Default to only one audio tracks..."
echo " "
echo -n "Enter the audio ID (AID) code you wish to rip (ex. 128) >"
read -e tracka
echo "================================================= "
echo "The DVD will now be ripped, it may take some time"
echo "================================================= "
echo " "
mplayer -dvd-device $dvd dvd://$title -dumpaudio -aid $tracka -dumpfile $loc/dv_output/langa.ac3
mplayer -dvd-device $dvd dvd://$title -dumpvideo -dumpfile $loc/dv_output/output.m2v
# Calculate requant factor
#requant_factor = (video_size / (4700000000 - audio_size)) * 1.04
# If you are including more than one audio stream or a subtitle stream, those
# filesizes must also be subtracted from the maximum dvd image size.
echo " "
echo "================================== "
echo "Calculating best requant factor..."
echo "================================== "
echo "==========================================="
echo "The closer to 1.00 the factor is the better"
echo "=========================================== "
echo " "
cd $loc/dv_output
vsize=`du -b output.m2v | cut -c 1-10` # video_size
audioa=`du -b langa.ac3 | cut -c 1-9` # audio_size for track #1
dvdlessaudio=$((4700000000-$audioa))
division=$(echo "scale=2; $vsize/$dvdlessaudio" | bc)
req=$(echo "scale=2; $division*1.05" | bc) # requant_factor
echo " "
echo "====================================== "
echo "Requant factor for this movie is:" "$req"
echo "====================================== "
echo " "
fi
if [ "$aud_number" = "1" ]; then
echo "You have chosen to rip 1 audio tracks..."
echo " "
echo -n "Enter the audio ID (AID) code you wish to rip (ex. 128) >"
read -e tracka
echo "================================================= "
echo "The DVD will now be ripped, it may take some time"
echo "================================================= "
echo " "
mplayer -dvd-device $dvd dvd://$title -dumpaudio -aid $tracka -dumpfile $loc/dv_output/langa.ac3
mplayer -dvd-device $dvd dvd://$title -dumpvideo -dumpfile $loc/dv_output/output.m2v
# Calculate requant factor
#requant_factor = (video_size / (4700000000 - audio_size)) * 1.04
# If you are including more than one audio stream or a subtitle stream, those
# filesizes must also be subtracted from the maximum dvd image size.
echo " "
echo "================================== "
echo "Calculating best requant factor..."
echo "================================== "
echo "==========================================="
echo "The closer to 1.00 the factor is the better"
echo "=========================================== "
echo " "
cd $loc/dv_output
vsize=`du -b output.m2v | cut -c 1-10` # video_size
audioa=`du -b langa.ac3 | cut -c 1-9` # audio_size for track #1
dvdlessaudio=$((4700000000-$audioa))
division=$(echo "scale=2; $vsize/$dvdlessaudio" | bc)
req=$(echo "scale=2; $division*1.05" | bc) # requant_factor
echo " "
echo "====================================== "
echo "Requant factor for this movie is:" "$req"
echo "====================================== "
echo " "
fi
if [ "$aud_number" = "2" ]; then echo "You have chosen to rip 2 audio tracks..."
echo " "
echo -n "Enter the audio ID (AID) code you wish to rip for track #1 (ex. 128) >"
read -e tracka
echo -n "Enter the audio ID (AID) code you wish to rip for track #2 (ex. 128) >"
read -e trackb
echo "================================================= "
echo "The DVD will now be ripped, it may take some time"
echo "================================================= "
echo " "
mplayer -dvd-device $dvd dvd://$title -dumpaudio -aid $tracka -dumpfile $loc/dv_output/langa.ac3
mplayer -dvd-device $dvd dvd://$title -dumpaudio -aid $trackb -dumpfile $loc/dv_output/langb.ac3
mplayer -dvd-device $dvd dvd://$title -dumpvideo -dumpfile $loc/dv_output/output.m2v
# Calculate requant factor
#requant_factor = (video_size / (4700000000 - audio_size)) * 1.04
# If you are including more than one audio stream or a subtitle stream, those
# filesizes must also be subtracted from the maximum dvd image size.
echo " "
echo "================================== "
echo "Calculating best requant factor..."
echo "================================== "
echo "==========================================="
echo "The closer to 1.00 the factor is the better"
echo "=========================================== "
echo " "
cd $loc/dv_output
vsize=`du -b output.m2v | cut -c 1-10` # video_size
audioa=`du -b langa.ac3 | cut -c 1-9` # audio_size for track #1
audiob=`du -b langb.ac3 | cut -c 1-9` # audio_size for track #2
dvdlessaudio=$((4700000000-($audioa+$audiob)))
division=$(echo "scale=2; $vsize/$dvdlessaudio" | bc)
req=$(echo "scale=2; $division*1.05" | bc) # requant_factor
echo " "
echo "====================================== "
echo "Requant factor for this movie is:" "$req"
echo "====================================== "
echo " "
fi
#echo " "
#echo "====================================== "
#echo "You can eject the DVD now if you want."
#echo "====================================== "
#echo " "
#========================================================================
# Requantize it, if necessary:
if [[ $( echo "$req > 1.00" | bc ) == "1" ]]; then
echo "========================================= "
echo "Requantizing (shrinking) the video stream."
echo "========================================= "
tcrequant -d2 -i output.m2v -o shrinked.m2v -f $req
# Cleaning....
rm output.m2v
else
echo "========================================= "
echo "No requantization necessary. Skipping."
echo "========================================= "
mv output.m2v shrinked.m2v
fi
#========================================================================
# Remultiplex:
echo " "
echo "====================================== "
echo "Multiplexing audio and video stream(s)."
echo "====================================== "
echo " "
if [ "$aud_number" = "" ]; then
mplex -f 8 -o final.mpg shrinked.m2v langa.ac3
fi
if [ "$aud_number" = "1" ]; then
mplex -f 8 -o final.mpg shrinked.m2v langa.ac3
fi
if [ "$aud_number" = "2" ]; then
mplex -f 8 -o final.mpg shrinked.m2v langa.ac3 langb.ac3
fi
# Cleaning up
rm langa.ac3
rm langb.ac3
rm shrinked.m2v
#========================================================================
# Re-author it
# This will create a folder named "dv_dvd" and generate inside it a dvd structure -- VIDEO_TS and AUDIO_TS
echo " "
echo "========================================= "
echo "Authoring and generating a DVD structure."
echo "========================================= "
# Populate filesystem
dvdauthor -t -o dv_dvd -c $CHAPTER_START_TIMES final.mpg
# Create IFO files
dvdauthor -o dv_dvd -T
# Create DVD Video compliant ISO image
mkisofs -dvd-video -udf -o ready2burn.iso dv_dvd/
#========================================================================
# End messages
echo " "
echo "==============================================================================="
echo "Done! Use K3B to burn the - ready2burn.iso- "
echo " created in the dv_output folder."
echo "==============================================================================="
exit
I am trying to figure out if I need to follow all the steps from the first post. I've got a DVD which is of 5.7Gb size, but actual movie is only 4.0Gb. All the rest is some extras and trailers which I do not need. So I'd like to make a copy of the main feature and keep a chapter structure: there is a menu in the beginning where you can pick up the chapter you want to watch.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.