Score:1

How to use GStreamer to play an mp4 video?

us flag

I want to use GStreamer on ubuntu 21.04. Here is what I have attempted:

user@host:~$ gst-launch-1.0 -v playbin uri=file:///home/user/thisVideo.mp4
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: ring-buffer-max-size = 0
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: buffer-size = -1
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: buffer-duration = -1
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: use-buffering = false
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: download = false
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: uri = file:///home/user/thisVideo.mp4
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: connection-speed = 0
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: source = "\(GstFileSrc\)\ source"
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstTypeFindElement:typefind.GstPad:src: caps = video/quicktime, variant=(string)iso
Missing element: Quicktime demuxer
WARNING: from element /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: No decoder available for type 'video/quicktime, variant=(string)iso'.
Additional debug info:
gsturidecodebin.c(921): unknown_type_cb (): /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0
ERROR: from element /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: Your GStreamer installation is missing a plug-in.
Additional debug info:
gsturidecodebin.c(988): no_more_pads_full (): /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0:
no suitable plugins found:
gstdecodebin2.c(4640): gst_decode_bin_expose (): /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0:
no suitable plugins found:
Missing decoder: Quicktime (video/quicktime, variant=(string)iso)

ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...

I think what this output implies is that the Quicktime demuxer is not installed on my system. Can somebody please tell me what I must do in order to play this video in GStreamer?

EDIT: It occurs to me that the problem is much deeper than just a missing decoder. Instead, it seems that I am missing all decoders. I have tried to apply GStreamer to various files of diverse formats, but I consistently receive messages of to the effect of 'missing decoder'. Here is yet another example:

user@host:~$ gst-play-1.0 /home/user/someAudio.flac
Press 'k' to see a list of keyboard shortcuts.
Now playing /home/user/someAudio.flac
WARNING No decoder available for type 'audio/x-flac'.
WARNING debug information: gsturidecodebin.c(921): unknown_type_cb (): /GstPlayBin:playbin/GstURIDecodeBin:uridecodebin0
ERROR Your GStreamer installation is missing a plug-in. for file:///home/user/someAudio.flac
ERROR debug information: gsturidecodebin.c(988): no_more_pads_full (): /GstPlayBin:playbin/GstURIDecodeBin:uridecodebin0:
no suitable plugins found:
gstdecodebin2.c(4640): gst_decode_bin_expose (): /GstPlayBin:playbin/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0:
no suitable plugins found:
Missing decoder: Free Lossless Audio Codec (FLAC) (audio/x-flac)

Reached end of play list.

So I think the problem will be solved when I make all common decoders available to my system. But how to do it?

Score:0
cn flag
sudo apt install gstreamer1.0-plugins-base

And if it doesn't solve the problem

sudo apt install gstreamer1.0-plugins-good
sudo apt install gstreamer1.0-plugins-bad
sudo apt install gstreamer1.0-plugins-ugly
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.