|
板凳
楼主 |
发表于 2020-11-12 16:39:19
|
只看该作者
亲,还想问下,我用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(); |
|