当前位置:网站首页>[MLT] Analysis of MLT Multimedia Framework Production and Consumption Architecture (2)
[MLT] Analysis of MLT Multimedia Framework Production and Consumption Architecture (2)
2022-08-09 04:49:00 【one two three o-0-o】
MLTAnalysis of production and consumption architecture of multimedia framework
前提
通过阅读【MLT】MLTAnalysis of production and consumption architecture of multimedia framework(一)满足以下两点:
- 了解MLT的核心C++The encapsulation hierarchy
- 掌握使用MLT的Consumer(sdl)消费Producer(MP4)
What to get from this article?
本文将对【MLT】MLTAnalysis of production and consumption architecture of multimedia framework(一)How to add video filters to the producer processing link in the production and consumption process mentioned in the analysis,如下图:
核心类解析
Service+Filter
【MLT】MLTAnalysis of production and consumption architecture of multimedia framework(一)Just a simple demonstration of the producer(A video resource is initialized)被消费者(初始化为SDL)Simple process of consumption.如上图所示,Two new encapsulations have been introduced to the process of producer processing:Service(Service abstract base class)+ Filter(Filter abstract service class).This section only briefly introduces the method we are about to use,These two packages will be fully analyzed later.
// Service abstract base class
/** * @brief attach Method for registering filter service * @param filter The filter service to register * @return Returns the registered error code */
int attach( Filter &filter );
/** * @brief detach The method to unregister the filter service * @param filter Filter service to unregister * @return Returns the unregistered error code */
int detach( Filter &filter );
Add filters for producers
// Create mosaic filters
Mlt::Filter *filter = new Mlt::Filter(profile, "frei0r.pixeliz0r");
// 使用从父类ServiceAdds a filter to the subscription ability inherited from
producer.attach(*filter);
Demon展示
为Producer(MP4)添加Filter(马赛克)效果
代码
Profile profile; // defaults to dv_pal
Producer producer(profile, filename);
Consumer consumer(profile); // defaults to sdl
Mlt::Filter *filter = new Mlt::Filter(profile, "frei0r.pixeliz0r");
producer.attach(*filter);
// Prevent scaling to the profile size.
// Let the sdl consumer do all scaling.
consumer.set("rescale", "none");
// Automatically exit at end of file.
consumer.set("terminate_on_pause", 1);
consumer.connect(producer);
consumer.run();
consumer.stop();
Affiliate code download link
参考资料
【1】MLT github链接
边栏推荐
- 必须指定GDAL API版本。提供一个路径使用GDAL_CONFIG gdal-config环境
- 【Harmony OS】【ArkUI】ets开发 基础页面布局与数据连接
- 【Harmony OS】【ARK UI】ETS 上下文基本操作
- 全栈代码测试覆盖率及用例发现系统的建设和实践
- 稳定性测试怎么做,这篇文章彻底讲透了!
- 【Harmony OS】【ARK UI】Date 基本操作
- 【暑期每日一题】洛谷 P1200 [USACO1.1]你的飞碟在这儿Your Ride Is Here
- 基于ABP和Magicodes实现Excel导出操作
- Ali YunTianChi competition problem (machine learning) - ali cloud security malware detection (complete code)
- 杰理之电话打入,远端听不到声音【篇】
猜你喜欢
I.MX6U-ALPHA开发板(高精度定时器)
阿里云天池大赛赛题(机器学习)——工业蒸汽量预测(完整代码)
MySQL: Implementation Principles of Submitted Read and Repeatable Read | MVCC (Multi-Version Concurrency Control) - Notes for Your Own Use
C进阶-C语言文件操作
通讯录(文件版)(C语言)(VS)
C进阶 - 程序的编译(预处理操作) + 链接
Harmony OS ets ArkUI 】 【 】 development create a view and building layout
2022 High Voltage Electrician Exam Questions and Answers
使用ceph-deploycep集群部署,并用3个磁盘作为专用osd
基于ABP和Magicodes实现Excel导出操作
随机推荐
【暑期每日一题】洛谷 P5729 【深基5.例7】工艺品制作
2022 High Voltage Electrician Exam Questions and Answers
Improve the user experience and add a small detail to your modal popup
【暑期每日一题】洛谷 P1048 [NOIP2005 普及组] 采药
【Harmony OS】【ARK UI】Date 基本操作
The influence law of genes for disease - read the paper
数量遗传学遗传力计算1:亲子回归方法
php使用phpoffice/phpspreadsheet导入导出excel表格
杰理之SD卡切回蓝牙没有作用【篇】
抖音直播带货的4个技巧,提升直播间转化率!
极速理解ML交叉验证
leetcode:315. 计算右侧小于当前元素的个数
Masked AutoEncoder论文及实现
[21天学习挑战赛——内核笔记](四)——内核常见调试手段(printf、dump_stack、devmem)
B. Arrays Sum
Base64编码和图片转化
2022-08-08 mysql慢SQL-Q18-10GB数据量-mysql/innodb测试
AttributeError: partially initialized module 'cv2' has no attribute 'gapi_wip_gst_GStreamerPipeline'
y91.第六章 微服务、服务网格及Envoy实战 -- 服务网格基础(二)
【Harmony OS】【ARK UI】ETS 上下文基本操作