2

I've been trying for hours to set up the pipeline for streaming an MP4 file to nginx via RTMP on my rpi2.

  • must use Openmax GPU encoding (omxh264enc)

Here's the command I'm trying

gst-launch-1.0 \
  filesrc location="/path/to/video.mp4" ! decodebin name=t \
  t. ! videoconvert ! omxh264enc ! queue ! flvmux name=mux \
  t. ! audioconvert ! voaacenc bitrate=128000 ! queue ! mux. \
  mux. ! rtmpsink location="rtmp://127.0.0.1:1935/live/cantelope live=1"

which outputs

Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
ERROR: from element /GstPipeline:pipeline0/GstOMXH264Enc-omxh264enc:omxh264enc- omxh264enc0: Internal data stream error.
Additional debug info:
gstomxvideoenc.c(865): gst_omx_video_enc_loop (): /GstPipeline:pipeline0/GstOMXH264Enc-omxh264enc:omxh264enc-omxh264enc0:
stream stopped, reason not-negotiated
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...

Edit: This is the new command and output.

2
  • The standard RPi hardware does not have any audio input capabilities and it looks as though that command expects to get its audio from a local device and not from presumably where it should (a file or pipe?)
    – SlySven
    Dec 28, 2015 at 1:12
  • @SlySven You're right of course, and I think I fixed the audio part, but I'm getting a new error now. See edit.
    – cantelope
    Dec 28, 2015 at 4:29

1 Answer 1

3

I was getting the same error and found the following test pipeline to work:

gst-launch-1.0 videotestsrc ! omxh264enc ! "video/x-h264,profile=high" ! h264parse ! matroskamux ! filesink location=output.avi

This was based on an old thread on the raspberrypi.org forums at https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=34250&start=75 by by Defiant on Sun Nov 17, 2013 7:22 pm

I modified the pipeline from my Logitech QuickCam Pro 9000 as follows resulting in success.

gst-launch-1.0 -e v4l2src device=/dev/video0 ! image/jpeg,width=960,height=720,framerate=15/1 ! jpegdec ! omxh264enc ! "video/x-h264,profile=high" ! h264parse ! matroskamux ! filesink location=output.mkv

My system is a Raspberry Pi 2 Linux carpi 4.1.13-v7+ #826 SMP PREEMPT Fri Nov 13 20:19:03 GMT 2015 armv7l GNU/Linux

gst-inspect-1.0 omxh264enc
Factory Details:
  Rank                     primary + 1 (257)
  Long-name                OpenMAX H.264 Video Encoder
  Klass                    Codec/Encoder/Video
  Description              Encode H.264 video streams
  Author                   Sebastian Dröge <[email protected]>

Plugin Details:
  Name                     omx
  Description              GStreamer OpenMAX Plug-ins
  Filename                 /usr/lib/arm-linux-gnueabihf/gstreamer-1.0/libgstomx.so
  Version                  1.0.0.1
  License                  LGPL
  Source module            gst-omx
  Source release date      2015-11-11 17:35 (UTC)
  Binary package           GStreamer OpenMAX Plug-ins git
  Origin URL               Unknown package origin
2
  • I was able to modify my command with the info provided in this answer, and got it working. Thank you!
    – cantelope
    Jan 5, 2016 at 1:34
  • 1
    the ! h264parse ! pipeline element was required for me, which I found in the gstreamer1.0-plugins-bad debian package.
    – Mark
    Feb 8, 2016 at 18:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.