尝试从网络摄像头流式传输视频时出现gstreamer管道错误

时间:2017-12-21 03:09:20

标签: video-streaming gstreamer

我想从网络摄像头获取h264帧,这是代码。我收到运行时错误。请有人帮忙。

代码:

status = FltRegisterFilter(DriverObject,
        &FilterRegistration,
        &MiniSpyData.Filter);

    if (!NT_SUCCESS(status)) {

        leave;
    }




    status = FltBuildDefaultSecurityDescriptor(&sd,
        FLT_PORT_ALL_ACCESS);

    if (!NT_SUCCESS(status)) {
        leave;
    }

    RtlInitUnicodeString(&uniString, WOODY_PORT_NAME);

    InitializeObjectAttributes(&oa,
        &uniString,
        OBJ_KERNEL_HANDLE | OBJ_CASE_INSENSITIVE,
        NULL,
        sd);

    status = FltCreateCommunicationPort(MiniSpyData.Filter,
        &MiniSpyData.ServerPort,
        &oa,
        NULL,
        SpyConnect,
        SpyDisconnect,
        SpyMessage,
        1);

    FltFreeSecurityDescriptor(sd);



    if (!NT_SUCCESS(status)) {
        leave;
    }

    //
    //  We are now ready to start filtering
    //

    status = FltStartFiltering(MiniSpyData.Filter);

    if (!NT_SUCCESS(status)) {

        FltUnregisterFilter(MiniSpyData.Filter);
    }
    else {
     //Here is what I want to attach
        RtlInitUnicodeString(&uniString, L"\\Device\\HarddiskVolume1");
        PFLT_VOLUME vol;
        FltGetVolumeFromName(&MiniSpyData.Filter, &uniString, &vol);
        status = FltAttachVolume(&MiniSpyData.Filter, vol, NULL, NULL);
    }

编译:

  

gcc gst_test.c -o gst_test -I / usr / include / gstreamer-1.0   -I / usr / lib / x86_64-linux-gnu / gstreamer-1.0 / include -I / usr / include / glib-2.0 -I / usr / lib / x86_64-linux-gnu / glib-2.0 / include -lgstreamer-1.0 -lgobject-2.0 -lglib-2.0

错误:

  

从元素源收到错误:内部数据流错误。   调试信息:gstbasesrc.c(2948):gst_base_src_loop():   / GstPipeline:test-pipeline / GstV4l2Src:source:暂停流媒体任务,   理由未谈判(-4)

0 个答案:

没有答案