This is a cache of https://discuss.96boards.org/t/gstreamer-question/2288. It is a snapshot of the page at 2024-10-31T06:09:01.877+0000.
Gstreamer question - DragonBoard 820c - 96Boards Forum

Gstreamer question

Do you know why I would be getting the following error:
linaro@linaro-developer:~$ gst-launch-1.0 filesrc location=HD_H264_06011_TS_ASYN_V1_001.mpeg ! tsdemux name=demux demux. ! h264parse ! avdec_h264 ! ximagesink
Setting pipeline to PAUSED …
Pipeline is PREROLLING …
Redistribute latency…
Redistribute latency…
ERROR: from element /GstPipeline:pipeline0/GstTSDemux:demux: Internal data stream error.
Additional debug info:
mpegtsbase.c(1613): mpegts_base_loop (): /GstPipeline:pipeline0/GstTSDemux:demux:
streaming stopped, reason not-negotiated (-4)
ERROR: pipeline doesn’t want to preroll.
Setting pipeline to NULL …
Freeing pipeline …
linaro@linaro-developer:~$

linaro@linaro-developer:~$ mediainfo HD_H264_06011_TS_ASYN_V1_001.mpeg
General
ID : 1 (0x1)
Complete name : HD_H264_06011_TS_ASYN_V1_001.mpeg
Format : MPEG-TS
File size : 38.9 MiB
Duration : 49 s 877 ms
Overall bit rate mode : Constant
Overall bit rate : 6 538 kb/s

Video
ID : 481 (0x1E1)
Menu ID : 1 (0x1)
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Main@L4
Format settings, CABAC : Yes
Format settings, ReFrames : 3 frames
Format settings, GOP : M=3, N=61
Codec ID : 27
Duration : 46 s 400 ms
Bit rate mode : Variable
Bit rate : 6 215 kb/s
Maximum bit rate : 6 029 kb/s
Width : 1 280 pixels
Height : 720 pixels
Display aspect ratio : 16:10
Frame rate : 60.000 FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.112
Stream size : 34.4 MiB (88%)

Menu
ID : 480 (0x1E0)
Menu ID : 1 (0x1)
Duration : 49 s 877 ms
List : 481 (0x1E1) (AVC) / 497 (0x1F1) (KLV)

linaro@linaro-developer:~$

you need to use “videoconvert ! ximagesink”, or “xvimagesink” , or even better “glimagesink”

ndec,

Thanks that worked. It is pretty sticky, so I did the following (which is still sticky):

linaro@linaro-developer:~$ gst-launch-1.0 filesrc location=HD_H264_06011_TS_ASYN_V1_001.mpeg ! tsdemux name=demux demux. ! h264parse ! v4l2video1dec ! videoconvert ! glimagesink

There may be a timestamping problem, or this computer is too slow.
WARNING: from element /GstPipeline:pipeline0/GstGLImageSinkBin:glimagesinkbin0/GstGLImageSink:sink: A lot of buffers are being dropped.
Additional debug info:
gstbasesink.c(2834): gst_base_sink_is_too_late (): /GstPipeline:pipeline0/GstGLImageSinkBin:glimagesinkbin0/GstGLImageSink:sink:
There may be a timestamping problem, or this computer is too slow.
WARNING: from element /GstPipeline:pipeline0/GstGLImageSinkBin:glimagesinkbin0/GstGLImageSink:sink: A lot of buffers are being dropped.
Additional debug info:
gstbasesink.c(2834): gst_base_sink_is_too_late (): /GstPipeline:pipeline0/GstGLImageSinkBin:glimagesinkbin0/GstGLImageSink:sink:
There may be a timestamping problem, or this computer is too slow.
^Chandling interrupt.
Interrupt: Stopping pipeline …
Execution ended after 0:00:15.454385016
Setting pipeline to PAUSED …
Setting pipeline to READY …
Setting pipeline to NULL …
Freeing pipeline …

you should remove the videoconvert element in your pipeline, it is not needed since glimagesink can deal with NV12 video buffers. With the videoconvert element it is possible that color conversion is done in videoconvert (e.g. on the CPU) instead of in glimagesink (e.g. on the GPU).

ndec,

Thanks. I get about two frames a second with this:
linaro@linaro-developer:~$ gst-launch-1.0 filesrc location=HD_H264_06011_TS_ASYN_V1_001.mpeg ! tsdemux name=demux demux. ! h264parse ! v4l2video1dec ! glimagesink
Setting pipeline to PAUSED …
libGL error: failed to authenticate magic 1
libGL error: failed to load driver: vmwgfx
Pipeline is PREROLLING …
Got context from element ‘sink’: gst.gl.GLDisplay=context, gst.gl.GLDisplay=(GstGLDisplay)"(GstGLDisplayX11)\ gldisplayx11-0";
Redistribute latency…
Pipeline is PREROLLED …
Setting pipeline to PLAYING …
New clock: GstSystemClock
WARNING: from element /GstPipeline:pipeline0/GstGLImageSinkBin:glimagesinkbin0/GstGLImageSink:sink: A lot of buffers are being dropped.
Additional debug info:
gstbasesink.c(2834): gst_base_sink_is_too_late (): /GstPipeline:pipeline0/GstGLImageSinkBin:glimagesinkbin0/GstGLImageSink:sink:
There may be a timestamping problem, or this computer is too slow.
WARNING: from element /GstPipeline:pipeline0/GstGLImageSinkBin:glimagesinkbin0/GstGLImageSink:sink: A lot of buffers are being dropped.
Additional debug info:
gstbasesink.c(2834): gst_base_sink_is_too_late (): /GstPipeline:pipeline0/GstGLImageSinkBin:glimagesinkbin0/GstGLImageSink:sink:
There may be a timestamping problem, or this computer is too slow.

i suspect you don’t have GPU enabled. Did you follow the Getting Started wiki completely? Have you installed Mesa from Debian Sid and do you have GPU firmware in /lib/firmware (a530*.fw)?

a simple test to check that GPU is enabled is:

  1. start X
  2. run glxgears

check ‘cat /proc/interrupts | grep A530’

if you can see interrupts count going up, you are good to go.

ndec,

you are right:

linaro@linaro-developer:~$ glxgears
libGL error: failed to authenticate magic 1
libGL error: failed to load driver: vmwgfx
103 frames in 5.0 seconds = 20.535 FPS
^Z
[1]+ Stopped glxgears
linaro@linaro-developer:~$ bg
[1]+ glxgears &
linaro@linaro-developer:~$ 114 frames in 5.6 seconds = 20.492 FPS

linaro@linaro-developer:~$ sudo cat 125 frames in 5.0 seconds = 24.876 FPS
/proc/interrupts | 126 frames in 5.0 seconds = 25.021 FPS
grep A530
173: 0 0 0 0 GICv3 332 Level A530
linaro@linaro-developer:~$ sudo cat /proc/interrupts | grep A530
173: 0 0 0 0 GICv3 332 Level A530
linaro@linaro-developer:~$ sudo cat /proc/interrupts | grep A530
173: 0 0 0 0 GICv3 332 Level A530
linaro@linaro-developer:~$

Without GPU, you end up doing video rendering (color conversion and
scaling) with the CPU.

Any idea on how to get the GPU up?
Thx

Running the exact instructions from the wiki should get you there. Have you
carefully followed everything?

It is important to switch to debian sid and to install all packages
mentioned on the wiki.

The next source of issue is lack of the gpu firmware in /lib/firmware, but
i know from private discussions that it should be ok.

Most people reported that the instructions worked fine.

If you did everything and it does not work please share the output of

lsmod
uname -a
Lsb_release -a
dpkg -l

And the complete boot log.

Note : i will be out of reach until Monday , starting in the next few mins.

Yes so I think I am getting the steps now:

  1. Install the latest build from 96boards
  2. Change the package source to the debian sid
  3. install all the packages (excluding gstreamer)
  4. follow the instructions on webpage to build the latest gstreamer
  5. install the qcom firmware files

Then you should have the latest and greatest gstreamer with hardware support.

Do not skip the gstreamer install. Install the packages as per the wiki,
and then rebuild gst-plugins-good as per the release, and reinstall it “on
top” of what you had already installed. less chances to mess up with the
installation this way!