dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5398
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: gstreamer openmax

Sat Aug 25, 2012 9:32 am

tomtaylor wrote: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?
How did you update firmware? rpi-update, or a manual method?

Can you show output of:
/opt/vc/bin/vcgencmd version

can you try running /opt/vc/src/hello_pi/hello_video

tomtaylor
Posts: 12
Joined: Sat May 19, 2012 3:17 pm

Re: gstreamer openmax

Sat Aug 25, 2012 10:21 am

dom wrote:How did you update firmware? rpi-update, or a manual method?
Hi Dom, I used rpi-update.
dom wrote:Can you show output of:
/opt/vc/bin/vcgencmd version

Code: Select all

Aug 23 2012 15:36:01 
Copyright (c) 2012 Broadcom
version 332937 (release)
dom wrote:can you try running /opt/vc/src/hello_pi/hello_video

Code: Select all

[email protected] /opt/vc/src/hello_pi/hello_video $ make
cc -DSTANDALONE -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -D_LINUX -fPIC -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -U_FORTIFY_SOURCE -Wall -g -DHAVE_LIBOPENMAX=2 -DOMX -DOMX_SKIP64BIT -ftree-vectorize -pipe -DUSE_EXTERNAL_OMX -DHAVE_LIBBCM_HOST -DUSE_EXTERNAL_LIBBCM_HOST -DUSE_VCHIQ_ARM -Wno-psabi -I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads -I./ -I../libs/ilclient -I../libs/vgfont -g -c video.c -o video.o -Wno-deprecated-declarations
cc -o hello_video.bin -Wl,--whole-archive video.o -lilclient -L/opt/vc/lib/ -lGLESv2 -lEGL -lopenmaxil -lbcm_host -lvcos -lvchiq_arm -L../libs/ilclient -L../libs/vgfont -Wl,--no-whole-archive -rdynamic
/usr/bin/ld: cannot find -lilclient
collect2: ld returned 1 exit status
make: *** [hello_video.bin] Error 1
rm video.o

tomtaylor
Posts: 12
Joined: Sat May 19, 2012 3:17 pm

Re: gstreamer openmax

Sat Aug 25, 2012 10:30 am

tomtaylor wrote:

Code: Select all

[email protected] /opt/vc/src/hello_pi/hello_video $ make
cc -DSTANDALONE -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -D_LINUX -fPIC -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -U_FORTIFY_SOURCE -Wall -g -DHAVE_LIBOPENMAX=2 -DOMX -DOMX_SKIP64BIT -ftree-vectorize -pipe -DUSE_EXTERNAL_OMX -DHAVE_LIBBCM_HOST -DUSE_EXTERNAL_LIBBCM_HOST -DUSE_VCHIQ_ARM -Wno-psabi -I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads -I./ -I../libs/ilclient -I../libs/vgfont -g -c video.c -o video.o -Wno-deprecated-declarations
cc -o hello_video.bin -Wl,--whole-archive video.o -lilclient -L/opt/vc/lib/ -lGLESv2 -lEGL -lopenmaxil -lbcm_host -lvcos -lvchiq_arm -L../libs/ilclient -L../libs/vgfont -Wl,--no-whole-archive -rdynamic
/usr/bin/ld: cannot find -lilclient
collect2: ld returned 1 exit status
make: *** [hello_video.bin] Error 1
rm video.o
Sorry, just spotted the README in the directory above. This compiles fine now, but running ./hello_video.bin test.h264 doesn't display anything, either on the framebuffer, or in X. It just hangs, until I interrupt it with ctrl-c.

tomtaylor
Posts: 12
Joined: Sat May 19, 2012 3:17 pm

Re: gstreamer openmax

Sat Aug 25, 2012 10:56 am

Thanks to gordonDrogon in #raspberrypi on Freenode, I've got that working now. It plays the sample video fine. I needed to increase the video memory split to 192/64 from 224/32. But I see the same error with the gstreamer pipeline.

mobilenomad
Posts: 1
Joined: Sun Aug 26, 2012 4:27 pm

Re: gstreamer openmax

Sun Aug 26, 2012 4:51 pm

I've been trying to get gst-omx to work for a while and I'm now almost there.

* Raspberry at 128/128 memory configuration
* hello_video.bin shows a test h264 video ok
* gstreamer seems to be working:

Code: Select all

gst-launch-0.10 videotestsrc ! video/x-raw-rgb, framerate=25/1, width=640, height=360 ! ffmpegcolorspace ! fbdevsink
and I get a nice "TV test" screen
* gst-omx seems to be there:

Code: Select all

~$ gst-inspect-0.10 | grep omx
openmax:  omxmpeg4videodec: OpenMAX MPEG4 Video Decoder
openmax:  omxh264dec: OpenMAX H.264 Video Decoder
But when I try to play a test video (same that worked with hello_video.bin):

Code: Select all

gst-launch-0.10 uridecodebin uri="file:///home/root/video/test.h264" ! fakesink sync=true
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
and nothing comes up on screen.

With GST_DEBUG="omx*:5", things look pretty ok:

Code: Select all

0:00:00.484410000 12878  0x1296050 DEBUG            omxvideodec gstomxvideodec.c:152:gst_omx_video_dec_base_init: No
 sink template caps specified for element 'omxh264dec', using default 'video/x-h264, parsed=(boolean) true, alignment=(string)au, stream-form
at=(string) byte-stream'
0:00:00.485593000 12878  0x1296050 DEBUG            omxvideodec gstomxvideodec.c:178:gst_omx_video_dec_base_init: No
 src template caps specified for element 'omxh264dec', using default 'video/x-raw-yuv, width = (int) [ 1, max ], height = (int) [ 1, max ], f
ramerate = (fraction) [ 0, max ]'
0:00:00.486779000 12878  0x1296050 DEBUG            omxvideodec gstomxvideodec.c:205:gst_omx_video_dec_base_init: Us
ing hack: no-empty-eos-buffer
0:00:00.487237000 12878  0x1296050 DEBUG            omxvideodec gstomxvideodec.c:205:gst_omx_video_dec_base_init: Us
ing hack: no-component-role
0:00:00.489876000 12878  0x1296050 DEBUG            omxvideodec gstomxvideodec.c:258:gst_omx_video_dec_open:<omxh264dec-
omxh264dec0> Opening decoder
0:00:00.505816000 12878  0x1296050 DEBUG                    omx gstomx.c:107:gst_omx_core_acquire: Successfully load
ed core '/usr/lib/libopenmaxil.so'
0:00:00.508779000 12878  0x1296050 DEBUG                    omx gstomx.c:122:gst_omx_core_acquire: Successfully init
ialized core '/usr/lib/libopenmaxil.so'
0:00:00.511347000 12878  0x1296050 DEBUG                    omx gstomx.c:453:gst_omx_component_new:<omxh264dec-omxh264de
c0> Successfully got component handle 0x13cf388 (OMX.broadcom.video_decode) from core '/usr/lib/libopenmaxil.so'
It seems to be doing decoding, but the pipeline is stuck at prerolling. This is from the end of the huge log:

Code: Select all

0:00:04.492521000 12878  0x138d888 DEBUG            omxvideodec gstomxvideodec.c:1274:gst_omx_video_dec_handle_frame:<omxh264dec-omxh264dec0> Handling frame
0:00:04.492860000 12878  0x138d888 DEBUG                    omx gstomx.c:945:gst_omx_port_acquire_buffer:<omxh264dec-omxh264dec0> Acquiring buffer from port 130
0:00:04.493182000 12878  0x138d888 DEBUG                    omx gstomx.c:803:gst_omx_component_get_last_error:<omxh264dec-omxh264dec0> Returning last error: None (0x00000000)
0:00:04.493495000 12878  0x138d888 DEBUG                    omx gstomx.c:1035:gst_omx_port_acquire_buffer:<omxh264dec-omxh264dec0> Queue of port 130 is empty
Any hints where to look?

naplam
Posts: 43
Joined: Tue Aug 14, 2012 11:04 pm

Re: gstreamer openmax

Mon Aug 27, 2012 8:26 am

tomtaylor wrote: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?
I'm having the same problem now, but I'm using the latest gstreamer tagged release with the small raspberry gst-omx changes ported to the latest gst-omx. I guess I'll have to try what everybody else is using just in case... By the way, the hello_video sample works for me.
When I use the test.h264 file from hello_video in gstreamer it says it doesn't have anything to decode h264. When I force it to use the omx element is when I get the error (failed to initialize core...)

tomtaylor
Posts: 12
Joined: Sat May 19, 2012 3:17 pm

Re: gstreamer openmax

Mon Aug 27, 2012 10:17 am

naplam wrote:I'm having the same problem now, but I'm using the latest gstreamer tagged release with the small raspberry gst-omx changes ported to the latest gst-omx. I guess I'll have to try what everybody else is using just in case...
That's what I was doing, but with gstreamer from the Raspbian apt repository. Are other people reporting success with gst-omx from master rather than the raspberry branch?

naplam
Posts: 43
Joined: Tue Aug 14, 2012 11:04 pm

Re: gstreamer openmax

Mon Aug 27, 2012 1:48 pm

tomtaylor wrote:
naplam wrote:I'm having the same problem now, but I'm using the latest gstreamer tagged release with the small raspberry gst-omx changes ported to the latest gst-omx. I guess I'll have to try what everybody else is using just in case...
That's what I was doing, but with gstreamer from the Raspbian apt repository. Are other people reporting success with gst-omx from master rather than the raspberry branch?
afaik, the master branch (0.11.x) can't even compile with gstreamer 0.10 (the Raspbian version). The Raspberry branch is derived from an older branch, you can see a lot of code changes if you compare it with the current version (the raspberry-specific changes on top of that are just four small changes).

I was trying just now to use the gstreamer version that comes with Raspbian, but this is bordering insane. apt-get wants to download like half a gigabyte of absurd dependencies, which I certainly won't let it do. So I'm back to gstreamer 0.11... let's see if I can fix this mess.

naplam
Posts: 43
Joined: Tue Aug 14, 2012 11:04 pm

Re: gstreamer openmax

Mon Aug 27, 2012 7:09 pm

After I installed plugins-bad it now recognises H.264 as such but it says I have no decoder: apparently the decoder is not initializing properly ("Failed to initialize core '/opt/vc/lib/libopenmaxil.so'"):

GST_DEBUG=3 gst-launch-1.0 uridecodebin uri="file:///root/test.h264" ! fakesink sync=true
GST_DEBUG=3 gst-launch-1.0 uridecodebin uri="file:///root/test.h264" ! fakesink sync=true
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
0:00:00.546724409 25828 0x85dc60 WARN GST_PADS gstpad.c:3515:gst_pad_peer_query:<capsfilter0:src> pad has no peer
0:00:00.550681318 25828 0x85dc60 WARN GST_PADS gstpad.c:3515:gst_pad_peer_query:<capsfilter0:src> pad has no peer
0:00:00.594760303 25828 0x85dc60 WARN GST_PADS gstpad.c:3515:gst_pad_peer_query:<capsfilter0:src> pad has no peer
0:00:00.627363552 25828 0x85dc60 ERROR omx gstomx.c:87:gst_omx_core_acquire: Failed to initialize core '/opt/vc/lib/libopenmaxil.so': 0x80001009
0:00:00.629065513 25828 0x85dc60 WARN decodebin gstdecodebin2.c:1998:connect_pad:<decodebin0> Couldn't set omxh264dec-omxh264dec0 to READY

Missing element: H.264 decoder
0:00:00.636949331 25828 0x85dc60 WARN uridecodebin gsturidecodebin.c:882:unknown_type_cb:<uridecodebin0> warning: No decoder available for type 'video/x-h264, stream-format=(string)byte-stream, width=(int)1920, height=(int)1080, parsed=(boolean)true, alignment=(string)au'.
WARNING: from element /GstPipeline:pipeline0/GstURIDecodeBin:uridecodebin0: No decoder available for type 'video/x-h264, stream-format=(string)byte-stream, width=(int)1920, height=(int)1080, parsed=(boolean)true, alignment=(string)au'.
Additional debug info:
gsturidecodebin.c(882): unknown_type_cb (): /GstPipeline:pipeline0/GstURIDecodeBin:uridecodebin0
0:00:00.644910147 25828 0x85dc60 WARN decodebin gstdecodebin2.c:3689:gst_decode_bin_expose:<decodebin0> No suitable plugins found
0:00:00.646567109 25828 0x85dc60 WARN decodebin gstdecodebin2.c:3691:gst_decode_bin_expose:<decodebin0> error: no suitable plugins found
ERROR: from element /GstPipeline:pipeline0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0: Your GStreamer installation is missing a plug-in.
Additional debug info:
gstdecodebin2.c(3691): gst_decode_bin_expose (): /GstPipeline:pipeline0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0:
no suitable plugins found
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
0:00:00.657050868 25828 0x85dc60 WARN decodebin gstdecodebin2.c:3673:gst_decode_bin_expose:<decodebin0> Currently, shutting down, aborting exposing
0:00:00.658681830 25828 0x85dc60 WARN decodebin gstdecodebin2.c:2456:pad_added_cb:<decodebin0> Couldn't expose group
Freeing pipeline ...
gst-inspect-1.0 |grep 264:
videoparsersbad: h264parse: H.264 parser
openmax: omxh264dec: OpenMAX H.264 Video Decoder
typefindfunctions: video/x-h264: h264, x264, 264
rtp: rtph264pay: RTP H264 payloader
rtp: rtph264depay: RTP H264 depayloader
I just tried MP4, same story:

Code: Select all

0:00:00.612599409 25832   0x16e060 ERROR                    omx gstomx.c:87:gst_omx_core_acquire: Failed to initialize core '/opt/vc/lib/libopenmaxil.so': 0x80001009
0:00:00.614269372 25832   0x16e060 WARN               decodebin gstdecodebin2.c:1998:connect_pad:<decodebin0> Couldn't set omxmpeg4videodec-omxmpeg4videodec0 to READY

tomtaylor
Posts: 12
Joined: Sat May 19, 2012 3:17 pm

Re: gstreamer openmax

Tue Aug 28, 2012 8:29 am

I'm afraid that's the same problem that I'm stuck with.

naplam
Posts: 43
Joined: Tue Aug 14, 2012 11:04 pm

Re: gstreamer openmax

Tue Aug 28, 2012 11:38 am

tomtaylor wrote:I'm afraid that's the same problem that I'm stuck with.
Tom, I think I have a solution. There are more Raspberry-specific changes in the raspberry branch than I thought. I added a call to bcm_host_init (See http://elinux.org/RPi_VideoCore_APIs#libbcm_host) and OMX_Init in libopenmaxil is now successful. I then searched for that in the raspberry branch, and sure enough, they were doing it too. So I'll have to merge the two branches more deeply... I'm now getting some other error about the buffers. I added h264 encoding to the config file too, but I have to get all this working first.

naplam
Posts: 43
Joined: Tue Aug 14, 2012 11:04 pm

Re: gstreamer openmax

Tue Aug 28, 2012 12:34 pm

Hmm It looks like the bcm_init thing was the only thing I overlooked (you can find the 5 changes at the top of this list: http://cgit.freedesktop.org/gstreamer/g ... =raspberry ).
So now I have this error:

Code: Select all

(gst-launch-1.0:3320): GStreamer-CRITICAL **: gst_buffer_extract: assertion `GST_IS_BUFFER (buffer)' failed
(repeated many times)
In between them I have this if I enable debug messages:
0:00:03.510508249 [331m 3282[00m 0xad0460 [37mDEBUG [00m [00m omx gstomx.c:1054:gst_omx_port_release_buffer:<omxh264dec-omxh264dec0>[00m Releasing buffer 0xb040b0 (0xb10810) to port 130
0:00:03.510752243 [331m 3282[00m 0xad0460 [37mDEBUG [00m [00m omx gstomx.c:782:gst_omx_component_get_last_error:<omxh264dec-omxh264dec0>[00m Returning last error: None (0x00000000)
0:00:03.511515226 [331m 3282[00m 0xad0460 [37mDEBUG [00m [00m omx gstomx.c:1097:gst_omx_port_release_buffer:<omxh264dec-omxh264dec0>[00m Released buffer 0xb040b0 to port 130: None (0x00000000)
0:00:03.511811219 [331m 3282[00m 0xad0460 [37mDEBUG [00m [00m omx gstomx.c:924:gst_omx_port_acquire_buffer:<omxh264dec-omxh264dec0>[00m Acquiring buffer from port 130
0:00:03.512041214 [331m 3282[00m 0xad0460 [37mDEBUG [00m [00m omx gstomx.c:782:gst_omx_component_get_last_error:<omxh264dec-omxh264dec0>[00m Returning last error: None (0x00000000)
0:00:03.512271209 [331m 3282[00m 0xad0460 [37mDEBUG [00m [00m omx gstomx.c:1018:gst_omx_port_acquire_buffer:<omxh264dec-omxh264dec0>[00m Port 11550864 has pending buffers
0:00:03.512493204 [331m 3282[00m 0xad0460 [37mDEBUG [00m [00m omx gstomx.c:1036:gst_omx_port_acquire_buffer:<omxh264dec-omxh264dec0>[00m Acquired buffer 0xb536b0 (0xb25810) from port 130: 0
The last one finally hangs here (I hjave to press ctrl-c to exit)

Code: Select all

(gst-launch-1.0:3342): GStreamer-CRITICAL **: gst_buffer_extract: assertion `GST_IS_BUFFER (buffer)' failed
0:00:11.678569142  3342  0x162e460 DEBUG                    omx gstomx.c:1054:gst_omx_port_release_buffer:<omxh264dec-omxh264dec0> Releasing buffer 0x16602d0 (0x179b760) to port 130
0:00:11.678896134  3342  0x162e460 DEBUG                    omx gstomx.c:782:gst_omx_component_get_last_error:<omxh264dec-omxh264dec0> Returning last error: None (0x00000000)

tomtaylor
Posts: 12
Joined: Sat May 19, 2012 3:17 pm

Re: gstreamer openmax

Tue Aug 28, 2012 7:30 pm

Good work! Sorry I'm not really able to contribute anything, this is bit beyond my Linux/C knowledge.

naplam
Posts: 43
Joined: Tue Aug 14, 2012 11:04 pm

Re: gstreamer openmax

Tue Aug 28, 2012 11:19 pm

I've now compiled 0.10 and it almost works but I think I'm having the issue other people mentioned before. It's stuck at "Pipeline is PREROLLING ..." when i do this:
gst-launch-0.10 -v filesrc location="test.h264" ! decodebin ! fbdevsink

With GST_DEBUG="*omx*:5" I see it continuously outputs these messages. Problem with the buffers? looks like the same problem I had in 0.11, but without the "CRITICAL" message.

Code: Select all

0:00:03.790386781  1682  0x1071720 DEBUG            omxvideodec gstomxvideodec.c:1274:gst_omx_video_dec_handle_frame:<omxh264dec-omxh264dec0> Handling frame
0:00:03.791866745  1682  0x1071720 DEBUG                    omx gstomx.c:945:gst_omx_port_acquire_buffer:<omxh264dec-omxh264dec0> Acquiring buffer from port 130
0:00:03.792791723  1682  0x1071720 DEBUG                    omx gstomx.c:803:gst_omx_component_get_last_error:<omxh264dec-omxh264dec0> Returning last error: None (0x00000000)
0:00:03.793846697  1682  0x1071720 DEBUG                    omx gstomx.c:1039:gst_omx_port_acquire_buffer:<omxh264dec-omxh264dec0> Port 17257264 has pending buffers
0:00:03.794170689  1682  0x1071720 DEBUG                    omx gstomx.c:1057:gst_omx_port_acquire_buffer:<omxh264dec-omxh264dec0> Acquired buffer 0x10a1d50 (0x1230a90) from port 130: 0
0:00:03.795103667  1682  0x1071720 DEBUG                    omx gstomx.c:1075:gst_omx_port_release_buffer:<omxh264dec-omxh264dec0> Releasing buffer 0x10a1d50 (0x1230a90) to port 130
0:00:03.796219639  1682  0x1071720 DEBUG                    omx gstomx.c:803:gst_omx_component_get_last_error:<omxh264dec-omxh264dec0> Returning last error: None (0x00000000)
0:00:03.797535607  1682  0x10a3e00 DEBUG                    omx gstomx.c:363:EmptyBufferDone:<omxh264dec-omxh264dec0> Port 130 emptied buffer 0x10a1d50 (0x1230a90)
0:00:03.798982573  1682  0x1071720 DEBUG                    omx gstomx.c:1118:gst_omx_port_release_buffer:<omxh264dec-omxh264dec0> Released buffer 0x10a1d50 to port 130: None (0x00000000)
0:00:03.800572534  1682  0x1071720 DEBUG            omxvideodec gstomxvideodec.c:1274:gst_omx_video_dec_handle_frame:<omxh264dec-omxh264dec0> Handling frame
0:00:03.801916501  1682  0x1071720 DEBUG                    omx gstomx.c:945:gst_omx_port_acquire_buffer:<omxh264dec-omxh264dec0> Acquiring buffer from port 130
0:00:03.802998475  1682  0x1071720 DEBUG                    omx gstomx.c:803:gst_omx_component_get_last_error:<omxh264dec-omxh264dec0> Returning last error: None (0x00000000)
0:00:03.803368466  1682  0x1071720 DEBUG                    omx gstomx.c:1039:gst_omx_port_acquire_buffer:<omxh264dec-omxh264dec0> Port 17257264 has pending buffers
0:00:03.804262444  1682  0x1071720 DEBUG                    omx gstomx.c:1057:gst_omx_port_acquire_buffer:<omxh264dec-omxh264dec0> Acquired buffer 0x10a1d20 (0x1244ac0) from port 130: 0
0:00:03.806002401  1682  0x1071720 DEBUG                    omx gstomx.c:1075:gst_omx_port_release_buffer:<omxh264dec-omxh264dec0> Releasing buffer 0x10a1d20 (0x1244ac0) to port 130
0:00:03.806586387  1682  0x1071720 DEBUG                    omx gstomx.c:803:gst_omx_component_get_last_error:<omxh264dec-omxh264dec0> Returning last error: None (0x00000000)
0:00:03.807513365  1682  0x1071720 DEBUG                    omx gstomx.c:1118:gst_omx_port_release_buffer:<omxh264dec-omxh264dec0> Released buffer 0x10a1d20 to port 130: None (0x00000000)
0:00:03.808882332  1682  0x10a3e00 DEBUG                    omx gstomx.c:363:EmptyBufferDone:<omxh264dec-omxh264dec0> Port 130 emptied buffer 0x10a1d20 (0x1244ac0)
0:00:03.810573291  1682  0x1071720 DEBUG            omxvideodec gstomxvideodec.c:1274:gst_omx_video_dec_handle_frame:<omxh264dec-omxh264dec0> Handling frame
0:00:03.811953257  1682  0x1071720 DEBUG                    omx gstomx.c:945:gst_omx_port_acquire_buffer:<omxh264dec-omxh264dec0> Acquiring buffer from port 130
0:00:03.813036231  1682  0x1071720 DEBUG                    omx gstomx.c:803:gst_omx_component_get_last_error:<omxh264dec-omxh264dec0> Returning last error: None (0x00000000)
0:00:03.813915209  1682  0x1071720 DEBUG                    omx gstomx.c:1039:gst_omx_port_acquire_buffer:<omxh264dec-omxh264dec0> Port 17257264 has pending buffers
0:00:03.814968183  1682  0x1071720 DEBUG                    omx gstomx.c:1057:gst_omx_port_acquire_buffer:<omxh264dec-omxh264dec0> Acquired buffer 0x10a1d40 (0x1258ae0) from port 130: 0
0:00:03.815346174  1682  0x1071720 DEBUG                    omx gstomx.c:1075:gst_omx_port_release_buffer:<omxh264dec-omxh264dec0> Releasing buffer 0x10a1d40 (0x1258ae0) to port 130
0:00:03.816269152  1682  0x1071720 DEBUG                    omx gstomx.c:803:gst_omx_component_get_last_error:<omxh264dec-omxh264dec0> Returning last error: None (0x00000000)
0:00:03.817773115  1682  0x10a3e00 DEBUG                    omx gstomx.c:363:EmptyBufferDone:<omxh264dec-omxh264dec0> Port 130 emptied buffer 0x10a1d40 (0x1258ae0)
0:00:03.819244080  1682  0x1071720 DEBUG                    omx gstomx.c:1118:gst_omx_port_release_buffer:<omxh264dec-omxh264dec0> Released buffer 0x10a1d40 to port 130: None (0x00000000)

Richard_P
Posts: 39
Joined: Mon Jun 11, 2012 10:43 am

Re: gstreamer openmax

Sun Sep 02, 2012 11:35 am

Has anyone progressed with this?

I get the same problem as the previous poster... lots of messages, Prerolling and nothing else

R

tomtaylor
Posts: 12
Joined: Sat May 19, 2012 3:17 pm

Re: gstreamer openmax

Sun Sep 02, 2012 11:39 am

No, I'm afraid not. Is it worth contacting George Kiagiadakis who made the raspberry pi branch in gst-omx to see if he has any suggestions?

Richard_P
Posts: 39
Joined: Mon Jun 11, 2012 10:43 am

Re: gstreamer openmax

Sun Sep 02, 2012 11:52 am

tomtaylor wrote:No, I'm afraid not. Is it worth contacting George Kiagiadakis who made the raspberry pi branch in gst-omx to see if he has any suggestions?
Email sent :D - I guess its the big wait. :(

Richard_P
Posts: 39
Joined: Mon Jun 11, 2012 10:43 am

Re: gstreamer openmax

Sun Sep 02, 2012 12:38 pm

Reply.. Some info, but myGstreamer installion hangs when I install the BAD plugins.

R


========= The Honorable George said..... ==========
Hi,
The most possible cause is that you don't have the h264parse element
installed (it's in gst-plugins-bad). Or otherwise decodebin doesn't
insert this element in the pipeline (try decodebin2). The problem is
that without h264parse, the OpenMAX decoder is unable to parse the
file's contents and unfortunately it doesn't report any errors, so the
pipeline continues prerolling forever.

Now if this is not the cause of the problem, I'm not sure what it can
be. Try playbin2 as well to eliminate the possiblity of it being a
gstreamer problem.

Regards,
George
==============================================

Richard_P
Posts: 39
Joined: Mon Jun 11, 2012 10:43 am

Re: gstreamer openmax

Sun Sep 02, 2012 2:46 pm

The gst-launch-0.10 playbin2 uri="file://path/to/file" video-sink=fbdevsink works for me, the other command line using filesrc doesnt :(

Note: the test.h264 file only shows 1 frame, I used other test files and they are all good.


Kudos to George, I have video (albeit not as I hoped)

EDIT:
gst-launch-0.10 filesrc location=/home/pi/big_buck_bunny.mp4 ! decodebin2 ! ffmpegcolorspace ! fbdevsink

^^^ the above works!


Richard
==== Fron George =============
Yes. Both of these pipelines have worked for me:

With X:
gst-launch-0.10 playbin2 uri="file://path/to/file" video-sink=ximagesink

With or without X:
gst-launch-0.10 playbin2 uri="file://path/to/file" video-sink=fbdevsink

Your initial pipeline uses fakesink, which doesn't really show
anything, it just drops data.

You can also do playbin2's work manually and use:

gst-launch-0.10 filesrc location=/path/to/file ! decodebin2 ! fbdevsink

Regards,
George
========================

tomtaylor
Posts: 12
Joined: Sat May 19, 2012 3:17 pm

Re: gstreamer openmax

Sun Sep 02, 2012 9:00 pm

Hurrah, that works for me. To parse an incoming RTP stream I use:

Code: Select all

gst-launch -v udpsrc port=4000 caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264" ! rtph264depay ! h264parse ! omxh264dec ! ffmpegcolorspace ! fbdevsink sync=false
This is still using the CPU to convert the colorspace, which must be possible in hardware. But it works.

naplam
Posts: 43
Joined: Tue Aug 14, 2012 11:04 pm

Re: gstreamer openmax

Sun Sep 02, 2012 9:48 pm

It still doesn't work for me. I see nothing on the screen even though omxh264dec appears to be doing something (but probably not much since cpu use is near zero anyway without gst_debug despite all the messages about the buffers that suggest omx might be working with gst_debug 4). And fbdevsink is working because I can see the test element whatever it's called (color bars and so on), but nothing seems to get to fbdevsink when using omxh264dec. By the way, my h264parse plugin is called legacyh264parse (apparently it was renamed a long time ago or something?). I've tried every way of doing it too (playbin2, decodebin, specifying all the elements from legacyh264parse to fbdevsink...)
This raspberry pi piece of junk is becoming increasingly frustrating for me, I might just as well toss it in the bin (SD card corruption, webcam drops frames, can't capture video and write to sd or usb at the same time, wireless nic drops half the packets...) - it's practically useless for any meaningful purpose.

naplam
Posts: 43
Joined: Tue Aug 14, 2012 11:04 pm

Re: gstreamer openmax

Sun Sep 02, 2012 10:40 pm

About encoding, nothing works either:
this successfully displays the webcam's video:
gst-launch-0.10 v4l2src ! 'video/x-raw-yuv,width=320,height=240' ! decodebin2 ! ffmpegcolorspace ! fbdevsink

this "successfully" (it's impossible to write to sd or usb while using the webcam... it will be like 1 frame per every 3 seconds) records mjpeg video:
gst-launch-0.10 v4l2src ! video/x-raw-yuv,width=640,height=480,framerate=15/1 ! ffmpegcolorspace ! jpegenc ! multipartmux ! filesink location=out/test8.mjpeg

these do nothing:

Code: Select all

GST_DEBUG=3 gst-launch-0.10 v4l2src ! 'video/x-raw-yuv,width=640,height=480,framerate=15/1' ! omxh264enc ! filesink location=out/testw.h264
gst-launch-0.10 v4l2src ! 'video/x-raw-yuv,width=640,height=480,framerate=15/1' ! queue ! videorate ! 'video/x-raw-yuv,format=I420,framerate=15/1' ! omxh264enc ! filesink location=out/testw.h264
gst-launch-0.10 v4l2src ! 'video/x-raw-yuv,width=640,height=480' ! decodebin2 ! ffmpegcolorspace !  omxh264enc ! filesink location=out/testM2.h264
gst-launch-0.10 v4l2src ! 'video/x-raw-yuv,width=640,height=480' ! decodebin2 ! videoparse width=640 height=480 format=i420 framerate=15/1 ! ffmpegcolorspace !  omxh264enc ! filesink gst-launch-0.10 v4l2src ! 'video/x-raw-yuv,width=640,height=480' ! decodebin2 ! videoparse width=640 height=480 format=i420  ! ffmpegcolorspace !  omxh264enc ! filesink location=out/testM2.h264
GST_DEBUG=2 gst-launch-0.10 v4l2src ! 'video/x-raw-yuv,width=320,height=240' ! decodebin2 ! videoparse width=320 height=240 format=i420  ! ffmpegcolorspace !  omxh264enc ! filesink location=out/testM4.h264
GST_DEBUG=2 gst-launch-0.10 v4l2src ! 'video/x-raw-yuv,width=320,height=240' ! videoparse width=320 height=240   ! ffmpegcolorspace !  omxh264enc ! filesink location=out/testM4.h264
GST_DEBUG=3 gst-launch-0.10 v4l2src ! 'video/x-raw-yuv,width=320,height=240' ! videoparse width=320 height=240   format=i420  !  omxh264enc ! filesink location=out/testM5.h264
GST_DEBUG=5 gst-launch-0.10 v4l2src ! 'video/x-raw-yuv,width=320,height=240' ! videoparse width=320 height=240   format=i420 ! ffmpegcolorspace !  omxh264enc ! filesink location=out/testM4.h264
gst-launch-0.10 v4l2src ! 'video/x-raw-yuv,width=320,height=240' ! decodebin2 ! ffmpegcolorspace ! fbdevsink
gst-launch-0.10 v4l2src ! 'video/x-raw-yuv,width=320,height=240' ! decodebin2 ! ffmpegcolorspace ! omxh264enc ! filesink location=out/testM.h264
gst-launch-0.10 v4l2src ! 'video/x-raw-yuv,width=320,height=240' ! decodebin2 ! ffmpegcolorspace ! videoparse width=320 height=240   format=i420 ! omxh264enc ! filesink location=out/testM.h264
gst-launch-0.10 v4l2src ! 'video/x-raw-yuv,width=320,height=240' ! decodebin2 ! ffmpegcolorspace ! fbdevsink
GST_DEBUG=2 gst-launch-0.10 v4l2src ! 'video/x-raw-yuv,width=320,height=240' ! videoparse width=320 height=240   format=i420 ! ffmpegcolorspace !  omxh264enc ! filesink location=out/testM4.h264
gst-launch-0.10 v4l2src ! video/x-raw-yuv,width=320,height=240 ! videoparse width=320 height=240 format=i420  ! ffmpegcolorspace ! omxh264enc ! filesink location=out/testM3.h264
gst-launch-0.10 v4l2src ! 'video/x-raw-yuv,width=320,height=240' ! decodebin2 ! ffmpegcolorspace ! videoparse width=320 height=240   format=i420 ! omxh264enc ! filesink location=out/testM6.h264
gst-launch-0.10 v4l2src ! 'video/x-raw-yuv,width=320,height=240' ! decodebin2 !  ! videoparse width=320 height=240   format=i420 ! omxh264enc ! filesink location=out/testM6.h264
gst-launch-0.10 v4l2src ! 'video/x-raw-yuv,width=320,height=240' ! decodebin2 !  videoparse width=320 height=240   format=i420 ! omxh264enc ! filesink location=out/testM6.h264
gst-launch-0.10 v4l2src ! 'video/x-raw-yuv,width=320,height=240' !  videoparse width=320 height=240   format=i420 ! omxh264enc ! filesink location=out/testM6.h264
gst-launch-0.10 v4l2src ! video/x-raw-yuv,width=320,height=240 ! videoparse width=320 height=240 format=i420  ! ffmpegcolorspace ! omxh264enc ! filesink location=out/testM3.h264
gst-launch-0.10 v4l2src ! video/x-raw-yuv,width=320,height=240 ! videoparse width=320 height=240 format=i420  ! ffmpegcolorspace ! omxh264enc ! filesink location=out/testM3.h264
gst-launch-0.10 v4l2src ! 'video/x-raw-yuv,width=640,height=480' ! decodebin2 ! videoparse width=640 height=480 format=i420  ! ffmpegcolorspace !  omxh264enc ! filesink location=out/testM2.h264
gst-launch-0.10 v4l2src ! 'video/x-raw-yuv,width=640,height=480' ! decodebin2 ! ffmpegcolorspace ! videoparse width=640 height=480 format=i420  !  omxh264enc ! filesink location=out/testM2.h264
gst-launch-0.10 v4l2src ! 'video/x-raw-yuv,width=640,height=480'  ! ffmpegcolorspace ! videoparse width=640 height=480 format=i420  !  omxh264enc ! filesink location=out/testM2.h264
gst-launch-0.10 v4l2src ! 'video/x-raw-yuv,width=640,height=480'  ! videoparse width=640 height=480 format=i420  !  omxh264enc ! filesink location=out/testM2.h264
gst-launch-0.10 v4l2src ! 'video/x-raw-yuv,width=640,height=480'  ! videoparse width=640 height=480 format=i420  ! ffmpegcolorspace ! omxh264enc ! filesink location=out/testM2.h264
gst-launch-0.10 v4l2src ! video/x-raw-yuv,width=640,height=480 ! ffmpegcolorspace ! omxh264enc ! mp4mux ! filesink location=out/testH.mp4
gst-launch-0.10 v4l2src ! video/x-raw-yuv,width=640,height=480 ! decodebin2 ! ffmpegcolorspace ! omxh264enc ! mp4mux ! filesink location=out/testH.mp4
gst-launch-0.10 v4l2src ! video/x-raw-yuv,width=640,height=480 ! videoparse format=i420 ! ffmpegcolorspace ! omxh264enc ! mp4mux ! filesink location=out/testH.mp4
gst-launch-0.10 v4l2src ! video/x-raw-yuv,width=320,height=240 ! videoparse format=i420 ! omxh264enc ! mp4mux ! filesink location=out/testH.mp4
My gstomx.conf section for omxh264enc:

Code: Select all

[omxh264enc]
type-name=GstOMXH264Enc
core-name=/opt/vc/lib/libopenmaxil.so
component-name=OMX.broadcom.video_encode
rank=256
in-port-index=200
out-port-index=201
hacks=no-empty-eos-buffer;no-component-role

gkiagia
Posts: 6
Joined: Mon Sep 03, 2012 9:24 am

Re: gstreamer openmax

Mon Sep 03, 2012 9:58 am

So here I am... Now you don't need to email me anymore :)

@naplam: Encoding might need some modifications in the gst-omx video encoder class, but I'm not sure. I've never tried it. The question is, of course, whether the firmware for the GPU that is shipped for the rpi includes video encoders. It is possible that it doesn't include encoders, as that would increase the cost.

Also, fwiw, decodebin(2) is for *decoding*, as it's name suggests. It won't encode anything.

Finally, legacyh264parse is an old element that has been replaced by the new h264parse. You should use the new one instead.

naplam
Posts: 43
Joined: Tue Aug 14, 2012 11:04 pm

Re: gstreamer openmax

Mon Sep 03, 2012 2:22 pm

gkiagia wrote:So here I am... Now you don't need to email me anymore :)
Nice to see you here, George :)

It does include encoders now that they've figured out the licensing issues (h264 encoding was disabled before because they thought they needed an additional license but they found out it was already included in the license they were paying, so in firmwares from early august it was unlocked and the possibility to pay for an mpeg2 license was added too).

I know decodebin2 is for decoding, but I was just trying anything at random, just in case...
Supposing omxh264enc worked without modifications, what would you suggest for testing?

I don't know why I have the legacyh264parse plugin and not h264parse, I downloaded the latest gstreamer 0.10 release and its plugins and compiled from source.

naplam
Posts: 43
Joined: Tue Aug 14, 2012 11:04 pm

Re: gstreamer openmax

Tue Sep 04, 2012 2:03 pm

legacyh264parse is what I get when I clone the 0.10 branch for gst-plugins-bad:

Code: Select all

grep legacy gst/h264*/*
gst/h264parse/gsth264parse.c:  GST_DEBUG_CATEGORY_INIT (h264_parse_debug, "legacy h264parse", 0,
gst/h264parse/gsth264parse.c:      "legacy h264 parser");
gst/h264parse/gsth264parse.c:  return gst_element_register (plugin, "legacyh264parse",
Isn't everybody here using the 0.10 package that comes with raspbian? I have compiled the 0.10 current version now (not the latest tagged release) and it still doesn't work. What am I supposed to do to make this to work? I tried 0.11 at first and it didn't work either.

Return to “Graphics, sound and multimedia”