Video file processing method and device, electronic equipment and medium
By employing a multi-level coding strategy to encode video data into base and enhancement layer files, the problem of high storage and transmission requirements for high-definition video is solved, achieving efficient storage and flexible video playback adaptation.
Patent Information
- Application Number
- CN202511734491.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-24
- Publication Date
- 2026-03-24
AI Technical Summary
In existing technologies, storing and transmitting high-definition video files requires multiple copies of the video file, resulting in high demands for storage space and transmission bandwidth, which affects the user's real-time playback experience.
A multi-level encoding strategy is adopted to encode video data into basic layer and enhancement layer video files. The basic layer provides basic data, the enhancement layer provides image quality enhancement data, and the target layer video file is dynamically provided according to network bandwidth and user needs.
It reduces video file storage redundancy, improves storage efficiency, enables video decoding adaptation for different needs, and enhances the playback experience.
Smart Images

Figure CN121728284A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a video file processing method, apparatus, electronic device, and medium. Background Technology
[0002] With the development of internet technology, the widespread adoption of high-definition and online videos has led to a surge in demand for video downloads. However, high-resolution and high-quality video files require significant storage space and high transmission bandwidth. Currently, video file storage typically employs video compression encoding technology to reduce redundancy and minimize storage space. Video files are often stored according to resolution; for example, for the same video, there might be a 720P file, a 1080P file, and a higher resolution file. This storage method requires multiple video files, each retaining the complete audio and video stream encoding and decoding structure, resulting in significant redundancy among the files. Playing the video requires decompressing the entire file, and decompressing high-resolution video files takes a considerable amount of time, impacting the user's real-time playback experience. Summary of the Invention
[0003] To solve the above-mentioned technical problems, or at least partially solve the above-mentioned technical problems, embodiments of the present invention provide a video file processing method, apparatus, electronic device, and medium.
[0004] In a first aspect, embodiments of the present invention provide a video file processing method, applied to a video encoding end, the method comprising: The video data is encoded into a multi-layer video file by performing multi-level encoding. The multi-layer video file includes a base layer video file and at least one enhancement layer video file. The video resolution of the base layer video file is lower than that of the enhancement layer video file, and the video resolutions of each enhancement layer video file are different. The base layer video file includes basic data required for playing the video, and the enhancement layer video file includes dedicated incremental data required for image quality enhancement. The multi-layer video files are stored according to their hierarchical structure. In response to receiving a video download request from at least one video decoding terminal, a target layer video file corresponding to each of the video decoding terminals is determined from the multi-layer video files, and the target layer video file is output to the video decoding terminal, wherein the target layer video file includes at least one file from the multi-layer video files.
[0005] Optionally, determining the target layer video file corresponding to each of the video decoding ends from the multi-layer video files includes: For each video decoding end, the target video resolution corresponding to the video decoding end is determined based on the current network bandwidth between the video decoding end and the video encoding end, and the target layer video file corresponding to the video decoding end is determined based on the target video resolution.
[0006] Optionally, determining the target layer video file corresponding to each of the video decoding ends from the multi-layer video files includes: For each video decoding end, the video resolution indicated by the video download request from the video decoding end is taken as the target video resolution corresponding to the video decoding end, and the target layer video file corresponding to the video decoding end is determined according to the target video resolution.
[0007] Optionally, determining the target layer video file corresponding to each of the video decoding ends from the multi-layer video files includes: For each video decoding end, determine the video preference information corresponding to the video decoding end, determine the target video resolution corresponding to the video decoding end based on the video preference information, and determine the target layer video file corresponding to the video decoding end based on the target video resolution.
[0008] Optionally, the video preference information includes one or more of the following: historical target video resolution, device performance information of the video decoding terminal, and registration information of the video decoding terminal.
[0009] Optionally, determining the target layer video file corresponding to the video decoding end based on the target video resolution includes: When the target video resolution is determined to be a first resolution, the target layer video file corresponding to the first resolution includes the base layer video file; When the target video resolution is determined to be a second resolution, the target layer video file corresponding to the second resolution includes the base layer video file and the enhancement layer video file that matches the second resolution; the second resolution is higher than the first resolution.
[0010] Optionally, determining the target video resolution corresponding to the video decoding end based on the current network bandwidth between the video decoding end and the video encoding end includes: The video resolution corresponding to the current network bandwidth range of the video decoding end and the video encoding end is taken as the target video resolution corresponding to the video decoding end.
[0011] Secondly, embodiments of this application provide a video file processing apparatus applied at a video encoding end, the apparatus comprising: An encoding module is used to perform multi-level encoding processing on video data to encode the video data into multi-level video files. The multi-level video files include a base layer video file and at least one enhancement layer video file. The video resolution corresponding to the base layer video file is lower than the video resolution corresponding to the enhancement layer video file, and the video resolution corresponding to each enhancement layer video file is different. The base layer video file includes basic data required for playing the video, and the enhancement layer video file includes dedicated incremental data required for image quality enhancement. A storage module is used to store the multi-layer video files according to their hierarchical structure. The identification module is configured to, in response to receiving a video download request from at least one video decoding terminal, determine the target layer video file corresponding to each of the video decoding terminals from the multi-layer video files, and output the target layer video file to the video decoding terminal, wherein the target layer video file includes at least one file from the multi-layer video files.
[0012] Optionally, the identification module is further configured to: for each video decoding end, determine the target video resolution corresponding to the video decoding end based on the current network bandwidth between the video decoding end and the video encoding end, and determine the target layer video file corresponding to the video decoding end based on the target video resolution.
[0013] Optionally, the identification module is further configured to: for each video decoding end, take the video resolution indicated by the video download request from the video decoding end as the target video resolution corresponding to the video decoding end, and determine the target layer video file corresponding to the video decoding end based on the target video resolution.
[0014] Optionally, the identification module is further configured to: for each video decoding end, determine the video preference information corresponding to the video decoding end, determine the target video resolution corresponding to the video decoding end based on the video preference information, and determine the target layer video file corresponding to the video decoding end based on the target video resolution.
[0015] Optionally, the video preference information includes one or more of the following: historical target video resolution, device performance information of the video decoding terminal, and registration information of the video decoding terminal.
[0016] Optionally, the recognition module is further configured to: when the target video resolution is determined to be a first resolution, the target layer video file corresponding to the first resolution includes the base layer video file; when the target video resolution is determined to be a second resolution, the target layer video file corresponding to the second resolution includes the base layer video file and an enhancement layer video file that matches the second resolution; the second resolution is higher than the first resolution.
[0017] Optionally, the identification module is further configured to: take the video resolution corresponding to the current network bandwidth interval of the video decoding end and the video encoding end as the target video resolution corresponding to the video decoding end.
[0018] Thirdly, embodiments of the present invention provide an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; the memory is used to store computer programs; and the processor is used to implement the video file processing method of any embodiment of the present invention when executing the program stored in the memory.
[0019] Fourthly, embodiments of the present invention provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the video file processing method of any embodiment of the present invention.
[0020] The technical solutions provided by the embodiments of the present invention bring at least the following beneficial effects: The video file processing method provided in this embodiment of the invention performs multi-level encoding processing on video data according to a functional layered encoding strategy to encode the video data into multi-level video files. The multi-level video files include a base layer video file and an enhancement layer video file. The video resolution corresponding to the base layer video file is lower than the video resolution corresponding to the enhancement layer video file. The base layer video file includes basic data required for playing the video, and the enhancement layer video file includes dedicated incremental data required for image quality enhancement. Upon receiving a video download request from at least one video decoding terminal, for each video decoding terminal, a target layer video file corresponding to the video decoding terminal is determined from the multi-layer video files, and the target layer video file is output to the video decoding terminal. This method encodes video files using a functional layered coding strategy to obtain a base layer video file containing the basic data required for video playback and an enhancement layer video file containing dedicated incremental data required for image quality enhancement. This allows different video files to be provided to video decoding terminals with different needs, achieving one-time encoding for multi-terminal adaptation. Furthermore, compared to prior art methods that obtain multiple video files with different resolutions through multiple encodings, this embodiment only requires storing one base layer video file and one enhancement layer video file, avoiding redundant storage. The storage space required for the base layer video file and the enhancement layer video file is smaller, improving storage efficiency. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below.
[0022] Figure 1 A flowchart illustrating a video file processing method according to an embodiment of the present invention is shown; Figure 2 A flowchart illustrating a video file processing method according to another embodiment of the present invention is shown; Figure 3 A flowchart illustrating a video file processing method according to another embodiment of the present invention is shown; Figure 4 A schematic diagram of the structure of a video file processing apparatus according to an embodiment of the present invention is shown; Figure 5 A schematic diagram of the structure of an electronic device according to an embodiment of the present invention is shown. Detailed Implementation
[0023] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of the present invention, including various details to aid understanding. These details should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0024] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0025] Figure 1 A flowchart illustrating a video file processing method according to an embodiment of the present invention is shown. This method is applied to a server. Figure 1 As shown, the video file processing method includes: Step S101: Perform multi-level encoding processing on the video data to encode the video data into a multi-level video file. The multi-level video file includes a base layer video file and at least one enhancement layer video file. The video resolution corresponding to the base layer video file is lower than that corresponding to the enhancement layer video file, and each enhancement layer video file has a different video resolution. For example, the base layer video file is a low-resolution or low-bitrate version, occupying minimal storage resources but providing basic visuals; for example, the base layer file can display 360P video. The enhancement layer video file is a high-resolution or high-bitrate version, used to present video details and improve video resolution. Optionally, the video resolution of the enhancement layer video file is higher than that of the base layer file. For example, the resolution of the enhancement layer video file is 480P, 720P, or 1080P. The base layer video file includes the basic data required for video playback, and the enhancement layer video file includes dedicated incremental data required for image quality enhancement.
[0026] Optionally, video data can be encoded into multi-level video files using a functional hierarchical coding strategy. Functional hierarchical coding is a hierarchical coding technique typically used to help classify and organize resources such as data, files, images, and any other type of activity. It consists of a series of hierarchical structures, reducing storage overhead by extracting encoding information from identical segments. Each video file contains specific data and files, and the data and files contained in each layer differ, thus helping to reduce the complexity of storing and managing data. The base layer video file corresponds to a lower video resolution than the enhancement layer video file. The base layer video file contains the basic data required for video playback, while the enhancement layer video file contains dedicated incremental data required for image quality enhancement. Functional hierarchical coding performs multi-level encoding of video data along at least one dimension: time, space, or quality. For example, in the time dimension, video frames are divided into different time layers (e.g., T0, T1, T2, T3) using "hierarchical predictive coding," with higher time layer frames relying on lower time layer frames for motion compensation prediction. For example, in the spatial dimension, encoding generates a "multi-resolution hierarchy," with the base layer at the lowest resolution and the enhancement layer at a higher resolution. Enhancement layer frames reuse texture and motion information from base layer frames through "inter-layer prediction," avoiding redundant encoding. In the quality dimension, "layered quantization" divides video quality into a base layer (low quality, such as low bitrate and high compression ratio) and an enhancement layer (high quality, such as high bitrate and low compression ratio). Optionally, the multi-layered video file obtained after functional layered encoding can include a low-resolution or low-bitrate version of the base layer video file and a high-resolution or high-bitrate version of the enhancement layer video file. The low-resolution or low-bitrate version of the base layer video file is used to present the basic image of the video. The high-resolution or high-bitrate version of the enhancement layer video file is used to present video details, resulting in a high-definition video image. For example, a low-resolution or low-bitrate version of the base layer video file occupies minimal storage resources but provides a basic image; for example, a base layer file can present a 360P video image. A high-resolution or high-bitrate version of the enhancement layer video file is used to present video details and improve video resolution. Optionally, the video resolution of the enhancement layer video file may be higher than that of the base layer file. For example, the enhancement layer video file may have a resolution of 480P, 720P, or 1080P, while the base layer video file has a resolution of 360P. As an alternative example, the layered coding strategy could be Scalable Video Coding (SVC). SVC is a type of video coding that encodes the video signal in layers. When bandwidth is insufficient, only the base layer bitstream is transmitted and decoded, resulting in low-quality decoded video. As bandwidth increases, the enhancement layer bitstream can be transmitted and decoded to improve the video decoding quality.
[0027] In an optional embodiment, the method first segments the video data to divide it into multiple video sub-data, and then performs functional hierarchical encoding on the video sub-data in parallel to improve encoding efficiency.
[0028] Step S102: Store the multi-layer video file according to its structural hierarchy.
[0029] For example, a multi-layer video file may consist of M layers (M being a positive integer greater than or equal to 2). The M layers of the video file are stored according to their hierarchical order. For instance, if the video resolution of the M-layer video files is from low to high, then the multi-layer video files are stored in order of increasing video resolution.
[0030] Step S103: In response to receiving a video download request from at least one video decoding end, determine the target layer video file corresponding to each video decoding end from the multi-layer video files, and output the target layer video file to the video decoding end. The target layer video file includes at least one file from the multi-layer video files. For example, the target layer video file includes a base layer file. Alternatively, the target layer video file includes a base layer file and at least one enhancement layer file.
[0031] Optionally, upon receiving a video download request from the video decoder, the target layer video file can be determined by specifying rules such as the agreement information between the video decoder and the video encoder, network bandwidth, or video preference information. Alternatively, the target layer video file can be determined based on the video download request, such as the video resolution it indicates.
[0032] The video file processing method provided in this embodiment of the invention performs multi-level encoding processing on video data according to a functional layered encoding strategy to encode the video data into multi-level video files. The multi-level video files include a base layer video file and an enhancement layer video file. The video resolution corresponding to the base layer video file is lower than the video resolution corresponding to the enhancement layer video file. The base layer video file includes basic data required for playing the video, and the enhancement layer video file includes dedicated incremental data required for image quality enhancement. Upon receiving a video download request from at least one video decoding terminal, for each video decoding terminal, a target layer video file corresponding to the video decoding terminal is determined from the multi-layer video files, and the target layer video file is output to the video decoding terminal. This method encodes video files using a functional layered coding strategy to obtain a base layer video file containing the basic data required for video playback and an enhancement layer video file containing dedicated incremental data required for image quality enhancement. This allows different video files to be provided to video decoding terminals with different needs, achieving one-time encoding for multi-terminal adaptation. Furthermore, compared to prior art methods that obtain multiple video files with different resolutions through multiple encodings, this embodiment only requires storing one base layer video file and one enhancement layer video file, avoiding redundant storage. The storage space required for the base layer video file and the enhancement layer video file is smaller, improving storage efficiency.
[0033] In an optional embodiment, upon receiving a video download request from the video decoding end, the target video resolution corresponding to the video decoding end can be determined based on the current network bandwidth between the video decoding end and the video encoding end. Based on the target video resolution, the target layer video file corresponding to the video decoding end can be determined. For example, the video resolution corresponding to the interval of the current network bandwidth between the video decoding end and the video encoding end can be used as the target video resolution corresponding to the video decoding end. For example, if the current network bandwidth between the video decoding end and the video encoding end belongs to a first interval, the target video resolution corresponding to the current network bandwidth is the first resolution, and the target layer video file corresponding to the first resolution includes the base layer video file. If the current network bandwidth between the video decoding end and the video encoding end belongs to a second interval, the target video resolution corresponding to the current network bandwidth is the second resolution, and the target layer video file corresponding to the second resolution includes the base layer video file and the enhancement layer video file matching the second resolution. The second resolution is higher than the first resolution.
[0034] For example, the first interval is [0M, 100M), the second interval is [100M, 300M), the third interval is [300M, 500M), and the fourth interval is [500M, ∞). The network bandwidth belonging to the first interval corresponds to a video resolution of 360P, the network bandwidth belonging to the second interval corresponds to a video resolution of 480P, the network bandwidth belonging to the third interval corresponds to a video resolution of 720P, and the network bandwidth belonging to the fourth interval corresponds to a video resolution of 1080P. Upon receiving a video download request from video decoding end A, the current network bandwidth between video decoding end A and video encoding end is 600M. The target layer video file corresponding to video decoding end A includes an enhancement layer video file and a base layer video file corresponding to a video resolution of 1080P. Upon receiving a video download request from video decoding end B, the current network bandwidth between video decoding end B and video encoding end is 80M. The target layer video file corresponding to video decoding end B is a base layer video file.
[0035] In an optional embodiment, the target layer video file can be determined based on the video download request from the video decoder. For example, the video resolution indicated by the video download request from the video decoder can be used as the target video resolution corresponding to the video decoder, and the target layer video file corresponding to the video decoder can be determined based on the target video resolution. For example, if the video resolution indicated by the video download request is 1080P, then the target layer video file includes a base layer video file and an enhancement layer video file. If the video resolution indicated by the video download request is 360P, then the target layer video file includes a base layer video file.
[0036] In an optional embodiment, the preferred video resolution of the video decoder can be determined based on the video preference information of the video decoder, such as historical target video resolution, device performance information of the video decoder (such as processor performance information, storage performance information), or registration information of the video decoder (such as identification information of the video decoder, membership information such as membership level, etc.). The preferred video resolution of the video decoder is then used as the target video resolution, thereby determining the target layer video file corresponding to the target video resolution.
[0037] The video file processing method of this invention encodes video files using a functional layered encoding strategy to obtain multi-layered video files containing different information. This eliminates the need for multiple encodings, allowing for one-time encoding and multi-terminal adaptation, and avoids generating video files for terminals with different network bandwidths. Storing this multi-layered video file avoids redundant storage and improves storage efficiency.
[0038] Figure 2 A flowchart illustrating another embodiment of the video file processing method of the present invention is shown. This method is applied at the video decoding end. Figure 2 As shown, the video file processing method includes: Step S201: Send a video download request to the video encoding end, the video download request being used to instruct the download of video data. The video data includes at least one layer of a multi-layer video file encoded based on a layered encoding strategy. For example, send a video download request to the server, the video download request instructing the download of video 1 to be downloaded, and the resolution of video 1 to be downloaded can be, for example, one of 360P, 480P, 720P, or 1080P.
[0039] Step S202: Receive the target layer video file from the video encoding end, wherein the target layer video file is determined by the video encoding end from the multi-layer video file based on the current network bandwidth between the video encoding end and the video decoding end.
[0040] For example, video decoder A sends a video download request to video encoder A, and the current network bandwidth between video decoder A and video encoder A is 500 Mbps. Video decoder B sends a video download request to video encoder B, and the current network bandwidth between video decoder B and video encoder B is 80 Mbps. When video encoder B receives the video download request from video decoder A, and the current network bandwidth between video decoder A and video encoder A is 500 Mbps, the target layer video file sent by video encoder B to video decoder A includes an enhancement layer video file and a base layer video file corresponding to a 1080P video resolution. When video encoder B receives the video download request from video decoder B, and the current network bandwidth between video decoder B and video encoder B is 80 Mbps, the target layer video file sent by video encoder B to video decoder A is a base layer video file.
[0041] Figure 3 A flowchart illustrating another embodiment of the video file processing method of the present invention is shown. Figure 3 As shown, the method includes: Step S301: Send a video download request to the video encoding end. The video download request is used to indicate the download of video data.
[0042] Step S302: Receive the target layer video file from the video encoding end. The target layer video file is determined by the video encoding end from the multi-layer video file based on the current network bandwidth between the video encoding end and the video decoding end.
[0043] Step S303: Load the target layer video file into the buffer pool. The buffer pool includes a current playback area and a forward buffer. The current playback area caches multiple video frames currently playing in the video file. The forward buffer caches multiple video frames following the currently playing video frames. The forward buffer is used to preload content to be played, improving smoothness.
[0044] Step S304: Determine whether multiple video frames following the currently playing video frame in the target layer video file are located in the forward roll buffer.
[0045] Step S305: If multiple video frames following the currently playing video frame are not in the forward buffer, load the multiple video frames following the currently playing video frame into the forward buffer for decoding.
[0046] Steps S301-S302 can be referred to Figure 2 The embodiments shown are not described in detail here to avoid repetition.
[0047] Upon receiving a video download request, the server determines the third video resolution corresponding to the request. The video resolution is the resolution of the video to be downloaded, as indicated by the download request. Optionally, the download request carries identification information indicating the resolution of the video to be downloaded, and the third video resolution corresponding to the request is determined based on this identification information. If the third video resolution is the same as the first video resolution, a base layer video file is output. If the third video resolution is the same as the second video resolution, a base layer video file and an enhancement layer video file matching the second resolution are output. For example, if the first video resolution is 1080P and the second video resolution is 480P, and the third video resolution is 480P, then the base layer video file is output directly. If the third video resolution is 1080P, then both a base layer video file and an enhancement layer video file need to be output. The base layer video file is used to present the basic image of the video, and the enhancement layer video file is used to present the details of the image based on the basic image.
[0048] Figure 4 A schematic diagram of a video file processing apparatus according to an embodiment of this application is shown. Figure 4 As shown, the video file processing device 400 includes: Encoding module 401 is used to perform multi-level encoding processing on video data to encode the video data into multi-level video files. The multi-level video files include a base layer video file and at least one enhancement layer video file. The video resolution corresponding to the base layer video file is lower than the video resolution corresponding to the enhancement layer video file, and the video resolution corresponding to each enhancement layer video file is different. The base layer video file includes basic data required for playing the video, and the enhancement layer video file includes dedicated incremental data required for image quality enhancement. Storage module 402 is used to store the multi-layer video file according to the structural hierarchy of the multi-layer video file; The identification module 403 is configured to, in response to receiving a video download request from at least one video decoding terminal, determine the target layer video file corresponding to each of the video decoding terminals from the multi-layer video files, and output the target layer video file to the video decoding terminal, wherein the target layer video file includes at least one file in the multi-layer video files.
[0049] Optionally, the identification module is further configured to: for each video decoding end, determine the target video resolution corresponding to the video decoding end based on the current network bandwidth between the video decoding end and the video encoding end, and determine the target layer video file corresponding to the video decoding end based on the target video resolution.
[0050] Optionally, the identification module is further configured to: for each video decoding end, take the video resolution indicated by the video download request from the video decoding end as the target video resolution corresponding to the video decoding end, and determine the target layer video file corresponding to the video decoding end based on the target video resolution.
[0051] Optionally, the identification module is further configured to: for each video decoding end, determine the video preference information corresponding to the video decoding end, determine the target video resolution corresponding to the video decoding end based on the video preference information, and determine the target layer video file corresponding to the video decoding end based on the target video resolution.
[0052] Optionally, the video preference information includes one or more of the following: historical target video resolution, device performance information of the video decoding terminal, and registration information of the video decoding terminal.
[0053] Optionally, the recognition module is further configured to: when the target video resolution is determined to be a first resolution, the target layer video file corresponding to the first resolution includes the base layer video file; when the target video resolution is determined to be a second resolution, the target layer video file corresponding to the second resolution includes the base layer video file and an enhancement layer video file that matches the second resolution; the second resolution is higher than the first resolution.
[0054] Optionally, the identification module is further configured to: take the video resolution corresponding to the current network bandwidth interval of the video decoding end and the video encoding end as the target video resolution corresponding to the video decoding end.
[0055] The above-described apparatus can execute the method provided in the embodiments of the present invention, and has the corresponding functional modules and beneficial effects for executing the method. Technical details not described in detail in this embodiment can be found in [reference needed]. Figure 2 or Figure 3 The video file processing method shown.
[0056] Figure 5 A schematic diagram of the structure of an electronic device according to an embodiment of the present invention is shown. Figure 5 As shown, the electronic device includes: The system includes a processor 501, a communication interface 502, a memory 503, and a communication bus 504. The processor 501, communication interface 502, and memory 503 communicate with each other via the communication bus 504. Memory 503 is used to store computer programs; The processor 501 is used to execute the program stored in the memory 503 to implement the video file processing method provided in the embodiments of the present invention.
[0057] The communication bus mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0058] The communication interface is used for communication between the aforementioned terminal and other devices.
[0059] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0060] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0061] In another embodiment of the present invention, a computer-readable storage medium is also provided, which stores instructions that, when executed on a computer, cause the computer to perform any of the video file processing methods described in the above embodiments.
[0062] In another embodiment of the present invention, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to perform any of the video file processing methods described in the above embodiments.
[0063] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).
[0064] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0065] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0066] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of protection of the present invention.
Claims
1. A method of processing a video file, characterized by, The method is applied to a video encoding end, and comprises the following steps: performing multi-level encoding processing on video data to encode the video data into a multi-level video file, wherein the multi-level video file comprises a base layer video file and at least one enhancement layer video file, the base layer video file corresponds to a video resolution lower than that of the enhancement layer video file, and each of the enhancement layer video files corresponds to a different video resolution; the base layer video file comprises base data required for playing a video, and the enhancement layer video file comprises exclusive incremental data required for quality enhancement; storing the multi-level video file according to a structural hierarchy of the multi-level video file; in response to receiving a video download request from at least one video decoding end, determining a target layer video file corresponding to each of the video decoding ends from the multi-level video file, and outputting the target layer video file to the video decoding end, wherein the target layer video file comprises at least one file in the multi-level video file.
2. The method of claim 1, wherein, The method for determining the target layer video file corresponding to each of the video decoding ends from the multi-level video file comprises the following steps: for each video decoding end, determining a target video resolution corresponding to the video decoding end according to a current network bandwidth between the video decoding end and the video encoding end, and determining a target layer video file corresponding to the video decoding end according to the target video resolution.
3. The method of claim 1, wherein, The method for determining the target layer video file corresponding to each of the video decoding ends from the multi-level video file comprises the following steps: for each video decoding end, taking a video resolution indicated by a video download request from the video decoding end as a target video resolution corresponding to the video decoding end, and determining a target layer video file corresponding to the video decoding end according to the target video resolution.
4. The method of claim 1, wherein, The method for determining the target layer video file corresponding to each of the video decoding ends from the multi-level video file comprises the following steps: for each video decoding end, determining video preference information corresponding to the video decoding end, determining a target video resolution corresponding to the video decoding end according to the video preference information, and determining a target layer video file corresponding to the video decoding end according to the target video resolution.
5. The method of claim 4, wherein, The video preference information comprises one or more of the following: a historical target video resolution, device performance information of the video decoding end, and registration information of the video decoding end.
6. The method according to any one of claims 2-4, characterized in that, The method for determining the target layer video file corresponding to each of the video decoding ends from the multi-level video file comprises the following steps: in a case where the target video resolution is determined to be a first resolution, a target layer video file corresponding to the first resolution comprises the base layer video file; in a case where the target video resolution is determined to be a second resolution, a target layer video file corresponding to the second resolution comprises the base layer video file and an enhancement layer video file matching the second resolution; the second resolution is higher than the first resolution.
7. The method of claim 6, wherein, The method for determining the target video resolution corresponding to the video decoding end according to the current network bandwidth between the video decoding end and the video encoding end comprises the following steps: The video decoding end corresponds to a target video resolution according to a corresponding interval of the current network bandwidth of the video encoding end.
8. An apparatus for processing a video file, the apparatus comprising: The device is applied to a video encoding end, and comprises: An encoding module, configured to perform multi-level encoding processing on video data to encode the video data into a multi-layer video file, wherein the multi-layer video file comprises a base layer video file and at least one enhancement layer video file, the base layer video file corresponds to a video resolution lower than that of the enhancement layer video file, and each of the enhancement layer video files corresponds to a different video resolution; the base layer video file comprises base data required for playing a video, and the enhancement layer video file comprises exclusive incremental data required for quality enhancement; A storage module, configured to store the multi-layer video file according to a structural hierarchy of the multi-layer video file; An identification module, configured to determine, in response to receiving a video download request from at least one video decoding end, a target layer video file corresponding to each video decoding end from the multi-layer video file, and output the target layer video file to the video decoding end, wherein the target layer video file comprises at least one file in the multi-layer video file.
9. An electronic device, comprising: The device comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; The memory is configured to store a computer program; The processor is configured to execute the program stored in the memory to implement the method in any one of claims 1-7.
10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The program is executed by the processor to implement the method in any one of claims 1-7.
