Page 24 of 25 FirstFirst ... 1422232425 LastLast
Results 231 to 240 of 249

Thread: HOWTO: Rip DVDs in MPEG-4 AVC (x264), multi audio, subtitles, Matroska

  1. #231
    Join Date
    Aug 2006
    Location
    Alexandria, VA
    Beans
    51
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: HOWTO: Rip DVDs in MPEG-4 AVC (x264), multi audio, subtitles, Matroska

    Quote Originally Posted by u-slayer View Post
    BTW, how did you know what frame rate to use? Is it always 24000/1001 or can it vary by dvd?
    Personally, I determine the source framerate by just playing the .vob in mplayer via the command line, and reading the output. For example, a Futurama DVD has output like this:

    Code:
    A:   0.7 V:   0.7 A-V:  0.027 ct:  0.034  17/ 14 28% 52%  5.3% 0 0 
    demux_mpg: 24000/1001fps progressive NTSC content detected, switching framerate.
    A:  29.7 V:  29.7 A-V: -0.000 ct:  0.102 714/711  6% 52%  0.8% 51 0 
    demux_mpg: 30000/1001fps NTSC content detected, switching framerate.
    Warning! FPS changed 23.976 -> 29.970  (-5.994005) [4]    0.8% 51 0 
    A:  87.2 V:  86.7 A-V:  0.450 ct:  0.174 2423/2420  4% 56%  0.6% 185 0
    It starts out as 24 fps then changes to 30 fps. As it continues to play, it switches back and forth. I treat this video as interlaced and use '-vf pullup,softskip,harddup,pp=lb' in the mencoder command. If it had been 24 fps and never changed to 30 fps, then it's a progressive video and doesn't get those filters.

    I don't have it automatic in my script, I just have the script start to play, then when I've determined the rate, I CTRL-C the process and have the script READ a '24' or '30' that I type, and it uses the correct commands from there.

    Prolly could do some fancy scripting to have it determine if it ever changes, but for me, that's too much work for little payoff. There may be some other tool that just straight-up tells you the .vob framerate, but if there is, i'm unaware of it.

  2. #232
    Join Date
    May 2009
    Beans
    1

    Re: HOWTO: Rip DVDs in MPEG-4 AVC (x264), multi audio, subtitles, Matroska

    Quote Originally Posted by lastchancetosee View Post
    I've created a script to automate/facilitate this process (attached below). Anyone want to try it, go ahead.
    Thank you for that awesome tool! I have made a few local modifications and will post them if they turn out to work as intended.

  3. #233
    Join Date
    Sep 2007
    Beans
    8

    Re: HOWTO: Rip DVDs in MPEG-4 AVC (x264), multi audio, subtitles, Matroska

    ...And here are my questions:
    1) Is there anyway to export the crop value from mplayer -vf crop to the videnc file automatically, rather than manually cutting and pasting? And if there isn't, is there anyway to have a break waiting on "Enter" before going to the next step (configuring videnc)?

    2) Is there anyway to take the input for the local variable $NAME and automatically update the corresponding entries in videnc?

    ...

    Good questions and cool script, i'm playing with it now...as i am a bit of a newbie with scripts and it is now 3 yrs since you posted this so not sure if your questions have been answered My answer to question 2) I inserted the line "mv ~/$NAME/videnc ~/$NAME/$NAME" below the line "cp ~/videnc ~/$NAME/". So it copies the videnc script to the new directory then moves and renames the videnc file to the same directory then deleting the now unused videnc file. Dunno if anyone will make sense of that As for question 1), I'm still going through the 20+ pages of replies as i don't have a clue either!! Thanks for your script once again have been looking for one for a while.

    Also, I want it to recognise when a disc is inserted into the drive and to ask whether to run the script or not. I'm heading in th direction of logfiles and trying to find where the outputs of those logfiles would be when a dvd disc is inserted...to me it's an "out there" idea. Just curious to see if i'm on the right track and/or if someone out there has done something similiar?

    Any help would be greatly appreciated!

  4. #234
    Join Date
    Jun 2005
    Location
    /world/OldEurope
    Beans
    184
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: HOWTO: Rip DVDs in MPEG-4 AVC (x264), multi audio, subtitles, Matroska

    I haven't read the whole thread but noticed that h264enc (click here) is not mentioned. It's a script which is constantly updated and comes with a man page as well as installation and deinstallation scripts. Might be superior to the bash scripts posted in this thread?

    BTW: I got some bad results with Handbrake, which was also mentioned in this thread. Audio was out of sync quite often. Apparently Handbrake doesn't work well with variable bitrates.
    Last edited by elektronaut; June 23rd, 2009 at 10:16 AM.

  5. #235
    Join Date
    Mar 2007
    Beans
    194
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: HOWTO: Rip DVDs in MPEG-4 AVC (x264), multi audio, subtitles, Matroska

    Quote Originally Posted by hyper_ch View Post
    Hiho

    sorry for the late reply but I have it now finally:

    Code:
    #!/bin/bash -x
    
    for EP in $(cat list.txt);
    
    do
    
            # Umount existing image
            umount /media/cdrom0;
    
            # Mount image
            mount -t iso9660 -o loop /media/hda1/B5/$EP.iso /media/cdrom0;
    
            # Rip files
            nice -n20 mplayer -dvd-device /media/cdrom0 dvd://1 -v -dumpstream -dumpfile $EP.vob;
            nice -n20 mencoder -dvd-device /media/cdrom0 dvd://1 \
                    -nosound -ovc frameno -o /dev/null -slang en -vobsubout $EP.en;
            nice -n20 mencoder -dvd-device /media/cdrom0 dvd://1 \
                    -nosound -ovc frameno -o /dev/null -slang de -vobsubout $EP.de;
    
            echo "nice -n20 mplayer $EP.vob -ao pcm:file=$EP.wav -vc dummy -aid 128 -vo null";
            nice -n20 mplayer $EP.vob -ao pcm:fast:file=$EP.wav -vc dummy -aid 128 -vo null;
    
            nice -n20 normalize-audio $EP.wav;
            nice -n20 oggenc -q5 $EP.wav;
    
    
            # First pass
            nice -n20 \
                    mencoder -v $EP.vob \
                    -vf harddup \
                    -ovc x264 \
                    -x264encopts subq=4:bframes=3:b_pyramid:weight_b:turbo=1:pass=1:psnr:bitrate=1000 \
                    -oac copy \
                    -of rawvideo \
                    -o $EP.264;
    
            # Second pass
            nice -n20 \
                    mencoder -v $EP.vob \
                    -vf harddup \
                    -ovc x264 \
                    -x264encopts subq=6:partitions=all:me=umh:frameref=5:bframes=3:b_pyramid:weight_b:pass=2:psnr:bitrate=1000 \
                    -oac copy \
                    -of rawvideo \
                    -o $EP.264;
    
            nice -n20 MP4Box -add $EP.264 $EP.mp4;
    
            # Put it in matroska container
            nice -n20 \
                    mkvmerge \
                    -o $EP.mkv \
                    -d 1 -A \
                    -S $EP.mp4 \
                    -a 0 -D -S $EP.ogg \
                    --language 0:eng -s 0 -D -A $EP.en.idx \
                    --language 0:ger -s 0 -D -A $EP.de.idx \
                    --track-order 0:1,1:0,2:0,3:0;
    
            # Delete unused files
            rm $EP.vob;
            rm $EP.wav;
            rm $EP.264;
            rm $EP.en.idx;
            rm $EP.en.sub;
            rm $EP.de.idx;
            rm $EP.de.sub;
            rm $EP.mp4;
            rm $EP.ogg;
            rm divx2pass.log;
    
            chown hyper.hyper *;
    
            echo "$EP done";
    
    done
    That just works fine - I only need a faster cpu

    Anyway, this little script will convert ISO contained in a text list into matroska... the ISOs I use are cleanly ripped (no black borders), contain only one audio stream and in my case two subtitles... so for you, little alterations must be made
    THANK YOU!!!

    Finally, after days of trying to figure this out, I've finally found a script that works. I hope the OP modifies his post to reflect the changes in x264's arguments

  6. #236
    Join Date
    Jan 2008
    Location
    Kuwait/Working
    Beans
    172
    Distro
    Xubuntu Development Release

    Re: HOWTO: Rip DVDs in MPEG-4 AVC (x264), multi audio, subtitles, Matroska

    Big D
    My Blog
    AMD FX 9590 Vishera/32 Gig DDR3 1866/AMD R9 290X GHz Edition
    Win8.1 Pro 64 bit/Xubuntu 15.04 Beta 1 64 bit

  7. #237
    Join Date
    Jul 2007
    Beans
    341

    Re: HOWTO: Rip DVDs in MPEG-4 AVC (x264), multi audio, subtitles, Matroska

    Hey guys, I wrote a script based on this thread. If you give it a list of iso files or dvd folders it will extract the video, audio and subtitles. It will then recompress these and mux them into a mkv file. My script can automatically choose the best audio and subtitle tracks to copy based on preferred languages. For the video it takes samples to decide on the crop setting and based on how grainy it is, whether or not to use hqdn3d. It also detects interlaced video and uses yadif to deinterlace.

    It's completely automated, so you can point it at a folder with a hundred dvd iso files, leave and a few days later all of them will have been converted to mkv files using all the right settings.

    I'm using this script to convert my entire dvd collection, but I want to share it with others. Where should I post it?
    Attached Files Attached Files

  8. #238
    Join Date
    Jul 2007
    Beans
    341

    Re: HOWTO: Rip DVDs in MPEG-4 AVC (x264), multi audio, subtitles, Matroska

    Quote Originally Posted by u-slayer View Post
    Hey guys, I wrote a script based on this thread. If you give it a list of iso files or dvd folders it will extract the video, audio and subtitles. It will then recompress these and mux them into a mkv file. My script can automatically choose the best audio and subtitle tracks to copy based on preferred languages. For the video it takes samples to decide on the crop setting and based on how grainy it is, whether or not to use hqdn3d. It also detects interlaced video and uses yadif to deinterlace.

    It's completely automated, so you can point it at a folder with a hundred dvd iso files, leave and a few days later all of them will have been converted to mkv files using all the right settings.

    I'm using this script to convert my entire dvd collection, but I want to share it with others. Where should I post it?
    Last time I posted a script in these forums, I got yelled at because apparently this isn't the right place for that. So if you have a better place I should post my script so that everyone can see please tell me. Until then here is how to run my script:

    How it works:
    iso2mkv is a fully automated script meant to automatically recompress dvd iso files into .mkv This is what it does:
    Extracts the vob file from an iso file without mounting and without root access.
    (It can also take video directly from a vob file or a disc in your DVD drive)
    Extracts audio tracks, normalizes and compress them to OGG Vorbis.
    (Can also directly copy the .ac3 audio tracks)
    Automatically crops the video to the correct size.
    Automatically chooses audio and subtitle tracks to copy based on preferred languages.
    Can automatically select the best audio track (based on on language then number of channels) and give it a higher bitrate than the other tracks.
    Automatically determines the frame rate and run time.
    Detects interlaced video and adds the correct video filters in the correct sequence.
    Compresses the video with two pass encoding or crf encoding (reccomended) to specified bitrate.
    Encapsulates video in an MP4 container.
    Finally it muxes all the video, audio and subtitle tracks into an mkv file.

    #Setup:
    #Install the programs iso2mkv needs:
    Install apps: sudo apt-get install mencoder mplayer normalize-audio gpac mkvtoolnix mpeg4ip-server
    #The mplayer/mencoder binary was last updated in 2007. If you want to upgrade mplayer/mencoder:
    svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer
    cd mplayer && ./configure --enable-gui && sudo make install
    #Edit the top of the script to change the default options to your liking. Specifically you need to change tempdir= and target= to folders you use. (You could also set these on the command line)

    #To Run:
    ./iso2mkv.py [options] files [options] files...

    I use the settings
    ./iso2mkv.py -vq2 -crf 19 -len 0 movie1.iso to get the feature film only.
    (change -len 0 to -len 33 or something to rip all video tracks over 33 seconds)

    #Command line options
    Everything can be set as a default at the top of the script or via command line to override the defaults
    A complete list of command line options is at the very bottom of the script. Below are some examples.

    iso2mkv reads the command line options in order. Each option applies to every file after it until the option is overridden by another.
    ./iso2mkv.py -vq2 -crf 20 -len 0 movie1.iso movie2.iso -crf 22 movie3.iso
    will encode the first two movies at a high bitrate (crf works on an inverse scale from 50 to 0) and quality settings and give a lower bitrate to the third movie. (-len 0 will only rip the longest video tracks)

    There are a few exceptions to the option rule. For example if you type:
    ./iso2mkv.py -b 1800 -nr 300 -aids 128,129 movie1.iso movie2.iso
    the script will only copy audio tracks 128 and 129 for movie1 but will use its normal decision structure for the audio tracks on movie2. However both movies will be encoded at 1800 kbps and both will have the noise reduction option applied to them.

    #vq levels
    There are three different quality settings so you can choose between speed of encoding and quality.
    For example type -vq2 and iso2mkv will use these x264 encoding options for mencoder:
    subq=6:8x8dct:me=umh:frameref=5:bframes=3:b_pyrami d:weight_bartitions=all

    #Language Selection
    At the top of the script there are options for default languages ( can also be set by command line)
    You can change the options to your preferred languages.
    For example:
    alang='en,es' means that only english and spanish audio tracks will be copied

    #Bitrate selection
    There are three ways to set the bitrate:
    bitrate=1800 #Set the bitrate directly
    target_size=700 #Target file size
    bitrate_percent=33 #Set the bitrate as a percent of the original source: 40 is great, 30 is good, 25 is okay
    crf=22 #Quality mode 0-50 0 is lossless - 18 thru 30 is a useful range. This is a single pass mode which automagically chooses the required bitrate for each frame to match a desired quality level. In my tests I have found it to be about 40% faster than a two pass encoding with no difference in quality. This option makes a lot more sense than trying to guess what bitrate is required to make each individual film look good. The only reason to use the bitrate based modes is if you want a specific file size.
    These can be set via the command line with -b, -size, -percent, -crf and -qp respectively.

    -size is very flexible: All of the options mean the same thing: 702 MiB = 736 MB = 736 = CD = CDR
    You can also say -size cd and iso2mkv will perform the necessary calculations to fit the movie onto a 702 MiB CD.
    Search for def get_target_size for a complete list of available sizes such as cd, dvd, mini cd, mini dvd, bd and so on...

    #Testing bitrate and quality levels with -sample
    ./iso2mkv.py -sample -b 500 -ss 31:00 -es 49:10 '/media/disk/mkv/5th Element 1/5th Element 1.vob' -b 1000 same -b 1500 same -b 2000 same -b 2500 same -vq2 -b 500 same -b 1000 same -b 1500 same -b 2000 same -b 2500 same
    This will produce 9 minute sample videos without audio at varying bitrates and quality levels.
    After a bitrate of 1500 it gets hard to spot differences between videos

    #Auto De-noise
    Samples the video in several places and compares the bitrates with and without hqdn3d.
    Example: -autodn 70 will use the hqdn3d filter if (bitrate with hqdn3d) / (bitrate without hqdn3d) < 70

    #Wanted features
    Detect Telecined video
    Blu-Ray compression
    Compare audio tracks and discard duplicates.

    Warnings:
    If there is corruption in the source file (sg1 1x03) mplayer will fill hard drive with junk and then crash.
    Mkvmerge will produce lines like this in the log:
    Warning: vobsub_reader: '/media/disk/mkv/I_AM_LEGEND.5.idx', line 711: The current timestamp (1524835:33:20.000) is smaller than the last one (1524838:03:20.000). mkvmerge will sort the entries according to their timestamps. This might result in the wrong order for some subtitle entries. If this is the case then you have to fix the .idx file manually
    Warning: spu_extract_duration: Encountered broken SPU packet (next_off < start_off) at timecode 00:09:20.343. This packet might be displayed incorrectly or not at all.
    I have tested videos with these errors and the subtitles all look fine to me and appear to be syncing with the audio.
    Last edited by u-slayer; July 18th, 2009 at 07:40 AM.

  9. #239
    Join Date
    Nov 2008
    Location
    Nashville, Tn
    Beans
    137
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HOWTO: Rip DVDs in MPEG-4 AVC (x264), multi audio, subtitles, Matroska

    so far so good. works really well. just curious though, ive looked through the script and it autimatically grabs any audio language from the disc for the selected language. but for videos that have more than one english audio it will grab them all. is there a place in the script to set max amount of languages to just one?

  10. #240
    Join Date
    Nov 2007
    Location
    Sweden
    Beans
    2,198

    Re: HOWTO: Rip DVDs in MPEG-4 AVC (x264), multi audio, subtitles, Matroska

    Quote Originally Posted by ixus_123 View Post
    If anyone is after a GUI frontend to do all this the OGMrip is up to the task
    SourceForge.net has some applications in this regard also: searched on dvd rip.
    Debian 8.0 "Jessie"
    HP laptop (15-ab064no-Nordic)
    Linux user since 1999.

Page 24 of 25 FirstFirst ... 1422232425 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •