tuffy / python-audio-tools

A collection of audio handling programs which work from the command line.
http://audiotools.sourceforge.net
GNU General Public License v2.0
250 stars 58 forks source link

DVD-Audio support #42

Closed remenor closed 9 years ago

remenor commented 9 years ago

I'll resurrect it as a seperate project later [...]

Use pretty dvda2track. Waiting for the new project. Until then I can not update...

tuffy commented 9 years ago

The ETA on the new project is a few weeks away. I'm working on make the bitstream library a little more portable and cleaning up any warnings that show up when building.

After thinking about it a little more, what I'll probably do is fold all the DVD-A features into a C library (libdvdaudio?) which Python Audio Tools can detect and use - like how it installs the cd2track utility if libcdio is present. The library will include some very basic DVD-A information and extraction utilities for debugging purposes (like mini versions of dvdainfo and dvda2track, compared to the full versions in Python Audio Tools).

This library won't change as quickly as Python Audio Tools and I can test it more thoroughly for memory leaks or other problems against all the DVD-A discs that I have without worrying about breaking it every time I make a change in Python Audio Tools.

remenor commented 9 years ago

I'll probably do is fold all the DVD-A features into a C library (libdvdaudio?) which Python Audio Tools can detect and use [...] without worrying about breaking it every time I make a change [...] Good idea, thanks!

tuffy commented 9 years ago

libdvd-audio is now available at:

https://github.com/tuffy/libdvd-audio

or packaged releases at:

http://libdvd-audio.sourceforge.net/

I've tested the library under Linux against all the discs in my collection and it's working as well or better than the old embedded version. A lot of old hacks have been fixed and some unusual discs are supported better.

If the latest version of Python Audio Tools (currently 3.0 beta 1) detects that libdvd-audio is installed (using pkg-config), it will install the dvda2track and dvdainfo utilities - which work very similarly to how they did before. It's analogous to how cd2track and cdinfo are installed only if the libcdio library is detected.

I hope you find it useful, and let me know if you run into any bugs.

remenor commented 9 years ago

Thanks! I could compile the library, although the make indicated an error:

m4 -DLIB_DIR=/usr/local/lib -DINCLUDE_DIR=/usr/local/include -DMAJOR_VERSION=1 -DMINOR_VERSION=0 -DRELEASE_VERSION=0 libdvd-audio.pc.m4 > libdvd-audio.pc /bin/sh: 1: m4: not found make: *\ [libdvd-audio.pc] Error 127

Installation apparently worked without errors. It is important the above error?

tuffy commented 9 years ago

That little piece is to get the library to show up under pkg-config, which will be helpful if you want Python Audio Tools to find it automatically. If you install the m4 macro processor (usually just "apt-get install m4" or something similar), delete the empty "libdvd-audio.pc" file and try the install again, it should work okay. If successful, running:

pkg-config --list-all | grep libdvd

should display a result.

remenor commented 9 years ago

It works perfectly! Thank you

remenor commented 9 years ago

I have a problem only in one pc (in other works properly):

dvda2track -h
Traceback (most recent call last):
  File "/usr/local/bin/dvda2track", line 24, in <module>
    import audiotools.dvda
ImportError: libdvd-audio.so.1: cannot open shared object file: No such file or directory

Not a problem in the library. Can be used directly:

dvda2wav
*** Usage : dvda2wav -A [AUDIO_TS] [OPTIONS]
Options:
  -h, --help                show this help message and exit
  --version                 display version number and exit
  -A PATH, --audio_ts=PATH  path to disc's AUDIO_TS directory
[...]

It seems to be a permissions problem. Am I doing something wrong?

sudo make install
install -m 644 libdvd-audio.so.1.0.0 /usr/local/lib
cp -Pp libdvd-audio.so.1 /usr/local/lib
cp -Pp libdvd-audio.so /usr/local/lib
install -m 644 libdvd-audio.a /usr/local/lib
install -m 644 include/dvd-audio.h /usr/local/include
install -m 755 dvda-debug-info dvda2wav /usr/local/bin
install -m 644 libdvd-audio.pc /usr/lib/pkgconfig
tuffy commented 9 years ago

The dvda2wav and dvda-debug-info tools use the static library so they should always work. Python Audio Tools is linked against the dynamic library.

You may just need to run "ldconfig" as root in order to refresh the linker's library cache. Or, it's possible that "/usr/local/lib" isn't in your "/etc/ld.so.conf" path. If that's the case, one solution would be to change "/usr/local/lib" to "/usr/lib" and "/usr/local/include" to "/usr/include" in the Makefile and then reinstall. Another solution is to add "/usr/local/include" to your "/etc/ld.so.conf" and then call "ldconfig" to refresh your library cache. One of those should work to get it running.

remenor commented 9 years ago

Thank you. It was only necessary to refresh the cache