如何在eos事件之前协商下沉?

时间:2017-11-22 10:10:20

标签: python-3.x gstreamer pygobject

如何在eos事件之前协商接收器? 请解释一下我做错了什么。 尝试使用Python运行教程8中的示例: https://gstreamer.freedesktop.org/documentation/tutorials/basic/short-cutting-the-pipeline.html

错误输出:

    ...
    0:00:00.117266000 78270 0x7ff68399a6d0 FIXME                default gstutils.c:3902:gchar *gst_pad_create_stream_id_internal(GstPad *, GstElement *, const gchar *):<app_source:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
    0:00:00.119250000 78270 0x7ff68399a6d0 WARN                 basesrc gstbasesrc.c:2939:void gst_base_src_loop(GstPad *):<app_source> error: Internal data stream error.
    0:00:00.119260000 78270 0x7ff68399a6d0 WARN                 basesrc gstbasesrc.c:2939:void gst_base_src_loop(GstPad *):<app_source> error: streaming stopped, reason not-negotiated (-4)
    0:00:00.119408000 78270 0x7ff68399ade0 WARN           audiobasesink gstaudiobasesink.c:1119:gst_audio_base_sink_wait_event:<audio_sink> error: Sink not negotiated before eos event.
    Error received from element app_source: gst-stream-error-quark: Internal data stream error. (1)
    Debugging information: gstbasesrc.c(2939): void gst_base_src_loop(GstPad *) (): /GstPipeline:test-pipeline/GstAppSrc:app_source:
    streaming stopped, reason not-negotiated (-4)

    Process finished with exit code 0

1 个答案:

答案 0 :(得分:0)

在我的情况下,我为appsrc输入数据输入了错误的音频上限。所以我改变了音频功能字符串:

AUDIO_CAPS = 'audio/x-raw, rate=(int)44100, format=(string)S16, ' \
            'channels=(int)1'

到此:

AUDIO_CAPS = 'audio/x-raw, rate=(int)44100, format=(string)S16LE, ' \
            'channels=(int)1, layout=(str)interleaved'