LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 09-10-2011, 07:04 AM   #1
Xeratul
Senior Member
 
Registered: Jun 2006
Location: Debian Land
Posts: 1,353

Rep: Reputation: 83
How to convert the VOBS of VIDEO_TS to a single AVI ?


Hello,

Onto my harddisk, I have an old copy of a DVD. I would like to make it as AVI.

Here is the ls:


Code:
ls -1
VIDEO_TS.BUP
VIDEO_TS.IFO
VIDEO_TS.VOB
VTS_01_0.BUP
VTS_01_0.IFO
VTS_01_0.VOB
VTS_01_1.VOB
VTS_01_2.VOB
VTS_01_3.VOB
VTS_01_4.VOB
VTS_02_0.BUP
VTS_02_0.IFO
VTS_02_0.VOB
VTS_02_1.VOB
VTS_03_0.BUP
VTS_03_0.IFO
VTS_03_0.VOB
VTS_03_1.VOB
VTS_04_0.BUP
VTS_04_0.IFO
VTS_04_0.VOB
VTS_04_1.VOB
VTS_05_0.BUP
VTS_05_0.IFO
VTS_05_0.VOB
VTS_05_1.VOB
Shall I run ?

Code:
		echo "Encoding Video..."
			xterm -bg black -fg green -e mencoder dvd://$title -dvd-device $DEVICE -o "$NAME.avi" -ovc x264 \
			-x264encopts turbo:subq=6:bframes=3:b_pyramid:weight_b:pass=1:psnr:bitrate=600:threads=auto \
			-vf $CROP,hqdn3d=2:1:2 -ofps 24000/1001  \
			-oac mp3lame -lameopts abr:aq=0:br=128 -mc 0 $4

			xterm -bg black -fg green -e mencoder dvd://$title -dvd-device $DEVICE -o "$NAME.avi" -ovc x264 \
			-x264encopts 8x8dct:frameref=5:subq=6:bframes=3:b_pyramid:weight_b:pass=2:psnr:bitrate=600:threads=auto \
			-vf $CROP,hqdn3d=2:1:2 -ofps 24000/1001  \
			-oac mp3lame -lameopts abr:aq=0:br=128 -mc 0 $4

			echo "Grabbing subtitles"
			xterm   -bg black -fg green -e  mencoder dvd://$title -dvd-device $DEVICE -nosound -ovc frameno -o /dev/null -slang en -vobsubout "$NAME" 2> /dev/null
 
Old 09-10-2011, 10:41 AM   #2
bryanl
Member
 
Registered: Dec 2003
Posts: 86

Rep: Reputation: 34
The simplest approach would be to use transcoding software that uses the 'command line' stuff as a backend. Two that work are:

Handbrake will let you select the videos by title and then take care of the partitioned video on the DVD. It is focused on the MP4 container as the AVI one is a bit long in the tooth. You can just point Handbrake to the ISO.

Avidemux will also concatenate the VOB files if you open one that is part of a series. With it, you can select the container and codecs for audio and video streams to transcode to. You'll need to mount the ISO to be able to open the VOB file.

The multiple VOB's are to keep file sizes down - a reminder of just how old that technology is!
 
Old 09-10-2011, 11:06 AM   #3
Xeratul
Senior Member
 
Registered: Jun 2006
Location: Debian Land
Posts: 1,353

Original Poster
Rep: Reputation: 83
I tried ffmpeg and mencoder from google search, but commands are not working. Nothing got done Command could be ok
 
Old 09-10-2011, 11:11 AM   #4
Xeratul
Senior Member
 
Registered: Jun 2006
Location: Debian Land
Posts: 1,353

Original Poster
Rep: Reputation: 83
It is however not working

Code:
#!/bin/bash

# First pass

mencoder -v\
	"$1"\
	-ofps 24000/1001\
	-sws 9\
	-vf crop=656:464:30:8,pullup,softskip,harddup,scale=784:464\
	-ovc x264 -x264encopts subq=4:bframes=3:b_pyramid:weight_b:turbo=1:pass=1:psnr:bitrate=1100\
	-oac copy\
	-of rawvideo\
	-o pass1.264

# Second pass

mencoder -v\
	"$1"\
	-ofps 24000/1001\
	-sws 9\
	-vf crop=656:464:30:8,pullup,softskip,harddup,scale=784:464\
	-ovc x264 -x264encopts subq=6:4x4mv:8x8dct:me=3:frameref=5:bframes=3:b_pyramid:weight_b:pass=2:psnr:bitrate=1100\
	-oac copy\
	-of rawvideo\
	-o pass2.264
 
Old 09-10-2011, 12:25 PM   #5
bryanl
Member
 
Registered: Dec 2003
Posts: 86

Rep: Reputation: 34
I don't know... trying to use ffmpeg and mencoder sounds like masochism to me

Also make sure you have libdvdcss (see https://help.ubuntu.com/community/Re...ts/PlayingDVDs ) installed as it is often needed for playing DVD's.
 
Old 09-10-2011, 01:54 PM   #6
Xeratul
Senior Member
 
Registered: Jun 2006
Location: Debian Land
Posts: 1,353

Original Poster
Rep: Reputation: 83
Quote:
Originally Posted by bryanl View Post
I don't know... trying to use ffmpeg and mencoder sounds like masochism to me

Also make sure you have libdvdcss (see https://help.ubuntu.com/community/Re...ts/PlayingDVDs ) installed as it is often needed for playing DVD's.
Code:
 sh /tmp/tee VTS_01_2 
MEncoder 1.0rc3-4.4.4 (C) 2000-2009 MPlayer Team
-x264encopts is not an MEncoder option

Exiting... (error parsing command line)
MEncoder 1.0rc3-4.4.4 (C) 2000-2009 MPlayer Team
-x264encopts is not an MEncoder option

Exiting... (error parsing command line)

with
Code:
#!/bin/bash

# First pass

mencoder -v\
	"$1"\
	-ofps 24000/1001\
	-sws 9\
	-vf crop=656:464:30:8,pullup,softskip,harddup,scale=784:464\
	-ovc x264 -x264encopts subq=4:bframes=3:b_pyramid:weight_b:turbo=1:pass=1:psnr:bitrate=1100\
	-oac copy\
	-of rawvideo\
	-o pass1.264

# Second pass

mencoder -v\
	"$1"\
	-ofps 24000/1001\
	-sws 9\
	-vf crop=656:464:30:8,pullup,softskip,harddup,scale=784:464\
	-ovc x264 -x264encopts subq=6:4x4mv:8x8dct:me=3:frameref=5:bframes=3:b_pyramid:weight_b:pass=2:psnr:bitrate=1100\
	-oac copy\
	-of rawvideo\
	-o pass2.264
 
Old 09-10-2011, 06:57 PM   #7
schneidz
Senior Member
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 4,094

Rep: Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635
hi, this is my saved output for xvidenc (x264enc):
Code:
[schneidz@hyper ~]$ cat bin/xvidenc-ac3-mkv.ksh
#!/bin/bash
################### START OF COMMANDS ###################

dvd=`lsdvd $1 | head -n 1 | awk '{print tolower($3)}' | sed s/_/-/g`
#mkdir /home/xbmc/win/stuff/clips/$dvd
titles=`lsdvd $1 | grep ^Title: | cut -b 8-9 | tail -n 1`
i=1
while [ $i -le 1 ]
do

/usr/bin/mencoder "dvd://$i" -dvd-device $1 -o /dev/null -vc mpeg12 -vf pp=al:c,softskip,unsharp=l5x5:.25:c5x5:.25,harddup -aid 128 -channels 6 -oac lavc -lavcopts acodec=ac3:abitrate=192 -a52drc 1 -ovc xvid -xvidencopts pass=1:turbo:me_quality=6:vhq=4:threads=2:max_bframes=2:bvhq=1:nopacked:quant_type=h263:noqpel:nogmc:trellis:nointerlacing:chroma_me:chroma_opt:hq_ac:nolumi_mask:rc_reaction_delay_factor=0:rc_averaging_period=100:closed_gop:autoaspect -passlogfile "$dvd-$i.log"

/usr/bin/mencoder "dvd://$i" -dvd-device $1 -o "$dvd-`zero-pad-2.x $i`".avi -vc mpeg12 -vf pp=al:c,softskip,unsharp=l5x5:.25:c5x5:.25,harddup -aid 128 -channels 6 -oac lavc -lavcopts acodec=ac3:abitrate=192 -a52drc 1 -ovc xvid -xvidencopts pass=2:bitrate=2000:me_quality=6:vhq=4:threads=2:max_bframes=2:bvhq=1:nopacked:quant_type=h263:noqpel:nogmc:trellis:nointerlacing:chroma_me:chroma_opt:hq_ac:nolumi_mask:rc_reaction_delay_factor=0:rc_averaging_period=100:closed_gop:autoaspect -passlogfile "$dvd-$i.log"




sleep 2

/usr/bin/mkvmerge   --title "$dvd-$title-ac3" --track-name 0:"$dvd-$title-ac3" --language 1:en --track-name 1:"AC3 5.1" "$dvd-`zero-pad-2.x $i`.avi"      -o "$dvd-`zero-pad-2.x $i`.mkv"
sleep 2

i=`expr $i + 1`
done
#################### END OF COMMANDS ####################
 
Old 09-10-2011, 08:12 PM   #8
teckk
Senior Member
 
Registered: Oct 2004
Distribution: FreeBSD Arch
Posts: 1,764

Rep: Reputation: 192Reputation: 192
Why don't you try to walk before you run. Something a little simpler.

Since the dvd vobs are on the hard drive instead of the dvd, you'll have to specify the path where the dvd data is, lets say ~/movie just for this example. I'll also assume that title 1 is the title that you want. You've got 5 titles on that dvd.

Code:
mencoder -dvd-device /home/movie dvd://1 -oac copy -ovc lavc -lavcopts vbitrate=2500:aspect=1.78 -o MyOuputAvi.avi
That will make you a movie with copied audio and mpeg video in an .avi container. This is a simple form.


If you want to crop black lines off of the picture then look at -vf crop= If your movie has a different aspect ratio than 1.78:1 then change that. If you want to encode audio instead of copy then do that. etc.

There's nothing hard about using mencoder or ffmpeg once you've learned a little sytax and have a little experience.

http://linux.die.net/man/1/ffmpeg
http://linux.die.net/man/1/mplayer
 
Old 09-10-2011, 08:23 PM   #9
teckk
Senior Member
 
Registered: Oct 2004
Distribution: FreeBSD Arch
Posts: 1,764

Rep: Reputation: 192Reputation: 192
Look at the man page, I think what you are wanting is something like

Code:
mencoder -dvd-device /home/movie dvd://1 -oac copy -ovc x264 -x264encopts bitrate=2500 -o output.avi
That's audio copy, x264 video at 2500 kbs. If you want to do any cropping then add it with -vf crop=
 
Old 09-11-2011, 02:50 PM   #10
Xeratul
Senior Member
 
Registered: Jun 2006
Location: Debian Land
Posts: 1,353

Original Poster
Rep: Reputation: 83
Quote:
Originally Posted by teckk View Post
Look at the man page, I think what you are wanting is something like

Code:
mencoder -dvd-device /home/movie dvd://1 -oac copy -ovc x264 -x264encopts bitrate=2500 -o output.avi
That's audio copy, x264 video at 2500 kbs. If you want to do any cropping then add it with -vf crop=
thank you so much.

The problem is that working on dvd://1 is rather slow. It would be simpler to copy whole DVD on disk, eject, and then work on the folder VIDEO_TS which is located onto the hdd...
 
Old 09-11-2011, 03:09 PM   #11
teckk
Senior Member
 
Registered: Oct 2004
Distribution: FreeBSD Arch
Posts: 1,764

Rep: Reputation: 192Reputation: 192
Quote:
The problem is that working on dvd://1 is rather slow. It would be simpler to copy whole DVD on disk, eject, and then work on the folder VIDEO_TS which is located onto the hdd...
That's not been my experience. You'll have less problems, and only have to do it once with something like
Code:
lsdvd
libdvdread: Using libdvdcss version 1.2.10 for DVD access
Disc Title: Blah Blah movie
Title: 01, Length: 01:26:40.143 Chapters: 09, Cells: 09, Audio streams: 02, Subpictures: 02

Title: 02, Length: 00:00:12.033 Chapters: 01, Cells: 01, Audio streams: 02, Subpictures: 02

Title: 03, Length: 00:00:12.000 Chapters: 01, Cells: 01, Audio streams: 02, Subpictures: 02

Title: 04, Length: 00:00:21.020 Chapters: 01, Cells: 01, Audio streams: 02, Subpictures: 02

Title: 05, Length: 00:02:07.310 Chapters: 01, Cells: 01, Audio streams: 02, Subpictures: 02

Longest track: 01
Code:
mplayer dvd://1
To see if it does what you want.
Code:
mencoder dvd://1 -oac copy -ovc lavc -lavcopts vbitrate=2500:aspect=1.78 -vf crop=718:360:2:62 -o MyMovie.avi
Otherwise you'll sometimes get the wrong language, if french for example is the default on the DVD,
The chapters can be mixed up, part of DVD copy protection, etc.

Last edited by teckk; 09-11-2011 at 03:10 PM.
 
Old 09-11-2011, 03:40 PM   #12
RedNeck-LQ
Member
 
Registered: Jan 2011
Posts: 83

Rep: Reputation: 11
This is how I rip my dvds that I owned and it works for me. The example below is ripping from a dvd drive. If you want to rip from a folder with a dvd-like structure i.e VOB files
replace dvd:// with -dvd-device and the path to your folder.

mplayer -dumpfile movie.avi -dumpstream -dvd-device folder_name/

First, determine which titles you want to rip using lsdvd or VLC. You can use VLC to see the current title playing.
Note: VLC can also rip titles too.

Next, Rip the title from the dvd with mencoder or mplayer. An example with title 1.

mencoder -o movie.vob -ovc copy -oac copy dvd://1

Or

mplayer -dumpfile movie.vob -dumpstream dvd://1

Note: Sometimes mencoder/mplayer will rip an audio stream language you do not want. For example, I once rip a dvd and the audio was in french. To rip the audio in english in this example add one of these options to the command above.

-aid 128 or -alang en

To determine the actual ID of the audio to rip, type
mplayer -identify -vo dummy -ao dummy dvd://1

Sample output

ID_AUDIO_ID=128
ID_AID_128_LANG=en
audio stream: 1 format: ac3 (stereo) language: fr aid: 129.

ID_AUDIO_ID=129
ID_AID_129_LANG=fr
number of audio channels on disk: 2.
subtitle ( sid ): 0 language: en

As you can see english audio is 128 and france audio is 129



Next, I then use ffmpeg to encode the movie.vob to divx5

ffmpeg -i movie.vob -vcodec mpeg4 -qmin 3 -qmax 31 -b 3600k -r 29.970 -g 300 -acodec libmp3lame -ar 48000 -ab 192k -ac 2 -async 48000 -vtag DX50 movie.avi

if your country uses PAL use -r 23.970 and -g 250

Last edited by RedNeck-LQ; 09-11-2011 at 04:26 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Video_TS to .avi conversion help. guriinii Linux - Software 2 01-12-2011 04:36 AM
[SOLVED] video_ts to avi timl Linux - Software 3 10-22-2010 01:53 AM
convert video_ts files to avi timl Linux - General 3 01-02-2010 07:09 PM
convert 2 cd avi to a single dvd initDr Linux - Software 1 08-10-2006 02:57 AM
vobs to avi -> how? synaptical Linux - General 2 04-11-2005 01:17 PM


All times are GMT -5. The time now is 02:56 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration