LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 05-02-2005, 10:50 PM   #1
cheesekeeper
LQ Newbie
 
Registered: Feb 2005
Location: Cincinnati, O.
Distribution: Fedora Core 2
Posts: 19

Rep: Reputation: 0
Get video DVD title string for shell script?


Should be a simple one:

How can I grab the title string of a video DVD for a shell script? I want to write a script that runs dd on disc insertion, and I want to set the title of the iso file to the title of the DVD.
 
Old 05-03-2005, 03:24 AM   #2
Simon Bridge
Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 197Reputation: 197
um ... FC2 does this sort of thing for you: i.e. without requiring you to write a script to do it. You go to the main menue > preferences > CD and DVD. Theres a place to stick in the command you want to run and a radio button to check to run the command on insertion.
 
Old 05-03-2005, 04:01 AM   #3
hw-tph
Senior Member
 
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 57
Our moderator acid_kewpie has made a nice DVD ripping tool called acidrip. This requires a tiny little helper utility called lsdvd which you could use: lsdvd -c | grep "Disc Title" | gawk '{print $3}' should give you the title of the inserted DVD.


Håkan
 
Old 05-03-2005, 11:37 AM   #4
cheesekeeper
LQ Newbie
 
Registered: Feb 2005
Location: Cincinnati, O.
Distribution: Fedora Core 2
Posts: 19

Original Poster
Rep: Reputation: 0
Not there

I don't have a CD and DVD menu item under Preferences. Is that an optional install? I'm using FC 2.

Quote:
Originally posted by Simon Bridge
um ... FC2 does this sort of thing for you: i.e. without requiring you to write a script to do it. You go to the main menue > preferences > CD and DVD. Theres a place to stick in the command you want to run and a radio button to check to run the command on insertion.
 
Old 05-03-2005, 06:57 PM   #5
Electro
Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
The utility dd will not work on DVD video disc. I suggest vobcopy or dvd::rip (transcode). vobcopy can list the title of the disc and also rip the whole disc. Then you can use mkisofs or growisofs to make an ISO image. mplayer's mencoder loses audio and video sync so I suggest not using acid::rip.
 
Old 05-04-2005, 12:03 AM   #6
cheesekeeper
LQ Newbie
 
Registered: Feb 2005
Location: Cincinnati, O.
Distribution: Fedora Core 2
Posts: 19

Original Poster
Rep: Reputation: 0
It's worked for me (but I'm tricking it)

I'm assuming you're telling me dd won't work because of the disc protections? I'm using a workaround for that, in which I call a program that uses libdvdcss right before dd.

I like your suggestion, though, and I will try that. I don't want to transcode anything, so I won't use mencoder.

Thanks.

Quote:
Originally posted by Electro
The utility dd will not work on DVD video disc. I suggest vobcopy or dvd::rip (transcode). vobcopy can list the title of the disc and also rip the whole disc. Then you can use mkisofs or growisofs to make an ISO image. mplayer's mencoder loses audio and video sync so I suggest not using acid::rip.
 
Old 05-04-2005, 03:55 AM   #7
Simon Bridge
Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 197Reputation: 197
Not there??? Huh?!

Quote:
Originally posted by cheesekeeper
I don't have a CD and DVD menu item under Preferences. Is that an optional install? I'm using FC 2.
Good grief - well I have FC2, a standard install, and it's right there off the main menue in Gnome. The command is "gnome-cd-properties" which will also call the dialog from terminal. However, if you use KDE...?
 
Old 05-04-2005, 10:24 AM   #8
cheesekeeper
LQ Newbie
 
Registered: Feb 2005
Location: Cincinnati, O.
Distribution: Fedora Core 2
Posts: 19

Original Poster
Rep: Reputation: 0
Re: Not there??? Huh?!

Hehehe. Yes. I'm on KDE. I should have mentioned that.

Quote:
Originally posted by Simon Bridge
Good grief - well I have FC2, a standard install, and it's right there off the main menue in Gnome. The command is "gnome-cd-properties" which will also call the dialog from terminal. However, if you use KDE...?
 
Old 05-04-2005, 05:31 PM   #9
urka58
Member
 
Registered: Nov 2003
Distribution: slackware 14
Posts: 532

Rep: Reputation: 30
This script could be useful for the purpose. It gives you the infos you need to rip a DVD. Some extra programs are required such as
lsdvd
streamanalyze
streamdvd
figlet
The comments are in italian

#!/bin/sh
# dvdinfo.sh
# script per rilevare le informazioni di un DVD VIDEO. Richiede streamanalyze e lsdvd
# Per poter estrarre il DVD bisogna avere installato streamdvd.
clear
echo "INSERIRE IL TITOLO DEL DVD"
# directory dove verranno creati i files temporanei
dir=/home/$(whoami)/tmp_dvd
# definisce il titolo che verrā usato come nome base dei vari files creati
read film
# inizializza la variabile "titolo" con l'output del comando. (restituisce un numero intero decimale)
titolo=`lsdvd -x | grep Longest | awk '{print $3}'`
# inizializza la variabile "audio" con l'output del comando. (restituisce un numero esadecimale 0xNN)
audio=`lsdvd -t "$titolo" -v -a | grep Italiano | grep ac3 | awk '{print $20}'`
clear
# redirige l'output sul file che conterrā le informazioni del DVD
streamanalyze -i /dev/dvd -t $titolo -s 0xe0,$audio 1>&/$dir/$film
# inizializza la variabile "factor" con l'ouput del comando (restituisce un numero decimale in virgola mobile)
factor=`grep Factor $dir/$film | awk '{print $3,$4}'`
# inizializza la variabile "capitoli" con l'output del comando (restituisce un numero intero decimale)
capitoli=`grep Chapters $dir/$film | awk '{print $4}'`
echo
echo
echo "RIASSUNTO DEI VALORI DEL FILM"
figlet -c $film
echo "IL TITOLO CONTENENTE IL FILM E'---------------$titolo"
echo "RANGE DEI CAPITOLI----------------------------1-$capitoli"
echo "IL VALORE DEL FLUSSO VIDEO E'-----------------0xe0"
echo "IL VALORE DEL FLUSSO AUDIO (Italiano) E'------$audio"
echo "IL VALORE DEL FATTORE DI REQUANT E'-----------$factor"
# Qui termina la parte di raccolta delle info sul DVD
echo
echo
echo
# Esegue il ripping del DVD in caso di risposta affermativa, altrimenti termina il programma
echo "E' ORA POSSIBILE INIZIARE IL RIPPING DEL DVD $film"
echo "VUOI INIZIARE IL RIPPING ?"
read risposta
case $risposta in
y|yes|s|si)
if [ "$factor" != "not needed" ]; then
streamdvd -i /dev/dvd -t $titolo -c 1-$capitoli -s 0xe0,$audio -f $factor > /home/$(whoami)/$film.mpeg
else
streamdvd -i /dev/dvd -t $titolo -c 1-$capitoli -s 0xe0,$audio > /home/$(whoami)/$film.mpeg
fi
;;
n|no)
echo "IL PROGRAMMA VERRA' TERMINATO"
;;
esac


Hope this helps
Ciao
 
Old 05-05-2005, 05:53 AM   #10
Simon Bridge
Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 197Reputation: 197
cheeskeeper: don't sweat it - you asked for a script... you had no reason to know that Gnome had a built-in to deal with what you wanted. Now... re: ripping dvd's, you seem to be in good hands...
 
  


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
Shell Script - String Replacement revof11 Programming 7 11-29-2005 06:38 AM
(shell script) string parsing kuru Programming 4 09-12-2005 07:59 PM
Shell script to find a particular string Prasun1 Linux - General 5 08-30-2005 09:23 AM
change case of a string (TOUPPER) in shell script raees Linux - Software 3 05-03-2005 02:13 PM
exploding string into individual characters using a shell script farmerjoe Programming 9 10-13-2004 03:23 AM


All times are GMT -5. The time now is 03:10 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