Video processing method and device and readable storage medium
By dividing high-definition videos into Tiles and merging them into DASH segments, the server transmits corresponding data according to the Tile information requested by the client, solving the problem of out-of-sync transmission of multiple video streams and improving the synchronization and network efficiency of video transmission.
Patent Information
- Application Number
- CN202410867403.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2024-09-10
Smart Images

Figure CN118632046A
Abstract
Description
Technical Field
[0001] The present application relates to the field of video processing technology, and in particular to a video processing method, device and readable storage medium. Background Art
[0002] In the existing panoramic video field of view (FOV) adaptive solution, the video transmission adopts the form of multiple high-definition and low-definition concurrent requests, and the number of concurrent requests is N+M+1 streams, where N is the number of tiles in the FOV, M is the number of tiles predicted by the view, and 1 is the number of low-definition video streams. In this way, the client will request nearly 20 streams at the same time.
[0003] Requesting many streams at the same time may cause the data transmission of multiple video streams to be asynchronous. Summary of the invention
[0004] The embodiments of the present application provide a video processing method, device, and readable storage medium to improve the synchronization of video transmission.
[0005] In a first aspect, an embodiment of the present application provides a video processing method, which is applied to a first device, including:
[0006] Divide the high-definition video to be transmitted into multiple tiles;
[0007] Based on the multiple tiles, multiple dynamic adaptive streaming over HTTP (DASH) segments are obtained;
[0008] Merge based on multiple DASH segments to obtain a first target media file.
[0009] In a second aspect, the embodiment of the present application further provides a video processing method, which is applied to a server, comprising:
[0010] Receiving a first request sent by a terminal, wherein the first request includes information of a target Tile;
[0011] According to the first request, obtaining a second target media file corresponding to the target Tile from a first target media file, wherein the first target media file is obtained by merging a plurality of DASH segments obtained based on a high-definition video to be transmitted by the first device;
[0012] Sending the second target media file to the terminal.
[0013] In a third aspect, an embodiment of the present application further provides a video processing apparatus, applied to a first device, comprising:
[0014] A first processing module, used for dividing the high-definition video to be transmitted into a plurality of tiles;
[0015] A second processing module is used to obtain a plurality of dynamic adaptive multimedia stream DASH segments based on the hypertext transfer protocol HTTP based on the plurality of tiles;
[0016] A third processing module, configured to merge the multiple DASH segments to obtain a first target media file;
[0017] The first transmission module is used to transmit the first target multimedia file.
[0018] In a fourth aspect, an embodiment of the present application further provides a video processing device, applied to a server, comprising:
[0019] A first receiving module, configured to receive a first request sent by a terminal, wherein the first request includes information of a target Tile;
[0020] A first processing module, configured to obtain, according to the first request, a second target media file corresponding to the target Tile from a first target media file, wherein the first target media file is obtained by merging a plurality of DASH segments obtained based on a high-definition video to be transmitted by a first device;
[0021] The first sending module is configured to send the second target media file to the terminal.
[0022] In a fifth aspect, an embodiment of the present application further provides a communication device, comprising: a memory, a processor, and a program stored in the memory and executable on the processor, wherein the processor implements the steps in the video processing method described above when executing the program.
[0023] In a sixth aspect, an embodiment of the present application further provides a readable storage medium, on which a program is stored, and when the program is executed by a processor, the steps in the video processing method as described above are implemented.
[0024] In the embodiment of the present application, the high-definition video to be transmitted is divided into multiple tiles, multiple DASH segments are obtained based on the multiple tiles, and the multiple DASH segments are merged to obtain the first target media file. Therefore, when the server receives the request from the client, it can simultaneously transmit multiple groups of data to the terminal based on the target tile requested by the client, thereby improving the synchronization of video transmission. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 It is one of the flow charts of the video processing method provided in the embodiment of the present application;
[0026] Figure 2 Schematic diagram of the division of Tiles in an embodiment of the present application;
[0027] Figure 3 is a schematic diagram of DASH segmentation in the prior art;
[0028] Figure 4 is a schematic diagram of a first target media file in an embodiment of the present application;
[0029] Figure 5 is a schematic diagram of each Box in the first target media file in an embodiment of the present application;
[0030] Figure 6 This is the second flowchart of the video processing method provided in the embodiment of the present application;
[0031] Figure 7 is one of the structural diagrams of the video processing device provided in the embodiment of the present application;
[0032] Figure 8 This is the second structural diagram of the video processing device provided in the embodiment of the present application;
[0033] Fig. 9 This is the third structural diagram of the video processing device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0034] In the embodiments of the present application, the term "and / or" describes the association relationship of the associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.
[0035] In the embodiments of the present application, the term "plurality" refers to two or more than two, and other quantifiers are similar.
[0036] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0037] See also Figure 1 , Figure 1 is a flowchart of a video processing method provided in an embodiment of the present application, which is applied to a first device, such as a device arranged at a front end, such as Figure 1 As shown, the following steps are included:
[0038] Step 101: Divide the high-definition video to be transmitted into multiple tiles.
[0039] In the embodiment of the present application, the rule for dividing the high-definition video to be transmitted into multiple tiles can be any rule. For example, assuming that the resolution of the high-quality video source is 7680*3840, the rule for dividing tiles is 12*8, and the size of each tile is 640*480, then the divided tiles can be as follows: Figure 2 As shown. Figure 2 In the figure, the area indicated by 21 is the area within the viewing angle (40, 41, 52, 53), the area indicated by 22 is the preload area (27, 28, 29, 30, 39, 42, 51, 54, 63, 64, 65, 66), and the area indicated by 23 is the area that does not need to be downloaded ( Figure 2 According to the solution of the prior art, the number of concurrent requests for high-definition slices is 16 (4+12).
[0040] Step 102: Based on the multiple tiles, multiple DASH segments are obtained.
[0041] Here, the existing technology is used to divide the obtained multiple tiles to obtain multiple DASH segments. For example, the DASH segmentation process may include:
[0042] Video encoding and segmentation: First, the original video is encoded into different quality levels, such as HD, SD, etc. Then, the video of each quality level is divided into multiple small segments. Segment index: In order to select the best quality level and segment suitable for the current network conditions of the terminal, a segment index file is generated. The index file contains the URL (Uniform Resource Locator) address of each quality level and segment.
[0043] Step 103: Merge based on multiple DASH segments to obtain a first target media file.
[0044] Specifically, in this step, the m4s files of the DASH segments are merged into an mp4 file, and the first target media file is obtained by using the mp4 file.
[0045] Each DASH segment is merged to form a new media segment, that is, the first target media file. Figure 3 As shown in FIG. 1 , each DASH segment (or dash time) contains 12*8 m4s files. Here, the 12*8 m4s files are merged into one mp4 file. The first target media file after the merger is as follows: Figure 4shown.
[0046] Among them, each DASH segmented m4s file has four box information, namely ftyp (File Type Box, file type container), sidx (Segment Index Box, segment index container), moof (Media Overlap FragmentBox, media overlay fragment container), and mdat (Media Data Box, media data container).
[0047] Specifically, when forming the mp4 file, the moof and mdat in the m4s file are combined into a segment (segment), and then the mp4 file is obtained according to the segment, the ftyp and sidx in the m4s file. Optionally, when forming the mp4 file, the segments can also be sorted according to the identifiers of the tiles corresponding to the segments (wherein the tiles are one or more of a plurality of tiles), and the sorted segments, the file type container ftyp and the fragment index container sidx in the m4s file are used to obtain the mp4 file. Sorting the segments can facilitate subsequent receiving and processing. Figure 5 The figure shows a schematic diagram of each box in the mp4 file formed in the above manner.
[0048] On the basis of the above embodiment, in order to facilitate the management of each segment, the information of the segment is stored in the sidx, wherein the information of the segment includes one or more of the following:
[0049] Segment size, segment duration, segment type, and flag.
[0050] Among them, as shown in Table 1, the meanings of the relevant fields in sidx are:
[0051] Table 1
[0052]
[0053] Step 104: Transmit the first target multimedia file.
[0054] The obtained first target media file may be transmitted to a CDN (Content Delivery Network) for acquisition by other devices.
[0055] In an embodiment of the present application, the high-definition video to be transmitted is divided into multiple tiles, multiple DASH segments are obtained based on the multiple tiles, and the multiple DASH segments are merged to obtain the first target media file. Therefore, when the server receives the request from the client, it can simultaneously transmit multiple groups of data to the terminal based on the target tile requested by the client, thereby improving the synchronization of video transmission. At the same time, since multiple groups of data can be transmitted simultaneously, the number of concurrent requests during transmission is reduced, and the number of video files transmitted is also reduced accordingly, reducing the data integrity risk caused by the network connection and the delay risk caused by the splicing calculation.
[0056] See also Figure 6 , Figure 6 This is a flowchart of video processing provided by an embodiment of the present application, which is applied to the server such as Figure 6 As shown, the following steps are included:
[0057] Step 601: Receive a first request sent by a terminal, wherein the first request includes information of a target Tile.
[0058] The target Tile information may be calculated by the player of the terminal according to the position of the visual area obtained. Of course, the target Tile may also be selected by the user. Figure 2 For example, here, the player needs to obtain the target Tile IDs 27, 28, 29, 30, 39, 40, 41, 42, 51, 52, 53, 54, 63, 64, 65, 66, a total of 16.
[0059] Among them, in the embodiment of the present application, the first request sent by the terminal received by the server is the first request sent by the terminal based on the byte-range request mode. "Byte-range" is used to implement the block transmission and continued transmission functions of the file. Specifically, the terminal can request the server to transmit only a part of the file instead of the entire file by sending a request containing the "byte-range" indicator. In this way, if the file is large, the network bandwidth occupancy can be reduced and the transmission efficiency can be improved by block transmission.
[0060] After obtaining the first media file, the first device may publish it to the CDN, so that other devices such as a server can read the first media file.
[0061] Step 602: According to the first request, obtain a second target media file corresponding to the target Tile from the first target media file, wherein the first target media file is obtained by merging a plurality of DASH segments obtained based on the high-definition video to be transmitted by the first device.
[0062] Here, the server can determine the target segment corresponding to the target Tile in the first target media file according to the information of the target Tile, and the target segment includes the target moof and the target mdat. Then, the server uses the target segment as the first target media file.
[0063] Specifically, when determining the target segment, the target DASH segment corresponding to the target Tile is determined in the first target media file according to the information of the target Tile. Since the division of Tile and the division of DASH segments both follow certain rules, the DASH segment corresponding to each Tile can be determined, for example, by mapping between the two rules. Afterwards, for the target mp4 file in the target DASH segment, the target segment is determined from the target mp4 file according to the offset of the first moof box recorded in the fragment index container sidx in the target mp4 file and the segment information, wherein the target mp4 file is any mp4 file in the target DASH segment.
[0064] Since the sidx field contains the size, duration, and offset data of each segment in the mp4 file, after determining the offset of the first moof box, the position and length of each segment can be calculated through these data, thereby obtaining each segment, that is, the second target media file.
[0065] Step 603: Send the second target media file to the terminal.
[0066] The server locates the corresponding segment based on the calculated position and length, and transmits multiple sets of segment data to the terminal at one time. Figure 2 For example, Tile IDs 27-30, 39-42, 51-54, and 63-66 are four groups of continuous data. The segments corresponding to the four groups of continuous tiles can be directly calculated together, and the segment corresponding to the first id (for example, 27) is used as the starting point. The server locates the corresponding segment based on the calculated position and length, and transmits multiple groups of segment data to the player at one time.
[0067] In an embodiment of the present application, the high-definition video to be transmitted is divided into multiple tiles, multiple DASH segments are obtained based on the multiple tiles, and the multiple DASH segments are merged to obtain the first target media file. Therefore, when the server receives the request from the client, it can simultaneously transmit multiple groups of data to the terminal based on the target tile requested by the client, thereby improving the synchronization of video transmission. At the same time, since multiple groups of data can be transmitted simultaneously, the number of concurrent requests during transmission is reduced, and the number of video files transmitted is also reduced accordingly, reducing the data integrity risk caused by the network connection and the delay risk caused by the splicing calculation.
[0068] In one embodiment of the present application, the following process may be included:
[0069] S1. Divide the high-definition video into tiles to obtain multiple tiles.
[0070] S2. Based on the result of S1, the high-definition video is segmented into DASH-like segments, and the tile segments in the same time period are merged into new media segments. The specific merging method can refer to the description of the above embodiment.
[0071] S3: Transfer new media segments to CDN.
[0072] S4. The player obtains the position of the visible area through the device and calculates the identifier of the required tile.
[0073] S5. The player sends a request to obtain new media to the server through a byte-range request.
[0074] S6. The server locates the corresponding segment according to the calculated position and length, and transmits multiple groups of segment data to the player at one time.
[0075] S7. The player receives data.
[0076] The player can merge and play the acquired segments according to the sequence numbers.
[0077] In an embodiment of the present application, the high-definition tile blocks of the panoramic video are merged into one video file, and the player obtains the content of this video file through a byte-range request, thereby turning multiple concurrency into one request, reducing the data integrity risk caused by the network connection and the delay risk caused by the stitching calculation.
[0078] See also Figure 7 , Figure 7 is a structural diagram of a video processing device provided in an embodiment of the present application, which is applied to a first device. Figure 7As shown, the video processing device includes:
[0079] The first processing module 701 is used to divide the high-definition video to be transmitted into multiple tiles; the second processing module 702 is used to obtain multiple dynamic adaptive multimedia stream DASH segments based on the hypertext transfer protocol HTTP based on the multiple tiles; the third processing module 703 is used to merge the multiple DASH segments to obtain the first target media file; the first transmission module 704 is used to transmit the first target multimedia file.
[0080] Optionally, the third processing module 703 may include:
[0081] A first processing submodule, configured to merge the m4s files of the DASH segments into an mp4 file;
[0082] The second processing submodule is used to obtain the first target media file by using the mp4 file.
[0083] Optionally, the first processing submodule includes:
[0084] The first processing unit is used to combine the media overlay fragment container moof and the media data container mdat in the m4s file into a segment segment;
[0085] The second processing unit is used to obtain the mp4 file according to the segment, the file type container ftyp and the segment index container sidx in the m4s file.
[0086] Optionally, the second processing unit is further used for:
[0087] Sort the segments according to identifiers of Tiles corresponding to the segments, wherein the Tiles are one or more of a plurality of Tiles;
[0088] The mp4 file is obtained by using the sorted segments, the file type container ftyp in the m4s file, and the segment index container sidx.
[0089] Optionally, the device may further include:
[0090] A storage unit, configured to store the information of the segment in the sidx, wherein the information of the segment includes one or more of the following:
[0091] Segment size, segment duration, segment type, and flags.
[0092] The device provided in the embodiment of the present application can execute the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.
[0093] See also Figure 8 , Figure 8 is a structural diagram of a video processing device provided in an embodiment of the present application, which is applied to a server. Figure 8 As shown, the video processing device includes:
[0094] The first receiving module 801 is used to receive a first request sent by a terminal, wherein the first request includes information of a target Tile; the first processing module 802 is used to obtain, according to the first request, a second target media file corresponding to the target Tile from the first target media file, wherein the first target media file is obtained by merging a plurality of DASH segments obtained based on a high-definition video to be transmitted by a first device; and the first sending module 803 is used to send the second target media file to the terminal.
[0095] Optionally, the first processing module 802 includes:
[0096] A first processing submodule, configured to determine a target segment corresponding to the target Tile in the first target media file according to information of the target Tile, wherein the target segment includes a target moof and a target mdat;
[0097] The second processing submodule is configured to use the target segment as the first target media file.
[0098] Optionally, the first processing submodule is further used for:
[0099] Determine, in the first target media file, a target DASH segment corresponding to the target Tile according to the information of the target Tile;
[0100] For the target mp4 file in the target DASH segment, the target segment is determined from the target mp4 file according to the offset of the first moof box recorded in the fragment index container sidx in the target mp4 file and the segment information, wherein the target mp4 file is any mp4 file in the target DASH segment.
[0101] The device provided in the embodiment of the present application can execute the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.
[0102] It should be noted that the division of units in the embodiments of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. In addition, each functional unit in each embodiment of the present application may be integrated into a processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0103] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a processor-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program codes.
[0104] like Fig. 9 As shown, an embodiment of the present application provides a communication device, including: a memory 901, a processor 902, and a program stored in the memory 901 and executable on the processor; the processor 902 is used to read the program in the memory 902 to implement the steps in the video processing method as described above.
[0105] The embodiment of the present application also provides a readable storage medium, on which a program is stored. When the program is executed by the processor, each process of the above-mentioned video processing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. Among them, the readable storage medium can be any available medium or data storage device that can be accessed by the processor, including but not limited to magnetic storage (such as floppy disk, hard disk, magnetic tape, magneto-optical disk (MO), etc.), optical storage (such as CD, DVD, BD, HVD, etc.), and semiconductor storage (such as ROM, EPROM, EEPROM, non-volatile memory (NAND FLASH), solid-state drive (SSD)), etc.
[0106] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0107] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, disk, CD), and includes a number of instructions for a terminal (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0108] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A video processing method, It is characterized in that Applied to a first device, comprising: Divide the HD video to be transmitted into multiple tiles; Based on the multiple tiles, multiple dynamic adaptive multimedia stream DASH segments based on the hypertext transfer protocol HTTP are obtained; Merge based on multiple DASH segments to obtain a first target media file; The first target multimedia file is transmitted.
2. The method according to claim 1, It is characterized in that The step of merging the plurality of DASH segments to obtain a first target media file includes: Merge the m4s files of the DASH segment into an mp4 file; The first target media file is obtained by using the mp4 file.
3. The method according to claim 2, It is characterized in that The step of merging the m4s files of the DASH segments into an mp4 file comprises: Combine the media overlay fragment container moof and the media data container mdat in the m4s file into a segment segment; The mp4 file is obtained according to the segment, the file type container ftyp in the m4s file, and the segment index container sidx.
4. The method according to claim 3, It is characterized in that The step of obtaining the mp4 file according to the segment, the file type container ftyp and the segment index container sidx in the m4s file includes: Sort the segments according to identifiers of Tiles corresponding to the segments, wherein the Tiles are one or more of a plurality of Tiles; The mp4 file is obtained by using the sorted segments, the file type container ftyp in the m4s file, and the segment index container sidx.
5. The method according to claim 3, It is characterized in that The method further comprises: The information of the segment is stored in the sidx, wherein the information of the segment includes one or more of the following: Segment size, segment duration, segment type, and flag.
6. A video processing method, It is characterized in that Applied to the server, including: Receiving a first request sent by a terminal, wherein the first request includes information of a target Tile; According to the first request, obtaining a second target media file corresponding to the target Tile from a first target media file, wherein the first target media file is obtained by merging a plurality of DASH segments obtained based on a high-definition video to be transmitted by the first device; The second target media file is sent to the terminal.
7. The method according to claim 6, It is characterized in that The acquiring, according to the first request, a second target media file corresponding to the target Tile from the first target media file includes: According to the information of the target Tile, determine the target segment corresponding to the target Tile in the first target media file, where the target segment includes a target moof and a target mdat; The target segment is used as the first target media file.
8. The method according to claim 7, It is characterized in that The determining, in the first target media file, a target segment corresponding to the target Tile according to the information of the target Tile includes: Determine, in the first target media file, a target DASH segment corresponding to the target Tile according to the information of the target Tile; For the target mp4 file in the target DASH segment, the target segment is determined from the target mp4 file according to the offset of the first moof box recorded in the fragment index container sidx in the target mp4 file and the segment information, wherein the target mp4 file is any mp4 file in the target DASH segment.
9. A video processing device, It is characterized in that Applied to a first device, comprising: A first processing module, used for dividing the high-definition video to be transmitted into a plurality of tiles; The second processing module is used to obtain multiple dynamic adaptive multimedia stream DASH segments based on the hypertext transfer protocol HTTP based on the multiple tiles; A third processing module, configured to merge the multiple DASH segments to obtain a first target media file; The first transmission module is used to transmit the first target multimedia file.
10. A video processing device, It is characterized in that Applied to the server, including: A first receiving module, configured to receive a first request sent by a terminal, wherein the first request includes information of a target Tile; A first processing module, configured to obtain, according to the first request, a second target media file corresponding to the target Tile from a first target media file, wherein the first target media file is obtained by merging a plurality of DASH segments obtained based on a high-definition video to be transmitted by a first device; The first sending module is configured to send the second target media file to the terminal.
11. A communication device, include: A memory, a processor, and a program stored in the memory and executable on the processor; wherein the processor is used to read the program in the memory to implement the steps in the video processing method as described in any one of claims 1 to 8.
12. A readable storage medium for storing a program, It is characterized in that When the program is executed by a processor, the steps in the video processing method according to any one of claims 1 to 8 are implemented.
