当前位置:网站首页>五、视频处理与GStreamer
五、视频处理与GStreamer
2022-07-28 05:22:00 【Aaaaaki】
五、视频处理与GStreamer
1 视频处理流程
视频处理的经典流程

- 解码(Decode):负责对压缩的视频进行解压缩,将压缩视频解码为Raw格式的原始视频流。在实际应用中,可能会并行解码多个流,且每个流拥有不同的分辨率与格式。常用解码方式有Media-SDK、OpenCV、GStreamer以及FFMPEG等,但需要注意的是,Media-SDK并不支持MP4这类容器文件。
- 预处理(Pre-Processing):将解码后获得的Raw原始视频流进行预处理,获取每一帧图像,使之匹配神经网络的输入格式,作为blob输入到神经网络中。该阶段包括转换图像格式、调整图像尺寸以及增强模糊图像等。
- 推理(Inference):使用基于深度学习的模型进行分类、检测以及分割等操作,可支持并行或串行多个模型的多个推理任务
- 后处理(Post-Processing):对推理结果进行处理,如加上识别框以及识别置信度等。
- 编码(Encode):获得视频流的处理结果后,重新对视频流进行压缩,以便用于存储或上传云端。
各阶段的软硬件依赖
软件依赖

硬件依赖

各阶段任务均可在CPU、GPU、FPGA以及AI加速器上运行,因此采用异构系统,将各阶段任务部署到不同硬件设备上,可以在同一系统上处理更多任务,最大限度的发挥系统效能
视频解码实战
通过下述代码,可选择各类解码方式
##### Decode #### # 3 options to decode #1) decode using OpenCV cap = cv2.VideoCapture("road.mp4") #2) Use GSTREAMER # cap = cv2.VideoCapture('filesrc location=road.mp4 ! decodebin ! videoconvert !appsink sync=false', cv2.CAP_GSTREAMER) #3) Use media-SDK,if don't have iGPU(集成显卡),these codes can't work, just for reference # cap = cv2.VideoCapture('road.h264', cv2.CAP_INTEL_MFX)
解码结果:

2 GStreamer流水线
适用场景
- 多个模型并行进行测量推理性能
- 对一个特殊视频流进行要素整合处理
- 解决多个视频流的解码密度问题
DL-Streamer
用于构建计算图或流水线,支持将开发的视频分析元素添加至GStreamer Elements的列表中,通过OpenVINO进行检测、分类以及可视化等操作。
边栏推荐
- Sqlalchemy usage related
- Ssh/scp breakpoint resume Rsync
- 利用辅助未标记数据增强无约束人脸识别《Boosting Unconstrained Face Recognition with Auxiliary Unlabeled Data》
- How to do wechat group purchase applet? How much does it usually cost?
- 小程序搭建制作流程是怎样的?
- Uniapp WebView listens to the callback after the page is loaded
- 小程序开发要多少钱?两种开发方法分析!
- The business of digital collections is not so easy to do
- 神经网络实现鸢尾花分类
- 小程序开发
猜你喜欢

神经网络学习

First meet flask

如何选择小程序开发企业

无约束低分辨率人脸识别综述一:用于低分辨率人脸识别的数据集

【4】 Redis persistence (RDB and AOF)

How to choose an applet development enterprise

Interface anti duplicate submission

UNL class diagram

深度学习(自监督:SimSiam)——Exploring Simple Siamese Representation Learning

Word2vec+ regression model to achieve classification tasks
随机推荐
Digital collections become a new hot spot in tourism industry
如何选择小程序开发企业
【5】 Redis master-slave synchronization and redis sentinel (sentinel)
使用神经网络实现对天气的预测
uView上传组件upload上传auto-upload模式图片压缩
将项目部署到GPU上,并且运行
How to do wechat group purchase applet? How much does it usually cost?
Construction of redis master-slave architecture
vscode uniapp
Centos7 installing MySQL
深度学习(增量学习)——(ICCV)Striking a Balance between Stability and Plasticity for Class-Incremental Learning
Small program development solves the anxiety of retail industry
Various programming languages decimal | time | Base64 and other operations of the quick look-up table
Sqlalchemy usage related
How much does small program development cost? Analysis of two development methods!
Reinforcement learning - dqn in value learning
D2SC-GAN:基于双深浅通道生成对抗网络的课堂场景低分辨率人脸识别
Distributed cluster architecture scenario optimization solution: distributed ID solution
Distributed lock database implementation
Dataset class loads datasets in batches