LinuxAnswers DiscussionThis forum is to discuss articles posted to LinuxAnswers.
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.
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.
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.
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.
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?
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!
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.
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.
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.
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:
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.
"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."
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.