Toybrick

标题: rk3399 拉流,用什么方式好? [打印本页]

作者: lily393    时间: 2020-11-11 14:33
标题: rk3399 拉流,用什么方式好?
想问下大家,我现在想用rk33399从摄像头上拉流,然后用mpp做硬解码,然后再做车辆检测之类的,想问下大家拉流需要用什么方式啊?需要用到rtsp库么?我在系统上安装了一下,也没安对,不知道什么原因?已经更新过源了
firefly@firefly:/etc/apt$ sudo apt install rockchip-mpp-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package rockchip-mpp-dev
firefly@firefly:/etc/apt$ sudo apt install rockchip-rga-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package rockchip-rga-dev



作者: jefferyzhang    时间: 2020-11-11 15:13
1. 非Toybrick产品用不了Toybrick的库
2. rtsp可以建议使用ffmpeg、gstreamer、curl等开源库拉流
作者: lily393    时间: 2020-11-12 16:39
jefferyzhang 发表于 2020-11-11 15:13
1. 非Toybrick产品用不了Toybrick的库
2. rtsp可以建议使用ffmpeg、gstreamer、curl等开源库拉流 ...

亲,还想问下,我用opencv拉流,它里边也是用的gstreamer,我可以拉回来了,但是这个是不是软解码的啊?我是想拉流回来,然后送到mpp做硬解码,我是需要拿到软解码前的数据,我要怎样才可以拿到??
   printf("###############\n");
    string gsurl = "rtsp://admin@@@117.33.218.136:10554/ latency=0 ! rtph264depay ! h264parse ! videoconvert ! video/x-raw,format=(string)BGR  ! appsink sync=false";  
    VideoCapture cap = VideoCapture(gsurl,cv::CAP_GSTREAMER);
    if(!cap.isOpened())
    {
        std::cout<<"cannot open captrue..."<<std::endl;
        return 0;
    }

    int fps = cap.get(5);
    cout<<"fps:"<<fps<<endl;
    Mat frame;
    bool readreturn = false;
    while(1)
    {  
        readreturn = cap.read(frame);

        imshow("RTSP",frame);
        if (waitKey(30) == 27)
        {
            cout << "Esc key is pressed by user" << endl;
            break;
        }
    }

    cap.release();
作者: flyingroc    时间: 2021-5-29 11:29
OpenCV是不行的,要用ffmpeg或者gstreamer




欢迎光临 Toybrick (https://t.rock-chips.com/) Powered by Discuz! X3.3