Score:2

How to handle gstreamer missing codecs

af flag

I experience the issue of missing codecs for popular video containers like mp4 and avi both when using gstreamer on the command line as well as when trying to run sample playbin code (details per each scenario below).

It might be missing packages or some setup that needs to take place. How would I fix up my environment for getting mp4 and avi codecs to work in gstreamer?

1. With playbin

Trying to run my first gstreamer playbin app plucked off the official gstreamer documentation. However, it seems that no matter the encoding of the video I choose to play, decoders are missing.

I have installed ubuntu-restricted-extras which was suggested elsewhere as a cover-all solution for this kind of matter, but really have no idea how to install or configure missing decoders. Perhaps you can make me wiser.

Here's the code and error trace following it:

import sys, os
import gi
gi.require_version('Gst', '1.0')
gi.require_version('Gtk', '3.0')
gi.require_version('GstVideo', '1.0')
from gi.repository import Gst, GObject, Gtk

# Needed for window.get_xid(), xvimagesink.set_window_handle(), respectively:
from gi.repository import GdkX11, GstVideo

class GTK_Main(object):

    def __init__(self):
        window = Gtk.Window(Gtk.WindowType.TOPLEVEL)
        window.set_title("Video-Player")
        window.set_default_size(500, 400)
        window.connect("destroy", Gtk.main_quit, "WM destroy")
        vbox = Gtk.VBox()
        window.add(vbox)
        hbox = Gtk.HBox()
        vbox.pack_start(hbox, False, False, 0)
        self.entry = Gtk.Entry()
        hbox.add(self.entry)
        self.button = Gtk.Button("Start")
        hbox.pack_start(self.button, False, False, 0)
        self.button.connect("clicked", self.start_stop)
        self.movie_window = Gtk.DrawingArea()
        vbox.add(self.movie_window)
        window.show_all()

        self.player = Gst.ElementFactory.make("playbin", "player")
        bus = self.player.get_bus()
        bus.add_signal_watch()
        bus.enable_sync_message_emission()
        bus.connect("message", self.on_message)
        bus.connect("sync-message::element", self.on_sync_message)

    def start_stop(self, w):
        if self.button.get_label() == "Start":
            filepath = self.entry.get_text().strip()
            if os.path.isfile(filepath):
                filepath = os.path.realpath(filepath)
                self.button.set_label("Stop")
                self.player.set_property("uri", "file://" + filepath)
                self.player.set_state(Gst.State.PLAYING)
            else:
                print(f"there is no file path {filepath}")
                self.player.set_state(Gst.State.NULL)
                self.button.set_label("Start")

    def on_message(self, bus, message):
        t = message.type
        if t == Gst.MessageType.EOS:
            self.player.set_state(Gst.State.NULL)
            self.button.set_label("Start")
        elif t == Gst.MessageType.ERROR:
            self.player.set_state(Gst.State.NULL)
            err, debug = message.parse_error()
            print("Error: %s" % err, debug)
            self.button.set_label("Start")

    def on_sync_message(self, bus, message):
        if message.get_structure().get_name() == 'prepare-window-handle':
            imagesink = message.src
            imagesink.set_property("force-aspect-ratio", True)
            imagesink.set_window_handle(self.movie_window.get_property('window').get_xid())


GObject.threads_init()
Gst.init(None)
GTK_Main()
Gtk.main()

Error trace:

playbin-example-video.py:72: PyGIDeprecationWarning: Since version 3.11, calling threads_init is no longer needed. See: https://wiki.gnome.org/PyGObject/Threading
      GObject.threads_init()
    playbin-example-video.py:17: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "type" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
      window = Gtk.Window(Gtk.WindowType.TOPLEVEL)
    playbin-example-video.py:27: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "label" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
      self.button = Gtk.Button("Start")
    Error: gst-core-error-quark: Your GStreamer installation is missing a plug-in. (12) gsturidecodebin.c(988): no_more_pads_full (): /GstPlayBin:player/GstURIDecodeBin:uridecodebin0:
    no suitable plugins found:
    gstdecodebin2.c(4640): gst_decode_bin_expose (): /GstPlayBin:player/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0:
    no suitable plugins found:
    Missing decoder: Audio Video Interleave (AVI) (video/x-msvideo)

Maybe this code is outdated, I did have to convert it to Python 3 after copying it from the official documentation.

I looked at an official doc for this kind of general situation, but couldn't see a clear path arising there.

2. Using the command line player

It's the same issue trying to play avi or mp4 files from the gstreamer command:

$ gst-play-1.0 media_file.mp4
$ gst-play-1.0 media_file.avi

Some places mention an environment variable that needs to be set, but it's a bit tricky to figure where plugins have been installed in order to supply them on that environment variable. E.g. I seem to have apt plugin packages installed ("base", "good" and "bad") but the directories I can find using whereis don't seem to include anything but two executables.

Running the executable from there:

$ /usr/lib/x86_64-linux-gnu/gstreamer1.0/gstreamer-1.0/gst-plugin-scanner

returns nothing.

Output of gst-inspect:

$ gst-inspect-1.0 
videoscale:  videoscale: Video scaler
ximagesink:  ximagesink: Video sink
audiotestsrc:  audiotestsrc: Audio test source
audiomixer:  audiointerleave: AudioInterleave
audiomixer:  liveadder: AudioMixer
audiomixer:  audiomixer: AudioMixer
audiorate:  audiorate: Audio rate adjuster
volume:  volume: Volume
videotestsrc:  videotestsrc: Video test source
opengl:  glfilterglass: OpenGL glass filter
opengl:  gldeinterlace: OpenGL deinterlacing filter
opengl:  gltestsrc: Video test source
opengl:  glstereosplit: GLStereoSplit
opengl:  glviewconvert: OpenGL Multiview/3D conversion filter
opengl:  glfilterapp: OpenGL application filter
opengl:  glshader: OpenGL fragment shader filter
opengl:  glcolorscale: OpenGL color scale
opengl:  gleffects_laplacian: Laplacian Convolution Demo Effect
opengl:  gleffects_blur: Blur with 9x9 separable convolution Effect
opengl:  gleffects_sobel: Sobel edge detection Effect
opengl:  gleffects_glow: Glow Lighting Effect
opengl:  gleffects_sin: All Grey but Red Effect
opengl:  gleffects_xray: Glowing negative effect
opengl:  gleffects_lumaxpro: Luma Cross Processing Effect
opengl:  gleffects_xpro: Cross Processing Effect
opengl:  gleffects_sepia: Sepia Toning Effect
opengl:  gleffects_heat: Heat Signature Effect
opengl:  gleffects_square: Square Effect
opengl:  gleffects_bulge: Bulge Effect
opengl:  gleffects_twirl: Twirl Effect
opengl:  gleffects_fisheye: FishEye Effect
opengl:  gleffects_tunnel: Light Tunnel Effect
opengl:  gleffects_stretch: Stretch Effect
opengl:  gleffects_squeeze: Squeeze Effect
opengl:  gleffects_mirror: Mirror Effect
opengl:  gleffects_identity: Do nothing Effect
opengl:  gleffects: Gstreamer OpenGL Effects
opengl:  glfiltercube: OpenGL cube filter
opengl:  glsrcbin: GL Src Bin
opengl:  glsinkbin: GL Sink Bin
opengl:  glfilterbin: GL Filter Bin
opengl:  glcolorbalance: Video balance
opengl:  glcolorconvert: OpenGL color converter
opengl:  gldownload: OpenGL downloader
opengl:  glupload: OpenGL uploader
opengl:  glimagesinkelement: OpenGL video sink
opengl:  glimagesink: GL Sink Bin
pbtypes:  GstVideoMultiviewFlagsSet (GstDynamicTypeFactory)
typefindfunctions: audio/audible: aa, aax
typefindfunctions: audio/x-xi: xi
typefindfunctions: video/x-pva: pva
typefindfunctions: application/x-ssa: ssa, ass
typefindfunctions: application/octet-stream: no extensions
typefindfunctions: image/x-degas: no extensions
typefindfunctions: image/x-icon: no extensions
typefindfunctions: application/x-yuv4mpeg: no extensions
typefindfunctions: image/vnd.wap.wbmp: no extensions
typefindfunctions: image/vnd.adobe.photoshop: psd
typefindfunctions: application/msword: doc
typefindfunctions: application/pdf: pdf
typefindfunctions: audio/x-kss: kss
typefindfunctions: video/x-ivf: ivf
typefindfunctions: audio/x-sap: sap
typefindfunctions: audio/x-vgm: vgm
typefindfunctions: audio/x-gbs: gbs
typefindfunctions: audio/x-ay: ay
typefindfunctions: audio/x-gym: gym
typefindfunctions: audio/x-nsf: nsf
typefindfunctions: video/vivo: viv
typefindfunctions: application/x-mmsh: no extensions
typefindfunctions: multipart/x-mixed-replace: no extensions
typefindfunctions: video/x-dirac: no extensions
typefindfunctions: application/x-ms-dos-executable: dll, exe, ocx, sys, scr, msstyles, cpl
typefindfunctions: application/x-ar: a
typefindfunctions: application/x-tar: tar
typefindfunctions: application/x-rar: rar
typefindfunctions: image/svg+xml: svg
typefindfunctions: application/postscript: ps
typefindfunctions: audio/x-caf: caf
typefindfunctions: audio/x-wavpack-correction: wvc
typefindfunctions: audio/x-wavpack: wv, wvp
typefindfunctions: audio/x-spc: spc
typefindfunctions: audio/aac: aac, adts, adif, loas
typefindfunctions: application/x-executable: no extensions
typefindfunctions: text/x-cmml: no extensions
typefindfunctions: application/x-ogg-skeleton: no extensions
typefindfunctions: audio/x-celt: no extensions
typefindfunctions: audio/x-speex: no extensions
typefindfunctions: application/x-ogm-text: no extensions
typefindfunctions: application/x-ogm-audio: no extensions
typefindfunctions: application/x-ogm-video: no extensions
typefindfunctions: video/x-theora: no extensions
typefindfunctions: audio/x-vorbis: no extensions
typefindfunctions: audio/x-flac: flac
typefindfunctions: application/x-subtitle-vtt: vtt
typefindfunctions: subtitle/x-kate: no extensions
typefindfunctions: application/x-compress: Z
typefindfunctions: application/zip: zip
typefindfunctions: application/x-gzip: gz
typefindfunctions: application/x-bzip: bz2
typefindfunctions: image/x-sun-raster: ras
typefindfunctions: image/x-xpixmap: xpm
typefindfunctions: image/x-jng: jng
typefindfunctions: video/x-mng: mng
typefindfunctions: image/x-xcf: xcf
typefindfunctions: audio/x-sid: sid
typefindfunctions: audio/x-sbc: sbc
typefindfunctions: audio/iLBC-sh: ilbc
typefindfunctions: audio/x-amr-wb-sh: amr
typefindfunctions: audio/x-amr-nb-sh: amr
typefindfunctions: video/x-dv: dv, dif
typefindfunctions: video/x-mve: mve
typefindfunctions: application/mxf: mxf
typefindfunctions: video/x-matroska: mkv, mka, mk3d, webm
typefindfunctions: image/x-portable-pixmap: pnm, ppm, pgm, pbm
typefindfunctions: image/x-exr: exr
typefindfunctions: image/webp: webp
typefindfunctions: image/tiff: tif, tiff
typefindfunctions: image/bmp: bmp
typefindfunctions: image/png: png
typefindfunctions: image/gif: gif
typefindfunctions: image/jpeg: jpg, jpe, jpeg
typefindfunctions: application/x-ape: ape
typefindfunctions: audio/x-shorten: shn
typefindfunctions: audio/x-rf64: rf64
typefindfunctions: audio/x-w64: w64
typefindfunctions: audio/x-ircam: sf
typefindfunctions: audio/x-sds: sds
typefindfunctions: audio/x-voc: voc
typefindfunctions: audio/x-nist: nist
typefindfunctions: audio/x-paris: paf
typefindfunctions: audio/x-svx: iff, svx
typefindfunctions: audio/x-aiff: aiff, aif, aifc
typefindfunctions: audio/x-wav: wav
typefindfunctions: application/xml: xml
typefindfunctions: application/ttml+xml: ttml+xml
typefindfunctions: application/smil: smil
typefindfunctions: application/sdp: sdp
typefindfunctions: application/x-hls: m3u8
typefindfunctions: application/itc: itc
typefindfunctions: text/uri-list: ram
typefindfunctions: text/utf-32: txt
typefindfunctions: text/utf-16: txt
typefindfunctions: text/plain: txt
typefindfunctions: video/x-flv: flv
typefindfunctions: application/vnd.ms-sstr+xml: no extensions
typefindfunctions: application/dash+xml: mpd, MPD
typefindfunctions: application/x-shockwave-flash: swf, swfl
typefindfunctions: application/x-pn-realaudio: ra, ram, rm, rmvb
typefindfunctions: application/vnd.rn-realmedia: ra, ram, rm, rmvb
typefindfunctions: text/html: htm, html
typefindfunctions: video/mj2: mj2
typefindfunctions: image/x-jpc: jpc, j2k
typefindfunctions: image/jp2: jp2
typefindfunctions: image/x-quicktime: qif, qtif, qti
typefindfunctions: video/quicktime: mov, mp4
typefindfunctions: application/x-3gp: 3gp
typefindfunctions: audio/x-m4a: m4a
typefindfunctions: video/x-nuv: nuv
typefindfunctions: video/x-h265: h265, x265, 265
typefindfunctions: video/x-h264: h264, x264, 264
typefindfunctions: video/x-h263: h263, 263
typefindfunctions: video/mpeg4: m4v
typefindfunctions: video/mpeg-elementary: mpv, mpeg, mpg
typefindfunctions: application/ogg: ogg, oga, ogv, ogm, ogx, spx, anx, axa, axv
typefindfunctions: video/mpegts: ts, mts
typefindfunctions: video/mpeg-sys: mpe, mpeg, mpg
typefindfunctions: audio/x-gsm: gsm
typefindfunctions: audio/x-dts: dts
typefindfunctions: audio/x-ac3: ac3, eac3
typefindfunctions: audio/mpeg: mp3, mp2, mp1, mpga
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/x-ttafile: tta
typefindfunctions: application/x-apetag: mp3, ape, mpc, wv
typefindfunctions: application/x-id3v1: mp3, mp2, mp1, mpga, ogg, flac, tta
typefindfunctions: application/x-id3v2: mp3, mp2, mp1, mpga, ogg, flac, tta
typefindfunctions: video/x-fli: flc, fli
typefindfunctions: audio/mobile-xmf: mxmf
typefindfunctions: audio/riff-midi: mid, midi
typefindfunctions: audio/midi: mid, midi
typefindfunctions: audio/x-imelody: imy, ime, imelody
typefindfunctions: video/x-vcd: dat
typefindfunctions: video/x-cdxa: dat
typefindfunctions: audio/qcelp: qcp
typefindfunctions: video/x-msvideo: avi
typefindfunctions: audio/x-au: au, snd
typefindfunctions: audio/x-musepack: mpc, mpp, mp+
typefindfunctions: video/x-ms-asf: asf, wm, wma, wmv
gio:  giostreamsrc: GIO stream source
gio:  giostreamsink: GIO stream sink
gio:  giosrc: GIO source
gio:  giosink: GIO sink
encoding:  encodebin: Encoder Bin
rawparse:  rawvideoparse: rawvideoparse
rawparse:  rawaudioparse: rawaudioparse
rawparse:  unalignedvideoparse: unalignedvideoparse
rawparse:  unalignedaudioparse: unalignedaudioparse
playback:  parsebin: Parse Bin
playback:  urisourcebin: URI reader
playback:  uridecodebin3: URI Decoder
playback:  uridecodebin: URI Decoder
playback:  decodebin3: Decoder Bin 3
playback:  decodebin: Decoder Bin
playback:  streamsynchronizer: Stream Synchronizer
playback:  subtitleoverlay: Subtitle Overlay
playback:  playsink: Player Sink
playback:  playbin3: Player Bin 3
playback:  playbin: Player Bin 2
app:  appsink: AppSink
app:  appsrc: AppSrc
videoconvert:  videoconvert: Colorspace converter
audioresample:  audioresample: Audio resampler
tcp:  multisocketsink: Multi socket sink
tcp:  multifdsink: Multi filedescriptor sink
tcp:  tcpserversrc: TCP server source
tcp:  tcpserversink: TCP server sink
tcp:  tcpclientsrc: TCP client source
tcp:  tcpclientsink: TCP client sink
tcp:  socketsrc: socket source
coretracers:  leaks (GstTracerFactory)
coretracers:  stats (GstTracerFactory)
coretracers:  rusage (GstTracerFactory)
coretracers:  log (GstTracerFactory)
coretracers:  latency (GstTracerFactory)
adder:  adder: Adder
audioconvert:  audioconvert: Audio converter
subparse:  ssaparse: SSA Subtitle Parser
subparse:  subparse: Subtitle parser
subparse: subparse_typefind: srt, sub, mpsub, mdvd, smi, txt, dks, vtt
coreelements:  streamiddemux: Streamid Demux
coreelements:  valve: Valve element
coreelements:  multiqueue: MultiQueue
coreelements:  typefind: TypeFind
coreelements:  tee: Tee pipe fitting
coreelements:  filesink: File Sink
coreelements:  queue2: Queue 2
coreelements:  queue: Queue
coreelements:  output-selector: Output selector
coreelements:  input-selector: Input selector
coreelements:  identity: Identity
coreelements:  funnel: Funnel pipe fitting
coreelements:  filesrc: File Source
coreelements:  fdsink: Filedescriptor Sink
coreelements:  fdsrc: Filedescriptor Source
coreelements:  fakesink: Fake Sink
coreelements:  fakesrc: Fake Source
coreelements:  downloadbuffer: DownloadBuffer
coreelements:  dataurisrc: data: URI source element
coreelements:  concat: Concat
coreelements:  capsfilter: CapsFilter
videorate:  videorate: Video rate adjuster
staticelements:  bin: Generic bin
staticelements:  pipeline: Pipeline object

Total count: 25 plugins, 253 features

How would I fix up my environment for getting mp4 and avi codecs to work in gstreamer?

Output for apt list gstreamer*:

gstreamer-qapt/focal 3.0.5-1ubuntu1 amd64
gstreamer1.0-adapter-pulseeffects/focal 4.7.1-2 amd64
gstreamer1.0-alsa/focal-updates,focal-security,now 1.16.2-4ubuntu0.1 amd64 [installed]
gstreamer1.0-alsa/focal-updates,focal-security 1.16.2-4ubuntu0.1 i386
gstreamer1.0-autogain-pulseeffects/focal 4.7.1-2 amd64
gstreamer1.0-clutter-3.0/focal,now 3.0.27-1 amd64 [installed]
gstreamer1.0-convolver-pulseeffects/focal 4.7.1-2 amd64
gstreamer1.0-crystalhd/focal 1:0.0~git20110715.fdd2f19-13build1 amd64
gstreamer1.0-crystalhd/focal 1:0.0~git20110715.fdd2f19-13build1 i386
gstreamer1.0-crystalizer-pulseeffects/focal 4.7.1-2 amd64
gstreamer1.0-doc/focal,focal 1.16.2-2 all
gstreamer1.0-espeak/focal 0.5.0-1 amd64
gstreamer1.0-fluendo-mp3/now 0.10.32.debian-1 amd64 [installed,local]
gstreamer1.0-gl/focal-updates,focal-security,now 1.16.2-4ubuntu0.1 amd64 [installed]
gstreamer1.0-gl/focal-updates,focal-security 1.16.2-4ubuntu0.1 i386
gstreamer1.0-gtk3/focal-updates,focal-security,now 1.16.2-1ubuntu2.1 amd64 [installed,automatic]
gstreamer1.0-gtk3/focal-updates,focal-security 1.16.2-1ubuntu2.1 i386
gstreamer1.0-libav-dbg/focal 1.16.2-2 amd64
gstreamer1.0-libav-dbg/focal 1.16.2-2 i386
gstreamer1.0-libav/focal,now 1.16.2-2 amd64 [installed,automatic]
gstreamer1.0-libav/focal 1.16.2-2 i386
gstreamer1.0-nice/focal,now 0.1.16-1 amd64 [installed,automatic]
gstreamer1.0-nice/focal 0.1.16-1 i386
gstreamer1.0-omx-bellagio-config/focal 1.16.2-1 amd64
gstreamer1.0-omx-generic-config/focal 1.16.2-1 amd64
gstreamer1.0-omx-generic/focal 1.16.2-1 amd64
gstreamer1.0-opencv/focal 1.16.2-2.1ubuntu1 amd64
gstreamer1.0-packagekit/focal-updates,focal-security,now 1.1.13-2ubuntu1.1 amd64 [installed]
gstreamer1.0-pipewire/focal 0.2.7-1 amd64
gstreamer1.0-plugins-bad-dbg/focal 1.16.2-2.1ubuntu1 amd64
gstreamer1.0-plugins-bad-dbg/focal 1.16.2-2.1ubuntu1 i386
gstreamer1.0-plugins-bad-doc/focal,focal 1.16.2-2.1ubuntu1 all
gstreamer1.0-plugins-bad/focal,now 1.16.2-2.1ubuntu1 amd64 [installed,automatic]
gstreamer1.0-plugins-bad/focal 1.16.2-2.1ubuntu1 i386
gstreamer1.0-plugins-base-apps/focal-updates,focal-security,now 1.16.2-4ubuntu0.1 amd64 [installed]
gstreamer1.0-plugins-base-apps/focal-updates,focal-security 1.16.2-4ubuntu0.1 i386
gstreamer1.0-plugins-base-dbg/focal-updates,focal-security 1.16.2-4ubuntu0.1 amd64
gstreamer1.0-plugins-base-dbg/focal-updates,focal-security 1.16.2-4ubuntu0.1 i386
gstreamer1.0-plugins-base-doc/focal-updates,focal-updates,focal-security,focal-security 1.16.2-4ubuntu0.1 all
gstreamer1.0-plugins-base/focal-updates,focal-security,now 1.16.2-4ubuntu0.1 amd64 [installed]
gstreamer1.0-plugins-base/focal-updates,focal-security 1.16.2-4ubuntu0.1 i386
gstreamer1.0-plugins-good-dbg/focal-updates,focal-security 1.16.2-1ubuntu2.1 amd64
gstreamer1.0-plugins-good-dbg/focal-updates,focal-security 1.16.2-1ubuntu2.1 i386
gstreamer1.0-plugins-good-doc/focal-updates,focal-updates,focal-security,focal-security 1.16.2-1ubuntu2.1 all
gstreamer1.0-plugins-good/focal-updates,focal-security,now 1.16.2-1ubuntu2.1 amd64 [installed]
gstreamer1.0-plugins-good/focal-updates,focal-security 1.16.2-1ubuntu2.1 i386
gstreamer1.0-plugins-rtp/focal 1.14.4.1 amd64
gstreamer1.0-plugins-ugly-dbg/focal 1.16.2-2build1 amd64
gstreamer1.0-plugins-ugly-dbg/focal 1.16.2-2build1 i386
gstreamer1.0-plugins-ugly-doc/focal,focal 1.16.2-2build1 all
gstreamer1.0-plugins-ugly/focal,now 1.16.2-2build1 amd64 [installed,automatic]
gstreamer1.0-plugins-ugly/focal 1.16.2-2build1 i386
gstreamer1.0-pocketsphinx/focal 0.8.0+real5prealpha+1-6ubuntu4 amd64
gstreamer1.0-pulseaudio/focal-updates,focal-security,now 1.16.2-1ubuntu2.1 amd64 [installed]
gstreamer1.0-pulseaudio/focal-updates,focal-security 1.16.2-1ubuntu2.1 i386
gstreamer1.0-python3-dbg-plugin-loader/focal 1.16.2-2 amd64
gstreamer1.0-python3-plugin-loader/focal 1.16.2-2 amd64
gstreamer1.0-qt5/focal-updates,focal-security 1.16.2-1ubuntu2.1 amd64
gstreamer1.0-qt5/focal-updates,focal-security 1.16.2-1ubuntu2.1 i386
gstreamer1.0-rtsp-dbg/focal 1.16.2-3 amd64
gstreamer1.0-rtsp/focal 1.16.2-3 amd64
gstreamer1.0-tools/focal,now 1.16.2-2 amd64 [installed]
gstreamer1.0-tools/focal 1.16.2-2 i386
gstreamer1.0-vaapi-doc/focal,focal 1.16.2-2 all
gstreamer1.0-vaapi/focal,now 1.16.2-2 amd64 [installed,automatic]
gstreamer1.0-x/focal-updates,focal-security,now 1.16.2-4ubuntu0.1 amd64 [installed]
gstreamer1.0-x/focal-updates,focal-security 1.16.2-4ubuntu0.1 i386
nobody avatar
gh flag
can you add `dpkg -l | egrep 'libav|ffmpeg'` to your question? I have no problems with playing mp4 or other files with gstreamer.
Score:0

Perhaps you are having "interference" with another python installation, e.g., from anaconda. Please check which -a python and which -a python3. If you find something suspicious, try fixing that and playing mp4 files again.

I had to do exactly that. At one point, I modified my ~/.bashrc for anaconda, including

export PATH="${ANACONDA_DIR}/bin${PATH:+:${PATH}}"

so my default python was from anaconda. Among other things, it doesn't have module gi, and I suspect that is (one of the) ultimate reason/s for gstreamer not to play videos.

Changing to

export PATH="${PATH:+${PATH}:}${ANACONDA_DIR}/bin"

I recovered use of /usr/bin/python3, which had module gi available, and perhaps others. Now gstreamer plays videos.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.