-n option activates the specification of the movie title after the inputfile. #

I can't see an inputfile in your command line.

the command you debugged needs the audio id in mplayer specification (zero based, like specified on the command line).
Normally the id is genrated either by grabbing the languages you specified (if language information is avaliable) or by interating over as many audio streams as either are available of as languages are specified.

It seems you ran into a race condition that never occured to me. Could you please verify that your input is valid? In the riptoh264 temporary directory you should have two log files containing commands. Start with testing the command calling avi2mkv and if that one fails try the one calling mkvmerge

2.0.0 was completly rewritten in another programming language, so it seems plausible that the error disappears pre-2.0.0. But I do not have an idea where to start looking for an error right now._________________Video Encoding scripts collection | Project page

I don't know the right syntax honestly, I am still trying to figure your scripts out. I thought I found that syntax somewhere else as an example. I was trying to read right off the disc. Can you give me an example of how to use that tool correctly and I can try again?

I am trying to read off the disc directly and encode into x264 in uhq quality, with English language audio. I would also like to use chapters and maybe subtitles too, but those are secondary wants.

If you want subtitles, then rip the disk to the harddisk first. Else you can buy a new drive before you have your movie!

I changed the default behaviour to assume "directory mode". But I now see, there is no command line option to set "read from disk". You have to set

Code:

riptoh264_directory = no

in the configuration file (or directory => "no" at the beginning of the program code). I will have to fix that.

Oh, I just see, the default in the config file is to put directory = no, which overrides the default. So this is not your problem. I just have to rethink my defaults

Your command line is correct (if you use the default configuration in ~/.fangorn/config). Chaptermarks are transfered automatically. If you want to have only english, either set it to the the default in the config file (remove the language = ger line at the top of the file) or give an additional

Code:

--language eng

on the command line (you can also abbreviate it by -l eng). Subtitles are copied using the -s switch, but as already written, it is advisable to copy the dvd to disk before trying to extract subtitles, because for every subtitle used the movie[/code] is read once, plus two times for the encoding. If I want to be really fast, I even copy the dvd to a RAMdisk before starting. Ok, that are the things you do if you have 12 GB of RAM and no need for virtualization at the time.

just trying out these scripts (specifically the riptoh264) and getting this error:

Code:

# riptoh264 BEO0NNF1/ test.mkv
###### the BEO0NNF1 is a dvd directory structure that was ripped to hd using dvdfab under wine
starting options testing
Encoding Movie BEO0NNF1 from device BEO0NNF1
encoding Title 1 which has 11 chapters
Volume ID: unknown
Disc ID:
Starting Processing. This can take a while. Please be patient.
Title 1: has 11 chapters and is seconds long
Use of uninitialized value in scalar chomp at /home/kundera/scripts/toolbox_fangorn line 1229.
Use of uninitialized value in scalar chomp at /home/kundera/scripts/toolbox_fangorn line 1232.
Use of uninitialized value in scalar chomp at /home/kundera/scripts/toolbox_fangorn line 1235.
Use of uninitialized value in division (/) at /home/kundera/scripts/toolbox_fangorn line 1236.
Use of uninitialized value in division (/) at /home/kundera/scripts/toolbox_fangorn line 1236.
Illegal division by zero at /home/kundera/scripts/toolbox_fangorn line 1236.

I have edited the location part for toolbox_fangorn in the riptoh264 script to point towards my script directory which is in my path.

it also looks like the aac flag isn't being passed too. I also tried using the -mp4 flag and still avi file.

EDIT well I think I figured out that an avi is first created then it is muxed? / converted? to matroska. I let the whole run but then ended up with zero files and a cryptic message about next time try using an input file. I lost the exact message. I will try again tonite when I'm actually home on the computer instead of ssh and see if I can reproduce the problem._________________Increasingly becoming a 2 channel audio nut!

You should have a config file in your /home/<username>/.fangorn/config

Activate debug mode by setting
debug = yes
in the config file. Or give the --debug flag on the command line. Then the temporary directory does not get cleaned away.

to clear the concept up a little:
I use multiple scripts for encoding - riptoh264 for dvds, blu2mkv for HD content and menc for the rest - who all use mencoder
to produce a valid h.264 video stream and audio in an AVI container (because this one is best supported by mencoder).
Then all the scripts call avi2mkv to mux the video and audio to other containers and maybe convert the audio on the fly if necessary.

riptoh264 in directory mode (which takes iso files also) is using the name of the directory as name of the movie by default.
If - like in your case - the directory is not named after the movie, you can provide the -n option and specify a name for the
movie at the end of the command line. I know this is inconsistant, but it is as it is for compatibility reasons with earlier versions.
In no way you have to specify the extension. This is selected by avi2mkv when finally muxing.

A "correct" command line would be

Code:

riptoh264 --debug -dn BEO0NNF1 <moviename>

it is <moviename>, not <filename>

Now to the specific error message. It seems the script cannot fully read the dvd structure. Have you tried playing it with mplayer

Code:

mplayer -dvd-device BEO0NNF1 dvd://

or you could see if lsdvd can read the dvd structure correctly.

Edit:
And I think when you are using "long options" (even when they are the short version ) it is recommended to use --aa --a2. The documentation for Getopt::Long is not very clear about that, but I do not think that this works for sure with just one -

But if these are the options you found working best for you, you can also set them in the config file.

If you want aac audio in a Matroska container, the support for audio conversion for matroska containers is quite young in avi2mkv and therefore not very well tested. I would start without audio conversion and if that works you can alway start another muxing session with an edited avi2mkv command line._________________Video Encoding scripts collection | Project page

You can do that, but if you find the time, please test avi2mkv for this job, as it is its own domain.

As my hardware is not so keen of MP4 and AAC (it plays, but MKV is supported better) my production
muxing goes into MKV. I ran just a few test cases, that worked for me. So I could use the input from
a tester that actually prefers MP4._________________Video Encoding scripts collection | Project page

Too many audio packets in the buffer: (4096 in 10485760 bytes).
Maybe you are playing a non-interleaved stream/file or the codec failed?
For AVI files, try to force non-interleaved mode with the -ni option.
Pos: 130.8s 3159f ( 2%) 29.73fps Trem: 79min 2775mb A-V:0.000 [3875:0]

Too many audio packets in the buffer: (4096 in 10485760 bytes).
Maybe you are playing a non-interleaved stream/file or the codec failed?
For AVI files, try to force non-interleaved mode with the -ni option.
File not found: 'crop=0:0:0:0,hqdn3d=2:1:2,harddup'
Failed to open crop=0:0:0:0,hqdn3d=2:1:2,harddup.
Cannot open file/device.

Exiting...
Switch will be removed from the Perl core distribution in the next major release. Please install it from CPAN. It is being used at /usr/local/bin/toolbox_fangorn, line 41.
movie title is war.mkv
using war.mkv.avi as source
Use of uninitialized value in scalar chomp at /usr/local/bin/toolbox_fangorn line 1229.
Use of uninitialized value in scalar chomp at /usr/local/bin/toolbox_fangorn line 1232.
Use of uninitialized value in scalar chomp at /usr/local/bin/toolbox_fangorn line 1235.
Use of uninitialized value in division (/) at /usr/local/bin/toolbox_fangorn line 1236.
Use of uninitialized value in division (/) at /usr/local/bin/toolbox_fangorn line 1236.
Illegal division by zero at /usr/local/bin/toolbox_fangorn line 1236.

This is using an updated mplayer ebuild with a new snapshot as of today. (31947) and perl-5.12.1-r1.

I should explain what happens. It appears to make the first pass fine, but when it comes to the second pass is when it crashes. I can play the temporary file during the initial run, as it is still encoding. However, the resolution is still 1920x1080. As I understand the config file, I've requested that it be resized to 1280x720 with the matted black bars to be cropped. I'm assuming when it comes to the second run, it fails and the temporary AVI is deleted and recreated with a 0 byte size.

So, my big question is: what am I doing wrong? Why is it failing, why is the temporary file still 1080p instead of 720p?_________________What's the worst that can happen?

I do not see what you are trying to do with this command. AFAIK I did not program an option --on
and the 1 (which did address an audiostream in earlier versions) does not address an audio stream
in MPEG Transport STream format. Also, in my experience, mencoder did have problems with
reencoding M2TS files directly. Also there is the problem that most Bluray productions compose
the Titles of multiple containers and that M2TS has no information of language codes or chapter
marks or such things. For such cases I have written bluray-info. It reads information from
AVCHD/Bluray Productions (the playlists) and can extract titles to .ts containers, preserving
information about languages, chapter, subtitles, ...

the tested procedure would be:
rename the source directory to something meaningful (in your case (war)
process the directory containing the BDMV directory with bluray-info
extract the main feature (mostly, but not always the longest item in the playlist)
blu2mkv <file.ts>
[/code]

If you just want one language, edit the config file and bluray-info will extract only audio and
subtitle streams of that language.

As a further tip: mencoder had problems using twopass encoding with the mbtree option before.
see the <moviename>_mencoder.log for detailed information what went wrong.

This is what I was after regarding that trigger. The .mt2s has 6? audio streams. I have english selected as the default on the config file. IIRC, it fails regardless if I specify the audio track at the command line. I did use tsmuxer to change from .mt2s to .ts as I re-read your original post regarding blu2mkv without much success.

I will try again leaving the config file settings as I noted without any command line switches activated._________________What's the worst that can happen?

Exiting...
Switch will be removed from the Perl core distribution in the next major release. Please install it from CPAN. It is being used at /usr/local/bin/toolbox_fangorn, line 41.
movie title is clones
Use of uninitialized value in scalar chomp at /usr/local/bin/toolbox_fangorn line 1229.
Use of uninitialized value in scalar chomp at /usr/local/bin/toolbox_fangorn line 1232.
Use of uninitialized value in scalar chomp at /usr/local/bin/toolbox_fangorn line 1235.
Use of uninitialized value in division (/) at /usr/local/bin/toolbox_fangorn line 1236.
Use of uninitialized value in division (/) at /usr/local/bin/toolbox_fangorn line 1236.
Illegal division by zero at /usr/local/bin/toolbox_fangorn line 1236.

As you can see, the temporary file is 3071MB before it starts drops out with the divide by zero error. Somewhere, it's zeroing out the temp file._________________What's the worst that can happen?

The problem why the encoding is not happening is that the mencoder line misses a "-vf " swtich before the crop= and other
filter options. I did not run into such an error for a long time (and I use this script multiple times a week). I will have to look into it.
Also the crop parameters are empty, so it seems your source is already in full 16:9 format without black borders. But normally
it does not use crop parameters then. Besides that the scale= parameters are missing to go from 1080p to 720p. Your settings
in config file seem to be correct. I will have to test this.

As for audio streams: blu2mkv prefers audio streams with the language information set. (all of them, not just the ones you want).
If none are set, it takes the first <number_of_audio_streams_wanted>, which is most likely not what you wanted - besides
you specially prepared the source.
If only some of the streams have language information, blu2mkv will most probably fail._________________Video Encoding scripts collection | Project page

The problem why the encoding is not happening is that the mencoder line misses a "-vf " swtich before the crop= and other
filter options. I did not run into such an error for a long time (and I use this script multiple times a week). I will have to look into it.
Also the crop parameters are empty, so it seems your source is already in full 16:9 format without black borders. But normally
it does not use crop parameters then. Besides that the scale= parameters are missing to go from 1080p to 720p. Your settings
in config file seem to be correct. I will have to test this.

As for audio streams: blu2mkv prefers audio streams with the language information set. (all of them, not just the ones you want).
If none are set, it takes the first <number_of_audio_streams_wanted>, which is most likely not what you wanted - besides
you specially prepared the source.
If only some of the streams have language information, blu2mkv will most probably fail.

The source does have black bars. I can do a crop detect in mplayer and it provides me with -vf crop=1920:784:0:150. The text in the config file states:

Kind of new to the whole encoding thing, but using these scripts (version from a couple days ago, I haven't tried the Friday update yet), any ideas why the .mkv output of riptoh264 would play fine in mplayer but not in xine? xine complains about dropped frames and only has a black screen until it seeks a bit and then "finishes". Interested in any suggestions.

Also, when I used riptoh264 -l jpn -l eng and had the order the other way in my config (language = eng, language = jpn), it extracted the audio in the command line order, but labeled them in the config file order (so jpn was labeled eng, and vice versa). Bug?_________________Website - All sorts of nonsense (some of it actually Linux related)

@PraetorZero
The dimensions result from my scripts trying to be as compatible as possible. So they use geometry in a 16x16 block design.
This is not really necessary most of the time, but it does not hurt (much).

@bssteph
I dont really know anything about xine. I have given up on every application using it a long time ago. There are alternatives that "just work".