CN120935399A - Method and device for playing moving pictures, electronic equipment and storage medium - Google Patents
Method and device for playing moving pictures, electronic equipment and storage mediumInfo
- Publication number
- CN120935399A CN120935399A CN202410585440.1A CN202410585440A CN120935399A CN 120935399 A CN120935399 A CN 120935399A CN 202410585440 A CN202410585440 A CN 202410585440A CN 120935399 A CN120935399 A CN 120935399A
- Authority
- CN
- China
- Prior art keywords
- picture
- data
- moving picture
- frame
- data packet
- 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
Landscapes
- Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
Abstract
The embodiment of the application provides a method and a device for playing a moving picture, electronic equipment and a storage medium. The moving picture playing method comprises the steps of intercepting a target network request, analyzing the target network request to obtain moving picture data for caching, forming picture data packets corresponding to each frame of picture based on the moving picture data, storing the picture data packets in a data packet queue, reading the picture data packets in the data packet queue for decoding to obtain picture frame data corresponding to each frame of picture, and loading the picture frame data into a target rendering tool to form moving picture frames. By utilizing the technical scheme of the application, the volume of the transmission file can be reduced, the network flow cost is saved, the moving picture is efficiently played under the conditions of low memory occupancy rate and low CPU use rate, other audio/video playing of a user is prevented from being interfered, and the experience of the user is improved.
Description
Technical Field
Embodiments of the present application relate to the field of computers, and more particularly, to a method, an apparatus, an electronic device, and a storage medium for playing a moving picture.
Background
This section is intended to provide a background or context to the embodiments of the application that are recited in the claims. The description herein may include concepts that could be pursued, but are not necessarily ones that have been previously conceived or pursued. Accordingly, unless indicated otherwise, what is described in this section is not prior art to the description and claims of the present application and is not admitted to be prior art by inclusion in this section.
GIF (GRAPHICS INTERCHANGE Format) moving pictures refer to pictures that enable a plurality of GIF pictures to play back moving pictures rapidly and continuously according to a certain rule by using a special animation production tool or adopting a method of shooting objects frame by frame. In the prior art, the playing mode of the GIF moving picture generally carries out rendering playing on the acquired moving picture data to a subsequent decoding rendering module. In the decoding stage, only a small number of pictures can be decoded at a time, and the mode of continuously releasing old pictures and decoding new pictures along with the time axis is adopted to solve the problem of high memory occupation. However, the existing scheme is easy to cause the problem of excessively high CPU occupation. In addition, the GIF can be converted into a video, and then the video is downloaded and played by the client through the network video player, and in this case, other audios and videos in the App of the user equipment or even other apps are easily interfered when playing the moving pictures.
In view of this, it is needed to propose an innovative moving picture playing method so as to play moving pictures efficiently under the conditions of low memory occupancy rate and low CPU usage rate, avoid interfering with other audio/video playing of the user, and improve the experience of the user.
Disclosure of Invention
In order to overcome the problems in the related art, embodiments of the present application desirably provide a method, an apparatus, an electronic device, and a storage medium for playing a moving picture. The moving picture playing method can efficiently play the moving picture under the conditions of low memory occupancy rate and low CPU utilization rate, avoid interference to other audio and video playing of the user, and promote the experience of the user.
In a first aspect of the embodiment of the present application, a method for playing a moving picture is provided, which includes intercepting a target network request, parsing the target network request to obtain moving picture data for buffering, forming a picture data packet corresponding to each frame of picture based on the moving picture data and storing the picture data packet in a data packet queue, reading the picture data packet in the data packet queue for decoding to obtain picture frame data corresponding to each frame of picture, and loading the picture frame data into a target rendering tool to form a moving picture frame.
In one embodiment of the application, analyzing the target network request to obtain the moving picture data for caching comprises establishing an independent folder and an independent information description file for each moving picture resource total link in the target network request, creating slice download description information for each slice file in the picture play index file and storing each slice download description information into the independent information description file, downloading each slice file in the picture play index file and updating the slice download description information corresponding to each slice file.
In one embodiment of the application, after storing each slice download description information in the independent information description file, the method further comprises creating an independent data information entity for successive picture data in each slice file, the independent data information entity being used to record a relationship of the file offset and the independent data information entity.
In one embodiment of the application, loading the picture frame data into the target rendering tool to form the moving picture frame includes obtaining a media type compressed sample in the picture frame data in response to a moving picture rendering instruction and loading the media type compressed sample into the target rendering tool to form the moving picture frame.
In one embodiment of the application, after acquiring the media type compressed samples in the picture frame data in response to the live view rendering instruction, the method further comprises extracting pixel decoding data in the media type compressed samples and loading the pixel decoding data into the target rendering tool to form the live view picture frame.
In one embodiment of the application, before loading the frame data into the target rendering tool to form the moving picture frame, the method comprises the steps of responding to the moving picture rendering instruction to execute the step of intercepting the target network request to read the frame data packet in the data packet queue for decoding, and obtaining the frame data corresponding to each frame picture.
In one embodiment of the present application, after loading the picture frame data into the target rendering tool to form the moving picture frames, the method further comprises sequentially playing the formed moving picture frames one by one.
In a second aspect of the embodiment of the application, a moving picture playing device is provided, which comprises a request interception module, a data caching module, a decapsulation module, a data decoding module and a moving picture forming module, wherein the request interception module is used for intercepting a target network request, the data caching module is used for analyzing the target network request to acquire moving picture data for caching, the decapsulation module is used for forming picture data packets corresponding to each frame picture based on the moving picture data and storing the picture data packets in a data packet queue, the data decoding module is used for reading the picture data packets in the data packet queue for decoding to obtain picture frame data corresponding to each frame picture, and the moving picture forming module is used for loading the picture frame data into a target rendering tool to form moving picture frames.
A third aspect of the application provides an electronic device comprising a processor and a memory having stored thereon executable code for moving picture playback, which when executed by the processor causes the processor to perform the method as described above.
A fourth aspect of the application provides a non-transitory machine-readable storage medium having stored thereon executable code for use in a playback of a video, which when executed by a processor of an electronic device, causes the processor to perform a method as described above.
The technical scheme provided by the embodiment of the application has the following beneficial effects:
According to the method, the device, the electronic equipment and the storage medium for playing the moving pictures, the target network request is intercepted, and then the target network request is analyzed to obtain moving picture data for caching. Further, a picture data packet is formed based on the moving picture data, the picture data packet is stored in a data packet queue, and then the picture data packet in the data packet queue is read for decoding, so that picture frame data is obtained, and then the picture frame data is loaded into a target rendering tool to form a moving picture frame. Therefore, the picture data packets in the data packet queue can be decoded and rendered orderly, the CPU resource consumption is reduced, and the memory occupancy rate is reduced. The GPU decoding is performed by using a hardware decoding tool at the bottom layer of the system native and the rendering is performed by using an independent rendering tool, so that the mutual interference with other scenes playing the audio and video by using the audio and video player of the system can be avoided, and the capability of the GPU can be fully exerted.
In general, the method and the device can play the moving pictures efficiently under the conditions of low memory occupancy rate and low CPU utilization rate, avoid interference to other audio/video playing of the user, and improve the experience of the user.
Drawings
The above, as well as additional purposes, features, and advantages of exemplary embodiments of the present application will become readily apparent from the following detailed description when read in conjunction with the accompanying drawings. Several embodiments of the present application are illustrated by way of example, and not by way of limitation, in the figures of the accompanying drawings and in which:
FIG. 1 schematically illustrates a block diagram of an exemplary computing system 100 suitable for implementing embodiments of the application;
fig. 2 schematically illustrates a flowchart of a method for playing a moving picture according to an embodiment of the present application;
fig. 3 schematically shows a flowchart of a method for moving picture playback according to yet another embodiment of the present application;
fig. 4 schematically shows a flowchart of a method for moving picture playback according to still another embodiment of the present application;
fig. 5 schematically illustrates a schematic structure of a moving picture playing device according to an embodiment of the present application;
fig. 6 schematically shows a schematic block diagram of an electronic device according to an embodiment of the application.
In the drawings, the same or corresponding reference numerals indicate the same or corresponding parts.
Detailed Description
The principles and spirit of the present application will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are presented merely to enable those skilled in the art to better understand and practice the application and are not intended to limit the scope of the application in any way. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
FIG. 1 illustrates a block diagram of an exemplary computing system 100 suitable for implementing embodiments of the application. As shown in fig. 1, the computing system 100 may include a Central Processing Unit (CPU) 101, a Random Access Memory (RAM) 102, a Read Only Memory (ROM) 103, a system bus 104, a hard disk controller 105, a keyboard controller 106, a serial interface controller 107, a parallel interface controller 108, a display controller 109, a hard disk 110, a keyboard 111, a serial peripheral 112, a parallel peripheral 113, and a display 114. Of these devices, coupled to the system bus 104 are a CPU 101, a RAM 102, a ROM 103, a hard disk controller 105, a keyboard controller 106, a serial controller 107, a parallel controller 108, and a display controller 109. The hard disk 110 is coupled to the hard disk controller 105, the keyboard 111 is coupled to the keyboard controller 106, the serial external device 112 is coupled to the serial interface controller 107, the parallel external device 113 is coupled to the parallel interface controller 108, and the display 114 is coupled to the display controller 109. It should be understood that the block diagram depicted in FIG. 1 is for illustrative purposes only and is not intended to limit the scope of the present application. In some cases, some devices may be added or subtracted as the case may be.
Those skilled in the art will appreciate that embodiments of the application may be implemented as a system, method, or computer program product. Accordingly, the present disclosure may be embodied in the form of entirely hardware, entirely software (including firmware, resident software, micro-code, etc.) or in combination with hardware and software that may all generally be referred to herein as a "circuit," module "or" system. Furthermore, in some embodiments, the application may also be embodied in the form of a computer program product in one or more computer-readable media, which contain computer-readable program code.
Any combination of one or more computer readable media may be employed. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive example) of the computer-readable storage medium could include, for example, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer, for example, through the internet using an internet service provider.
Embodiments of the present application will be described below with reference to flowchart illustrations of methods and block diagrams of apparatus (or systems) according to embodiments of the application. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable medium that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable medium produce an article of manufacture including instruction means which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks.
According to the embodiment of the application, a method and equipment for playing a dynamic diagram are provided.
In this document, it should be understood that any number of elements in the drawings is for illustration and not limitation, and that any naming is used only for distinction and not for any limitation.
The principles and spirit of the present application are explained in detail below with reference to several representative embodiments thereof.
Summary of The Invention
The inventor finds that in the prior art, the playing mode of the GIF map generally refers to rendering and playing the acquired map data to a subsequent decoding and rendering module. In the decoding stage, only a small number of pictures can be decoded at a time, and the mode of continuously releasing old pictures and decoding new pictures along with the time axis is adopted to solve the problem of high memory occupation. However, the existing scheme is easy to cause the problem of excessively high CPU occupation. In addition, the GIF can be converted into a video, and then the video is downloaded and played by the client through the network video player, and in this case, other audios and videos in the App of the user equipment or even other apps are easily interfered when playing the moving pictures.
Based on the method, the target network request is intercepted, and then the target network request is analyzed to acquire the moving picture data for caching. Further, a picture data packet is formed based on the moving picture data, the picture data packet is stored in a data packet queue, and then the picture data packet in the data packet queue is read for decoding, so that picture frame data is obtained, and then the picture frame data is loaded into a target rendering tool to form a moving picture frame. Therefore, the picture data packets in the data packet queue can be decoded and rendered orderly, the CPU resource consumption is reduced, and the memory occupancy rate is reduced. The system can also utilize a hardware decoding tool at the bottom layer of the system to decode GPU and utilize an independent rendering tool to render, so that the mutual interference with other scenes playing audio and video by using the system with an audio and video player can be avoided, and the capability of the GPU can be fully exerted.
In general, the method and the device can play the moving pictures efficiently under the conditions of low memory occupancy rate and low CPU utilization rate, avoid interference to other audio/video playing of the user, and improve the experience of the user.
Having described the basic principles of the present application, various non-limiting embodiments of the application are described in detail below.
Application scene overview
The moving picture playing method of the embodiment of the application is suitable for various electronic devices, such as mobile devices like mobile phones and tablets, fixed devices like personal computers and intelligent display screens, and the like. By adopting the moving picture playing method provided by the application on the electronic equipment, moving pictures can be efficiently played under the conditions of low memory occupancy rate and low CPU utilization rate, other audio/video playing of a user is prevented from being interfered, and the experience of the user is improved.
Exemplary method
A moving picture playing method according to an exemplary embodiment of the present application will be described below with reference to fig. 2. It should be noted that the above application scenario is only shown for the convenience of understanding the spirit and principle of the present application, and the embodiments of the present application are not limited in any way. Rather, embodiments of the application may be applied to any scenario where applicable.
In step S201 of the method 200, a target network request is intercepted. In the embodiment of the present application, the aforementioned target network request may be an HTTP request having moving picture data as a request result. Illustratively, a customized protocol such as HTTP protocol may be added to the FFmpeg (Fast Forward Mpeg, FFmpeg is a set of open source computer programs that may be used to record, convert digital audio, video, and convert it to streams) framework to effect interception of the target network request. The moving picture data may be video data obtained by transcoding GIF original pictures in the internet by FFmpeg, for example, video data of MP4 format transcoded into H264 coding.
In step S202, the target network request is parsed to acquire moving picture data for buffering. In the embodiment of the application, after the target network request is analyzed, the download link of the moving picture data can be acquired to download the moving picture data, and then the moving picture data obtained by downloading is cached.
In step S203, a picture packet corresponding to each frame of picture is formed based on the moving picture data and stored in a packet queue. In an embodiment of the present application, when the moving picture data is accumulated to form a decapsulated picture data packet, the formed picture data packet is stored in a data packet queue. For example, the cumulative file size of the moving picture data may be counted, and when the predetermined file size is reached, the moving picture data is regarded as constituting one decapsulated picture data packet.
In step S204, the frame data packet in the packet queue is read and decoded to obtain the frame data corresponding to each frame. In an embodiment of the present application, videoToolBox frames may be used to decode the data in the picture packets to obtain picture frame data (AVFrame). The frame data may also be queued by a frame queue.
In step S205, the picture frame data is loaded into the target rendering tool to form a moving picture frame. In the embodiment of the present application, the foregoing target rendering tool may be an independent rendering tool of a bottom layer of a system native, for example, AVSampleBufferDisplayLayer of an iOS system may be adopted, which is a relatively high-level video frame rendering tool, and a Metal rendering frame is used in the video frame rendering tool, so that the high-efficiency hard solution performance of the GPU can be exerted, and the working pressure of the CPU is effectively released. But also is compatible with adapting to low-version systems or devices, and memory usage is low. The rendering tool is used for displaying the moving picture, so that the problem of unnecessary audio resource occupation can be avoided.
According to the method, the target network request is intercepted, and then the target network request is analyzed to obtain the moving picture data for caching. Further, a picture data packet is formed based on the moving picture data, the picture data packet is stored in a data packet queue, and then the picture data packet in the data packet queue is read for decoding, so that picture frame data is obtained, and then the picture frame data is loaded into a target rendering tool to form a moving picture frame. Therefore, the picture data packets in the data packet queue can be decoded and rendered orderly, and the CPU resource consumption and the memory occupancy rate are reduced. The system can utilize the hardware decoding tool at the bottom layer of the system to decode the GPU and utilize the independent rendering tool to render, so that the mutual interference with other scenes playing the audio and video by using the audio and video player of the system can be avoided, and the capability of the GPU can be fully exerted. In general, the method and the device can play the moving pictures efficiently under the conditions of low memory occupancy rate and low CPU utilization rate, avoid interference to other audio/video playing of the user, and improve the experience of the user.
In some embodiments, in order to improve performance, the buffer mode of the moving picture data may be further designed to perform fine granularity management on the moving picture data. The manner of buffering moving picture data will be described in detail below in conjunction with fig. 3. Fig. 3 schematically illustrates a flowchart of a method for playing a moving picture according to another embodiment of the present application, referring to fig. 3, the method 300 for playing a moving picture according to an embodiment of the present application may include:
In step S301, an independent folder and an independent information description file are established for each total link of the moving picture resources in the target network request, so as to facilitate the split management of different picture data. In the embodiment of the present application, the picture data may be M3U8 format video data, and the total link of the moving picture resource is URL (uniform resource locator) of the M3U8 format video data. M3U8 is an HTTP-based streaming media file format, mainly used to describe URL addresses of pieces of audio and video data.
In step S302, slice download description information is created for each slice file in the picture play index file, and each slice download description information is stored into an independent information description file. In the embodiment of the present application, the slice download description information is used to record slice download information, and the picture playing index file may be obtained through total links of the moving picture resources. It will be appreciated that the information of each different video slice is provided in the picture playing index file, including the specific slice file address, so that after parsing the information of the picture playing index file, different video slices can be downloaded one by one, thereby forming moving picture data.
In step S303, an independent data information entity is created for the continuous picture data in each slice file. The continuous frame data refers to a section of continuously downloaded file data without jumping, and the independent data information entity is used for recording the relation between the file offset and the independent data information entity. The drag behavior of the screen progress is considered, and thus the downloaded data is often segmented. Illustratively, after viewing the previous segment of data a, the user drags to the second half to view a segment that constitutes a continuous and independent segment of data B that is not contiguous with the last segment of video content a. The user then returns to the previous next view of the previously middle section of the picture, forming the data section C, which is why the data section was generated. To record information for each individual data segment, it may be recorded in a structure named "entry". The downloaded content can only be stored according to the downloading sequence when being stored, so the actual storage sequence of the downloaded file is a data segment A, a data segment B is connected at the back, and a data segment C is connected at the back. When the downloaded file and the index file matched with the downloaded file are actually taken, the data segment A needs to be found for playing according to the normal sequence, then the content of the data segment C is found for playing, and finally the data segment B is found for playing. For this purpose, for each data segment, two concepts are created, a logically-oriented data start point and a physically-oriented data start point, in order to find it accurately and read it. The record information of the data segment download of one slice file may be, for example, as follows:
The logical_pos records a time axis in the eyes of the user, and the logical_pos+entry_size of the previous entry is equal to the logical_pos of the next entry. Until the last, the sum of all entry_size is equal to the tree_file_size of the previous corresponding slice file. The physical_pos records the position of the data segment in a continuous file, so that the file offset (i.e. the position of the data segment in the continuous file) and the correspondence between the file offset and the independent data information entity (i.e. the continuous file) can be recorded.
In step S304, each slice file in the picture play index file is downloaded, and slice download description information corresponding to each slice file is updated. Illustratively, the slice download description information may be as follows:
The tree in each slice downloading description information corresponds to the information of each slice file of the video, so that different slice files are managed separately.
In some embodiments, the rendering process may be further designed. The rendering process will be described in detail below in conjunction with fig. 4. Fig. 4 schematically illustrates a flowchart of a method for playing a moving picture according to still another embodiment of the present application, referring to fig. 4, the method 400 for playing a moving picture according to an embodiment of the present application may include:
In step S401, a media type compressed sample in picture frame data is acquired in response to a moving picture rendering instruction. In the embodiment of the present application, the step of intercepting the target network request may be performed in response to the moving picture rendering instruction to the step of reading the picture data packet in the data packet queue and decoding the picture data packet to obtain the picture frame data corresponding to each frame of picture, so as to provide the picture frame data for the rendering process (AVFrame), and further obtain the compressed sample of the media type (CMSampleBuffer, a core basic object, including compressed (or uncompressed) samples of zero or more specific media types (audio, video, multi-channel mixing, etc.) in the picture frame data. The CPU resource consumption and memory occupation caused by the full-time acquisition of the data can be avoided, namely, the target network request is intercepted when the moving picture rendering instruction is received so as to acquire moving picture data.
In step S402, media type compression samples are loaded into a target rendering tool to form a moving picture frame. In the embodiment of the present application, the pixel decoding data (CVPixelBuffer) in the media type compressed samples may be further extracted, that is, the decoded picture pixel data, and then the pixel decoding data is loaded into the target rendering tool to form the moving picture frame. Both the media type compressed samples and the pixel decoded data can be rendered by AVSampleBufferDisplayLayer to form a moving picture frame.
In step S403, the plurality of moving picture frames formed are sequentially played one by one. It can be understood that, in the embodiment of the present application, the "loading the frame data into the target rendering tool to form the moving picture frame" is performed continuously, so as to generate a plurality of moving picture frames corresponding to one moving picture, so that the formed plurality of moving picture frames can be played sequentially one by one to play the complete moving picture.
Exemplary apparatus
Having introduced the method of the exemplary embodiment of the present application, next, please refer to fig. 5 and 6 for a description of related products of the method of playing a moving picture of the exemplary embodiment of the present application.
Fig. 5 schematically illustrates a schematic structural diagram of a moving picture playing device according to an embodiment of the present application, referring to fig. 5, a moving picture playing device 500 according to an embodiment of the present application may include:
a request interception module 501, configured to intercept a target network request;
The data caching module 502 is configured to parse the target network request to obtain moving picture data for caching;
a decapsulation module 503, configured to form a picture data packet corresponding to each frame of picture based on the moving picture data and store the picture data packet in a data packet queue;
The data decoding module 504 is configured to read the picture data packet in the data packet queue to decode to obtain picture frame data corresponding to each frame of picture, where the data decoding module 504 may be configured to read the picture data packet in the data packet queue to perform hardware decoding, and the hardware decoding is implemented by calling a function provided by a hardware decoding module with an open bottom layer of the system;
the moving picture forming module 505 is configured to load the frame data into a target rendering tool to form moving picture frames.
According to the moving picture playing device, the target network request is intercepted, and then the target network request is analyzed to obtain moving picture data for caching. Further, a picture data packet is formed based on the moving picture data, the picture data packet is stored in a data packet queue, and then the picture data packet in the data packet queue is read for decoding, so that picture frame data is obtained, and then the picture frame data is loaded into a target rendering tool to form a moving picture frame. Therefore, the picture data packets in the data packet queue can be decoded and rendered orderly, and the CPU resource consumption and the memory occupation are reduced. And the GPU decoding is performed by utilizing a hardware decoding tool at the bottom layer of the system native and the rendering is performed by utilizing an independent rendering tool, so that the mutual interference with other scenes playing the audio and video by using the system with an audio and video player can be avoided, and the capability of the GPU can be fully exerted.
In general, the method and the device can play the moving pictures efficiently under the conditions of low memory occupancy rate and low CPU utilization rate, avoid interference to other audio/video playing of the user, and improve the experience of the user. Since the specific function of the moving picture playing device is the same as that of the moving picture playing method described above, specific details or further embodiments thereof may refer to the content described above for the moving picture playing method, and will not be described in detail herein.
Fig. 6 schematically shows a schematic block diagram of an electronic device according to an embodiment of the application. Referring to fig. 6, an electronic device 600 may include a processor 601. Further, the electronic device may also comprise a memory 602 storing computer instructions that, when executed by the processor 601, cause the electronic device 600 to perform the method according to the various embodiments or implementations described above.
In some implementations, the electronic device 600 may include a server or a terminal device, such as a physical server, a cloud server, a server cluster, a data processing apparatus, an application testing robot, a computer terminal, a smart terminal, a PC device, an internet of things terminal, and so forth.
Depending on the implementation scenario, the above Processor 601 may be a central processing unit (Central Processing Unit, CPU), but may also be other general purpose processors, digital signal processors (DIGITAL SIGNAL Processor, DSP), application SPECIFIC INTEGRATED Circuit (ASIC), field-Programmable gate array (Field-Programmable GATE ARRAY, FPGA) or other Programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Based on the foregoing, the present application also discloses a computer readable storage medium containing program instructions which, when executed by a processor, cause the implementation of the method according to the various embodiments or implementations described above.
In some implementations, the computer-readable storage medium described above may be any suitable magnetic or magneto-optical storage medium, such as, for example, resistance change Memory RRAM (Resistive Random Access Memory), dynamic Random Access Memory DRAM (Dynamic Random Access Memory), static Random Access Memory SRAM (Static Random-Access Memory), enhanced dynamic Random Access Memory EDRAM (ENHANCED DYNAMIC Random Access Memory), high-Bandwidth Memory HBM (High-Bandwidth Memory), hybrid storage cube HMC (Hybrid Memory Cube), or any other medium that may be used to store the desired information and that may be accessed by an application, a module, or both. Any such computer storage media may be part of, or accessible by, or connectable to, the device. Any of the applications or modules described herein may be implemented using computer-readable/executable instructions that may be stored or otherwise maintained by such computer-readable media.
It should be noted that although in the above detailed description several modules or sub-modules of the playback device are mentioned, this division is only exemplary and not mandatory. Indeed, the features and functions of two or more modules described above may be embodied in one module in accordance with embodiments of the present application. Conversely, the features and functions of one module described above may be further divided into a plurality of modules to be embodied.
Furthermore, although the operations of the methods of the present application are depicted in the drawings in a particular order, this is not required or suggested that these operations must be performed in this particular order or that all of the illustrated operations must be performed in order to achieve desirable results. Rather, the steps depicted in the flowcharts may change the order of execution. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step to perform, and/or one step decomposed into multiple steps to perform.
Use of the verb "comprise," "include" and its conjugations in this application does not exclude the presence of elements or steps other than those stated in the application. The article "a" or "an" preceding an element does not exclude the presence of a plurality of such elements.
While the spirit and principles of the present application have been described with reference to several particular embodiments, it is to be understood that the application is not limited to the disclosed embodiments nor does it imply that features of the various aspects are not useful in combination, nor are they useful in any combination, such as for convenience of description. The application is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims. The scope of the following claims is to be accorded the broadest interpretation so as to encompass all such modifications and equivalent structures and functions.
Claims (10)
1. A method for moving picture playback, comprising:
intercepting a target network request;
Analyzing the target network request to obtain moving picture data for caching;
forming a picture data packet corresponding to each frame of picture based on the moving picture data and storing the picture data packet in a data packet queue;
Reading the picture data packet in the data packet queue to decode to obtain the picture frame data corresponding to each frame of picture, and
And loading the picture frame data into a target rendering tool to form a moving picture frame.
2. The method of claim 1, wherein parsing the target network request to obtain moving picture data for buffering comprises:
Establishing an independent folder and an independent information description file for each total dynamic diagram resource link in the target network request;
creating slice downloading description information for each slice file in the picture playing index file, and storing each slice downloading description information into the independent information description file;
and downloading each slice file in the picture playing index file, and updating slice downloading description information corresponding to each slice file.
3. The method of moving picture playback according to claim 2, wherein after said storing each slice download description information in said independent information description file, said method further comprises:
An independent data information entity is created for the continuous picture data in each slice file, the independent data information entity being used to record the relationship of the file offset and the independent data information entity.
4. The method of claim 1, wherein loading the picture frame data into a target rendering tool to form a picture frame comprises:
acquiring a media type compressed sample in the picture frame data in response to a rendering instruction;
Loading the media type compressed samples into a target rendering tool to form a moving picture frame.
5. The method of claim 4, wherein after the obtaining of media type compressed samples in the picture frame data in response to a rendering instruction, the method further comprises:
Extracting pixel decoding data in the media type compressed samples;
loading the pixel decoding data into a target rendering tool to form a moving picture frame.
6. The method of moving picture playback as set forth in claim 4, comprising, prior to said loading said picture frame data into a target rendering tool to form moving picture frames:
And responding to the moving picture rendering instruction to execute the step of intercepting the target network request, and the step of reading the picture data packet in the data packet queue to decode so as to obtain picture frame data corresponding to each frame of picture.
7. A method of moving picture playback as claimed in claim 3, characterized in that, after said loading of said picture frame data into a target rendering tool for forming moving picture frames, the method further comprises:
And sequentially playing the formed plurality of moving picture frames one by one.
8. A motion picture playback apparatus, comprising:
the request interception module is used for intercepting a target network request;
the data caching module is used for analyzing the target network request to acquire moving picture data for caching;
The decapsulation module is used for forming a picture data packet corresponding to each frame of picture based on the moving picture data and storing the picture data packet in a data packet queue;
A data decoding module for reading the picture data packet in the data packet queue to decode to obtain the picture frame data corresponding to each frame picture, and
And the moving picture forming module is used for loading the picture frame data into a target rendering tool to form moving picture frames.
9. An electronic device, comprising:
Processor, and
A memory having stored thereon executable code for use in a playback of a moving picture, which when executed by the processor causes the processor to perform the method of any of claims 1-7.
10. A non-transitory machine-readable storage medium having stored thereon executable code for use in a playback of a moving picture, which when executed by a processor of an electronic device, causes the processor to perform the method of any of claims 1-7.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202410585440.1A CN120935399A (en) | 2024-05-11 | 2024-05-11 | Method and device for playing moving pictures, electronic equipment and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202410585440.1A CN120935399A (en) | 2024-05-11 | 2024-05-11 | Method and device for playing moving pictures, electronic equipment and storage medium |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN120935399A true CN120935399A (en) | 2025-11-11 |
Family
ID=97580896
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202410585440.1A Pending CN120935399A (en) | 2024-05-11 | 2024-05-11 | Method and device for playing moving pictures, electronic equipment and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN120935399A (en) |
-
2024
- 2024-05-11 CN CN202410585440.1A patent/CN120935399A/en active Pending
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN111277869B (en) | Video playing method, device, equipment and storage medium | |
| US10645405B2 (en) | Script-based video rendering | |
| CN109840879B (en) | Image rendering method and device, computer storage medium and terminal | |
| CN110784750B (en) | Video playing method and device and computer equipment | |
| US10791160B2 (en) | Method and apparatus for cloud streaming service | |
| CN111669645B (en) | Video playing method and device, electronic equipment and storage medium | |
| US10419798B2 (en) | Method and apparatus for just-in-time transcoding | |
| US8706803B1 (en) | Client-side generation of preliminary version of network page | |
| WO2021233123A1 (en) | Video processing method and apparatus, and computer device and storage medium | |
| US12210558B2 (en) | Multimedia file storage and access method | |
| US20220256226A1 (en) | Video data processing method, electronic device and computer-readable medium | |
| CN115460183A (en) | Browser-based streaming media data playback method, device and related equipment | |
| CN114040245A (en) | Video playing method and device, computer storage medium and electronic equipment | |
| CN111356023B (en) | Playing mode determining method and device | |
| CN120935399A (en) | Method and device for playing moving pictures, electronic equipment and storage medium | |
| CN111447490A (en) | Streaming media file processing method and device | |
| CN114979719B (en) | Video playing method, device, medium and electronic equipment | |
| CN119402708A (en) | Video file transmission method, device, equipment and readable storage medium | |
| US10938939B2 (en) | Client-side quality-of-service (QOS) for viewing of adaptive bitrate (ABR) streams | |
| HK40023559A (en) | Video playback method and apparatus, device and storage medium | |
| HK40023559B (en) | Video playback method and apparatus, device and storage medium | |
| CN117241091A (en) | Method, apparatus and computer readable medium for processing image decoding data | |
| CN119402706A (en) | Video processing method, device, electronic device, storage medium and program product | |
| CN119232977A (en) | Method, apparatus, medium and program product for performing frame-filling processing | |
| CN115955592A (en) | Bar screen content management system |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination |