CN114025197A - 基于视频流的防伪加密方法 - Google Patents

基于视频流的防伪加密方法 Download PDF

Info

Publication number
CN114025197A
CN114025197A CN202111281311.6A CN202111281311A CN114025197A CN 114025197 A CN114025197 A CN 114025197A CN 202111281311 A CN202111281311 A CN 202111281311A CN 114025197 A CN114025197 A CN 114025197A
Authority
CN
China
Prior art keywords
video stream
slice
encryption method
code
video
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111281311.6A
Other languages
English (en)
Inventor
吴硕涛
陈海江
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Lishi Technology Co Ltd
Original Assignee
Zhejiang Lishi Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Lishi Technology Co Ltd filed Critical Zhejiang Lishi Technology Co Ltd
Priority to CN202111281311.6A priority Critical patent/CN114025197A/zh
Publication of CN114025197A publication Critical patent/CN114025197A/zh
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/23418Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving operations for analysing video streams, e.g. detecting features or characteristics
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/2343Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
    • H04N21/234309Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements by transcoding between formats or standards, e.g. from MPEG-2 to MPEG-4 or from Quicktime to Realvideo
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/2347Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving video stream encryption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/44008Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving operations for analysing video streams, e.g. detecting features or characteristics in the video stream
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • H04N21/440218Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display by transcoding between formats or standards, e.g. from MPEG-2 to MPEG-4
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/4405Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving video stream decryption

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

本发明涉及一种基于视频流的防伪加密方法,包括以下步骤:预先训练好人物识别模型;将摄像头的原始视频流进行转码并切片处理;接入处理过的视频流,读取视频流中的每一张图片的信息并将图片信息放入人物识别模型中,通过人物识别模型识别有人物的图片找到对应的切片;在对应的切片上采用随机码进行文件头字节标记处理;按照随机码对应的字节加密算法对切片进行加密处理从而使每一个有人物标记的切片都采用不同加密算法进行加密处理。本发明的有益之处在于,安全性高,性能占用少,加密和解密速度快。

Description

基于视频流的防伪加密方法
技术领域
本发明涉及一种基于视频流的防伪加密方法,尤其是一种针对监控视频的实时加密方法。
背景技术
现有技术通常通过加密算法对视频文件进行指定的加解密,没有针对视频流的加解密。并且对整个视频流进行加解密太耗时,又吃性能。由于视频监控内容的敏感性和保密性,要保证视频内容的安全性和准确性,但现有的监控系统中远程传输安全性较低,视频数据在网络传输的过程中易被窃取和篡改,造成信息泄露。
发明内容
本发明的目的在于提供一种基于视频流的防伪加密方法,以解决上述背景技术中提出的问题。
为实现上述目的,本发明提供如下技术方案:
一种基于视频流的防伪加密方法,包括以下步骤:
预先训练好人物识别模型;
将摄像头的原始视频流进行转码并切片处理;
接入处理过的视频流,读取视频流中的每一张图片的信息并将图片信息放入人物识别模型中,通过人物识别模型识别有人物的图片找到对应的切片;
在对应的切片上采用随机码进行文件头字节标记处理;
按照随机码对应的字节加密算法对切片进行加密处理从而使每一个有人物标记的切片都采用不同加密算法进行加密处理。
作为本发明进一步的方案:基于视频流的防伪加密方法加密的视频流的解密播放方法包括以下步骤:
播放时使用专用视频播放器按顺序加载切片;
遇到有标记的视频切片,分析切片头部字节标记码;
根据标记码找到对应解密算法进行字节解密;
把解密后的数据添加到视频播放流中播放。
作为本发明进一步的方案:随机码随机出来的一个长度大于10小于255数字数组写入到切片头部的字节码,设定第一个值为随机码长度值,第二个值为约定加密算法代号在随机码中的位置值。
作为本发明进一步的方案:对于每个加密算法代码对应设置不同的加密算法。
作为本发明进一步的方案:在实际使用中,可以使用专用视频播放器授权对加载到切片根据文件头字节标记码获得解密算法进行解密播放。
作为本发明进一步的方案:预先通过Yolov3做模型训练,将人物图片放入训练,获取到训练好的人物识别模型。
作为本发明进一步的方案:通过ffmpeg将摄像头的原始视频流转码为hls。
作为本发明进一步的方案:切片文件的切片时间长度可以设置为十秒一个,一组6个。
作为本发明进一步的方案:通过opencv接入处理过的视频流。
与现有技术相比,本发明的有益效果是:安全性高,性能占用少,加密和解密速度快
可以应用到摄像头中实现实时加密,并且可以只加密有人物出现的视频流切片,在视频数据的传输过程中保障视频内容传输的安全性和可靠性,性能占用少,加密和解密速度快。
智能识别人物出现的切片,采用切片播放技术,使播放器可以采取跳跃式加载用户指定时间点的切片数据来进行解密播放,不必加载不需要片段数据。在网络环境中播放时,大大减轻服务器压力与带宽开支,提升用户体验,切片播放还可以方便对不同清晰度视频源进行无缝切换,采用随机标记码模式理论上可以使得每个切片都可以采取不同的加密算法进行加密,极大的增加了破解加密视频的难度,使保护视频的安全性大大提高。
附图说明
图1是作为本发明的基于视频流的防伪加密方法的流程图;
图2是基于视频流的防伪加密方法加密的视频流的解密播放方法的流程图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
如图1和图2所示,一种基于视频流的防伪加密方法,包括以下步骤:
预先训练好人物识别模型,具体而言,预先通过Yolov3做模型训练,将人物图片放入训练,获取到训练好的人物识别模型;
将摄像头的原始视频流进行转码并切片处理,具体而言,通过ffmpeg将摄像头的原始视频流转码为hls,m3u8的视频流格式,其中切片文件的切片时间长度可以设置为十秒一个,一组6个。
接入处理过的视频流,读取视频流中的每一张图片的信息并将图片信息放入人物识别模型中,通过人物识别模型识别有人物的图片找到对应的切片;
在对应的切片上采用随机码进行文件头字节标记处理;
按照随机码对应的字节加密算法对切片进行加密处理从而使每一个有人物标记的切片都采用不同加密算法进行加密处理。
具体而言,通过opencv接入处理过的视频流,并通过write模块读取视频流中每一张图片的信息,将图片信息放入yolov3生成的人物识别模型,模型识别到该图片有人物出现,找到对应的切片。
在对应的切片上采用约定随机码进行文件头字节标记处理(约定随机加密代号加密时随机出来的一个长度大于10小于255数字数组写入到切片头部的字节码,设定第一个值为随机码长度值,第二个值为约定加密算法代号在随机码中的位置值。例如随机码为22,52,1,9,67,32,43,7,8,4,97,则表示该随机码占11个字节,第六个字节值32(从0开始)为加密算法代号)。
对于每个加密算法代码对应设置不同的加密算法。作为一种可选的加密方法为:设定加密算法代号为1,约定为对切片每隔100个字节(随机码以后)对50个字节进行压缩处理。代号2约定为对切片每隔100个字节进行对50个字节进行对5异或处理。可以设定很多种不同的加密算法,然后对应不同加密代号,有效降低被破译的风险。
基于视频流的防伪加密方法加密的视频流的解密播放方法包括以下步骤:
播放时使用专用视频播放器按顺序加载切片;
遇到有标记的视频切片,分析切片头部字节标记码;
根据标记码找到对应解密算法进行字节解密;
把解密后的数据添加到视频播放流中播放。
在实际使用中,可以使用专用视频播放器授权对加载到切片根据文件头字节标记码获得解密算法进行解密播放。
智能识别人物出现的切片,采用切片播放技术,使播放器可以采取跳跃式加载用户指定时间点的切片数据来进行解密播放,不必加载不需要片段数据。在网络环境中播放时,大大减轻服务器压力与带宽开支,提升用户体验,切片播放还可以方便对不同清晰度视频源进行无缝切换,采用随机标记码模式理论上可以使得每个切片都可以采取不同的加密算法进行加密,极大的增加了破解加密视频的难度,使保护视频的安全性大大提高。
对于本领域技术人员而言,显然本发明不限于上述示范性实施例的细节,而且在不背离本发明的精神或基本特征的情况下,能够以其他的具体形式实现本发明。因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的,本发明的范围由所附权利要求而不是上述说明限定,因此旨在将落在权利要求的等同要件的含义和范围内的所有变化囊括在本发明内。不应将权利要求中的任何附图标记视为限制所涉及的权利要求。
此外,应当理解,虽然本说明书按照实施方式加以描述,但并非每个实施方式仅包含一个独立的技术方案,说明书的这种叙述方式仅仅是为清楚起见,本领域技术人员应当将说明书作为一个整体,各实施例中的技术方案也可以经适当组合,形成本领域技术人员可以理解的其他实施方式。

Claims (9)

1.一种基于视频流的防伪加密方法,其特征在于,包括以下步骤:
预先训练好人物识别模型;
将摄像头的原始视频流进行转码并切片处理;
接入处理过的视频流,读取视频流中的每一张图片的信息并将图片信息放入所述人物识别模型中,通过所述人物识别模型识别有人物的图片找到对应的切片;
在对应的切片上采用随机码进行文件头字节标记处理;
按照随机码对应的字节加密算法对切片进行加密处理从而使每一个有人物标记的切片都采用不同加密算法进行加密处理。
2.根据权利要求1所述的基于视频流的防伪加密方法,其特征在于,
所述基于视频流的防伪加密方法加密的视频流的解密播放方法包括以下步骤:
播放时使用专用视频播放器按顺序加载切片;
遇到有标记的视频切片,分析切片头部字节标记码;
根据标记码找到对应解密算法进行字节解密;
把解密后的数据添加到视频播放流中播放。
3.根据权利要求1所述的基于视频流的防伪加密方法,其特征在于,
随机码随机出来的一个长度大于10小于255数字数组写入到切片头部的字节码,设定第一个值为随机码长度值,第二个值为约定加密算法代号在随机码中的位置值。
4.根据权利要求3所述的基于视频流的防伪加密方法,其特征在于,
对于每个加密算法代码对应设置不同的加密算法。
5.根据权利要求1所述的基于视频流的防伪加密方法,其特征在于,
在实际使用中,可以使用专用视频播放器授权对加载到切片根据文件头字节标记码获得解密算法进行解密播放。
6.根据权利要求1所述的基于视频流的防伪加密方法,其特征在于,
预先通过Yolov3做模型训练,将人物图片放入训练,获取到训练好的人物识别模型。
7.根据权利要求1所述的基于视频流的防伪加密方法,其特征在于,
通过ffmpeg将摄像头的原始视频流转码为hls。
8.根据权利要求1所述的基于视频流的防伪加密方法,其特征在于,
切片文件的切片时间长度可以设置为十秒一个,一组6个。
9.根据权利要求1所述的基于视频流的防伪加密方法,其特征在于,
通过opencv接入处理过的视频流。
CN202111281311.6A 2021-11-01 2021-11-01 基于视频流的防伪加密方法 Pending CN114025197A (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111281311.6A CN114025197A (zh) 2021-11-01 2021-11-01 基于视频流的防伪加密方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111281311.6A CN114025197A (zh) 2021-11-01 2021-11-01 基于视频流的防伪加密方法

Publications (1)

Publication Number Publication Date
CN114025197A true CN114025197A (zh) 2022-02-08

Family

ID=80059426

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111281311.6A Pending CN114025197A (zh) 2021-11-01 2021-11-01 基于视频流的防伪加密方法

Country Status (1)

Country Link
CN (1) CN114025197A (zh)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106658062A (zh) * 2016-12-20 2017-05-10 广东东田数码科技有限公司 一种基于随机加密的视频切片加密与播放方法
CN110008875A (zh) * 2019-03-26 2019-07-12 武汉大学 一种基于关键帧回溯的人脸识别视频片段筛选方法及系统
CN111339879A (zh) * 2020-02-19 2020-06-26 安徽领云物联科技有限公司 一种兵器室单人入室监测方法及装置

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106658062A (zh) * 2016-12-20 2017-05-10 广东东田数码科技有限公司 一种基于随机加密的视频切片加密与播放方法
CN110008875A (zh) * 2019-03-26 2019-07-12 武汉大学 一种基于关键帧回溯的人脸识别视频片段筛选方法及系统
CN111339879A (zh) * 2020-02-19 2020-06-26 安徽领云物联科技有限公司 一种兵器室单人入室监测方法及装置

Similar Documents

Publication Publication Date Title
CN106331751B (zh) 一种基于iOS操作系统的在线加密切片视频播放方法
US20180253567A1 (en) Tamper Protection and Video Source Identification for Video Processing Pipeline
US9094733B2 (en) Methods and systems for cryptographic access control of video
CN109348292B (zh) 一种基于切片文件字节阈值的视频切片方法
FR2857811A1 (fr) Methode de chiffrage d'un flux audio ou video compresse a tolerance d'erreurs
Upadhyay et al. Video authentication: Issues and challenges
CN112040336B (zh) 视频水印添加、提取的方法、装置和设备
CN107707504A (zh) 一种流媒体的播放方法、系统以及服务器和客户端
CN109525893A (zh) 基于切片文件时长阈值的视频切片方法
CN109543432A (zh) 一种视频中人脸图像加密防篡改和检索的方法
CN106709853A (zh) 一种图像检索方法及系统
WO2018010118A1 (zh) 一种数字视频内容安全认证的方法及其系统
CN110035319A (zh) 一种音视频数据的加密、解密方法、装置及播放设备
CN106791923A (zh) 一种视频帧流处理方法、视频服务器及终端设备
CN109275030A (zh) 基于hls技术的web端密钥混淆错序视频加密方法
CN109348293A (zh) 基于hls技术的app端密钥混淆错序视频加密方法
CN102158768B (zh) 基于mp4文件封装格式的视频认证水印嵌入和提取方法
CN111988639B (zh) 一种基于国密算法和可逆隐写术的视频加密及解密方法
CN114025197A (zh) 基于视频流的防伪加密方法
CN101980238B (zh) 一种对rm/rmvb文件的加密方法
CN113727146B (zh) 基于区块链的云电视视频流处理装置及方法
CN111954035A (zh) 影音信号流的加密方法与装置
CN115802071A (zh) 一种面向流媒体存储系统的数据安全管理方法和系统
US11317128B1 (en) Systems, methods, and devices for media content tamper protection and detection
Hasso Steganography in video files

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination