ContinuumIO / anaconda-issues

Anaconda issue tracking
646 stars 220 forks source link

PyQt5 - Gstreamer plugins not found #8047

Open raphmur opened 6 years ago

raphmur commented 6 years ago

Hi all,

I am trying to develop a Qt5 interface using QVideoWidget and QMediaPlayer from the QtMultimedia package. So far on Linux (CentOS 7). I am first trying to run the simple program from https://pythonprogramminglanguage.com/pyqt5-video-widget/ but so far without success.

conda info --show-channel-urls

outputs:

# packages in environment at /xxxPATHxxx/conda2/envs/py2:
#
bzip2                     1.0.6                h6d464ef_2    defaults
ca-certificates           2017.08.26           h1d4fec5_0    defaults
certifi                   2017.11.5        py27h71e7faf_0    defaults
dbus                      1.10.22              h3b5a359_0    defaults
expat                     2.2.5                he0dffb1_0    defaults
ffmpeg                    3.4                  h7264315_0    defaults
fontconfig                2.12.1                        3    defaults
freetype                  2.5.5                         2    defaults
glib                      2.53.6               h5d9569c_2    defaults
gst-plugins-base          1.12.2               he3457e5_0    defaults
gstreamer                 1.12.2               h4f93127_0    defaults
icu                       54.1                          0    defaults
jpeg                      9b                   h024ee3a_2    defaults
libffi                    3.2.1                hd88cf55_4    defaults
libgcc                    7.2.0                h69d50b8_2    defaults
libgcc-ng                 7.2.0                h7cc24e2_2    defaults
libiconv                  1.14                          0    defaults
libopus                   1.2.1                hb9ed12e_0    defaults
libpng                    1.6.32               hbd3595f_4    defaults
libstdcxx-ng              7.2.0                h7a57d05_2    defaults
libvpx                    1.6.1                h888fd40_0    defaults
libxcb                    1.12                 hcd93eb1_4    defaults
libxml2                   2.9.4                         0    defaults
openssl                   1.0.2n               hb7f436b_0    defaults
pcre                      8.41                 hc27e229_1    defaults
pip                       9.0.1                    py27_1    defaults
pyqt                      5.6.0            py27h4b1e83c_5    defaults
python                    2.7.13                        0    defaults
qt                        5.6.2                         5    defaults
readline                  6.2                           2    defaults
setuptools                36.4.0                   py27_1    defaults
sip                       4.18.1           py27he9ba0ab_2    defaults
sqlite                    3.13.0                        0    defaults
tk                        8.5.18                        0    defaults
wheel                     0.29.0                   py27_0    defaults
xz                        5.2.3                h55aa19d_2    defaults
zlib                      1.2.11                        0    defaults

And conda info

     active environment : py2
    active env location : /xxxPATHxxx/conda2/envs/py2
            shell level : 1
       user config file : /xxxuser/.condarc
 populated config files : /xxxuser/.condarc
          conda version : 4.4.6
    conda-build version : 3.2.1
         python version : 2.7.13.final.0
       base environment : /xxxPATHxxx/conda2  (writable)
           channel URLs : https://repo.continuum.io/pkgs/main/linux-64
                          https://repo.continuum.io/pkgs/main/noarch
                          https://repo.continuum.io/pkgs/free/linux-64
                          https://repo.continuum.io/pkgs/free/noarch
                          https://repo.continuum.io/pkgs/r/linux-64
                          https://repo.continuum.io/pkgs/r/noarch
                          https://repo.continuum.io/pkgs/pro/linux-64
                          https://repo.continuum.io/pkgs/pro/noarch
                          https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
          package cache : /xxxPATHxxx/conda2/pkgs
                          /xxxuser/.conda/pkgs
       envs directories : /xxxPATHxxx/conda2/envs
                          /xxxuser/.conda/envs
               platform : linux-64
             user-agent : conda/4.4.6 requests/2.14.2 CPython/2.7.13 Linux/3.10.0-514.26.2.el7.x86_64 centos/7 glibc/2.17
                UID:GID : 26283:1500
             netrc file : None
           offline mode : False

The issue I have is that I get the error after loading a video (.avi, mpeg4 encoded):

    Warning: "No decoder available for type 'video/x-msvideo'."
    Error: "Your GStreamer installation is missing a plug-in."

I am convinced I am missing something in the conda install or in the package linking and I would for sure benefit from some insights...

Any clue on making this work? Am I missing some Gstreamer packages? Will Gstreamer need to be built with ffmpeg bindings?

raphmur commented 6 years ago

Additional information about Gstreamer install

(py2) []$ which gst-inspect-1.0 
/xxxPATHxxx/conda2/envs/py2/bin/gst-inspect-1.0
(py2) []$ gst-inspect-1.0 
pbtypes:  GstVideoMultiviewFlagsSet (GstDynamicTypeFactory)
audiotestsrc:  audiotestsrc: Audio test source
adder:  adder: Adder
app:  appsrc: AppSrc
app:  appsink: AppSink
videoscale:  videoscale: Video scaler
audioresample:  audioresample: Audio resampler
subparse: subparse_typefind: srt, sub, mpsub, mdvd, smi, txt, dks, vtt
subparse:  subparse: Subtitle parser
subparse:  ssaparse: SSA Subtitle Parser
tcp:  socketsrc: socket source
tcp:  tcpclientsink: TCP client sink
tcp:  tcpclientsrc: TCP client source
tcp:  tcpserversink: TCP server sink
tcp:  tcpserversrc: TCP server source
tcp:  multifdsink: Multi filedescriptor sink
tcp:  multisocketsink: Multi socket sink
videoconvert:  videoconvert: Colorspace converter
encoding:  encodebin: Encoder Bin
audioconvert:  audioconvert: Audio converter
typefindfunctions: video/x-ms-asf: asf, wm, wma, wmv
typefindfunctions: audio/x-musepack: mpc, mpp, mp+
typefindfunctions: audio/x-au: au, snd
typefindfunctions: video/x-msvideo: avi
typefindfunctions: audio/qcelp: qcp
typefindfunctions: video/x-cdxa: dat
typefindfunctions: video/x-vcd: dat
typefindfunctions: audio/x-imelody: imy, ime, imelody
typefindfunctions: audio/midi: mid, midi
typefindfunctions: audio/riff-midi: mid, midi
typefindfunctions: audio/mobile-xmf: mxmf
typefindfunctions: video/x-fli: flc, fli
typefindfunctions: application/x-id3v2: mp3, mp2, mp1, mpga, ogg, flac, tta
typefindfunctions: application/x-id3v1: mp3, mp2, mp1, mpga, ogg, flac, tta
typefindfunctions: application/x-apetag: mp3, ape, mpc, wv
typefindfunctions: audio/x-ttafile: tta
typefindfunctions: audio/x-mod: 669, amf, ams, dbm, digi, dmf, dsm, gdm, far, imf, it, j2b, mdl, med, mod, mt2, mtm, okt, psm, ptm, sam, s3m, stm, stx, ult, umx, xm
typefindfunctions: audio/mpeg: mp3, mp2, mp1, mpga
typefindfunctions: audio/x-ac3: ac3, eac3
typefindfunctions: audio/x-dts: dts
typefindfunctions: audio/x-gsm: gsm
typefindfunctions: video/mpeg-sys: mpe, mpeg, mpg
typefindfunctions: video/mpegts: ts, mts
typefindfunctions: application/ogg: ogg, oga, ogv, ogm, ogx, spx, anx, axa, axv
typefindfunctions: video/mpeg-elementary: mpv, mpeg, mpg
typefindfunctions: video/mpeg4: m4v
typefindfunctions: video/x-h263: h263, 263
typefindfunctions: video/x-h264: h264, x264, 264
typefindfunctions: video/x-h265: h265, x265, 265
typefindfunctions: video/x-nuv: nuv
typefindfunctions: audio/x-m4a: m4a
typefindfunctions: application/x-3gp: 3gp
typefindfunctions: video/quicktime: mov, mp4
typefindfunctions: image/x-quicktime: qif, qtif, qti
typefindfunctions: image/jp2: jp2
typefindfunctions: video/mj2: mj2
typefindfunctions: text/html: htm, html
typefindfunctions: application/vnd.rn-realmedia: ra, ram, rm, rmvb
typefindfunctions: application/x-pn-realaudio: ra, ram, rm, rmvb
typefindfunctions: application/x-shockwave-flash: swf, swfl
typefindfunctions: application/dash+xml: mpd, MPD
typefindfunctions: application/vnd.ms-sstr+xml: no extensions
typefindfunctions: video/x-flv: flv
typefindfunctions: text/plain: txt
typefindfunctions: text/utf-16: txt
typefindfunctions: text/utf-32: txt
typefindfunctions: text/uri-list: ram
typefindfunctions: application/itc: itc
typefindfunctions: application/x-hls: m3u8
typefindfunctions: application/sdp: sdp
typefindfunctions: application/smil: smil
typefindfunctions: application/ttml+xml: ttml+xml
typefindfunctions: application/xml: xml
typefindfunctions: audio/x-wav: wav
typefindfunctions: audio/x-aiff: aiff, aif, aifc
typefindfunctions: audio/x-svx: iff, svx
typefindfunctions: audio/x-paris: paf
typefindfunctions: audio/x-nist: nist
typefindfunctions: audio/x-voc: voc
typefindfunctions: audio/x-sds: sds
typefindfunctions: audio/x-ircam: sf
typefindfunctions: audio/x-w64: w64
typefindfunctions: audio/x-rf64: rf64
typefindfunctions: audio/x-shorten: shn
typefindfunctions: application/x-ape: ape
typefindfunctions: image/jpeg: jpg, jpe, jpeg
typefindfunctions: image/gif: gif
typefindfunctions: image/png: png
typefindfunctions: image/bmp: bmp
typefindfunctions: image/tiff: tif, tiff
typefindfunctions: image/webp: webp
typefindfunctions: image/x-exr: exr
typefindfunctions: image/x-portable-pixmap: pnm, ppm, pgm, pbm
typefindfunctions: video/x-matroska: mkv, mka, mk3d, webm
typefindfunctions: application/mxf: mxf
typefindfunctions: video/x-mve: mve
typefindfunctions: video/x-dv: dv, dif
typefindfunctions: audio/x-amr-nb-sh: amr
typefindfunctions: audio/x-amr-wb-sh: amr
typefindfunctions: audio/iLBC-sh: ilbc
typefindfunctions: audio/x-sbc: sbc
typefindfunctions: audio/x-sid: sid
typefindfunctions: image/x-xcf: xcf
typefindfunctions: video/x-mng: mng
typefindfunctions: image/x-jng: jng
typefindfunctions: image/x-xpixmap: xpm
typefindfunctions: image/x-sun-raster: ras
typefindfunctions: application/x-bzip: bz2
typefindfunctions: application/x-gzip: gz
typefindfunctions: application/zip: zip
typefindfunctions: application/x-compress: Z
typefindfunctions: subtitle/x-kate: no extensions
typefindfunctions: application/x-subtitle-vtt: vtt
typefindfunctions: audio/x-flac: flac
typefindfunctions: audio/x-vorbis: no extensions
typefindfunctions: video/x-theora: no extensions
typefindfunctions: application/x-ogm-video: no extensions
typefindfunctions: application/x-ogm-audio: no extensions
typefindfunctions: application/x-ogm-text: no extensions
typefindfunctions: audio/x-speex: no extensions
typefindfunctions: audio/x-celt: no extensions
typefindfunctions: application/x-ogg-skeleton: no extensions
typefindfunctions: text/x-cmml: no extensions
typefindfunctions: application/x-executable: no extensions
typefindfunctions: audio/aac: aac, adts, adif, loas
typefindfunctions: audio/x-spc: spc
typefindfunctions: audio/x-wavpack: wv, wvp
typefindfunctions: audio/x-wavpack-correction: wvc
typefindfunctions: audio/x-caf: caf
typefindfunctions: application/postscript: ps
typefindfunctions: image/svg+xml: svg
typefindfunctions: application/x-rar: rar
typefindfunctions: application/x-tar: tar
typefindfunctions: application/x-ar: a
typefindfunctions: application/x-ms-dos-executable: dll, exe, ocx, sys, scr, msstyles, cpl
typefindfunctions: video/x-dirac: no extensions
typefindfunctions: multipart/x-mixed-replace: no extensions
typefindfunctions: application/x-mmsh: no extensions
typefindfunctions: video/vivo: viv
typefindfunctions: audio/x-nsf: nsf
typefindfunctions: audio/x-gym: gym
typefindfunctions: audio/x-ay: ay
typefindfunctions: audio/x-gbs: gbs
typefindfunctions: audio/x-vgm: vgm
typefindfunctions: audio/x-sap: sap
typefindfunctions: video/x-ivf: ivf
typefindfunctions: audio/x-kss: kss
typefindfunctions: application/pdf: pdf
typefindfunctions: application/msword: doc
typefindfunctions: image/vnd.adobe.photoshop: psd
typefindfunctions: image/vnd.wap.wbmp: no extensions
typefindfunctions: application/x-yuv4mpeg: no extensions
typefindfunctions: image/x-icon: no extensions
typefindfunctions: image/x-degas: no extensions
typefindfunctions: application/octet-stream: no extensions
typefindfunctions: application/x-ssa: ssa, ass
typefindfunctions: video/x-pva: pva
typefindfunctions: audio/x-xi: xi
typefindfunctions: audio/audible: aa, aax
videotestsrc:  videotestsrc: Video test source
rawparse:  unalignedaudioparse: unalignedaudioparse
rawparse:  unalignedvideoparse: unalignedvideoparse
rawparse:  rawaudioparse: rawaudioparse
rawparse:  rawvideoparse: rawvideoparse
coretracers:  latency (GstTracerFactory)
coretracers:  log (GstTracerFactory)
coretracers:  rusage (GstTracerFactory)
coretracers:  stats (GstTracerFactory)
coretracers:  leaks (GstTracerFactory)
videorate:  videorate: Video rate adjuster
volume:  volume: Volume
gio:  giosink: GIO sink
gio:  giosrc: GIO source
gio:  giostreamsink: GIO stream sink
gio:  giostreamsrc: GIO stream source
playback:  playbin: Player Bin 2
playback:  playbin3: Player Bin 3
playback:  playsink: Player Sink
playback:  subtitleoverlay: Subtitle Overlay
playback:  streamsynchronizer: Stream Synchronizer
playback:  decodebin: Decoder Bin
playback:  decodebin3: Decoder Bin 3
playback:  uridecodebin: URI Decoder
playback:  urisourcebin: URI reader
playback:  parsebin: Parse Bin
ximagesink:  ximagesink: Video sink
audiorate:  audiorate: Audio rate adjuster
coreelements:  capsfilter: CapsFilter
coreelements:  concat: Concat
coreelements:  dataurisrc: data: URI source element
coreelements:  downloadbuffer: DownloadBuffer
coreelements:  fakesrc: Fake Source
coreelements:  fakesink: Fake Sink
coreelements:  fdsrc: Filedescriptor Source
coreelements:  fdsink: Filedescriptor Sink
coreelements:  filesrc: File Source
coreelements:  funnel: Funnel pipe fitting
coreelements:  identity: Identity
coreelements:  input-selector: Input selector
coreelements:  output-selector: Output selector
coreelements:  queue: Queue
coreelements:  queue2: Queue 2
coreelements:  filesink: File Sink
coreelements:  tee: Tee pipe fitting
coreelements:  typefind: TypeFind
coreelements:  multiqueue: MultiQueue
coreelements:  valve: Valve element
coreelements:  streamiddemux: Streamid Demux
staticelements:  bin: Generic bin
staticelements:  pipeline: Pipeline object

Total count: 23 plugins, 210 features
mingwandroid commented 6 years ago

I'm afraid our qt / gstreamer packages do not support many video formats, if they support any at all.

We cannot for licensing reasons support things like mp4 (h264) or hevc (h265).

I would like to be able to support webm with opus audio or mp3 audio in the future but cannot make any promises.

raphmur commented 6 years ago

Alright then Is there a way to "build" gstreamer with the correct bindings with conda build to get the good codecs?

mingwandroid commented 6 years ago

Is there a way to "build" gstreamer.

No need for the quotes around build, because rebuild gstreamer is exactly what you want to do, finally, but it requires a good amount of knowledge about how to build software packages. First you'd need to make conda packages for all of the audio and video codec libraries that you want to add support for, then modify the ffmpeg conda package so it uses them and then rebuild gstreamer (though this step may not be necessary because gstreamer might dynamically query ffmpeg).

There's a community effort that's built around conda and conda-build called conda-forge. Their ffmpeg recipe is at https://github.com/conda-forge/ffmpeg-feedstock. They have a gitter channel too: https://gitter.im/conda-forge/conda-forge.github.io

Before attempting to contribute audio and video codec packages to conda-forge I would try to find out if there are any they explicitly will not link to their ffmpeg for licensing reasons.

raphmur commented 6 years ago

Brilliant

I already tried ffmpeg from the conda-forge channel, and was hoping that gstreamer would correctly bind to it and with the needed codecs, but looks like it is not. I am quite familiar with building on linux, but not so much with the ffmpeg-gstreamer connection.

I guess I will try to build my own ffmpeg (already done for other purposes) for my conda channel and same for gstreamer

Thanks a lot for the tips.

FMI: what is the issue with not providing any codecs with gstreamer?

mingwandroid commented 6 years ago

I guess I will try to build my own ffmpeg (already done for other purposes) for my conda channel and same for gstreamer

That's up to you but helping out on conda-forge would be appreciated.

FMI: what is the issue with not providing any codecs with gstreamer?

I don't really know what you mean, but to guess, priorities. Video and audio codecs were not the focus of our builds of Qt / PyQt (Navigator was) so we didn't make deliberate efforts to support that, and as I mentioned before, licensing prevents us from providing the ones that most people will want anyway (for audio, mp3 - though now it is possible and for video, everything controlled by the MPEG-LA).

raphmur commented 6 years ago

Hi again,

Managed to build gst-plugins-good (for avidemux plugin), and gst-libav and everything works. Brilliant. Thanks for the help.

I will try and propose the compiled packages to the conda-forge team, at least for the gst-libav package since it uses only the "libav" library from the conda package "ffmpeg"

In the meantime anyone needs the same as I did, you can do:

conda install -c raphmur gst-plugins-good gst-ffmpeg

Just be aware that the dependencies might not be finalised, and check for conda install ffmpeg gstreamer gst-plugins-base maybe from conda-forge...

Issue can me marked as resolved

Cheers

subhaananth commented 5 years ago

@raphmur im having a similar issue, but when i use the above

conda install -c raphmur gst-plugins-good gst-ffmpeg

The packages are not found, is there an alternative I could try? Thanks in advance

andres-fr commented 3 years ago

@subhaananth I'm a bit late, but I wanted to point out that nehaljwani provides his own 5.12 release together with a compatible gstreamer slot (doesn't work for python >3.6 though). It may fix some of your issues:

conda install -c nehaljwani pyside2 

These may also help further, libav contains ffmpeg bindings (I fixed the errors but still getting no sound on Ubuntu20.04...):

conda install -c conda-forge gst-plugins-good
conda install -c conda-forge gst-plugins-bad
conda install -c conda-forge gst-libav

EDIT: It turns out my issue wasn't 100% related to this. I was finally able to fix it, here are the details about the setup and the fix in case some other confused user comes across this issue: https://stackoverflow.com/a/67465089/4511978