2013-09-26 66 views
4

我試圖從rasberrypi RTMP流,該OMX硬件編碼器的工作非常不錯,對了,所以我跑:的GStreamer flvmux和RTMP錯誤

gst-launch-1.0 v4l2src ! «video/x-raw,width=640,height=480,framerate=30/1» !\ 
omxh264enc target-bitrate=1000000 control-rate=variable !\ 
video/x-h264,profile=high ! h264parse ! queue ! \ 
flvmux name=mux alsasrc device=plughw:1 ! audioresample ! \ 
audio/x-raw,rate=48000,channels=1 ! queue ! voaacenc bitrate=32000 ! queue ! mux. mux. !\ 
rtmpsink location='rtmp://my_rtmp_for_ustream.tv_url' 

而且有一個錯誤:

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 ... 

首先我認爲有一些問題,ALSA或者這樣,後來我試着寫簡單MPEGTS的,它的工作:

gst-launch-1.0 v4l2src ! «video/x-raw,width=640,height=480,framerate=30/1» ! \ 
omxh264enc target-bitrate=1000000 control-rate=variable !\ 
video/x-h264,profile=high ! h264parse ! queue ! \ 
mpegtsmux name=mux alsasrc device=plughw:1 ! audioresample !\ 
audio/x-raw,rate=48000,channels=1 ! queue ! voaacenc bitrate=32000 ! \ 
queue ! mux. mux. ! filesink location=1.ts 

但我不能只是改變「文件接收地點= 1.ts」到rtmpsink位置=「RTMP://my_rtmp_for_ustream.tv_url」因爲我會得到一個錯誤:

警告:管道錯誤:無法連接複用到rtmpsink0

那麼,我能做些什麼來得到它的工作?謝謝。

回答

0

真正的問題是rtmpsync需要原始的AAC,所以我加了aacparse和它的工作了,這樣的事情:

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" 
1

rtmpsink需要「video/x-flv」格式的數據。你的第一條管道清楚地顯示出談判錯你可以通過在命令行中添加-v來獲得管道協商轉儲的管道。