CN112437346A - 一种判断视频文件是否完整的方法 - Google Patents
一种判断视频文件是否完整的方法 Download PDFInfo
- Publication number
- CN112437346A CN112437346A CN202011215433.0A CN202011215433A CN112437346A CN 112437346 A CN112437346 A CN 112437346A CN 202011215433 A CN202011215433 A CN 202011215433A CN 112437346 A CN112437346 A CN 112437346A
- Authority
- CN
- China
- Prior art keywords
- video
- file
- video file
- complete
- metadata
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 26
- 238000000605 extraction Methods 0.000 claims abstract description 7
- 230000010365 information processing Effects 0.000 abstract description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000004590 computer program Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 230000009191 jumping Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/80—Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
- H04N21/85—Assembly of content; Generation of multimedia applications
- H04N21/854—Content authoring
- H04N21/8547—Content authoring involving timestamps for synchronizing content
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing 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/44—Processing 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/4402—Processing 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
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing 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/442—Monitoring of processes or resources, e.g. detecting the failure of a recording device, monitoring the downstream bandwidth, the number of times a movie has been viewed, the storage space available from the internal hard disk
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/80—Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
- H04N21/85—Assembly of content; Generation of multimedia applications
- H04N21/854—Content authoring
- H04N21/85406—Content authoring involving a specific file format, e.g. MP4 format
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Databases & Information Systems (AREA)
- Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本发明涉及计算机多媒体(图像和视频)信息处理领域技术领域,具体涉及一种判断视频文件是否完整的方法,旨在解决现有技术中判断较大视频文件完整性的时候耗时较长形成的问题,其技术要点在于:包含以下步骤:读取文件,并提取视频文件的元数据;如果提取元数据失败,则得出视频文件不完整的结论,并退出,如果提取元数据成功,则进入下一步;根据提取的元数据进行解码至最后一帧,并将最后一帧的时间戳与视频时长T进行对比,如果时间戳小于视频时长T,则得出视频文件不完整的结论,否则说明文件完整。上述判断视频文件是否完整的方法,检测视频文件过程中不需要访问源文件,并且相比完整播放的做法能够更快的判断是否完整。
Description
技术领域
本发明涉及计算机多媒体(图像和视频)信息处理领域技术领域,具体涉及一种判断视频文件是否完整的方法。
背景技术
从网络或者某些渠道获取的视频文件,有时候需要判断文件是否完整,在能访问源文件的情况下,可以对比源文件与该文件MD5值或文件大小是否匹配来判断文件是否完整,但是某些情况下,比如断网或其它原因访问不到源文件的情况下,只能通过分析视频文件本身的属性来判断文件是否完整。
传统判断视频文件完整性需要比对该文件与源文件的MD5值或者文件大小是否匹配来判断是否完整,该方法在不能访问源文件的情况下并不适用。
在不能访问源文件的情况下需要判断视频完整性,通常的做法是完整播放该视频,如果播放时长与视频时长不匹配说明文件不完整。该方法耗时与视频时长有关,对于较大的视频通常比较耗时。
发明内容
因此,本发明要解决的技术问题在于克服现有技术中判断较大视频完整性耗时较长形成的缺陷,从而提供一种判断视频文件是否完整的方法。
本发明的上述技术目的是通过以下技术方案得以实现的:
一种判断视频文件是否完整的方法,包含以下步骤:
S1:读取视频文件,并提取视频文件的元数据;
S2:如果提取元数据失败,则得出视频文件不完整的结论,并退出,如果提取元数据成功,则进入下一步;
S3:根据提取的元数据进行解码至最后一帧,并将最后一帧的时间戳与视频时长T进行对比,如果时间戳小于视频时长T,则得出视频文件不完整的结论,否则说明文件完整。
优选的,所述S3中,当视频时长T小于5秒,则从文件开头开始解码视频文件,直到最后一帧。
优选的,所述S3中,当所述视频文件时长T大于5秒,则调用多媒体处理工具的API接口seek至T-5秒,如果seek失败,则得出视频不完整的结论,如果果seek成功,则从当前帧开始解码,直到最后一帧,如果最后一帧时间戳小于视频时长T说明文件不完整,否则说明文件完整。
上述所述的一种判断视频文件是否完整的方法,通过比对最后一帧的时间戳和视频元数据中的时长来确认视频是否完整。使得检测视频文件过程中不需要访问源文件,通过seek方法快速跳转至文件末尾来减少文件分析时间,并且相比完整播放的做法能够更快的判断是否完整。
附图说明
为了更清楚地说明本发明具体实施方式或现有技术中的技术方案,下面将对具体实施方式或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施方式,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本发明的一种实施方式的一种判断视频文件是否完整的方法的步骤示意图。
具体实施方式
为了使本发明的目的、技术方案及优点更加清楚明白,应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。
文中部分英文释义:
ffmpeg开源工具:一套可以用来记录、转换数字音频、视频,并能将其转化为流的开源计算机程序
API接口:应用程序接口
seek:探查
以下结合附图及实施例,对本发明进行进一步详细说明。
请参阅图1,一种判断视频文件是否完整的方法,其包含以下步骤:
S1:读取视频文件,并提取视频文件的元数据。
具体的,所述元数据中包含视频时长(T)等信息。
S2:如果提取元数据失败,则得出视频文件不完整的结论,并退出;否则进入下一步。
S3:根据提取的元数据进行解码至最后一帧,并将最后一帧的时间戳与视频时长T进行对比,如果时间戳小于视频时长T,则得出视频文件不完整的结论,否则说明文件完整。
具体的,在一实施方式中,当视频时长T小于5秒,则从文件开头开始解码视频文件,直到最后一帧。
在另一实施方式中,当所述视频文件时长T大于5秒,则调用多媒体处理工具的API接口seek至T-5秒,如果seek失败,则得出视频不完整的结论,如果seek成功,则从当前帧开始解码,直到最后一帧,如果最后一帧时间戳小于视频时长T说明文件不完整,否则说明文件完整。这样,检测过程中可以有效地减少文件分析时间,使得不需要访问源文件就可以得到视频是否完整的信息。
本申请所提供的一种判断视频文件是否完整的方法,其通过比对最后一帧的时间戳和视频元数据中的时长来确认视频是否完整。使得检测视频文件过程中不需要访问源文件,并且相比完整播放的做法能够更快的判断是否完整。
显然,上述实施例仅仅是为清楚地说明所作的举例,而并非对实施方式的限定。对于所属领域的普通技术人员来说,在上述说明的基础上还可以做出其它不同形式的变化或变动。这里无需也无法对所有的实施方式予以穷举。而由此所引伸出的显而易见的变化或变动仍处于本发明创造的保护范围之中。
Claims (3)
1.一种判断视频文件是否完整的方法,其特征在于:包含以下步骤:
S1:读取视频文件,并提取视频文件的元数据;
S2:如果提取元数据失败,则得出视频文件不完整的结论,并退出,如果提取元数据成功,则进入下一步;
S3:根据提取的元数据进行解码至最后一帧,并将最后一帧的时间戳与视频时长T进行对比,如果时间戳小于视频时长T,则得出视频文件不完整的结论,否则说明文件完整。
2.根据权利要求1所述的判断视频文件是否完整的方法,其特征在于:所述S3中,当视频时长T小于5秒,则从文件开头开始解码视频文件,直到最后一帧。
3.根据权利要求1所述的判断视频文件是否完整的方法,其特征在于:所述S3中,当所述视频文件时长T大于5秒,则调用多媒体处理工具的API接口seek至T-5秒,如果seek失败,则得出视频不完整的结论,如果果seek成功,则从当前帧开始解码,直到最后一帧,如果最后一帧时间戳小于视频时长T说明文件不完整,否则说明文件完整。
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011215433.0A CN112437346A (zh) | 2020-11-04 | 2020-11-04 | 一种判断视频文件是否完整的方法 |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011215433.0A CN112437346A (zh) | 2020-11-04 | 2020-11-04 | 一种判断视频文件是否完整的方法 |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112437346A true CN112437346A (zh) | 2021-03-02 |
Family
ID=74695258
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011215433.0A Pending CN112437346A (zh) | 2020-11-04 | 2020-11-04 | 一种判断视频文件是否完整的方法 |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112437346A (zh) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103024437A (zh) * | 2012-12-28 | 2013-04-03 | 河南辉煌科技股份有限公司 | 视频数据完整性检测方法 |
CN104301805A (zh) * | 2014-09-26 | 2015-01-21 | 北京奇艺世纪科技有限公司 | 一种视频时间长度的估计方法和装置 |
CN105049915A (zh) * | 2015-06-30 | 2015-11-11 | 株洲南车时代电气股份有限公司 | 一种机车视频数据完整性自动检测方法 |
CN106101867A (zh) * | 2016-07-20 | 2016-11-09 | 深圳芯智汇科技有限公司 | 一种提高flv视频跳播速度和定位精确性的方法 |
WO2020192152A1 (zh) * | 2019-03-26 | 2020-10-01 | 广州华多网络科技有限公司 | 视频传输的方法、根节点、子节点、p2p服务器和*** |
-
2020
- 2020-11-04 CN CN202011215433.0A patent/CN112437346A/zh active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103024437A (zh) * | 2012-12-28 | 2013-04-03 | 河南辉煌科技股份有限公司 | 视频数据完整性检测方法 |
CN104301805A (zh) * | 2014-09-26 | 2015-01-21 | 北京奇艺世纪科技有限公司 | 一种视频时间长度的估计方法和装置 |
CN105049915A (zh) * | 2015-06-30 | 2015-11-11 | 株洲南车时代电气股份有限公司 | 一种机车视频数据完整性自动检测方法 |
CN106101867A (zh) * | 2016-07-20 | 2016-11-09 | 深圳芯智汇科技有限公司 | 一种提高flv视频跳播速度和定位精确性的方法 |
WO2020192152A1 (zh) * | 2019-03-26 | 2020-10-01 | 广州华多网络科技有限公司 | 视频传输的方法、根节点、子节点、p2p服务器和*** |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP1635575A1 (en) | System and method for embedding scene change information in a video bitstream | |
US8295611B2 (en) | Robust video retrieval utilizing audio and video data | |
US8433108B2 (en) | Video fingerprinting | |
EP1610557A1 (en) | System and method for embedding multimedia processing information in a multimedia bitstream | |
US20110289099A1 (en) | Method and apparatus for identifying video program material via dvs or sap data | |
US20070074097A1 (en) | System and method for dynamic transrating based on content | |
EP2031594A2 (en) | Information processing device and information processing method | |
US20160371545A1 (en) | Automatic extraction of closed caption data from frames of an audio video (av) stream using image clipping | |
US20060059509A1 (en) | System and method for embedding commercial information in a video bitstream | |
Dumont et al. | Automatic story segmentation for tv news video using multiple modalities | |
CN111314732A (zh) | 确定视频标签的方法、服务器及存储介质 | |
WO2013097101A1 (zh) | 分析视频文件的方法和装置 | |
RU2413990C2 (ru) | Способ и устройство для обнаружения границ элемента контента | |
Park et al. | Exploiting script-subtitles alignment to scene boundary dectection in movie | |
US20040098750A1 (en) | Method for fixing up last uniform resource locator representing path and file name of multiphoto/video asset | |
CN112437346A (zh) | 一种判断视频文件是否完整的方法 | |
CN113507625B (zh) | 一种自适应视频修复方法 | |
US10178415B2 (en) | Chapter detection in multimedia streams via alignment of multiple airings | |
US20060056506A1 (en) | System and method for embedding multimedia compression information in a multimedia bitstream | |
KR20090015266A (ko) | 비디오 식별을 통한 유해 동영상 검열 시스템 및 방법 | |
CN112218142A (zh) | 带字幕视频人声分离方法、装置、存储介质及电子设备 | |
CN113569719A (zh) | 视频侵权判定方法、装置、存储介质及电子设备 | |
CN113660442A (zh) | 一种视频修复方法、装置、电子设备及可读介质 | |
Altinisik et al. | Automatic generation of H. 264 parameter sets to recover video file fragments | |
CN113111200A (zh) | 审核图片文件的方法、装置、电子设备和存储介质 |
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 |