CN118286678A - Audio and video file playing method and device, storage medium and intelligent equipment - Google Patents
Audio and video file playing method and device, storage medium and intelligent equipment Download PDFInfo
- Publication number
- CN118286678A CN118286678A CN202410320708.9A CN202410320708A CN118286678A CN 118286678 A CN118286678 A CN 118286678A CN 202410320708 A CN202410320708 A CN 202410320708A CN 118286678 A CN118286678 A CN 118286678A
- Authority
- CN
- China
- Prior art keywords
- video file
- audio
- format
- file
- target audio
- 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 59
- 238000004590 computer program Methods 0.000 claims description 30
- 230000008569 process Effects 0.000 description 12
- 230000006870 function Effects 0.000 description 8
- 238000010586 diagram Methods 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 4
- 230000004044 response Effects 0.000 description 4
- 101001121408 Homo sapiens L-amino-acid oxidase Proteins 0.000 description 3
- 102100026388 L-amino-acid oxidase Human genes 0.000 description 3
- 230000000694 effects Effects 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 101100233916 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) KAR5 gene Proteins 0.000 description 1
- 230000001133 acceleration Effects 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000009877 rendering Methods 0.000 description 1
Classifications
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F13/00—Video games, i.e. games using an electronically generated display having two or more dimensions
- A63F13/50—Controlling the output signals based on the game progress
- A63F13/52—Controlling the output signals based on the game progress involving aspects of the displayed game scene
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F13/00—Video games, i.e. games using an electronically generated display having two or more dimensions
- A63F13/50—Controlling the output signals based on the game progress
- A63F13/54—Controlling the output signals based on the game progress involving acoustic signals, e.g. for simulating revolutions per minute [RPM] dependent engine sounds in a driving game or reverberation against a virtual wall
-
- 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/4302—Content synchronisation processes, e.g. decoder synchronisation
- H04N21/4307—Synchronising the rendering of multiple content streams or additional data on devices, e.g. synchronisation of audio on a mobile phone with the video output on the TV screen
-
- 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/434—Disassembling of a multiplex stream, e.g. demultiplexing audio and video streams, extraction of additional data from a video stream; Remultiplexing of multiplex streams; Extraction or processing of SI; Disassembling of packetised elementary stream
- H04N21/4341—Demultiplexing of audio and video streams
-
- 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/435—Processing of additional data, e.g. decrypting of additional data, reconstructing software from modules extracted from the transport stream
- H04N21/4353—Processing of additional data, e.g. decrypting of additional data, reconstructing software from modules extracted from the transport stream involving decryption of additional data
-
- 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/439—Processing of audio elementary streams
- H04N21/4394—Processing of audio elementary streams involving operations for analysing the audio stream, e.g. detecting features or characteristics in audio streams
-
- 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/44008—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 operations for analysing video streams, e.g. detecting features or characteristics in the video stream
-
- 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/44012—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 rendering scenes according to scene graphs, e.g. MPEG-4 scene graphs
-
- 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/80—Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
- H04N21/81—Monomedia components thereof
- H04N21/816—Monomedia components thereof involving special video data, e.g 3D video
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Acoustics & Sound (AREA)
- Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
Abstract
Description
技术领域Technical Field
本申请涉及软件开发技术领域,尤其涉及一种音视频文件播放方法、装置、存储介质和智能设备。The present application relates to the field of software development technology, and in particular to a method, apparatus, storage medium and intelligent device for playing audio and video files.
背景技术Background technique
Unity是一款跨平台的2D/3D游戏引擎,由Unity Technologies研发,可开发跨平台的视频游戏、并延伸于基于WebGL技术的HTML5网页平台,以及tvOS、Oculus Rift、ARKit等新一代多媒体平台。Unity is a cross-platform 2D/3D game engine developed by Unity Technologies. It can develop cross-platform video games and extend to the HTML5 web platform based on WebGL technology, as well as new generation multimedia platforms such as tvOS, Oculus Rift, and ARKit.
Unity本身对音视频的支持有限,一般都采用第三方插件如avpro实现对音视频的支持,然而,不同平台需要不同插件,且插件价格昂贵。Unity itself has limited support for audio and video, and generally uses third-party plug-ins such as avpro to achieve support for audio and video. However, different platforms require different plug-ins, and the plug-ins are expensive.
鉴于此,如何有效扩展Unity可支持的音视频格式,实现多种音视频的正常播放,是当前需要考虑的问题。In view of this, how to effectively expand the audio and video formats supported by Unity and achieve normal playback of multiple audio and video is an issue that needs to be considered at present.
发明内容Summary of the invention
本申请实施例提供了一种音视频文件播放方法、装置、存储介质和智能设备,可以在不额外添加第三方插件的情况下,有效扩展Unity可支持的音视频格式,实现多种音视频的正常播放。The embodiments of the present application provide a method, apparatus, storage medium and smart device for playing audio and video files, which can effectively expand the audio and video formats supported by Unity and realize normal playback of multiple audio and video without adding third-party plug-ins.
第一方面,本申请实施例提供了一种音视频文件播放方法,包括:In a first aspect, an embodiment of the present application provides a method for playing an audio or video file, comprising:
确定目标音视频文件的真实文件格式;Determine the actual file format of the target audio and video files;
若所述真实文件格式为游戏引擎可支持的格式,则调用所述游戏引擎中所述真实文件格式对应的播放器,播放所述目标音视频文件;If the real file format is a format supported by the game engine, calling a player corresponding to the real file format in the game engine to play the target audio and video file;
若所述游戏引擎不支持所述真实文件格式,则调用指定组件,利用所述指定组件对所述目标音视频文件进行解码,得到解码数据包;If the game engine does not support the real file format, calling a specified component, and using the specified component to decode the target audio and video file to obtain a decoded data packet;
基于解码数据包,播放所述目标音视频文件。Based on the decoded data packet, the target audio and video file is played.
在第一方面的一种可能的实现方式中,所述确定目标音视频文件的真实文件格式的步骤,包括:In a possible implementation manner of the first aspect, the step of determining the real file format of the target audio and video file includes:
读取目标音视频文件的文件信息;Read the file information of the target audio and video file;
基于所述文件信息与预设对照表,确定所示目标音视频文件的真实文件格式。Based on the file information and the preset comparison table, the actual file format of the target audio and video file is determined.
在第一方面的一种可能的实现方式中,所述文件信息包括所述目标音视频文件的二进制文件抬头和后缀名;In a possible implementation manner of the first aspect, the file information includes a binary file header and a suffix name of the target audio and video file;
所述根据待解码音视频文件的文件信息,确定该待解码音视频文件的真实文件格式的步骤,包括:The step of determining the real file format of the audio or video file to be decoded according to the file information of the audio or video file to be decoded comprises:
在预设对照表中查找所述二进制文件抬头对应的后缀名列表;Searching for a list of suffixes corresponding to the header of the binary file in a preset comparison table;
若所述后缀名在所述后缀名列表中,则所述后缀名对应的格式即为所述目标音视频文件的真实文件格式;If the suffix is in the suffix list, the format corresponding to the suffix is the real file format of the target audio and video file;
若所述后缀名不在所述后缀名列表中,则从所述后缀名列表中选择一个预设后缀名替换所述后缀名;If the suffix name is not in the suffix name list, selecting a preset suffix name from the suffix name list to replace the suffix name;
将所述预设后缀名对应的格式确定为所述目标音视频文件的真实文件格式。The format corresponding to the preset suffix name is determined as the real file format of the target audio and video file.
在第一方面的一种可能的实现方式中,所述利用所述指定组件对所述目标音视频文件进行解码,得到解码数据包的步骤,包括:In a possible implementation manner of the first aspect, the step of decoding the target audio and video file by using the designated component to obtain a decoded data packet includes:
利用所述指定组件对所述目标音视频文件进行软解码或者硬解码,得到解码数据包。The target audio and video file is soft-decoded or hard-decoded using the designated component to obtain a decoded data packet.
在第一方面的一种可能的实现方式中,所述利用所述指定组件对所述目标音视频文件进行软解码或者硬解码,得到解码数据包的步骤,包括:In a possible implementation manner of the first aspect, the step of using the designated component to soft-decode or hard-decode the target audio and video file to obtain a decoded data packet includes:
读取硬件性能信息;Read hardware performance information;
若所述硬件性能信息满足预设条件,则对所述目标音视频文件进行硬解码;If the hardware performance information meets the preset conditions, the target audio and video file is hard-decoded;
若所述硬件性能信息不满足所述预设条件,则对所述目标音视频文件进行软解码。If the hardware performance information does not meet the preset condition, the target audio and video file is soft-decoded.
在第一方面的一种可能的实现方式中,所述基于解码数据包,播放所述目标音视频文件的步骤,还包括:In a possible implementation manner of the first aspect, the step of playing the target audio and video file based on the decoded data packet further includes:
循环读取所述解码数据包;Looping through the decoded data packets;
将所述解码数据包中的音视频数据的格式转换为目标格式;Converting the format of the audio and video data in the decoded data packet into a target format;
基于所述游戏引擎所支持格式的音视频数据,播放展示所述目标音视频文件。Based on the audio and video data in the format supported by the game engine, the target audio and video file is played and displayed.
第二方面,本申请实施例提供了一种音视频文件播放装置,包括:In a second aspect, an embodiment of the present application provides an audio and video file playback device, including:
格式确定单元,用于确定目标音视频文件的真实文件格式;A format determination unit, used to determine the actual file format of the target audio and video file;
第一播放单元,用于若所述真实文件格式为游戏引擎可支持的格式,则调用所述游戏引擎中所述真实文件格式对应的播放器,播放所述目标音视频文件;A first playing unit, configured to call a player corresponding to the real file format in the game engine to play the target audio and video file if the real file format is a format supported by the game engine;
第二播放单元,用于若所述游戏引擎不支持所述真实文件格式,则调用指定组件,利用所述指定组件对所述目标音视频文件进行解码,得到解码数据包;基于解码数据包,播放所述目标音视频文件。The second playback unit is used to call a specified component if the game engine does not support the real file format, and use the specified component to decode the target audio and video file to obtain a decoded data packet; based on the decoded data packet, play the target audio and video file.
第三方面,本申请实施例提供了一种智能设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现如上述第一方面所述的音视频文件播放方法。In a third aspect, an embodiment of the present application provides an intelligent device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for playing audio and video files as described in the first aspect above is implemented.
第四方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现如上述第一方面所述的音视频文件播放方法。In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for playing audio and video files as described in the first aspect above is implemented.
第五方面,本申请实施例提供了一种计算机程序产品,当计算机程序产品在智能设备上运行时,使得智能设备执行如上述第一方面所述的音视频文件播放方法。In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on a smart device, the smart device executes the audio and video file playback method as described in the first aspect above.
本申请实施例中,通过先对目标音视频文件的格式进行分析,确定该目标音视频文件的真实文件格式,避免该目标音视频文件因格式错误无法正常播放,若该真实文件格式为Unity可支持的格式,则直接调用Unity中该真实文件格式对应的播放器,播放所述目标音视频文件;若Unity不支持所述真实文件格式,则调用指定组件,利用所述指定组件对所述目标音视频文件进行解码,得到解码数据包,再基于解码数据包,播放所述目标音视频文件。本申请方案不需要额外添加第三方插件即可实现Unity对多种音视频文件格式的支持,从而可利用Unity实现多种音视频文件的正常播放,扩展Unity在2D/3D上的展现形式。In the embodiment of the present application, the format of the target audio and video file is first analyzed to determine the real file format of the target audio and video file, so as to avoid the target audio and video file from not being able to be played normally due to format errors. If the real file format is a format supported by Unity, the player corresponding to the real file format in Unity is directly called to play the target audio and video file; if Unity does not support the real file format, a specified component is called to decode the target audio and video file using the specified component to obtain a decoded data packet, and then the target audio and video file is played based on the decoded data packet. The present application solution can realize Unity's support for multiple audio and video file formats without the need to add additional third-party plug-ins, so that Unity can be used to realize the normal playback of multiple audio and video files, and expand Unity's display form in 2D/3D.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
图1是本申请实施例提供的音视频文件播放方法的实现流程图;FIG1 is a flowchart of an implementation method of an audio and video file playback method provided in an embodiment of the present application;
图2是本申请实施例提供的音视频文件播放方法中步骤S101的具体实现流程图;FIG. 2 is a flowchart showing a specific implementation of step S101 in the audio and video file playing method provided in an embodiment of the present application;
图3是本申请实施例提供的音视频文件播放方法中确定所示目标音视频文件的真实文件格式的一种具体实现流程图;3 is a specific implementation flow chart of determining the real file format of the target audio and video file in the audio and video file playing method provided in an embodiment of the present application;
图4是本申请实施例提供的音视频文件播放方法中得到解码数据包的一种具体实现流程图;4 is a specific implementation flow chart of obtaining a decoded data packet in the audio and video file playing method provided in an embodiment of the present application;
图5是本申请实施例提供的音视频文件播放方法步骤S104的具体实现流程图;FIG5 is a flowchart of a specific implementation of step S104 of the audio and video file playing method provided in an embodiment of the present application;
图6是本申请实施例提供的音视频文件播放装置的结构框图;FIG6 is a structural block diagram of an audio and video file playback device provided in an embodiment of the present application;
图7是本申请实施例提供的智能设备的示意图。FIG. 7 is a schematic diagram of a smart device provided in an embodiment of the present application.
具体实施方式Detailed ways
以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本申请。在其它情况中,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本申请的描述。In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
应当理解,当在本申请说明书和所附权利要求书中使用时,术语“包括”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and/or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and/or combinations thereof.
还应当理解,在本申请说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。It should also be understood that the term “and/or” used in the specification and appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
如在本申请说明书和所附权利要求书中所使用的那样,术语“如果”可以依据上下文被解释为“当...时”或“一旦”或“响应于确定”或“响应于检测到”。类似地,短语“如果确定”或“如果检测到[所描述条件或事件]”可以依据上下文被解释为意指“一旦确定”或“响应于确定”或“一旦检测到[所描述条件或事件]”或“响应于检测到[所描述条件或事件]”。As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
另外,在本申请说明书和所附权利要求书的描述中,术语“第一”、“第二”、“第三”等仅用于区分描述,而不能理解为指示或暗示相对重要性。In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
在本申请说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
本申请实施例提供的音视频文件播放方法可应用于需要执行音视频文件播放的各种类型的智能设备或者服务器,智能设备具体可以包括手机、平板电脑、可穿戴设备、笔记本电脑、台式电脑和超级移动个人计算机(ultra-mobile personal computer,UMPC)等。本申请实施例对智能设备或者服务器的具体类型不作任何限制。The audio and video file playing method provided in the embodiment of the present application can be applied to various types of smart devices or servers that need to play audio and video files, and the smart devices can specifically include mobile phones, tablet computers, wearable devices, laptop computers, desktop computers, and ultra-mobile personal computers (UMPC), etc. The embodiment of the present application does not impose any restrictions on the specific types of smart devices or servers.
图1示出了本申请实施例提供的音视频文件播放方法的实现流程,该方法流程包括步骤S101至步骤S104。各步骤的具体实现原理如下:FIG1 shows the implementation process of the audio and video file playback method provided by the embodiment of the present application, and the method flow includes steps S101 to S104. The specific implementation principle of each step is as follows:
步骤S101:确定目标音视频文件的真实文件格式。Step S101: Determine the actual file format of the target audio or video file.
目标音视频文件是指待解析播放的音视频文件。所述音视频文件包括音频和/或视频。一些实施方式中,音视频文件还包括字幕文件。真实文件格式是指该目标音视频文件的实际格式。The target audio and video file refers to the audio and video file to be parsed and played. The audio and video file includes audio and/or video. In some implementations, the audio and video file also includes a subtitle file. The real file format refers to the actual format of the target audio and video file.
目标音视频文件的真实文件格式可能与其后缀名显示的不相同。例如,明明是mp3/WAV,后缀却是mp3,导致对于该目标音视频文件可能出现无法播放的情况。鉴于此,本实施例中,对于目标音视频文件,先进行格式分析,确定该目标音视频文件的真实文件格式,避免因后缀名显示的格式与该目标音视频文件的真实文件格式不一致而导致播放失败。The actual file format of the target audio and video file may be different from that displayed by its suffix name. For example, it is clearly mp3/WAV, but the suffix is mp3, which may cause the target audio and video file to be unable to be played. In view of this, in this embodiment, for the target audio and video file, a format analysis is first performed to determine the actual file format of the target audio and video file, so as to avoid playback failure due to the inconsistency between the format displayed by the suffix name and the actual file format of the target audio and video file.
作为本申请一种可能的实施方式,图2示出了本申请实施例提供的音视频文件播放方法步骤S101的具体实现流程,详述如下:As a possible implementation of the present application, FIG. 2 shows a specific implementation process of step S101 of the audio and video file playback method provided in an embodiment of the present application, which is described in detail as follows:
A1:读取目标音视频文件的文件信息。读取目标音视频文件的二进制文件抬头和后缀名。二进制文件抬头为二进制编码的文件头。A1: Read the file information of the target audio and video file. Read the binary file header and suffix of the target audio and video file. The binary file header is the binary-coded file header.
一种可能的实施方式中,读取所述目标音视频文件中字符串长度小于或等于预设长度的字符串,并从字符串长度小于或等于预设长度的字符串中查找该目标音视频文件的二进制文件抬头。上述预设长度根据预设对照表中预设文件抬头的最长字符串长度确定。In a possible implementation, a character string whose length is less than or equal to a preset length is read from the target audio and video file, and a binary file header of the target audio and video file is searched from the character string whose length is less than or equal to the preset length. The preset length is determined according to the longest character string length of the preset file header in the preset comparison table.
本实施例中,读取预设对照表中的预设文件抬头对应的字符串,并根据字符串的长度,确定预设对照表中最长字符串长度,基于该最长字符串长度确定上述预设长度。例如,若预设文件抬头的最长字符串长度为l,则该预设长度为l+1。In this embodiment, the character string corresponding to the preset file header in the preset comparison table is read, and the longest character string length in the preset comparison table is determined according to the length of the character string, and the preset length is determined based on the longest character string length. For example, if the longest character string length of the preset file header is 1, then the preset length is 1+1.
A2:基于所述文件信息与预设对照表,确定所示目标音视频文件的真实文件格式。A2: Based on the file information and the preset comparison table, determine the actual file format of the target audio and video file.
作为本申请一种可能的实施方式,上述文件信息包括所述目标音视频文件的二进制文件抬头和后缀名,如图3所示,上述基于所述文件信息与预设对照表,确定所示目标音视频文件的真实文件格式的步骤,具体包括:As a possible implementation of the present application, the above-mentioned file information includes a binary file header and a suffix name of the target audio and video file. As shown in FIG3 , the above-mentioned step of determining the real file format of the target audio and video file based on the file information and the preset comparison table specifically includes:
B1:在预设对照表中查找所述二进制文件抬头对应的后缀名列表。预设对照表包括预设文件抬头与预设后缀名的映射关系。值得说明的是,同一个预设文件抬头可对应一个或者多个预设后缀名,对于对应多个预设后缀名的情形,该预设文件抬头与预设后缀名列表对应,该预设后缀名列表中包括与该预设文件抬头对应的多个预设后缀名。B1: Search the preset comparison table for the list of suffixes corresponding to the binary file header. The preset comparison table includes the mapping relationship between the preset file header and the preset suffix. It is worth noting that the same preset file header may correspond to one or more preset suffixes. For the case of corresponding to multiple preset suffixes, the preset file header corresponds to the preset suffix list, and the preset suffix list includes multiple preset suffixes corresponding to the preset file header.
本实施例中,将目标音视频文件的二进制文件抬头与预设对照表中的预设文件抬头进行匹配,再根据匹配的预设文件抬头确定对应的后缀名列表,基于该后缀名列表验证所述目标音视频文件的后缀名标识的格式是否为该目标音视频文件的真实格式。In this embodiment, the binary file header of the target audio and video file is matched with the preset file header in the preset comparison table, and then the corresponding suffix name list is determined based on the matched preset file header, and based on the suffix name list, it is verified whether the format identified by the suffix name of the target audio and video file is the actual format of the target audio and video file.
B2:若所述后缀名在所述后缀名列表中,则所述后缀名对应的格式即为所述目标音视频文件的真实文件格式。该目标音视频文件无需修改文件格式。B2: If the suffix is in the suffix list, the format corresponding to the suffix is the real file format of the target audio and video file. The target audio and video file does not need to modify the file format.
B3:若所述后缀名不在所述后缀名列表中,则从所述后缀名列表中选择一个预设后缀名替换所述后缀名。B3: If the suffix name is not in the suffix name list, select a preset suffix name from the suffix name list to replace the suffix name.
选择预设后缀名的方式可由用户自定义。例如,一些场景下,可采用随机算法,从二进制文件抬头对应的后缀名列表中随机选择一个预设后缀名作为该目标音视频文件新的后缀名,或者,直接按后缀名列表中顺序,优先选择排序靠前的预设后缀名。另一些场景下,可优先从二进制文件抬头对应的后缀名列表中,选择Unity支持格式的预设后缀名作为该目标音视频文件新的后缀名。The method of selecting a preset suffix name can be customized by the user. For example, in some scenarios, a random algorithm can be used to randomly select a preset suffix name from the suffix name list corresponding to the binary file header as the new suffix name of the target audio and video file, or the preset suffix name with the highest order can be directly selected according to the order in the suffix name list. In other scenarios, a preset suffix name in a format supported by Unity can be selected from the suffix name list corresponding to the binary file header as the new suffix name of the target audio and video file.
B4:将所述预设后缀名对应的格式确定为所述目标音视频文件的真实文件格式。B4: Determine the format corresponding to the preset suffix name as the real file format of the target audio and video file.
对于后缀名不在所述后缀名列表中的情形,意味着该目标音视频文件的格式有误,存在无法正常播放的可能。本实施例从二进制文件抬头对应的后缀名列表中选择一个预设后缀名替换原来的后缀名,即修改该目标音视频文件的后缀名,修改后的后缀名与二进制文件抬头对应,避免因实际格式和后缀名显示的格式不符而导致无法正常播放。If the suffix is not in the suffix list, it means that the format of the target audio and video file is incorrect and there is a possibility that it cannot be played normally. This embodiment selects a preset suffix from the suffix list corresponding to the binary file header to replace the original suffix, that is, the suffix of the target audio and video file is modified, and the modified suffix corresponds to the binary file header, avoiding the inability to play normally due to the inconsistency between the actual format and the format displayed by the suffix.
步骤S102:若所述真实文件格式为游戏引擎可支持的格式,则调用所述游戏引擎中所述真实文件格式对应的播放器,播放所述目标音视频文件。Step S102: If the real file format is a format supported by the game engine, a player corresponding to the real file format in the game engine is called to play the target audio and video file.
在本申请实施例中,当目标音视频文件为游戏引擎可支持的格式时,直接调用Unity中真实文件格式对应的播放器对该音视频文件进行解码播放。In an embodiment of the present application, when the target audio and video file is in a format that can be supported by the game engine, the player corresponding to the real file format in Unity is directly called to decode and play the audio and video file.
步骤S103:若所述游戏引擎不支持所述真实文件格式,则调用指定组件,利用所述指定组件对所述目标音视频文件进行解码,得到解码数据包。Step S103: If the game engine does not support the real file format, a specified component is called to decode the target audio and video file using the specified component to obtain a decoded data packet.
本申请实施例中,利用所述指定组件对所述目标音视频文件进行软解码或者硬解码,得到解码数据包。所述指定组件为FFmpeg组件。FFmpeg组件是一套可以用来记录、转换数字音频、视频,并能将其转化为流的开源计算机程序。In the embodiment of the present application, the target audio and video file is soft-decoded or hard-decoded using the designated component to obtain a decoded data packet. The designated component is an FFmpeg component. The FFmpeg component is an open source computer program that can be used to record and convert digital audio and video and convert them into streams.
在一种可能的实施方式中,先利用所述指定组件对所述目标音视频文件进行软解码,若软解码失败,则再利用所述指定组件对所述目标音视频文件进行硬解码。In a possible implementation, the target audio and video file is first soft-decoded using the designated component. If the soft decoding fails, the target audio and video file is hard-decoded using the designated component.
作为本申请一种可能的实施方式,图4示出了本申请实施例提供的音视频文件播放方法中得到解码数据包的一种具体实现流程,详述如下:As a possible implementation of the present application, FIG. 4 shows a specific implementation process of obtaining a decoded data packet in the audio and video file playback method provided in an embodiment of the present application, which is described in detail as follows:
C1:读取硬件性能信息。硬件性能信息为运行游戏引擎的智能设备中硬件的性能信息。具体地,所述硬件性能信息包括CPU和/或GPU的使用占比。C1: Reading hardware performance information. The hardware performance information is the performance information of the hardware in the smart device running the game engine. Specifically, the hardware performance information includes the usage percentage of the CPU and/or GPU.
C2:若所述硬件性能信息满足预设条件,则对所述目标音视频文件进行硬解码。C2: If the hardware performance information meets the preset conditions, the target audio and video file is hard-decoded.
例如,当GPU的使用占比小于或等于预设使用占比时,通过获取智能设备的显卡型号以及系统支持的硬件加速方法,匹配合适的解码器对所述目标音视频文件进行硬解码。For example, when the usage ratio of the GPU is less than or equal to the preset usage ratio, the target audio and video file is hard-decoded by matching a suitable decoder by obtaining the graphics card model of the smart device and the hardware acceleration method supported by the system.
C3:若所述硬件性能信息不满足所述预设条件,则对所述目标音视频文件进行软解码。例如,当GPU的使用占比大于预设使用占比时,通过CPU对所述目标音视频文件进行软解码。C3: If the hardware performance information does not meet the preset condition, soft decoding is performed on the target audio and video file. For example, when the usage ratio of the GPU is greater than the preset usage ratio, the target audio and video file is soft decoded by the CPU.
本实施例中,对于Unity不支持的音视频文件格式,通过调用FFmpeg组件实现跨平台解码,无需添加第三方插件即可扩展Unity可支持的音视频文件格式,实现多种音视频的正常播放。In this embodiment, for audio and video file formats that Unity does not support, cross-platform decoding is achieved by calling the FFmpeg component. The audio and video file formats that Unity can support can be expanded without adding third-party plug-ins, thereby achieving normal playback of multiple audio and video files.
步骤S104:基于解码数据包,播放所述目标音视频文件。Step S104: based on the decoded data packet, play the target audio and video file.
Unity基于解码数据包播放所述目标音视频文件。Unity plays the target audio and video file based on the decoded data packet.
作为本申请一种可能的实施方式,图5示出了本申请实施例提供的音视频文件播放方法中步骤S104的一种具体实现流程,详述如下:As a possible implementation of the present application, FIG. 5 shows a specific implementation process of step S104 in the audio and video file playback method provided in an embodiment of the present application, which is described in detail as follows:
D1:循环读取所述解码数据包。解码数据包中包括音频流、视频流以及字幕流等数据,D1: Circularly read the decoded data packet. The decoded data packet includes data such as audio stream, video stream and subtitle stream.
D2:将所述解码数据包中的音视频数据的格式转换为目标格式。目标格式为用户需求的可在Unity上播放的格式。D2: Convert the format of the audio and video data in the decoded data packet into a target format, which is a format that can be played on Unity as required by the user.
D3:基于所述游戏引擎所支持格式的音视频数据,播放展示所述目标音视频文件。D3: Based on the audio and video data in the format supported by the game engine, play and display the target audio and video file.
本实施例中,可调用FFmpeg组件自带的转码方法对所述解码数据包中的音视频数据进行转码,导出用户需要的格式,具体地,通过调用FFmpeg组件获取解码数据包中的帧数据,然后将缓冲区的帧数据进行编码,导出目标格式。In this embodiment, the transcoding method provided by the FFmpeg component can be called to transcode the audio and video data in the decoded data packet and export the format required by the user. Specifically, the frame data in the decoded data packet is obtained by calling the FFmpeg component, and then the frame data in the buffer is encoded to export the target format.
在本申请实施例中,将解码、转码后得到每一帧的视频流、音频流与字幕流等数据,分别渲染到Unity中相应的组件上,通过控制帧数据的同步,以及三个组件的显示配合即可实现游戏引擎对目标音视频文件的播放。In an embodiment of the present application, the video stream, audio stream, subtitle stream and other data of each frame obtained after decoding and transcoding are rendered to the corresponding components in Unity respectively. By controlling the synchronization of frame data and the display coordination of the three components, the game engine can realize the playback of the target audio and video files.
对于视频流,视频流的帧格式是YUV的,视频流数据和基础的图片数据类似,存储每一帧每一个像素的颜色,Unity获取到视频流数据后,遍历读取每帧视频流中每一个像素的数据,生成对应的texture2D贴图,显示到对应的SpriteRender即可。For video streams, the frame format of the video stream is YUV. The video stream data is similar to the basic image data, storing the color of each pixel in each frame. After Unity obtains the video stream data, it traverses and reads the data of each pixel in each frame of the video stream, generates the corresponding texture2D map, and displays it to the corresponding SpriteRender.
对于音频流,音频流的帧格式是PCM,而Unity本身就支持PCM,他的audioClip提供了PCMReaderCallback回调,用于加载流音频数据,直接调用Unity的系统方法即可渲染完成。For audio streams, the frame format of the audio stream is PCM, and Unity itself supports PCM. Its audioClip provides a PCMReaderCallback callback for loading streaming audio data. Rendering can be completed by directly calling Unity's system method.
对于字幕流,字幕流的格式基本就是string,直接通过label渲染即可。For subtitle streams, the format of subtitle streams is basically string, which can be rendered directly through labels.
在本申请实施例中,通过先对目标音视频文件的格式进行分析,确定该目标音视频文件的真实文件格式,避免该目标音视频文件因格式错误无法正常播放,若该真实文件格式为Unity可支持的格式,则直接调用Unity中该真实文件格式对应的播放器,播放所述目标音视频文件;若Unity不支持所述真实文件格式,则调用指定组件,利用所述指定组件对所述目标音视频文件进行解码,得到解码数据包,再基于解码数据包,播放所述目标音视频文件。本申请方案不需要额外添加第三方插件即可实现Unity对多种音视频文件格式的支持,从而可利用Unity实现多种音视频文件的正常播放,扩展Unity在2D/3D上的展现形式。In an embodiment of the present application, the format of the target audio and video file is first analyzed to determine the real file format of the target audio and video file, so as to avoid the target audio and video file from not being able to be played normally due to format errors. If the real file format is a format supported by Unity, the player corresponding to the real file format in Unity is directly called to play the target audio and video file; if Unity does not support the real file format, a specified component is called to decode the target audio and video file using the specified component to obtain a decoded data packet, and then the target audio and video file is played based on the decoded data packet. The present application solution can realize Unity's support for multiple audio and video file formats without the need to add additional third-party plug-ins, so that Unity can be used to realize the normal playback of multiple audio and video files, and expand Unity's display form in 2D/3D.
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
对应于上文实施例所述的音视频文件播放方法,图6示出了本申请实施例提供的音视频文件播放装置的结构框图,为了便于说明,仅示出了与本申请实施例相关的部分。Corresponding to the audio and video file playing method described in the above embodiment, FIG6 shows a structural block diagram of the audio and video file playing device provided in the embodiment of the present application. For the sake of convenience of explanation, only the part related to the embodiment of the present application is shown.
参照图6,该音视频文件播放装置包括:格式确定单元61,第一播放单元62,第二播放单元63,其中:6, the audio and video file playback device includes: a format determination unit 61, a first playback unit 62, and a second playback unit 63, wherein:
格式确定单元61,用于确定目标音视频文件的真实文件格式;A format determination unit 61, used to determine the real file format of the target audio and video file;
第一播放单元62,用于若所述真实文件格式为游戏引擎可支持的格式,则调用所述游戏引擎中所述真实文件格式对应的播放器,播放所述目标音视频文件;A first playing unit 62 is configured to call a player corresponding to the real file format in the game engine to play the target audio and video file if the real file format is a format supported by the game engine;
第二播放单元63,用于若所述游戏引擎不支持所述真实文件格式,则调用指定组件,利用所述指定组件对所述目标音视频文件进行解码,得到解码数据包;基于解码数据包,播放所述目标音视频文件。The second playback unit 63 is used to call a specified component if the game engine does not support the real file format, and use the specified component to decode the target audio and video file to obtain a decoded data packet; based on the decoded data packet, play the target audio and video file.
作为本申请一种可能的实施方式,上述格式确定单元61包括:As a possible implementation of the present application, the format determination unit 61 includes:
信息读取模块,用于读取目标音视频文件的文件信息;An information reading module, used to read the file information of the target audio and video files;
真实格式确定模块,用于基于所述文件信息与预设对照表,确定所示目标音视频文件的真实文件格式。The real format determination module is used to determine the real file format of the target audio and video file based on the file information and a preset comparison table.
作为本申请一种可能的实施方式,上述文件信息包括所述目标音视频文件的二进制文件抬头和后缀名;上述真实格式确定模块具体用于:As a possible implementation of the present application, the file information includes a binary file header and a suffix of the target audio and video file; the real format determination module is specifically used for:
在预设对照表中查找所述二进制文件抬头对应的后缀名列表;Searching for a list of suffixes corresponding to the header of the binary file in a preset comparison table;
若所述后缀名在所述后缀名列表中,则所述后缀名对应的格式即为所述目标音视频文件的真实文件格式;If the suffix is in the suffix list, the format corresponding to the suffix is the real file format of the target audio and video file;
若所述后缀名不在所述后缀名列表中,则从所述后缀名列表中选择一个预设后缀名替换所述后缀名;If the suffix name is not in the suffix name list, selecting a preset suffix name from the suffix name list to replace the suffix name;
将所述预设后缀名对应的格式确定为所述目标音视频文件的真实文件格式。The format corresponding to the preset suffix name is determined as the real file format of the target audio and video file.
作为本申请一种可能的实施方式,上述第二播放单元63包括:As a possible implementation of the present application, the second playback unit 63 includes:
解码模块,用于利用所述指定组件对所述目标音视频文件进行软解码或者硬解码,得到解码数据包。The decoding module is used to use the specified component to perform soft decoding or hard decoding on the target audio and video file to obtain a decoded data packet.
作为本申请一种可能的实施方式,上述解码模块具体用于:As a possible implementation of the present application, the above decoding module is specifically used for:
读取硬件性能信息;Read hardware performance information;
若所述硬件性能信息满足预设条件,则对所述目标音视频文件进行硬解码;If the hardware performance information meets the preset conditions, the target audio and video file is hard-decoded;
若所述硬件性能信息不满足所述预设条件,则对所述目标音视频文件进行软解码。If the hardware performance information does not meet the preset condition, the target audio and video file is soft-decoded.
作为本申请一种可能的实施方式,上述第二播放单元63还包括:As a possible implementation of the present application, the second playback unit 63 further includes:
播放展示模块,用于循环读取所述解码数据包;将所述解码数据包中的音视频数据的格式转换为目标格式;基于所述游戏引擎所支持格式的音视频数据,播放展示所述目标音视频文件。The playing and displaying module is used to cyclically read the decoded data packets; convert the format of the audio and video data in the decoded data packets into a target format; and play and display the target audio and video files based on the audio and video data in the format supported by the game engine.
在本申请实施例中,通过先对目标音视频文件的格式进行分析,确定该目标音视频文件的真实文件格式,避免该目标音视频文件因格式错误无法正常播放,若该真实文件格式为Unity可支持的格式,则直接调用Unity中该真实文件格式对应的播放器,播放所述目标音视频文件;若Unity不支持所述真实文件格式,则调用指定组件,利用所述指定组件对所述目标音视频文件进行解码,得到解码数据包,再基于解码数据包,播放所述目标音视频文件。本申请方案不需要额外添加第三方插件即可实现Unity对多种音视频文件格式的支持,从而可利用Unity实现多种音视频文件的正常播放,扩展Unity在2D/3D上的展现形式。In an embodiment of the present application, the format of the target audio and video file is first analyzed to determine the real file format of the target audio and video file, so as to avoid the target audio and video file from not being able to be played normally due to format errors. If the real file format is a format supported by Unity, the player corresponding to the real file format in Unity is directly called to play the target audio and video file; if Unity does not support the real file format, a specified component is called to decode the target audio and video file using the specified component to obtain a decoded data packet, and then the target audio and video file is played based on the decoded data packet. The present application solution can realize Unity's support for multiple audio and video file formats without the need to add additional third-party plug-ins, so that Unity can be used to realize the normal playback of multiple audio and video files, and expand Unity's display form in 2D/3D.
需要说明的是,上述装置/单元之间的信息交互、执行过程等内容,由于与本申请方法实施例基于同一构思,其具体功能及带来的技术效果,具体可参见方法实施例部分,此处不再赘述。It should be noted that the information interaction, execution process, etc. between the above-mentioned devices/units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
本申请实施例还提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现如图1至图5表示的任意一种音视频文件播放方法的步骤。An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of any one of the audio and video file playback methods shown in Figures 1 to 5 are implemented.
本申请实施例还提供一种智能设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现如图1至图5表示的任意一种音视频文件播放方法的步骤。An embodiment of the present application also provides an intelligent device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of any one of the audio and video file playback methods shown in FIGS. 1 to 5 are implemented.
本申请实施例还提供一种计算机程序产品,当该计算机程序产品在服务器上运行时,使得服务器执行实现如图1至图5表示的任意一种音视频文件播放方法的步骤。The embodiment of the present application also provides a computer program product. When the computer program product is run on a server, the server executes the steps of any one of the audio and video file playback methods shown in Figures 1 to 5.
图7是本申请一实施例提供的智能设备的示意图。如图7所示,该实施例的智能设备7包括:处理器70、存储器71以及存储在所述存储器71中并可在所述处理器70上运行的计算机程序72。所述处理器70执行所述计算机程序72时实现上述各个音视频文件播放方法实施例中的步骤,例如图1所示的步骤S101至步骤S104。或者,所述处理器70执行所述计算机程序72时实现上述各装置实施例中各模块/单元的功能,例如图6所示单元61至单元64的功能。FIG7 is a schematic diagram of an intelligent device provided in an embodiment of the present application. As shown in FIG7 , the intelligent device 7 of this embodiment includes: a processor 70, a memory 71, and a computer program 72 stored in the memory 71 and executable on the processor 70. When the processor 70 executes the computer program 72, the steps in the above-mentioned audio and video file playback method embodiments are implemented, such as steps S101 to S104 shown in FIG1 . Alternatively, when the processor 70 executes the computer program 72, the functions of each module/unit in the above-mentioned device embodiments are implemented, such as the functions of units 61 to 64 shown in FIG6 .
示例性的,所述计算机程序72可以被分割成一个或多个模块/单元,所述一个或者多个模块/单元被存储在所述存储器71中,并由所述处理器70执行,以完成本申请。所述一个或多个模块/单元可以是能够完成特定功能的一系列计算机可读指令段,该指令段用于描述所述计算机程序72在所述智能设备7中的执行过程。Exemplarily, the computer program 72 may be divided into one or more modules/units, which are stored in the memory 71 and executed by the processor 70 to complete the present application. The one or more modules/units may be a series of computer-readable instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program 72 in the smart device 7.
所述智能设备7可包括,但不仅限于,处理器70、存储器71。本领域技术人员可以理解,图7仅仅是智能设备7的示例,并不构成对智能设备7的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述智能设备7还可以包括输入输出设备、网络接入设备、总线等。The smart device 7 may include, but is not limited to, a processor 70 and a memory 71. Those skilled in the art will appreciate that FIG. 7 is merely an example of the smart device 7 and does not limit the smart device 7. The smart device 7 may include more or fewer components than shown in the figure, or may combine certain components, or may include different components. For example, the smart device 7 may also include an input/output device, a network access device, a bus, etc.
所述处理器70可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The processor 70 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
所述存储器71可以是所述智能设备7的内部存储单元,例如智能设备7的硬盘或内存。所述存储器71也可以是所述智能设备7的外部存储设备,例如所述智能设备7上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器71还可以既包括所述智能设备7的内部存储单元也包括外部存储设备。所述存储器71用于存储所述计算机程序以及所述智能设备所需的其他程序和数据。所述存储器71还可以用于暂时地存储已经输出或者将要输出的数据。The memory 71 may be an internal storage unit of the smart device 7, such as a hard disk or memory of the smart device 7. The memory 71 may also be an external storage device of the smart device 7, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the smart device 7. Further, the memory 71 may also include both an internal storage unit and an external storage device of the smart device 7. The memory 71 is used to store the computer program and other programs and data required by the smart device. The memory 71 may also be used to temporarily store data that has been output or is to be output.
需要说明的是,上述装置/单元之间的信息交互、执行过程等内容,由于与本申请方法实施例基于同一构思,其具体功能及带来的技术效果,具体可参见方法实施例部分,此处不再赘述。It should be noted that the information interaction, execution process, etc. between the above-mentioned devices/units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质至少可以包括:能够将计算机程序代码携带到装置/终端设备的任何实体或装置、记录介质、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random AccessMemory)、电载波信号、电信信号以及软件分发介质。例如U盘、移动硬盘、磁碟或者光盘等。在某些司法管辖区,根据立法和专利实践,计算机可读介质不可以是电载波信号和电信信号。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to the device/terminal device, a recording medium, a computer memory, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), an electric carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202410320708.9A CN118286678A (en) | 2024-03-20 | 2024-03-20 | Audio and video file playing method and device, storage medium and intelligent equipment |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202410320708.9A CN118286678A (en) | 2024-03-20 | 2024-03-20 | Audio and video file playing method and device, storage medium and intelligent equipment |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN118286678A true CN118286678A (en) | 2024-07-05 |
Family
ID=91685414
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202410320708.9A Pending CN118286678A (en) | 2024-03-20 | 2024-03-20 | Audio and video file playing method and device, storage medium and intelligent equipment |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN118286678A (en) |
-
2024
- 2024-03-20 CN CN202410320708.9A patent/CN118286678A/en active Pending
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN101213607B (en) | Synchronous aspects of interactive multimedia presentation management | |
| JP4907653B2 (en) | Aspects of media content rendering | |
| CN104219555A (en) | Video displaying device and method for Android system terminals | |
| JP2019509547A (en) | GPU resource reconstruction method, user device, system, and storage medium | |
| KR20070121662A (en) | Media Timeline Processing Infrastructure | |
| CN106470353A (en) | Multimedia data processing method and device and electronic equipment | |
| CN107454447B (en) | Plug-in loading method and device for player and television | |
| CN108600813A (en) | a kind of media file playing method, device and media play system | |
| WO2024098836A1 (en) | Video alignment method and apparatus | |
| US20080256341A1 (en) | Data Processing Pipeline Selection | |
| CN118286678A (en) | Audio and video file playing method and device, storage medium and intelligent equipment | |
| CN108073424A (en) | The call method and device of component interface | |
| CN106331553B (en) | Video storage method and device and electronic equipment | |
| CN105096989A (en) | Method and apparatus for processing background music | |
| CN111836054A (en) | Video anti-piracy method, electronic device and computer-readable storage medium | |
| US20200286120A1 (en) | Advertising monitoring method, system, apparatus, and electronic equipment | |
| JP6871388B2 (en) | Methods and equipment for determining intercut time buckets in audio or video | |
| CN113840173B (en) | Webpage video playing method, device, equipment, storage medium and program product | |
| KR20080044872A (en) | Systems and Methods for Processing Information or Data on Computers | |
| CN113082720B (en) | Prompt information determination method, device and electronic device | |
| CN111757168B (en) | Audio decoding method, device, storage medium and equipment | |
| CN112099926A (en) | Information processing method and device and electronic equipment | |
| CN108335706B (en) | A seamless playback method, terminal device and storage medium for multimedia files | |
| CN111641867B (en) | Video output method, device, electronic equipment and storage medium | |
| CN112788428A (en) | Audio and video file processing method and device and storage medium |
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 |