Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gstreamer and Raspberry Pi #284

Open
p10tyr opened this issue Oct 29, 2013 · 2 comments
Open

Gstreamer and Raspberry Pi #284

p10tyr opened this issue Oct 29, 2013 · 2 comments

Comments

@p10tyr
Copy link

p10tyr commented Oct 29, 2013

Hi Roman,

I have been working with the latest gstreamer 1.0 compiled for the Pi to use the hardware capabilities. After 3 long nights I finally got a pipe to work for gstreamer and nginx-rtmp.

The command line I use is as follows

raspivid -t 999999 -h 720 -w 1080 -fps 25 -hf -b 2000000 -o - | gst-launch-1.0 -v fdsrc ! h264parse ! flvmux ! rtmpsink location=\"rtmp://localhost/rtmp/live live=1\"

I use the flvmux and that combination seems to work. Anything else I try will just give me that erroneous pipeline error and the debug says cannot match source to rtmp sink.

The problem is that for some reason the m3u8 gets created and then after a few seconds it gets deleted and only video1.ts available after that. It grows in size then gets deleted grows, deleted... but there is no m3u8 file?

nginx.conf is setup like in your manual, using 1 worker process and running as root for now + publish_time_fix off; is under rtmp { server { ...

I also tried the variation you published to use a normal webcam

raspivid -t 999999 -o - | gst-launch-1.0 -v fdsrc  ! "video/x-raw,width=640,height=480,framerate=15/1" ! omxh264enc target-bitrate=1000000 control-rate=variable ! video/x-h264,profile=high ! h264parse ! queue ! flvmux name=mux ! rtmpsink location=\"rtmp://localhost/hls/live live=1\"

but get the error

Additional debug info:
gstomxvideoenc.c(1738): gst_omx_video_enc_handle_frame (): /GstPipeline:pipeline0/GstOMXH264Enc-omxh264enc:omxh264enc-omxh264enc0:
Failed to write input into the OpenMAX buffer
ERROR: pipeline doesn't want to preroll.

Also when I use strobemedia as before to try and view the RTMP stream it just says buffering...

How can I solve this?

-EDIT
I downloaded rtmp dump and I get this result. It detects the frame size but there are not framerate?
image

EDIT 2
I added this ! h264parse config-interval=2 ! to the pipe and that seems to get rtmp stream working... but not always.

@vierlex
Copy link

vierlex commented Mar 4, 2014

i have EXACTLY the same problem. does this problem still persist? what kind of problems do you have using the config-interval option?

also, i have tried using UV4L(http://www.linux-projects.org/modules/sections/index.php?op=viewarticle&artid=16), its a video4linux2 wrapper which supports the raspicam, you can use it instead of raspivid as a source http://nginx-rtmp.blogspot.co.at/2013/07/gstreamer-and-raspberry-pi.html but i guess you tried that too. in my case, this doesnt even show any error. it just timesout after a while.

@evjenios
Copy link

This issue still persists on new versions of Gstreamer, e.g. 1.8 and 1.10, but 1.2.4 works fine.

Pipeline is:

gst-launch-1.0 \
        rtspsrc location=rtsp://my.ip.cam/ protocols=tcp ! rtph264depay \
            ! h264parse \
            ! queue \
            ! flvmux \
! rtmpsink location="rtmp://my.server.ip/live/test"

Any thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants