gstreamer openmax


230 posts   Page 2 of 10   1, 2, 3, 4, 5 ... 10
by Richard_P » Tue Jun 19, 2012 8:04 pm
Here is the error when I set GST_DEBUG=3

Code: Select all
0:00:00.057449047  4946   0x471400 INFO                GST_INIT gst.c:456:gst_init_check: initialized GStreamer successfully
0:00:00.114783093  4946   0x471400 ERROR                    omx gstomx.c:2040:plugin_init: Failed to load configuration file: Valid key file could not be found in search dirs
0:00:00.120135191  4946   0x471400 WARN      GST_PLUGIN_LOADING gstplugin.c:559:gst_plugin_register_func: plugin "/home/pi/omx/lib/gstreamer-0.10/libgstopenmax.so" failed to initialise


Where/what is this configuration/key file!

Edit: there is a broadcom gstomx.conf file in the debian directory or the omx-debian tree...
Posts: 39
Joined: Mon Jun 11, 2012 10:43 am
by pauly24 » Tue Jun 19, 2012 8:36 pm
hmm still not having alot of luck, my libgstopenmax.so stays blacklisted, probably because it hasnt been installed properly.
Posts: 59
Joined: Fri May 18, 2012 2:42 pm
by Richard_P » Tue Jun 19, 2012 8:44 pm
pauly24 wrote:hmm still not having alot of luck, my libgstopenmax.so stays blacklisted, probably because it hasnt been installed properly.

The blacklist is due to the missing .conf file (so the debug shows)

If I knew where to put the file it might magically clear the blacklist and work. ;)

R

EDIT: add
export GST_OMX_CONFIG_DIR= path/to/your/gstomx.conf

Make sure its the Broadcom gstomx.conf , and not the ST version. (open the file and it will be pretty evident)
Another problem though... gst-inspect does not exit the scan procedure.
Posts: 39
Joined: Mon Jun 11, 2012 10:43 am
by pauly24 » Tue Jun 19, 2012 9:23 pm
my broadcom gstomx.conf file is in
home/gst-omx0.10-debian/debian/gstomx.conf

so i typed
export GST_OMX_CONFIG_DIR=home/gst-omx0.10-debian/debian/gstomx.conf

and it doesn't say anything has been done, just goes to a new line, but when I typed

gst-inspect, I get.
0:00:46.585642180 3615 0x25710e0 ERROR omx gstomx.c:2040:plugin_init: Failed to load configuration file: Valid key file could not be found in search dirs

but inside the gstomx.conf there is no reference to any gstomx.c file.
Posts: 59
Joined: Fri May 18, 2012 2:42 pm
by Richard_P » Tue Jun 19, 2012 9:28 pm
pauly24 wrote:my broadcom gstomx.conf file is in
home/gst-omx0.10-debian/debian/gstomx.conf

so i typed
export GST_OMX_CONFIG_DIR=home/gst-omx0.10-debian/debian/gstomx.conf

and it doesn't say anything has been done, just goes to a new line, but when I typed

gst-inspect, I get.
0:00:46.585642180 3615 0x25710e0 ERROR omx gstomx.c:2040:plugin_init: Failed to load configuration file: Valid key file could not be found in search dirs

but inside the gstomx.conf there is no reference to any gstomx.c file.


I mistyped... it should just be based on what you typed...

export GST_OMX_CONFIG_DIR=/home/gst-omx0.10-debian/debian/

is this really the correct path? :P
Posts: 39
Joined: Mon Jun 11, 2012 10:43 am
by pauly24 » Tue Jun 19, 2012 9:39 pm
yup!
I did a $find / -name gstomx.conf

and i got two returns, one in
home/gst-omx0.10-debian/debian/gstomx.conf
home/gst-omx0.10-debian/omx/gstomx.conf

the one in omx was the ST.

from the home directory is where i did the $git clone
Then i cd into the directory and did
$sudo ./autogen
(Had to install a bunch of plugins the autogen wanted)
$./configure
$make
$make install

then that's where all the files ended up (I think ive been playing around with it alot, maybe a fresh install is in order)

Did I do something wrong?
Posts: 59
Joined: Fri May 18, 2012 2:42 pm
by Richard_P » Wed Jun 20, 2012 6:24 am
Nothing wrong... just unconventional :D

Code: Select all
0:00:00.057643940  1607   0xfea400 INFO                GST_INIT gst.c:805:init_post: GLib runtime version: 2.32.3
0:00:00.059367968  1607   0xfea400 INFO                GST_INIT gst.c:807:init_post: GLib headers version: 2.30.2
0:00:00.061229999  1607   0xfea400 INFO                GST_INIT gst.c:456:gst_init_check: initialized GStreamer successfully
0:00:00.275273489  1607   0xfea400 WARN                     omx gstomx.c:1989:gst_omx_parse_hacks: Unknown hack: bcm-host
0:00:00.280605576  1607   0xfea400 WARN                     omx gstomx.c:1989:gst_omx_parse_hacks: Unknown hack: bcm-host
0:00:00.282909614  1607   0xfea400 INFO      GST_PLUGIN_LOADING gstplugin.c:859:gst_plugin_load_file: plugin "/home/pi/omx/lib/gstreamer-0.10/libgstopenmax.so" loaded


The only evidence I have before the plug-in loader goes in to a bad loop and never exits.
Posts: 39
Joined: Mon Jun 11, 2012 10:43 am
by pauly24 » Wed Jun 20, 2012 9:45 am
oh ok, see im new to linux so this is slightly confusing but I'm getting the hang of it.
So if i type
export GST_DEBUG=3
Then when I run say gst-launch with the openmax plugin, it will check this variable, see its been enabled, and then print out the errors... and hopeflly I get the same error as you and then were on the same page/
Posts: 59
Joined: Fri May 18, 2012 2:42 pm
by Richard_P » Wed Jun 20, 2012 12:52 pm
Got OMX registered

Code: Select all
git clone -b raspberry git://anongit.freedesktop.org/gstreamer/gst-omx
./autogen --noconfigure
./configure --prefix=/home/pi/omx_new
make
make install

export GST_PLUGIN_PATH=/home/pi/omx_new/lib/gstreamer-0.10/
export GST_OMX_CONFIG_DIR=/home/pi/omx_new/lib/gstreamer-0.10/

(placed a renamed gstomx.conf raspberry version at that location)
NB ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

gst-inspect


Dont know if it works yet... I am downloading a H264 movie trailer now.

Edit: does anyone know how to use the OpenMax components in Gstreamer?

gst-launch filesrc location=Movie.mp4 ! omxmpeg4videodec
(very wrong... but any takers?)

R
Richard
Posts: 39
Joined: Mon Jun 11, 2012 10:43 am
by Richard_P » Wed Jun 20, 2012 3:20 pm
I feel like a dog that has just caught a car.. great achievement but can do nothing with it.

All I can do it look at this Gstreamer-omx chocolate tea-pot.
Posts: 39
Joined: Mon Jun 11, 2012 10:43 am
by pauly24 » Wed Jun 20, 2012 8:44 pm
Richard can you post the link of the video you used for testing, I've got my plugin out of the blacklist and it seems to be working, except whenever I point it towards the test.h264 file that comes with the installation it doesn't work, kind of just hangs. I'm thinking it might be the specific video codec now.
Posts: 59
Joined: Fri May 18, 2012 2:42 pm
by Richard_P » Thu Jun 21, 2012 7:12 pm
pauly24 wrote:Richard can you post the link of the video you used for testing, I've got my plugin out of the blacklist and it seems to be working, except whenever I point it towards the test.h264 file that comes with the installation it doesn't work, kind of just hangs. I'm thinking it might be the specific video codec now.


I just googled for H264 Sample videos and it links you to a movie trailer website. Didnt get anything to play though... even with x264parse
Posts: 39
Joined: Mon Jun 11, 2012 10:43 am
by pauly24 » Thu Jun 21, 2012 8:00 pm
ohhh... I thought you meant you got it working... back to the drawing board. After restarting my raspberry it can't find the plugins, even after I remove the cache and redefine the environment variables grrrr
Posts: 59
Joined: Fri May 18, 2012 2:42 pm
by Richard_P » Mon Jun 25, 2012 10:28 am
pauly24 wrote:ohhh... I thought you meant you got it working... back to the drawing board. After restarting my raspberry it can't find the plugins, even after I remove the cache and redefine the environment variables grrrr



Sorry, nope. I gave up (admittedly I don't like defeat, but there is a point where picking the battle and subjecting my kids to the horrors of me screaming at a TV)
I have decided to get a SnowBall development board for Gstreamer things.

Richard
Posts: 39
Joined: Mon Jun 11, 2012 10:43 am
by m][sko » Sun Aug 12, 2012 7:09 pm
It is working

just change
GST_PLUGIN_PATH
to exact directory where are all omx*.so-s
and
same for GST_OMX_CONFIG_DIR
ls
gstomx.conf libgstopenmax.a libgstopenmax.la libgstopenmax.so

after that

you will see
gst-inspect-0.10 | grep openmax

pi@raspberrypi ~/gst_omx/lib/gstreamer-0.10 $ gst-inspect-0.10 | grep openmax
openmax: omxmpeg4videodec: OpenMAX MPEG4 Video Decoder
openmax: omxh264dec: OpenMAX H.264 Video Decoder
wow

and now test run
GST_DEBUG="*:3" gst-launch-0.10 uridecodebin uri="file:///home/misko/test/1778150-MZNqiO.mp4" ! fakesink sync=true

you will see omxh264dec in logs output
and it looks like it take only 20% cpu time now :) for 720x576 25fps video
If I compare it to default ffdec_h264 as rapsberry don't have enaught cpu power

20%CPU for 720x576 25fps
45%CPU for 1280x720
74% CPU for 1920x840
Posts: 81
Joined: Fri Jul 20, 2012 6:37 am
Location: Slovakia
by dom » Sun Aug 12, 2012 7:20 pm
@m][sko
Sounds promising. I assume this is just decoding and discarding the data, rather than displaying it?
Either way, looks like a useful step forward for gstreamer support.
Moderator
Moderator
Posts: 3861
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge
by m][sko » Mon Aug 13, 2012 1:30 pm
dom wrote:@m][sko
Sounds promising. I assume this is just decoding and discarding the data, rather than displaying it?
Either way, looks like a useful step forward for gstreamer support.


uridecodebin generate pipeline with omx h264 decoder and output is fakesink (black hole)
you can try fbdevsink (framebuffer)
http://gstreamer.freedesktop.org/data/d ... vsink.html
But you will need gst-plugins-bad-plugins debian package

I want to make it to work with qt multimedia qt5 and qml as output
But no success :(
with GST_DEBUG="omx:4" omx handle get me resource problem :(

I also found leak in gst-omx.
It is just related to Broadcom modification as it need some init/deinit
And deinit is missing

Current omx .conf support only mpeg4 and h264
It isn't support AAC decoding and other stuff.
If anybody can regenerate omx conf file with all supported formats it will be great :)
Posts: 81
Joined: Fri Jul 20, 2012 6:37 am
Location: Slovakia
by m][sko » Tue Aug 14, 2012 6:51 am
now I am able to decode video and audio and I can show it in QML :)
it was some memory problem as I Qt application allocate to much resources in opengl (video core)
and openmax was not able to allocate buffers :)

pipeline
gst-omx(gstreamer) -> qt multimedia(opengl) -> QML(opengl)

I think there can be some optimization with EGLImage as openmax can allocate output directly to EGL

Now I simple create small Qt QML app with videooutput and mediaplayer
it is working now :)
192/64 configuration is really low on resources
Posts: 81
Joined: Fri Jul 20, 2012 6:37 am
Location: Slovakia
by dom » Tue Aug 14, 2012 9:22 am
@m][sko excellent!
What resolution video can you play? How busy is the ARM?
It would be good if you could post detailed instructions and/or make a video of this running.
Moderator
Moderator
Posts: 3861
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge
by dapa79 » Tue Aug 14, 2012 6:07 pm
@m][sko: Sounds great!!

Would be most appreciated if you could make a quick tutorial of any system modifications required and a very basic code sample for others to use as starting template.
By the way, is this Qt5?
Posts: 13
Joined: Mon May 21, 2012 5:55 am
by m][sko » Tue Aug 14, 2012 7:13 pm
howto hmm :)
1. build qt5. (you don't need x11 as it will be slow) egl and framebuffer is all what you need
http://releases.qt-project.org/qt5.0/beta-snapshots/

You can simple build it on pi device.
http://qt-project.org/wiki/RaspberryPi
./configure -v -opengl es2 -device linux-rasp-pi-g++ -device-option DISTRO=bsquask -opensource -confirm-license -optimized-qmake -reduce-relocations -reduce-exports -release -make libs -device-option CROSS_COMPILE=arm-linux-gnueabihf-
you will need simlik all arm-linux-gnueabihf-split ,..... to split,....
and patch for javascript engine link in wiki

It took some time but with distcc rapsbbery as master and 5* rapsberry in qemu it is no problem
you don't need qtwebkit!
2. gstreamer. all debian packages in repo
3. gstreamer openmax plugin in this discusion (use gst-launch for tests)
4. QML app just little modification(source) of
http://qt-project.org/doc/qt-5.0/qml-qt ... layer.html
5. right test file (rapsberry pi support hw decoding of h264 and mpeg4 video nothing else!!)
everything else is decoded with cpu with proper gstreamer plugin(we have all packages in rapsbian repo)
Last edited by m][sko on Tue Aug 14, 2012 7:40 pm, edited 2 times in total.
Posts: 81
Joined: Fri Jul 20, 2012 6:37 am
Location: Slovakia
by m][sko » Tue Aug 14, 2012 7:22 pm
dom wrote:@m][sko excellent!
What resolution video can you play? How busy is the ARM?
It would be good if you could post detailed instructions and/or make a video of this running.

PAL is no problem 720x576 25fps MPEG4 H264
46% cpu but another 15% is pulseaudio but you can always pass trough audio over HDMI and it should be better.
10% from application time took AAC software decoding :(
It will need some modification in gstreamer or you can do it with gstreamer ranking I think

Big problem is rapsberry pi memmory
but we can modify gstreamer with egl-sink and gst-omx(output to egl directly)
all stuff decoded with OpenMAX stay in EGL directly (zero buffer copy) but only for mpeg4 and h264


I don't profile application as I don't know how to profile gstreamer and qt in same time :)
Posts: 81
Joined: Fri Jul 20, 2012 6:37 am
Location: Slovakia
by dapa79 » Wed Aug 15, 2012 5:24 pm
m][sko wrote:howto hmm :)
1. build qt5. (you don't need x11 as it will be slow) egl and framebuffer is all what you need
http://releases.qt-project.org/qt5.0/beta-snapshots/

You can simple build it on pi device.
http://qt-project.org/wiki/RaspberryPi
./configure -v -opengl es2 -device linux-rasp-pi-g++ -device-option DISTRO=bsquask -opensource -confirm-license -optimized-qmake -reduce-relocations -reduce-exports -release -make libs -device-option CROSS_COMPILE=arm-linux-gnueabihf-
you will need simlik all arm-linux-gnueabihf-split ,..... to split,....
and patch for javascript engine link in wiki

It took some time but with distcc rapsbbery as master and 5* rapsberry in qemu it is no problem
you don't need qtwebkit!
2. gstreamer. all debian packages in repo
3. gstreamer openmax plugin in this discusion (use gst-launch for tests)
4. QML app just little modification(source) of
http://qt-project.org/doc/qt-5.0/qml-qt ... layer.html
5. right test file (rapsberry pi support hw decoding of h264 and mpeg4 video nothing else!!)
everything else is decoded with cpu with proper gstreamer plugin(we have all packages in rapsbian repo)


Thanks! Seems a bit to complicated for me. I think I'll wait for a pre-compiled qt after all.
Posts: 13
Joined: Mon May 21, 2012 5:55 am
by ghans » Wed Aug 22, 2012 8:02 am
I'm not sure if it is the right terminology here,
but have you pushed your changes "upstream" ?
Or do you want to contact the package maintainers of Raspbian ?

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org
Posts: 3914
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany
by tomtaylor » Sat Aug 25, 2012 9:12 am
I've got pretty close to getting this working, mostly thanks to this thread. Much appreciated.

The omxh264dec element is available, but when I try to use it to decode a stream, I get the following error:

0:00:02.179516954 1958 0x13e7a00 ERROR omx gstomx.c:87:gst_omx_core_acquire: Failed to initialize core '/opt/vc/lib/libopenmaxil.so': 0x80001009

That file is present, and I've just upgraded the firmware, so I'm not sure what's going wrong. Is there any way of testing this another way to see why it might be failing?
Posts: 12
Joined: Sat May 19, 2012 3:17 pm