Elleo / gst-deepspeech

NOTE: This plugin is now deprecated in favour of the coqui-stt branch in gst-plugins-bad: https://gitlab.freedesktop.org/philn/gstreamer/-/tree/coqui-stt/subprojects/gst-plugins-bad/ext/coqui
Other
169 stars 20 forks source link

Issue Running Plugin #12

Closed thecolorblue closed 6 years ago

thecolorblue commented 6 years ago

When I try to run the plugin in a gstreamer pipeline, or when I inspect the plugin with gst-inspect-1.0, I get this error:

(gst-inspect-1.0:15659): GStreamer-WARNING **: 14:35:57.638: Failed to load plugin '/usr/local/lib/gstreamer-1.0/libgstdeepspeech.so': /usr/local/lib/gstreamer-1.0/libgstdeepspeech.so: undefined symbol: ZN10DeepSpeech5Model14getInputVectorEPKsjiPPfPiS5 Could not load plugin file: Opening module failed: /usr/local/lib/gstreamer-1.0/libgstdeepspeech.so: undefined symbol: ZN10DeepSpeech5Model14getInputVectorEPKsjiPPfPiS5

I suspect it is related to how I linked the c libraries, but I don't know if is an issue with the install process or how I am running it.

Any help is greatly appreciated.

Elleo commented 6 years ago

Hi Brad,

What version of deepspeech did you install? gst-deepspeech is currently only compatible with version 0.1 and 0.1.1 (the released versions, not the current git head)

Also what distribution are you using? If it's anything Ubuntu derived then there are PPAs you can install with prebuilt packages. Take a look at my blog for details: http://blog.mikeasoft.com/2017/12/30/speech-recognition-mozillas-deepspeech-gstreamer-and-ibus/

Cheers, Mike

thecolorblue commented 6 years ago

Hi Elleo, I have deepspeech 0.1.1 installed.

I will try the PPA. I had issues installing it on my bare machine (I am having issues installing anything through apt-get, not related to this), but I am working in a docker container now so it should be easy to try.

I'll let you know how it goes.

thecolorblue commented 6 years ago

This is definitely a different issue, but I am going to post here since this is the journey I went on to solve the problem.

I added the ppa repositories:

add-apt-repository ppa:michael-sheldon/gst-deepspeech 
add-apt-repository ppa:michael-sheldon/gst-deepspeech

I got this error:

E: The repository 'http://ppa.launchpad.net/michael-sheldon/deepspeech/ubuntu bionic Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.

I updated:

apt-get update --allow-unauthenticated

I got the same error as when I added the repository.

I then tried to install the package:

root:# apt-get install gstreamer1.0-deepspeech
...
E: Unable to locate package gstreamer1.0-deepspeech
E: Couldn't find any package by glob 'gstreamer1.0-deepspeech'
E: Couldn't find any package by regex 'gstreamer1.0-deepspeech'

I know I went wrong somewhere but I am not sure if there was something I should have done when adding the repo, updating apt-get, or if I have the wrong package name.

Elleo commented 6 years ago

Hi Brad,

I'm afraid there aren't builds for bionic in the PPA yet, only Xenial and Artful; I'll see about kicking some off when I have a bit of time to spare (probably over the weekend)

Cheers, Mike

thecolorblue commented 6 years ago

I can try it again with xenial or artful. It should not be hard to switch. Is that documented somewhere in launchpad? I don't have a lot of experience using it.

thecolorblue commented 6 years ago

I got it working. I'm going to leave my steps here in case someone else has similar issues or someone wants to try it out in a docker image as well.

Here is what I did:

Dockerfile (pretty sparse):

FROM ubuntu:16.04

then in the container:

apt-get update
apt-get install python-setuptools python-dev build-essential
apt-get install libgstreamer1.0-0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-doc gstreamer1.0-tools
add-apt-repository ppa:michael-sheldon/gst-deepspeech
add-apt-repository ppa:michael-sheldon/deepspeech
apt-get update
apt-get install gstreamer1.0-deepspeech

after that I loaded a wav file onto the container and ran:

gst-launch-1.0 -m filesrc location=/path/to/file.wav ! decodebin ! audioconvert ! audiorate ! audioresample ! deepspeech ! fakesink

... and it worked!

Thanks for the help.

Elleo commented 6 years ago

Awesome, well done!