LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General > LinuxAnswers Discussion
User Name
Password
LinuxAnswers Discussion This forum is to discuss articles posted to LinuxAnswers.

Notices


Reply
  Search this Thread
Old 03-04-2005, 08:16 PM   #121
wapcaplet
LQ Guru
 
Registered: Feb 2003
Location: Colorado Springs, CO
Distribution: Gentoo
Posts: 2,018

Rep: Reputation: 48

Delete your old configuration file; it will create a new one with default values. The "DVD" and "LOC" variables (both in the script and in the config file) were renamed "DVD_DEVICE" and "WORKING_DIR".

I'll see if I can figure out why it's giving the wrong output size... maybe my math is screwed up.

edit: OK, I see you figured it out
 
Old 03-04-2005, 08:28 PM   #122
wapcaplet
LQ Guru
 
Registered: Feb 2003
Location: Colorado Springs, CO
Distribution: Gentoo
Posts: 2,018

Rep: Reputation: 48
I've revised the part of the script that creates the config file. Here's the new code for it:

Code:
echo "==============================="
echo "Reading from the config file..."
echo "==============================="
echo " "

# If config file doesn't exist, create it
if [[ ! -e "$CONFIG_FILE" ]]; then
  CONFIG_CONTENTS=`cat << 'EOF'
# dvrequant configuration file

# The device name of the DVD drive to get content from
DVD_DEVICE /dev/dvd

# Working directory. This is where temporary content
# and the finished ISO will be saved. This directory
# should have about 11GB of free space in it.
WORKING_DIR /home/$USER
EOF`

  # Save contents to config file
  echo "$CONFIG_CONTENTS" > "$CONFIG_FILE"
fi
Everything above and below this block is the same. This approach lets you have a more self-documenting default configuration file; just add to the CONFIG_CONTENTS section if you want the default configuration file to have anything extra. That way, there's no need to distribute a separate config file with dvrequant; it's created automatically the first time you run it. It would even be easy to add a small piece of code to check whether the config file was created by an earlier version of the program, and offer the option to update it with the new defaults.

Note: I don't know how to get variables to be expanded in the "cat << EOF" style above (called a "here document"). For example, $USER in the default config file will get saved literally, without being evaluated. There's probably a way around it, but it's not really necessary yet.

Last edited by wapcaplet; 03-04-2005 at 08:34 PM.
 
Old 03-04-2005, 08:36 PM   #123
sk545
Member
 
Registered: Aug 2002
Posts: 312

Rep: Reputation: 30
Quote:
You can send this info to me at : steel_j1971@yahoo.ca It's not much but it's important to do it I think.
YGM.

Quote:
Those are cool! Kommander looks like it gives a very nice, step-by-step kind of interface. (Looks like it doesn't convert arbitrary videos to DVD format, though, so tovid is one step ahead of it there
Right, its basically an authoring program only. This kommander thing has got me a bit excited for some reason...maybe i'll try to learn it. Heehee.

Quote:
We could also do a "find / -name libdvdcss.so.2" but that would take forever, and isn't very reliable (since it'll find it, even if it's not usable).
You're right, that isn't the best way to do it.

Quote:
It already kind of uses a wizard approach, but with many more things to do in each step. I like the idea of keeping it very simple: "Pick some videos to play", "Choose a menu font", etc. I'll try to include something like this down the road.
tovid-gui is wizard-like, but its not a "hardcore" wizard, if you know what i mean. Its fine, and its flow has gotten much better.

Quote:
It's sort of like a Windows Notepad built into tovid. I figure there will occasionally be a need to edit small config files or whatnot; for instance, maybe an option to edit the dvdauthor/vcdxbuild XML file prior to authoring, or edit the dvrequant config file.
Sounds like a good idea, since there is ALWAYS some kind of text editing needed in Linux.

Quote:
Tested the new code. Got an error right away. It cannot create the work folder:
Yeah, i got the same thing. It works after your fix for the config file.
 
Old 03-04-2005, 09:42 PM   #124
sk545
Member
 
Registered: Aug 2002
Posts: 312

Rep: Reputation: 30
Just tried the newer version, a few things came up:

- 'slocate' wasn't installed by default on my system, so i had to apt-install it.
- Afterwards, the libdvdcss error was gone.
- Is there supposed to be some kind of counter that tells how much time is remaining? I see some code for it in the script, but no counter comes up in the console.
- It still exits out with a final.mpg and dv_dvd folder only. Tells me that it can't find mkisofs:

mkisofs: No such file or directory. Invalid node - .iso

Also, is there anyway to feed the iso into k3b directly? Like maybe have a prompt for k3b, then just use the k3b command line paramater to feed the iso into it?

Last edited by sk545; 03-04-2005 at 09:51 PM.
 
Old 03-04-2005, 09:51 PM   #125
Steel_J
Member
 
Registered: Oct 2004
Location: Montreal, Canada
Distribution: Linux Mint 21.3 Cinnamon
Posts: 359

Original Poster
Blog Entries: 1

Rep: Reputation: 31
Well looks like you found out why my method of error checking did not find your libdvdcss.

New method used now anyway with my joint effort with wapcaplet.

I am guessing your mkisofs is of a incompatible version somehow, either to new or to old. I would have to study mkisofs versioning.

Hummmmm!!!! I am a bit stumped. Give me sometime. Wapcaplet feeds me new code and ideas at a fast rate today and I have a major bugs to workout.

No counter as of yet. Surely later I could implement the counter system of Tovid. That's what open source is all about right; re-usable code, hahahaha!
 
Old 03-04-2005, 09:55 PM   #126
sk545
Member
 
Registered: Aug 2002
Posts: 312

Rep: Reputation: 30
Quote:
I am guessing your mkisofs is of a incompatible version somehow, either to new or to old. I would have to study mkisofs versioning.
$ mkisofs --version
mkisofs 2.01-unofficial-iconv (i686-pc-linux-gnu)

Quote:
Hummmmm!!!! I am a bit stumped. Give me sometime. Wapcaplet feeds me new code and ideas at a fast rate today and I have a major bugs to workout.
No problem, i am just giving as much feedback as i can today since i am going to be off to work the next two days. Not trying to rush you in any way.
 
Old 03-04-2005, 10:14 PM   #127
Steel_J
Member
 
Registered: Oct 2004
Location: Montreal, Canada
Distribution: Linux Mint 21.3 Cinnamon
Posts: 359

Original Poster
Blog Entries: 1

Rep: Reputation: 31
WapCaplet:

It is clear after much testing that the requant factor is calculated without the audio size value. That make the requant factor to small and outputs a final.mpg that is too large.

I am still trying to figure out why. The formula seems ok at fisrts glance. I am missing something.
 
Old 03-05-2005, 01:16 PM   #128
wapcaplet
LQ Guru
 
Registered: Feb 2003
Location: Colorado Springs, CO
Distribution: Gentoo
Posts: 2,018

Rep: Reputation: 48
Guys, check this out:

dvdunauthor /dev/dvd

I am testing it now, so I'm not sure what it does, but it appears that it's designed to rip the structure of the whole DVD, and generate a dvdauthor.xml file for re-authoring. This means we can rip discs, shrink individual titles, and then re-author all of the original content to a smaller disc, menus and everything. At least, I think that's what this means!

It's not very well documented, but I did find this site that talks about using dvdunauthor with xine-transcode.

Give it a try and let me know if you think we can use it.

Edit: OK, I gave it a test run. It does rip all the content from the DVD (all VOB files) and also generates a dvdauthor.xml file. Everything is saved in the current directory.

Problem is, the XML file is not complete - it doesn't include the "button" directives that tell where the menus jump to, so when you try to re-author the disc using:

Code:
dvdauthor -o output_dir -x dvdauthor.xml
You get errors about "Cannot find button 1 as referenced by subtitle" etc. The buttons are in the VOBs, but they are not defined in the XML file.

I'll keep investigating to see if we can extract the button info from the menus. There is a nice "spuunmux" utility that does just the opposite of "spumux" - it takes a VOB or MPG, and spits out a sub.xml and several PNGs for the button highlights. So we do have a good way to find out what buttons are in there - we just need a good way to find out where they jump to.

I'm excited! This could be exactly what we're looking for to make a complete disc-shrinking tool.

Last edited by wapcaplet; 03-05-2005 at 01:30 PM.
 
Old 03-05-2005, 03:39 PM   #129
sk545
Member
 
Registered: Aug 2002
Posts: 312

Rep: Reputation: 30
yep, i remember that tool (xine-transcode)...It got mentioned either here or on some other forums i was reading. I never gave it a try at that time for some reason that i can't remember...

/edit: now i remember, i didn't try it because it was based on transcode, i am not a big fan of transcode.

Last edited by sk545; 03-05-2005 at 03:41 PM.
 
Old 03-05-2005, 04:09 PM   #130
wapcaplet
LQ Guru
 
Registered: Feb 2003
Location: Colorado Springs, CO
Distribution: Gentoo
Posts: 2,018

Rep: Reputation: 48
OK, I've done some more experimenting with dvdunauthor. The XML file that is produced is sort of wacky, but I think there's probably a way to decipher it and make it work for re-authoring the disc.

Here's a sample snippet of output from a DVD I authored a while back:

Code:
<dvdauthor>
  <vmgm>
    <menus lang="en">
      <pgc>
        <vob file="vob_00_001m.vob">
          <cell start="0:00:00.000" end="-1" program="1" />
        </vob>
      </pgc>
      <pgc>
      </pgc>
    </menus>
  </vmgm>
  <titleset>
    <titles>
      <pgc>
        <vob file="vob_01_001t.vob">
          <cell start="0:00:00.000" end="0:07:46.899" chapter="1" />
        </vob>
        <vob file="vob_01_001t.vob">
          <cell start="0:07:46.899" end="0:19:25.330" chapter="1" />
        </vob>
        <vob file="vob_01_001t.vob">
          <cell start="0:19:25.330" end="0:35:46.677" chapter="1" />
        </vob>
        <vob file="vob_01_001t.vob">
          <cell start="0:35:46.677" end="-1" chapter="1" />
        </vob>
      </pgc>
This is the XML that is generated by 'dvdunauthor' on an existing DVD. For very simple DVDs, it seems to make sense, but I tried it on a commercial DVD and all the titles were in a weird order, and hard to decipher. But it's a good starting point - it gives us a structure to use for the DVD, which means we could (in theory) shrink each title, and re-author the entire disc - menus and all!

It tends to insert a lot of empgy PGCs (see the <pgc></pgc> above) which can just be ignored. For chapters, it authors a separate VOB for each chapter (see the four VOBs at the bottom, each with chapter="1"). I don't know what will happen when this is re-authored, but it looks like it will work once we get the buttons put back in, and linked to the appropriate titles.

All we need to figure out is how to automatically determine what each menu jumps to. Using 'spuunmux' on the menu VOB (vob_00_001m.vob, above - menus always seem to end in 'm') gives back the menu highlight images (which we don't need) and the spumux XML file with all the buttons. So, in short, we know how many buttons are on each menu, but we don't know where each button jumps to in the DVD. That information is not provided by dvdunauthor. There seems to be no guarantee that the buttons link to the titles in order - they could jump somewhere else, to the middle of a titleset, another menu, etc.

It's definitely progress, though! Maybe combining this with lsdvd or another tool, we can find out where the menus go.

By the way, I don't think we need xine-transcode - the page I linked to was just an example that happened to use it. I think we can still use the tcrequant, as we're already doing in dvrequant.

Last edited by wapcaplet; 03-05-2005 at 04:11 PM.
 
Old 03-05-2005, 07:35 PM   #131
sk545
Member
 
Registered: Aug 2002
Posts: 312

Rep: Reputation: 30
Well, this wiki seems to at least hint at the possiblility:

http://inferno.slug.org/cgi-bin/wiki...ng_And_Burning

"dvdauthor includes dvdunauthor which operates on dvd's or on the output of dvdbackup and decomposes the dvd structure, simultaneously creating an XML script that can be used to feed the decomposed data back into dvdauthor, possibly after passing the individual VOB's through tcrequant."

Also, some googling came up with this:

http://64.233.167.104/search?q=cache...crequant&hl=en

Its an old google cache, but it looks like people have been working on something like this, but the development stopped for some reason.

I did try dvdunauthor then dvdauthor <xml file>, and it leaves with an error, like you said::

INFO: dvdauthor creating table of contents
INFO: Scanning /mnt/vob//VIDEO_TS/vts_01_0.ifo
INFO: Scanning /mnt/vob//VIDEO_TS/vts_02_0.ifo
INFO: Scanning /mnt/vob//VIDEO_TS/vts_03_0.ifo
INFO: Scanning /mnt/vob//VIDEO_TS/vts_04_0.ifo
INFO: Scanning /mnt/vob//VIDEO_TS/vts_05_0.ifo
INFO: Scanning /mnt/vob//VIDEO_TS/vts_06_0.ifo
INFO: Scanning /mnt/vob//VIDEO_TS/vts_07_0.ifo
INFO: Creating menu for TOC

STAT: Processing vob_00_001m.vob...
ERR: Cannot find button '1' as referenced by the subtitle

---

After looking at the slug wiki, i can't help but think that maybe tovid could have a section where "small" things like backing up a dvd or making a dvd into a avi (ok, that is more complicated) should be included. It doesn't look like it would be too difficult to do, but it depends on where you want tovid to head. Personally, i think it would be cool to put in those since, hey, we have all the tools installed already as it is. Let me know what you think.

Last edited by sk545; 03-05-2005 at 07:50 PM.
 
Old 03-05-2005, 10:44 PM   #132
wapcaplet
LQ Guru
 
Registered: Feb 2003
Location: Colorado Springs, CO
Distribution: Gentoo
Posts: 2,018

Rep: Reputation: 48
Sweet, thanks for the links. I especially like the one you found in the Google cache - there's a complete script for ripping dvd9 to dvd5. Though, you might have noticed, it says in the script that you have to specify the buttons manually in the XML file - which is exactly the thing I'm stuck on. I have a few ideas for generating them automatically, but it probably won't work all the time. I guess it's better than nothing - if the menus can't be hooked up correctly, it can always just play everything in order, and skip using the menus.
 
Old 03-06-2005, 02:18 AM   #133
Steel_J
Member
 
Registered: Oct 2004
Location: Montreal, Canada
Distribution: Linux Mint 21.3 Cinnamon
Posts: 359

Original Poster
Blog Entries: 1

Rep: Reputation: 31
Never the less....You are on to something.

All of this "forumming" and video scripting of ours might have lead us quite close to the "Linux dvdshrink" sooner then we all thought.
 
Old 03-06-2005, 07:47 AM   #134
sk545
Member
 
Registered: Aug 2002
Posts: 312

Rep: Reputation: 30
Quote:
I guess it's better than nothing - if the menus can't be hooked up correctly, it can always just play everything in order, and skip using the menus.
Thats not a bad idea at all...also, i would do a backup of the google cache script, not sure how long the cache keeps it there, since it looks like you might find it useful.
Quote:
All of this "forumming" and video scripting of ours might have lead us quite close to the "Linux dvdshrink" sooner then we all thought.
Yeah, its pretty exciting and fun i would say. Well, fun for me at least, i dunno about the actual programming "fun" of it, if any. lol.

Last edited by sk545; 03-06-2005 at 07:50 AM.
 
Old 03-06-2005, 11:28 AM   #135
wapcaplet
LQ Guru
 
Registered: Feb 2003
Location: Colorado Springs, CO
Distribution: Gentoo
Posts: 2,018

Rep: Reputation: 48
I found another script for converting DVD9 to DVD5. Haven't tried it out, but it may be good to get ideas from.

I'm trying a quick-and-dirty re-author of a disc I unauthored. Here's what I did:
[list=1][*] dvdunauthor /dev/dvd. This rips everything off the DVD into the current directory (as VOBs), and creates a dvdauthor.xml file.[*] (Now you could do any tcrequant/shrinking you want to do to the individual titles. The video titles are VOBs ending in "t", such as vob_01_002t.vob. I didn't do any shrinking though, just to keep it simple.)[*] Look for any VOBs ending in "m" (i.e., vob_00_001m.vob). These are usually menus (or still-frame videos).[*] Run spuunmux vob_00_001m.vob. Some "m" menus do not have any subtitle streams, but any that are used for navigation will have them. You get several PNG files for output (the subtitle images) and a sub.xml.[*] Look at sub.xml for each menu. This lists buttons that are in the menu. They are named "1", "2", etc.[*] Edit dvdauthor.xml, and find the <menu> section corresponding to each of the menu VOBs. Add <button> tags for however many buttons there are. To keep things simple, I just made button 1 jump to title 1, button 2 to title 2, etc.[*] Save dvdauthor.xml, and run dvdauthor -o output_dir -x dvdauthor.xml[/list=1]

For a simple DVD that I made, this process worked perfectly. The title chapters were kept, and the menu works, and links to the correct titles. However, this test case was very simple: it has 1 menu and 6 titles, and the menu links to the titles in order. I don't know what would happen with a more complex DVD. If a menu links to still-images (usually also with a "m" in the name, since they are single-frame videos), this procedure probably won't work. If the titles are out of order (the menu buttons are not in the same order as the titles), then the menu will link to the wrong titles. If there are multiple menus and sub-menus, it probably won't work. If there are video titles that play before the main menu is reached (as is the case on virtually all commercial DVDs), it probably won't work.

But at least we know it's easy to make it work for simple discs. The procedure above could easily be automated, and I think we can use the dvrequant script to figure out some of the more complicated discs and still do the right thing.

When I eventually implement this in the GUI, I will definitely give the user an option to edit the dvdauthor.xml file before authoring. There's still a good chance that the dvdauthor.xml file will be invalid and won't author correctly, in which case it'll be necessary to edit it by hand. But the more we find out where errors occur, the more we can fix it to make editing unnecessary.

First things first, though: let's get it implemented in the dvrequant script. I think I will go ahead and get started on it. What I will probably do is provide a command-line option like '-all' or '-disc' to allow re-authoring the whole disc, and '-title' or '-single' to author only a single title from the disc. I may also include a '-menus' or '-nomenus' option to omit the menus entirely, if you just want to rip all the titles and play them in order.

Feel free to send any suggestions and test results my way! If you guys try this re-authoring procedure and it fails, let me know what went wrong (and send me the XML files). I have no doubt that it will fail on a lot of DVDs, since they're a lot more complex than this one.
 
  


Reply

Tags
k9copy



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] DVD9 to DVD5 guide Steel_J Linux - Software 62 05-08-2011 10:27 AM
problem at step 5 in "DVD9 to DVD5 guide" Vindane Linux - Software 5 04-24-2005 01:25 PM
DVD backup DVD9 to DVD5 ksgill Linux - Newbie 7 03-05-2005 03:08 PM
DVD9 to DVD5 Klas Linux - Software 2 12-15-2004 12:45 AM
DVD9 to DVD5 Avo Linux - Software 3 10-20-2004 04:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General > LinuxAnswers Discussion

All times are GMT -5. The time now is 12:29 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration