简体   繁体   中英

Anaconda Gstreamer Gst packge lacking “jpegenc”

I have recently been working with gstreamer in python. I am working under an anaconda virtual environment.

I have run into an issue where it appears jpegenc is an inaccessible element.
gst_parse_error: no element "jpegenc" (1)

By request, the whole error.

File "---/gstreamer_test.py", line 15, in <module>
pipeline = Gst.parse_launch("v4l2src ! video/x-raw, framerate=30/1 , width=640,height=480 ! jpegenc ! appsink name=sink")
gi.repository.GLib.Error: gst_parse_error: no element "jpegenc" (1)

Gst inspect confirms that within the anaconda environment jpegenc is not listed. This said if I deactivate the anaconda environment the normal command line gst inspect can find the jepgenc.

Does anyone know a quick fix for jepgenc within anaconda? Would rather not build from source.

Python Version

Python 3.8.6 | packaged by conda-forge

Anaconda Version

conda 4.9.2

Package Versions

gst-plugins-base          1.14.5               h0935bb2_2    conda-forge
gst-plugins-good          1.14.5               h08bb679_2    conda-forge
gstreamer                 1.18.3               h3560a44_0    conda-forge

I have found a working solution for the moment. However, it does not extend to all the use cases I wish to cover. My webcam can natively generate mjpeg which is already encoded as jpeg. Therefore all you need to do is specify the output type to use from the source as shown below.

pipeline = Gst.parse_launch("v4l2src ! image/jpeg,framerate=30/1 , width=640,height=480 ! appsink name=sink")

This said this still does not solve the problem for cameras without native jpeg encoding or for cases where I want to transcode an incoming non jpeg stream.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM