Avdump2 on Linux: Difference between revisions

From AniDB
Jump to navigation Jump to search
(First bunch of Linux usage notes)
 
(Second batch of Avdump2 on Linux notes)
Line 24: Line 24:
'''Library search path missing'''
'''Library search path missing'''


Most likely Mono can’t find the binary library even if it’s in the same directory as <tt>Avdump2CL.exe</tt>. Then you’ll have to set the environment variable <tt>LD_LIBRARY_PATH</tt> to point to the diretory into which you extracted Avdump2. Write yourself a wrapper script to do that or have a look at the example wrapper scripts below.
Most likely Mono can’t find the binary library even if it’s in the same directory as <tt>Avdump2CL.exe</tt>. Then you’ll have to set the environment variable <tt>LD_LIBRARY_PATH</tt> to point to the diretory into which you extracted Avdump2. Write yourself a wrapper script to do that or have a look at the example wrapper scripts below. Sometimes you’ll also have to set <tt>MONO_PATH</tt> to point to the same directory.


'''Incompatible GLIBC'''
'''Incompatible GLIBC'''
Line 33: Line 33:


If you modified ''any'' of the required files Avdump2 came with, you will usually get the misleading error ''Either the client is outdated or your username/password combination is wrong.'' So no, you can’t edit the config file either.
If you modified ''any'' of the required files Avdump2 came with, you will usually get the misleading error ''Either the client is outdated or your username/password combination is wrong.'' So no, you can’t edit the config file either.
== Workarounds ==
''' The cursor caret is gone and output resumes at the far right edge of the terminal window when I abort Avdump2 with ^C or it exits with some error.'''
Avdump2 doesn’t reset the console properly when you abort it or when it runs into a Mono-specific error. You can restore the cursor with <tt>setterm -cursor on</tt> and a simple <tt>echo</tt> if you write a wrapper for that. See examples below.
'''I can’t dump files that have spaces in their name.'''
This has been observed with Mono 2.4 but not with Mono 2.8. If it applies to you, you can add additional quotation marks to the parameters because Avdump2 can do its own parameter handling: <tt>Avdump2CL.exe -0 "\"file with spaces.mkv\""</tt> As you can’t use standard shell expansion like <tt>*.mkv</tt> with that, you’d better use the appropriate wrapper sript from below.
== Wrapper Scripts ==
To make using Avdump2 more comfortable, you can use or modify one of these wrapper scripts to handle all the workarounds. Save it as <tt>/usr/local/bin/avdump2cl</tt>, for example. These examples assume that you extracted Avdump2 to <tt>/usr/local/lib/avdump2</tt>.
A simple wrapper to set the <tt>LD_LIBRARY_PATH</tt> and to fix the cursor after using ^C:
<pre>
#!/bin/bash
export LD_LIBRARY_PATH=/usr/local/lib/avdump2
# If libMediaInfo still can't be found, uncomment this.
#export MONO_PATH=$LD_LIBRARY_PATH
if ! mono /usr/local/lib/avdump2/AVDump2CL.exe "$@" ; then
  echo
  setterm -cursor on
fi
</pre>
A more elaborate wrapper to add quotation marks to filenames with spaces in them if your Mono version doesn’t handle them properly:
<pre>
#!/bin/bash
export LD_LIBRARY_PATH=/usr/local/lib/avdump2
declare -i i=0
declare -a params
while [ $# -gt 0 ]; do
  if [ -z "${1##* *}" ]; then
    params[$i]="\"${1}\""
  else
    params[$i]="${1}"
  fi
  shift
  i=$i+1
done
if ! mono /usr/local/lib/avdump2/AVDump2CL.exe "${params[@]}" ; then
  echo
  setterm -cursor on
fi
</pre>
== Things That Just Don’t Work ==
Some things just don’t work on Linux and you’ll have to live with that. :P
'''Avdump2 corrupts the terminal or crashes with a ''DisplayBuffer'' error when I resize the terminal window.'''
The output routine used to draw the Avdump2 progress bars is not very compatible with the <tt>curses</tt>-based output used by Mono. Enlarging the terminal window usually results in writing over previous lines and shrinking the terminal window usually results in crashes because Avdump2 tries to write to areas that don’t exist anymore.
Solutions: Don’t resize the terminal window while Avdump2 is running or use the <tt>-w</tt> option to disable the progress bars.
== Unconfirmed Trouble ==
* Donefiles might not work with relative paths, so use an absolute path instead.
* Automatically deleting files might not work, files just stay there. Delete them manually instead.
* Avdump2 might exit with a return code of <tt>0</tt> on some errors, so don’t rely on the return code.

Revision as of 16:57, 19 June 2011

Avdump2 was developed on Windows, for Windows. Thanks to Mono it’s possible to run Avdump2 on Linux and all efforts are made to support all basic features on Linux as well, but handling every peculiarity of every Mono version on every Linux installation is beyond the scope of Avdump2 at this time. Therefore, some things just don’t work on Linux, or at least not right away, without some workarounds.

This page is a collection of various workarounds and suggestions that should help you get started with Avdump2 on Linux.

The Basics

Can't get Avdump2 to work at all? Here are some basic suggestions to set up Adump2.

Mono

Avdump2 has successfully been tested with Mono 2.4 on Ubuntu and with Mono 2.8 on Gentoo.

Avdump2CL.exe looks like a Windows .exe, how do I start it?

Try making the file executable. If that doesn’t work, call it using the mono Interpreter: mono Avdump2CL.exe

Avdump2 keeps looking for /some/directory/mono

If you extracted Avdump2 into /some/directory and it won’t work because it can’t find /some/directory/mono, you might have a buggy Mono version. This has been observed with Mono 2.10 on Gentoo and downgrading to Mono 2.8 solved the issue.

libMediaInfo

A special version of libMediaInfo is required for Avdump2 to work and if it can’t find the one it comes with, you will usually get Media Info Library not found. Don’t try to provide your own because the files are hashed and unknown versions will produce odd errors when you try to dump a file.

There are many possible causes if the library can’t be found.

Library search path missing

Most likely Mono can’t find the binary library even if it’s in the same directory as Avdump2CL.exe. Then you’ll have to set the environment variable LD_LIBRARY_PATH to point to the diretory into which you extracted Avdump2. Write yourself a wrapper script to do that or have a look at the example wrapper scripts below. Sometimes you’ll also have to set MONO_PATH to point to the same directory.

Incompatible GLIBC

If your Linux installation is very old or you’re using a distribution that ships with an outdated GLIBC (CentOS is a prime offender here), Mono can’t link against libMediaInfo and Avdump2 will still complain about missing the library. To check if that’s the case, use ldd libMediaInfo*.so. If you get a message like version 'GLIBCXX_3.4.9' not found, you’re out of luck. You can either try to update GLIBC, which usually involves pain, or upgrade or change your distribution to one with a newer GLIBC.

Hashing works but I can’t dump anything

If you modified any of the required files Avdump2 came with, you will usually get the misleading error Either the client is outdated or your username/password combination is wrong. So no, you can’t edit the config file either.

Workarounds

The cursor caret is gone and output resumes at the far right edge of the terminal window when I abort Avdump2 with ^C or it exits with some error.

Avdump2 doesn’t reset the console properly when you abort it or when it runs into a Mono-specific error. You can restore the cursor with setterm -cursor on and a simple echo if you write a wrapper for that. See examples below.

I can’t dump files that have spaces in their name.

This has been observed with Mono 2.4 but not with Mono 2.8. If it applies to you, you can add additional quotation marks to the parameters because Avdump2 can do its own parameter handling: Avdump2CL.exe -0 "\"file with spaces.mkv\"" As you can’t use standard shell expansion like *.mkv with that, you’d better use the appropriate wrapper sript from below.

Wrapper Scripts

To make using Avdump2 more comfortable, you can use or modify one of these wrapper scripts to handle all the workarounds. Save it as /usr/local/bin/avdump2cl, for example. These examples assume that you extracted Avdump2 to /usr/local/lib/avdump2.

A simple wrapper to set the LD_LIBRARY_PATH and to fix the cursor after using ^C:

#!/bin/bash

export LD_LIBRARY_PATH=/usr/local/lib/avdump2

# If libMediaInfo still can't be found, uncomment this.
#export MONO_PATH=$LD_LIBRARY_PATH

if ! mono /usr/local/lib/avdump2/AVDump2CL.exe "$@" ; then
  echo
  setterm -cursor on
fi

A more elaborate wrapper to add quotation marks to filenames with spaces in them if your Mono version doesn’t handle them properly:

#!/bin/bash

export LD_LIBRARY_PATH=/usr/local/lib/avdump2

declare -i i=0
declare -a params

while [ $# -gt 0 ]; do
  if [ -z "${1##* *}" ]; then
    params[$i]="\"${1}\""
  else
    params[$i]="${1}"
  fi
  shift
  i=$i+1
done

if ! mono /usr/local/lib/avdump2/AVDump2CL.exe "${params[@]}" ; then
  echo
  setterm -cursor on
fi

Things That Just Don’t Work

Some things just don’t work on Linux and you’ll have to live with that. :P

Avdump2 corrupts the terminal or crashes with a DisplayBuffer error when I resize the terminal window.

The output routine used to draw the Avdump2 progress bars is not very compatible with the curses-based output used by Mono. Enlarging the terminal window usually results in writing over previous lines and shrinking the terminal window usually results in crashes because Avdump2 tries to write to areas that don’t exist anymore.

Solutions: Don’t resize the terminal window while Avdump2 is running or use the -w option to disable the progress bars.

Unconfirmed Trouble

  • Donefiles might not work with relative paths, so use an absolute path instead.
  • Automatically deleting files might not work, files just stay there. Delete them manually instead.
  • Avdump2 might exit with a return code of 0 on some errors, so don’t rely on the return code.