[SOLVED] Transfering DVD and Blu Ray discs to my Slackware machine
SlackwareThis Forum is for the discussion of Slackware Linux.
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.
Your missing the needed extra libraries to do what you want with mencoder. Mainly x264 (which also needs YASM from extra/). Depending on the exact audio codec your wanting, you'll need that as well. Common audio codecs are FAAC, FAAD, lame(mp3), oggvorbis, or keep the original ac3 multichannel audio.
Strange enough, I did install FAAD, FAAC & lame and all that stuff when I installed XBMC from slackbuilds.org.... I did not actually skip any packages and installed everything that was required or even recommended.... Should FAAD, FAAC & lame and all other things appear in the output when I run mencoder -oac help & -ovc help?
Quote:
Mainly x264 (which also needs YASM from extra/).
Thats what I thought. I have a feeling, even if I'm a complete noob in multmedia under linux, that I have only the barebone stuff, nothing more. If this wont pose a problem down the road, could I be able to install all popular codecs and not be dependent on stuff I dont have?
Finally, what is roughly the difference between handbrake, mencoder & ffmpeg? Just a short description with key words would help. I know they are all transcoders but what are their strngth? In other words, why are you picking a tool over another for a certain job?
Thanks disturbed1, I understand it might be tough with all my questions,but I am just trying to instruct myself so I can help others and answer myself in the future!
First, thanks to all who contribute to the forums. In five years of using linux, specificaly Slackware, I have never encoutered a problem that could not be solved by searching (99% of my fixes have come from linuxquestions.org).Thanks again.
With that said, I use this to get dvds onto my htpc with no loss in visual quality and about one quarter the size.
Code:
#!/bin/sh
#
# As long as MPlayer, with all the dependencies, is installed this should work.
#
# Set the rip path to a folder where you have a good bit of room, > 12 gigs or so for 90 minute videos should be fine.
RIPPATH=/home/foo
# Change -alang to whatever language you want.
# Some dvds will play with the wrong audio track. "-alang en" takes care of that for me.
ALANG=en
echo "Enter a title for the rip"
read TITLE
echo
echo "Enter the track to rip ( usualy 1 ) or press enter for track 1"
read TRACK
if [ "$TRACK" = "" ]; then
TRACK="1"
else
echo
fi
# I read somewhere that black borders increase the encoded file size so.
echo
echo "Skip through the video some and make sure the black borders are consistent throughout"
echo "Press q to stop playing and enter the detected crop size."
echo "Press enter to start crop detection."
read NOTHING
mplayer dvd://${TRACK} -alang $ALANG -vf cropdetect -sb 50000000
echo
echo "Enter the detected crop size. (-vf crop=x:x:x:x) Copy and paste the x:x:x:x part"
read CROP
echo
echo "Enter the target bitrate or press enter for 900. A 90 minute video ends up being a little under a gigabyte with 900."
echo
echo "BITRATE"
read BITRATE
if [ "$BITRATE" = "" ]; then
BITRATE="900"
else
echo
fi
# Rip to hard drive
mplayer dvd://${TRACK} -alang $ALANG -dumpstream -dumpfile ${RIPPATH}/${TITLE}.mpg
# Encode to 264 using 2 passes. If your machine gets unresponsive while encoding change "threads=auto" to "threads=3" or
# "threads=2" or whatever.
mencoder ${RIPPATH}/${TITLE}.mpg \
-vf pullup,softskip,crop=${CROP},harddup -oac copy -sid 0 -forcedsubsonly \
-ovc x264 -x264encopts bitrate=${BITRATE}:\
subq=5:bframes=3:\
b_pyramid=normal:weight_b:turbo=1:threads=auto:pass=1 \
-o /dev/null
mencoder ${RIPPATH}/${TITLE}.mpg \
-vf pullup,softskip,crop=${CROP},harddup -oac copy -sid 0 -forcedsubsonly \
-ovc x264 -x264encopts bitrate=${BITRATE}:\
subq=5:8x8dct:frameref=2:bframes=3:\
b_pyramid=normal:weight_b:threads=auto:pass=2 \
-o ${RIPPATH}/${TITLE}.264
# Delete the data used for the 2 pass encode.
rm divx2pass*
# Delete the big old ripped video.
rm ${RIPPATH}/${TITLE}.mpg
Thanks guys for all the replies, this thread is getting really constructive! I feel the same way, if LQ wasn't there, i'd be using windows for sure... I got so many answers on the forum and met (virtually) so many good people here, I couldn't afford to lose LQ!
Anyways, I appreciate the suggestions, I realize that multimedia stuff in Linux is so "large" there is literally tons of ways to do something...
Just as a learning thing, I'd like to be explained quickly or pointed out to a good site, to know what is the difference between the transcoders (handbrake, mencoder & ffmpeg)? I am not looking for a master's thesis on that subject but just to have a better understanding of the subject, I think I will be spending quite a bit of time with this in the future...
In the meantime I will experiment with the above scripts! Thanks to all again!
Strange enough, I did install FAAD, FAAC & lame and all that stuff when I installed XBMC from slackbuilds.org.... I did not actually skip any packages and installed everything that was required or even recommended.... Should FAAD, FAAC & lame and all other things appear in the output when I run mencoder -oac help & -ovc help?
Finally, what is roughly the difference between handbrake, mencoder & ffmpeg? Just a short description with key words would help. I know they are all transcoders but what are their strngth? In other words, why are you picking a tool over another for a certain job?
Thanks disturbed1, I understand it might be tough with all my questions,but I am just trying to instruct myself so I can help others and answer myself in the future!
Thanks again!
Recompile mplayer/mencoder to get the new libs to appear. Use the sources / SlackBuild in the source/xap/MPlayer directory. That should allow mencoder to report the new libs with -ovc help -oac help.
I pick one over the other, just for personal preference. Given the same encoding options, they all produce roughly the same quality at the same encoding speed. Personally, I can't stand FFmpeg. They like to change the API/options and forget to document it. So when you're used to passing one set of options for years, it suddenly no longer works. It's not documented in the change log, read me, help, man page .... You need to read commit logs and header files to figure out what has changed. The new(ish) -vf is just one example. Before that, they changed the options of how external codecs were called. Though it could be documented by now, I stopped caring some time ago
Handbrake and mencoder are pretty close to each other. Mencoder is far more powerful with it's set of filters. Mencoder can also use more codecs to encode with. Handbrake is limited to 3 video codecs. h.264 via x264, theora via libtheora, and mpeg4-asp via ffmpeg/libavc. And only two format containers mkv and mp4. For audio it's, mp3 via lame, oggvorbis via libvorbis, aac via faac, or ac3/dts pass through. Handbrake is easier to compile and maintain though. As mplayer / mencoder relies on outside libraries. With mplayer you need to keep up with each encoding library. Handbrake's compile system builds each lib statically. When you build Handbrake from svn, it fetches fresh copies of known working/compatible codec libraries. No need to maintain anything, just do an svn up on Handbrake periodically.
I started backing up our movies to mkv with Handbrake some time ago, for a few reasons. x264 produces the same quality as xvid with a lower bitrate. Translates into a 1.5GiB xvid movie having the same quality as ~1.0GiB h.264 movie. No need to worry about detecting crop, aspect ratio, and resize values -- handbrake does this automatically. We moved from xvid compatible DVD players, to MythTV with VDPAU. VDPAU decodes h264 content and has good filters which use the hardware GPU's of your Nvidia card. Though recent Nvidia GPUs do support hardware decoding of mpeg4-asp (xvid), most of our MythTV front ends are running either Nvidia 9400 or 9500's which do not support VDPAU mpeg4-asp hardware decoding.
I usually use mencoder because I find it easier (not sure why) but lately I've been using ffmpeg as well. Here's what I use for different tasks.
1. Using a script for encoding with xvid and x264 using mencoder. All my DVD are ripped with highest quality using mencoder.
2. For home-videos, I used to use mencoder with my old miniDV camera. Now that I have flash drive hdd camera that records in H264, I use ffmpeg to convert MTS files to mkv or mp4.
3. Use ffmpeg2theora to convert files to Theora/vorbis, if I feel like.
4. Use ffmpeg to convert home videos to either flash or webm for web streaming. I'm experimenting with webm right now.
5. For mythtv recordings, some of the shows are converted to xvid.
I've posted a H264 encoding script using mencoder below. This one uses transcode, neroAacEnc, x264, and lame. My preferred encoding is H264 with Vorbis audio.
Recompile mplayer/mencoder to get the new libs to appear. Use the sources / SlackBuild in the source/xap/MPlayer directory. That should allow mencoder to report the new libs with -ovc help -oac help.
OK I'm just about to try people's suggestions but I am facing something strange: I recompiled MPlayer from sources using the slackbuild script and installed the package. Then I re-tried mencoder -ovc help only to find out that I did not have more choices than previously. Then reading the documentation on the MPlayer website, I realized that I should have a /usr/local/lib/codecs (or something similar) but I have nothing like that. I am running Slack64 13.1
Does it mean that I have NO codecs on that machine? DO I need to compile with a special argument such as --codecsdir= ???
I installed dozens of packages from slackbuilds prior to installing xbmc and since I built this machine I never had a problem to play video files nor audio files...
The codecs dir is for playback only. Mplayer can make use of some windows dll files for decoding.
Hmm, not sure why Mplayer did not pick up the new codecs. I tried it on my own machine, using the same SlackBuild and it found everything. Running just ./configure gives me this on one of my 64 machines (not quite 13.1 not quite -current )
Did you notice THIS part when running the SlackBuild?
Code:
++
|| MPlayer-20101218
++
**
** Removing internal DeCSS library.
** If you want to play encrypted DVD's you need to install libdvdcss separately.
** You take full legal responsibility for any use of DeCSS. We neither supply
** DeCSS code nor endorse any illegal use of it.
**
** If you are unaffected by patent concerns because you hold the required
** licenses and permission to use the patented code, or reside in a
** location where this is not a concern, and wish to include the patented
** and restricted code (you take all legal responsibility for doing so),
** then edit this SlackBuild script and change the line:
** USE_PATENTS=${USE_PATENTS:-"NO"}
** to:
** USE_PATENTS="YES"
**
Run the SlackBuild like so -
USE_PATENTS="YES" ./MPlayer.SlackBuild
Which produces the desired effect, and finds all codecs and options on this machine.
During compilation, here's the typical output I see (this is only a chunk of the whole thing...):
Code:
CC flashsvenc.o
CC flicvideo.o
CC flvdec.o
CC flvenc.o
CC fraps.o
CC frwu.o
CC g722.o
CC g726.o
CC gif.o
CC gifdec.o
CC golomb.o
CC gsmdec.o
CC gsmdec_data.o
CC h261.o
CC h261_parser.o
CC h261dec.o
CC h261enc.o
CC h263.o
CC h263_parser.o
CC h263dec.o
CC h264.o
h264.c: In function 'fill_filter_caches':
h264.c:2345: warning: initialization from incompatible pointer type
h264.c:2422: warning: initialization from incompatible pointer type
h264.c:2437: warning: initialization from incompatible pointer type
h264.c: In function 'decode_nal_units':
h264.c:2740: warning: array subscript is below array bounds
CC h264_cabac.o
In file included from h264_cabac.c:40:
x86/h264_i386.h: In function 'decode_significance_x86':
x86/h264_i386.h:41: warning: cast from pointer to integer of different size
x86/h264_i386.h:42: warning: cast from pointer to integer of different size
x86/h264_i386.h: In function 'decode_significance_8x8_x86':
x86/h264_i386.h:94: warning: cast from pointer to integer of different size
CC h264_cavlc.o
CC h264_direct.o
h264_direct.c: In function 'pred_spatial_direct_motion':
h264_direct.c:263: warning: assignment from incompatible pointer type
h264_direct.c:264: warning: assignment from incompatible pointer type
h264_direct.c: In function 'pred_temp_direct_motion':
h264_direct.c:443: warning: assignment from incompatible pointer type
h264_direct.c:444: warning: assignment from incompatible pointer type
CC h264_loopfilter.o
CC h264_mp4toannexb_bsf.o
CC h264_parser.o
CC h264_ps.o
CC h264_refs.o
CC h264_sei.o
CC h264dsp.o
CC h264idct.o
CC h264pred.o
CC huffman.o
CC huffyuv.o
CC idcinvideo.o
Does it mean that it found the codecs? I saw the very same thing the first time I compiled it...
Compilation just finished: same result! nothing more than with the stock mplayer that comes with slackware....
EDIT: Is there a way to clearly list all codecs installed on the system?
The codecs Mplayer finds is displayed just after configure finishes, before the build starts. This SlackBuild is one that AlienBob wrote, and has plenty of log files output in /tmp. You should have a configure log in /tmp.
The problem with listing what is installed, there is not really a great way to do this. Sometimes pkg-config is used, and you can pass the --modversion option, but (as with lame, for example) there may not even be a .pc file for that given library. If you built the packages using unmodified SlackBuilds from SlackBuilds.org, then all should be fine. An all too common of a problem is when you compile a package and the libraries end up the wrong directory. This happens by not specifying the correct arch (libraries end up in /usr/lib instead of /usr/lib64 on a 64bit system) you forget/ommit --libdir= and libraries end up in /usr/local/blah or some other place. You could cat /var/log/packages/$PACKAGE-NAME to see where (or if) packages are installed.
You did upgradepkg /tmp/MPlayer-blah.txz right
Re-reading the SlackBuild, MPlayer will disable several codecs UNLESSUSE_PATENTS="YES" ./MPlayer.SlackBuild is passed.
Code:
# Remove support for patent encumbered and possibly illegal code:
if [ "$USE_PATENTS" != "YES" ]; then
DO_PATENTED="--disable-libdvdcss-internal \
--disable-mp3lame --disable-mp3lame-lavc \
--disable-faac --disable-faac-lavc \
--disable-libopencore_amrnb \
--disable-libopencore_amrwb"
else
DO_PATENTED=""
fi
This should tell you what your install can handle.
Code:
mplayer -vc help
mplayer -ac help
Only if Mplayer was built against those libs. If those libs were installed after Mplayer was built, it changes nothing. Mplayer will not tell you "Hey I can this once you install X"
1-there is a file named configure-MPlayer.log in /tmp with the following content:
Code:
Config files successfully generated by ./configure --prefix=/usr --mandir=/usr/man --confdir=/etc/mplayer --enable-gui --enable-menu --enable-largefiles --disable-arts --codecsdir=/usr/lib64/codecs --language=en nl fr de es --enable-runtime-cpudetection !
Install prefix: /usr
Data directory: /usr/share/mplayer
Config direct.: /etc/mplayer
Byte order: little-endian
Optimizing for: Runtime CPU-Detection enabled
Languages:
Messages/GUI: en
Manual pages: en fr de es
Documentation: en fr de es
Enabled optional drivers:
Input: dvdnav(internal) ftp pvr tv-v4l2 tv-v4l tv librtmp cddb cdda libdvdcss(internal) dvdread(internal) vcd dvb smb networking
Codecs: libvpx libschroedinger libdirac xvid libdv libopencore_amrwb libopencore_amrnb ffmpeg(internal) real xanim faad2(internal) faac libdca libmpeg2(internal) liba52 mpg123 mp3lib(internal) libtheora libgsm speex tremor(internal) libmad liblzo gif
Audio output: alsa jack esd oss v4l2 sdl mpegpes(dvb)
Video output: v4l2 matrixview opengl sdl gif89a pnm jpeg mpegpes(dvb) fbdev svga caca aa xvidix cvidix dga vdpau xv x11 xover yuv4mpeg md5sum tga
Disabled optional drivers:
Input: vstream radio tv-dshow live555 nemesi bluray
Codecs: x264 qtx win32 musepack toolame twolame OpenJPEG
Audio output: sun openal pulse nas arts ivtv dxr2
Video output: zr zr2 ivtv dxr3 dxr2 vesa ggi winvidix 3dfx xmga xvmc directfb dfbmga bl xvr100 tdfx_vid wii s3fb tdfxfb mga
2-Then I realized that I was trying to compile with USE_PATENTS=yes ./MPlayer.SlackBuild instead of USE_PATENTS="YES" ./MPlayer.SlackBuilds (note the yes VS "YES")
3-THen I tried to compile using the "YES" instead of yes and compilation failed toward the end (I suppose because it compiled for like 5 minutes) with:
Quote:
libdvdcss/ioctl.o libdvdcss/libdvdcss.o libmpcodecs/ad_libmad.o libmpcodecs/vd_libmpeg2.o libmpeg2/alloc.o libmpeg2/cpu_accel.o libmpeg2/cpu_state.o libmpeg2/decode.o libmpeg2/header.o libmpeg2/idct.o libmpeg2/motion_comp.o libmpeg2/slice.o libmpeg2/idct_mmx.o libmpeg2/motion_comp_mmx.o stream/stream_smb.o libmpcodecs/vd_theora.o libmpdemux/demux_mng.o libmpcodecs/ad_mpg123.o libmpcodecs/ad_mp3lib.o mp3lib/sr1.o mp3lib/decode_mmx.o mp3lib/dct64_sse.o stream/stream_rtsp.o stream/freesdp/common.o stream/freesdp/errorlist.o stream/freesdp/parser.o stream/librtsp/rtsp.o stream/librtsp/rtsp_rtp.o stream/librtsp/rtsp_session.o osdep/shmem.o osdep/vsscanf.o stream/stream_netstream.o stream/asf_mmst_streaming.o stream/asf_streaming.o stream/cookies.o stream/http.o stream/network.o stream/pnm.o stream/rtp.o stream/udp.o stream/tcp.o stream/stream_rtp.o stream/stream_udp.o stream/realrtsp/asmrp.o stream/realrtsp/real.o stream/realrtsp/rmff.o stream/realrtsp/sdpplin.o stream/realrtsp/xbuffer.o libmpcodecs/vd_mpng.o stream/stream_pvr.o libmpcodecs/ad_realaud.o libmpcodecs/vd_realvid.o libmpcodecs/ad_speex.o stream/cache2.o tremor/bitwise.o tremor/block.o tremor/codebook.o tremor/floor0.o tremor/floor1.o tremor/framing.o tremor/info.o tremor/mapping0.o tremor/mdct.o tremor/registry.o tremor/res012.o tremor/sharedbook.o tremor/synthesis.o tremor/window.o stream/stream_tv.o stream/tv.o stream/frequencies.o stream/tvi_dummy.o stream/tvi_v4l.o stream/audio_in.o stream/tvi_v4l2.o sub/unrar_exec.o stream/stream_vcd.o libmpcodecs/ad_libvorbis.o libmpdemux/demux_ogg.o libmpcodecs/vd_xanim.o libmpcodecs/vd_xvid4.o ffmpeg/libavformat/libavformat.a ffmpeg/libavcodec/libavcodec.a ffmpeg/libavcore/libavcore.a ffmpeg/libavutil/libavutil.a ffmpeg/libpostproc/libpostproc.a ffmpeg/libswscale/libswscale.a -Wl,-z,noexecstack -ffast-math -lncurses -lsmbclient -lpng -lz -lmng -lz -ljpeg -lungif -lasound -ldl -lpthread -lcdda_interface -lcdda_paranoia -lfreetype -lz -lfontconfig -lass -lfribidi -lenca -lz -lbz2 -llzo2 -lmad -lspeex -lgsm -ltheora -logg -lmpg123 -la52 -ldca -lrtmp -lopencore-amrnb -lopencore-amrwb -ldv -lxvidcore -lm -ldirac_encoder -ldirac_decoder -lm -lstdc++ -lschroedinger-1.0 -lpthread -lm -lorc-0.4 -lvpx -lpthread -ldl -rdynamic -L/usr/lib64 -lm -lXext -lX11 -lpthread -lXss -lXv -lvdpau -lXinerama -lXxf86vm -lXxf86dga -laa -lcaca -lvga -lSDL -lGL -ldl -lesd -ljack -lfaac -lmp3lame -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lglib-2.0 -llirc_client cc: libdvdnav/dvdnav.o: No such file or directory
cc: libdvdnav/highlight.o: No such file or directory
cc: libdvdnav/navigation.o: No such file or directory
cc: libdvdnav/read_cache.o: No such file or directory
cc: libdvdnav/remap.o: No such file or directory
cc: libdvdnav/searching.o: No such file or directory
cc: libdvdnav/settings.o: No such file or directory
cc: libdvdnav/vm/decoder.o: No such file or directory
cc: libdvdnav/vm/vm.o: No such file or directory
cc: libdvdnav/vm/vmcmd.o: No such file or directory
cc: libdvdread4/bitreader.o: No such file or directory
cc: libdvdread4/dvd_input.o: No such file or directory
cc: libdvdread4/dvd_reader.o: No such file or directory
cc: libdvdread4/dvd_udf.o: No such file or directory
cc: libdvdread4/ifo_print.o: No such file or directory
cc: libdvdread4/ifo_read.o: No such file or directory
cc: libdvdread4/md5.o: No such file or directory
cc: libdvdread4/nav_print.o: No such file or directory
cc: libdvdread4/nav_read.o: No such file or directory
make: *** [mplayer] Error 1 Makefile:4: xml.mak: No such file or directory
./configure
Searching for XML catalogs...
Found SGML catalog at /etc/sgml/catalog
Searching for stylesheets...
Searching for html/chunk.xsl...
Found chunk.xsl at /usr/share/xml/docbook/xsl-stylesheets-1.75.2/html/chunk.xsl
Searching for html/docbook.xsl...
Found docbook.xsl at /usr/share/xml/docbook/xsl-stylesheets-1.75.2/html/docbook.xsl
Searching for DTD...
Found docbookx.dtd at /usr/share/xml/docbook/xml-dtd-4.5/docbookx.dtd
Looking for a valid XSLT processor...
Found xsltproc. If it works, it's probably the best choice.
mkdir -p ../HTML/en
cp -f default.css ../HTML/en
SGML_CATALOG_FILES=/etc/sgml/catalog xsltproc --catalogs -o ../HTML/en/MPlayer.html html-single.xsl en/main.xml
mkdir -p ../HTML/fr
cp -f default.css ../HTML/fr
SGML_CATALOG_FILES=/etc/sgml/catalog xsltproc --catalogs -o ../HTML/fr/MPlayer.html html-single.xsl fr/main.xml
mkdir -p ../HTML/de
cp -f default.css ../HTML/de
SGML_CATALOG_FILES=/etc/sgml/catalog xsltproc --catalogs -o ../HTML/de/MPlayer.html html-single.xsl de/main.xml
mkdir -p ../HTML/es
cp -f default.css ../HTML/es
SGML_CATALOG_FILES=/etc/sgml/catalog xsltproc --catalogs -o ../HTML/es/MPlayer.html html-single.xsl es/main.xml ./MPlayer.SlackBuild: line 298: cd: /tmp/build/package-MPlayer/usr/share/mplayer/skins: No such file or directory
./MPlayer.SlackBuild FAILED at line 298!
Also sometimes I start the compilation with the command USE_PATENTS="YES" ./MPlayer.SlackBuild and I get this:
Quote:
bash-4.1# USE_PATENTS="YES" ./MPlayer.SlackBuild
Source 'MPlayer-r29301.tar.bz2' not available yet...
Will checkout sources to /home/lpallard/mplayer
File 'MPlayer-r29301.tar.bz2' not available.. aborting the build.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.