gstreamer flvmux and rtmp error

匿名 (未验证) 提交于 2019-12-03 08:48:34

问题:

I trying to stream rtmp from rasberrypi, the omx hardware encoder worked really nice, by the way, so I'm running:

And there is an error:

Setting pipeline to PAUSED ... Pipeline is live and does not need PREROLL ... Setting pipeline to PLAYING ... New clock: GstAudioSrcClock ERROR: from element /GstPipeline:pipeline0/GstAlsaSrc:alsasrc0: Internal data flow error. Additional debug info: gstbasesrc.c(2812): gst_base_src_loop (): /GstPipeline:pipeline0/GstAlsaSrc:alsasrc0: streaming task paused, reason not-negotiated (-4) Execution ended after 535913298 ns. Setting pipeline to PAUSED ... Setting pipeline to READY ... Setting pipeline to NULL ... libv4l2: warning v4l2 mmap buffers still mapped on close() Freeing pipeline ... 

First of all i thought that there is some alsa problems or such, but then I tried to write simple mpegts and it worked:

But i can't just change "filesink location=1.ts" to rtmpsink location='rtmp://my_rtmp_for_ustream.tv_url' because i'll get an error:

WARNING: erroneous pipeline: could not link mux to rtmpsink0

So, what can I do to get it work? Thanks.

回答1:

rtmpsink requires data in "video/x-flv" format. Your first pipeline clearly showing negotiation error. Can you get me caps negotiation dump of your pipeline by adding -v in command line.



回答2:

Real problem was that rtmpsync need raw aac, so I added aacparse and it worked out, something like this:

gst-launch-1.0 v4l2src ! \    "video/x-raw, framerate=25/1, width=320, height=240" ! \    omxh264enc target-bitrate=300000 control-rate=variable ! \    h264parse ! queue ! flvmux name=muxer alsasrc device=hw:1 ! \    audioresample ! "audio/x-raw,rate=48000" ! queue ! \    voaacenc bitrate=32000 ! aacparse ! queue ! muxer. muxer. ! \    rtmpsink location="$RTMP_URL" 


标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!