本文整理汇总了C++中Pipeline::addFilters方法的典型用法代码示例。如果您正苦于以下问题:C++ Pipeline::addFilters方法的具体用法?C++ Pipeline::addFilters怎么用?C++ Pipeline::addFilters使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pipeline
的用法示例。
在下文中一共展示了Pipeline::addFilters方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char** argv) {
if (argc < 3) {
cerr << "Usage: " << argv[0] << " <output video 1> <output video 2> " << endl;
return -1;
}
string outputVideo1 = argv[1];
string outputVideo2 = argv[2];
Pipeline* pipe = Factory::createPipeline("DASH webcam stream - two output");
Filter* reader = Factory::createFilter("video_reader", "reader");
Filter* scaler1 = Factory::createFilter("image_scaler", "scaler1");
Filter* scaler2 = Factory::createFilter("image_scaler", "scaler2");
Filter* encoder1 = Factory::createFilter("video_encoder", "encoder1");
Filter* encoder2 = Factory::createFilter("video_encoder", "encoder2");
Filter* muxer1 = Factory::createFilter("video_muxer", "muxer1");
Filter* muxer2 = Factory::createFilter("video_muxer", "muxer2");
pipe->addFilters(reader, scaler1, scaler2, encoder1, encoder2, muxer1, muxer2, nullptr);
pipe->connectFilters(reader, scaler1);
pipe->connectFilters(scaler1, encoder1);
pipe->connectFilters(encoder1, muxer1);
pipe->connectFilters(reader, scaler2);
pipe->connectFilters(scaler2, encoder2);
pipe->connectFilters(encoder2, muxer2);
reader->setProp("input_video", "/dev/video0");
reader->setProp("video_format", "video4linux2");
reader->setProp("input_format", "mjpeg");
reader->setProp("framerate", "20");
scaler1->setProp<int>("width", 640);
scaler1->setProp<int>("height", 480);
scaler2->setProp<int>("width", 320);
scaler2->setProp<int>("height", 240);
encoder1->setProp("bitrate", 400000);
encoder1->setProp("framerate", 20);
encoder1->setProp("output_video", outputVideo1);
encoder2->setProp("bitrate", 400000);
encoder2->setProp("framerate", 20);
encoder2->setProp("output_video", outputVideo2);
pipe->init();
pipe->run();
Factory::destroyPipeline(pipe);
return 0;
}
示例2: main
int main(int argc, char** argv) {
Pipeline* pipe = Factory::createPipeline("E-Health Client");
Filter* sensor = Factory::createFilter("ehealthsensor", "ehealthsensor");
Filter* display = Factory::createFilter("ehealthdisplay", "ehealthdisplay");
pipe->addFilters(sensor, display, nullptr);
pipe->connectFilters(sensor, display);
pipe->init();
pipe->run();
Factory::destroyPipeline(pipe);
return 0;
}