raspberrypi gstreamer1.0 alsasrc0:内部数据流错误

Posted

技术标签:

【中文标题】raspberrypi gstreamer1.0 alsasrc0:内部数据流错误【英文标题】:raspberrypi gstreamer1.0 alsasrc0: Internal data flow error 【发布时间】:2013-10-02 12:01:11 【问题描述】:

我在尝试用声音从罗技 c210 网络摄像头流式传输 rtmp 时遇到一个问题。

我已经安装了 gstreamer1.0-omx 和其他需要的 stuf,但是当我尝试获取视频时(为了简化,让我们将其写入 flv 文件):

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. \! filesink location=1.flv

我得到了一个类似的错误:

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 69507879 ns.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
libv4l2: warning v4l2 mmap buffers still mapped on close()
Freeing pipeline ...

还有一些调试信息(-vvv 选项):

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstAudioSrcClock
/GstPipeline:pipeline0/GstAlsaSrc:alsasrc0: actual-buffer-time = 200000
/GstPipeline:pipeline0/GstAlsaSrc:alsasrc0: actual-latency-time = 10000
/GstPipeline:pipeline0/GstAlsaSrc:alsasrc0.GstPad:src: caps = audio/x-raw, format=(string)S16LE, layout=(string)interleaved, rate=(int)48000, channels=(int)1
/GstPipeline:pipeline0/GstAudioResample:audioresample0.GstPad:src: caps = audio/x-raw, format=(string)S16LE, layout=(string)interleaved, rate=(int)48000, channels=(int)1
/GstPipeline:pipeline0/GstCapsFilter:capsfilter2.GstPad:src: caps = audio/x-raw, format=(string)S16LE, layout=(string)interleaved, rate=(int)48000, channels=(int)1
/GstPipeline:pipeline0/GstQueue:queue1.GstPad:src: caps = audio/x-raw, format=(string)S16LE, layout=(string)interleaved, rate=(int)48000, channels=(int)1
/GstPipeline:pipeline0/GstVoAacEnc:voaacenc0.GstPad:sink: caps = audio/x-raw, format=(string)S16LE, layout=(string)interleaved, rate=(int)48000, channels=(int)1
/GstPipeline:pipeline0/GstVoAacEnc:voaacenc0.GstPad:sink: caps = audio/x-raw, format=(string)S16LE, layout=(string)interleaved, rate=(int)48000, channels=(int)1
/GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = video/x-raw, format=(string)I420, width=(int)640, height=(int)480, interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw, format=(string)I420, width=(int)640, height=(int)480, interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1
/GstPipeline:pipeline0/GstVoAacEnc:voaacenc0.GstPad:src: caps = audio/mpeg, mpegversion=(int)4, channels=(int)1, rate=(int)48000, stream-format=(string)raw, level=(string)2, base-profile=(string)lc, profile=(string)lc, codec_data=(buffer)1188
/GstPipeline:pipeline0/GstOMXH264Enc-omxh264enc:omxh264enc-omxh264enc0.GstPad:sink: caps = video/x-raw, format=(string)I420, width=(int)640, height=(int)480, interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-raw, format=(string)I420, width=(int)640, height=(int)480, interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1
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 561957256 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 速度或缓冲区等存在问题,那么有什么解决方案可以让它工作吗?

我也可以通过 arecord 或 gstreamer 录制声音,没有任何问题。或者也只是视频。只有同时捕捉视频和声音才会出现问题。

谢谢

【问题讨论】:

【参考方案1】:

问题是您的 alsasrc1.0 没有正确安装或根本没有安装。我会尝试以下方法:

首先尝试为 gstreamer1.0 额外安装 alsasrc:

sudo apt-get install gstreamer1.0-alsa

有时 Linux 的行为很奇怪,尽管您已经安装了一个软件包,但合并并没有正确完成。

如果上述解决方案不起作用,请尝试为您的管道安装 gstreamer0.10 版本所需的所有软件包,并使用gst-launch-0.10 尝试您的管道

【讨论】:

以上是关于raspberrypi gstreamer1.0 alsasrc0:内部数据流错误的主要内容,如果未能解决你的问题,请参考以下文章

音视频系列8:gstreamer基础

使用 Python3 gstreamer1.0 和 pylonsrc 使用 basler 相机和 pylon5 在处理循环中出现错误

Gstreamer 1.0 - 创建自定义消息/事件/信号

linux打开编辑ppt pptx doc文件

bitbake 如何在构建过程中搜索配方?

GStreamer 1.0 在 C 中将原始编码为 H.264