I just updated all my scripts. If you update, be sure to update them all.

avi2mkv now finally automatically checks output container and audio format when a preset is specified. Also it can now mux to OGM container. Please test it and write if you find any problems.

choose_x264_encoding_parameters.sh now supports checking output video geometry and video bitrate. All encoding scripts now depend on it for scaling video!

menc, riptoh264 and blu2mkv now support user specified or x264 given output geometries and video bitrates. If there are multiple geometries allowed, the maximum resolution is used. When Bitrate is above preset limits, the maximum allowed value is used. User can specify output video width and height. Should only one parameter be given, video is scaled to calculated value given by specified value and source aspect ratio and black borders are added if the selected x264 video preset/playback device demands it.

Additionally riptoh264 now supports linear pcm audio streams.

blu2mkv also now supports the cropping of black borders and user specified output container selection (instead of Matroska use MPEG Transport Stream, ISO MP4 or OGM).

Search pattern not terminated at -e line 1.
...
Width =
Height =
Aspect =
...
No audio stream specified. Trying to use specified languages if available in source file. If not, default stream will be used.
AUDIO1 is -aid 0 1
...
Do not scale is no

So we have multiple minor and major problems here.

First: you have to put a space between -p and the preset. I don't know if this is a typo.

And: are there no language tags to the audio streams in the MKV file? You can correct that using the mmg header editor without copying all streams to a new file.
Or if you prefer other than the default languages (ger and eng), just set them in the beginning of the script (variables mkv_firstlanguage and mkv_secondlanguage).
But it is strange why it wants to encode two streams at once. ("-aid 0 1") I have to look into this to see if this is just a stupid output or a serious bug.

And last just a tip: if you don't want your FullHD content to be scaled down to 720p you have to specify the -n option (--noscale if I find the time to rewrite the option system )

Edit: I am not used to my own programming logic atm. With the new feature of preset based geometry checks, it is not clear if it gets scaled or if it doesn't. I will have to rethink the default values. Oh, those nifty library tool changes that affect multiple programs from different times. There is always an aspect you have not thought of. _________________Video Encoding scripts collection | Project page

Also you might check your source file. It seems to have two audio streams of a preferred language, which irritates the script in the last version.

I corrected that in my development version, but I already changed major features and my version is absolutely untested. So if you want to test further, consider changing the language setting of the unneeded audio stream in your source to something else (mmg has a header editor that can do that "in place" for Matroska sources). I don't know when i will release the corrected version. There are already some features i have in queue that seem easy to implement and maybe I will include them before the next release. _________________Video Encoding scripts collection | Project page

I'm really confused now, though. I know I've used this script successfully before, and I'm not sure what's changed on my system. Now, the script complains that it can't find tsmuxer. I have no indication that tsmuxer has ever been on this install. I installed tsMuxeR, and it complains that it can't find libfreetype.so.6

Avi2mkv needs tsMuxer when muxing to MPEG transport stream (which is used by default by several x264 encoding profiles - for instance the avchd or bluray presets but also ps3 and others). Some also support other containers, but you have to specify them on the command line with blu2mkv.

There should be a *_commands.log or *_mencoder.log with the command lines used for encoding.

Try to run those on the command line (in the same directory) and see what mencoder spits out.

I had cases, where mencoder was not built with x264 support, where mencoder could not handle one or more of the x264 preset parameters, ... If you did not recompile mplayer lately, the second option is more likely._________________Video Encoding scripts collection | Project page

mencoder does not open display windows. So the "video driver" is the decoding chain, the filter set or the encoder. when it is a x264 option there is a small statement somewhere that option xyz is not recognized._________________Video Encoding scripts collection | Project page

Most likely it is the slash at the end. Have not seen that before. You can also test if mbtree works for you. It is said to have good quality improvement with slight impact on the conversion time. (But in my experience there is not a visible difference in most sources when encoding fullHD in two-pass mode with 6000 kBit/s average bitrate, which is the default of blu2mkv - might be different when converting MTV-cut source material, but I could not watch that for a whole movie length )

Edit:
Thank you, you found a bug.

My replacement when encoding DTS audio sources is wrong.
encopts="${encopts//:mbtree/:nombtree/}"
is sed style. bash does not need the last /.

I just uploaded an updated version of blu2mkv. It will still take a while to implement the "killer feature" of version 1.0.0.

I recognized that tsMuxeR can't reproducibly report language codes, so I had to search for an alternative. I found one, but it is a C program that maybe will be a part of handbrake later. So I decided to reimplement the parser and add my functions to the program. Thanks to the developer(s) for providing this excellently working parser code. Took me less time to write it as my first real Perl program than it would have taken to read the documentation of the binary format. If they are interested, I will provide them with the additional functions to output tsMuxeR .meta files._________________Video Encoding scripts collection | Project page

external call was successfull
grep: 3000_x264_encoding_parameters.txt: No such file or directory
encoder options by preset are empty. Using default settings.
grep: 3000_x264_encoding_parameters.txt: No such file or directory
geometryfilteroptions
video filters used for first pass: -vf harddup
AUDIO channel used
second audio
MEncoder SVN-r30425-4.3.4 (C) 2000-2010 MPlayer Team

As you might have read in the Changelog, I have rewritten the option handling. But -b should normally work. For a try, use --bitrate instead. I think the long version of -p is --preset, but I am not sure atm.