vigata / vgtmpeg

a Versed Generalist Transcoder

Home Page:http://godromo.com/gmt/vgtmpeg

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to compile vgtmpeg - what is needed to reference libdvdread-vgtmpeg?

ajkessel opened this issue · comments

When I try to build the latest git checkout from source, I get this error:
/usr/src/vgtmpeg/libavformat/dvdurl.c:175: undefined reference to 'DVDOpenEx'
I believe this is because it's not finding dvd_reader.c and dvd_reader.h from libdvdread-vgtmpeg. I have checked out, built, and installed the latest libdvdread-vgtmpeg, but that doesn't seem to have fixed anything. Is there something more I need to do to get the vgtmpeg to rely on the functions defined in libdvdread-vgtmpeg when building from source?

Make sure libdvdread-vgtmpeg is installed with the same prefix as vgtmpeg. If correctly installed you should see libdvdread-vgtmpeg dvd_reader.h header and libraries under 'lib' directory

libdvdread-vgtmpeg is installed in /usr/local and the headers and libraries are where you would expect them in /usr/local/include and /usr/local/lib respectively. It appears that vgtmpeg by default is configured for /usr/local as well but it must be pulling from /usr rather than /usr/local here. Am I missing an easy fix?

I found a workaround but uninstalling libdvdread-dev from Debian. Then the vgtmpeg build process properly relied on the /usr/local versions of the package. I also need to export LD_LIBRARY_PATH=/usr/local/lib before invoking vgtmpeg for it to rely on the right libraries.

I think there may be some library name clashing going on. In reality vgtmpeg is thought to be compiled with a user provided prefix (usually --prefix= con configure) that will create a pseudo root for the compile. This is how compiles work with the vgtmpeg build scripts. (available on github under vgtmpeg-builds)

commented

I am also having this issue.

Like @ajkessel I can get vgtmpeg to work if I run export LD_LIBRARY_PATH=/usr/local/lib before invoking vgtmpeg. However, I am having trouble getting that to work from python scripts to integrate its usage in another project.

I also looked at using the build scripts but I am compiling on ARM (raspberry pi) and the build scripts seem to only support x86_32/64. I read over them to see if I could add ARM or see what I was missing but I was not able to figure it out.

Below is the list of commands I'm using to compile. These complete successfully if the prefix is /usr/local but they fail if I change it.

I have tried compiling with a prefix (/home/niich/build/vgtmpeg/build) but when I do that I get an error trying to compile vgtmpeg that it can't find libbluray.

Thanks for your help, and let me know if you need any more information.

compile steps for vgtmpg on ARM mostly working

sudo apt-get update
sudo apt-get install -y libdvdread-dev autoconf libtool libxml2-dev libfontconfig1-dev

download source
git clone --depth=1 https://github.com/vigata/vgtmpeg.git

cd vgtmpeg

git clone --depth=1 https://github.com/vigata/libbluray-vgtmpeg.git

git clone --depth=1 https://github.com/vigata/libdvdread-vgtmpeg.git

cd libbluray-vgtmpeg

build and install libbluray
git rm -r --cached contrib/libudfread
rmdir contrib/libudfread

git submodule add https://code.videolan.org/videolan/libudfread.git contrib/libudfread
git submodule update --init

./bootstrap
./configure --prefix=/usr/local --disable-bdjava-jar
make -j8
sudo make install

build and install libdvdread
cd ../libdvdread-vgtmpeg
autoreconf -f -i
./configure --prefix=/usr/local
make -j8
sudo make install

build and install vgtmpeg
cd ..
./configure --prefix=/usr/local
make -j8
sudo make `install

notes that might help

Distributor ID: Raspbian
Description: Raspbian GNU/Linux 10 (buster)
Release: 10
Codename: buster
Raspberry Pi 3
Kernel: 4.19.97-v7+

update

It seems like this might be more of a package clash error than a compile error.

I was able to determine that vgtmpeg was trying to reference the wrong libdvdread.

running ldd showed that vgtmpeg was trying to referance the standard libdvdread not the one i compiled.
pi@raspberrypi:~ $ ldd /usr/local/bin/vgtmpeg
...
libbluray.so.2 => /usr/local/lib/libbluray.so.2
libdvdread.so.4 => /usr/lib/arm-linux-gnueabihf/libdvdread.so.4
...

I removed this lib with this command
pi@raspberrypi:~ $ sudo apt --purge remove libdvdread4

After that re-running ldd shows that vgtmpeg is now referencing the correct libdvdread
libdvdread.so.4 => /usr/local/lib/libdvdread.so.4

But wait, there's more
After the previous steps, I received a segmentation fault when I tried to run the same command that was previously causing the reference error.

I am going to try recompiling on a fresh Raspbian image to see if any of my other "testing" caused the problem.

Update 2
So I tried another disk and did not get the error. I'm not sure why just that disk is having issues. It worked previously but not anymore.

For now, I am going to move on to another task and just hope that it was caused by a scratch or some other anomaly with that specific dvd. If I find that this error happens more often then ill have to look into a better solution.