Video file transpackaging method, device, equipment and storage medium
By serializing video files and generating description files, the problem that video storage server needs to store multiple media formats is solved, and the effect of reducing storage space waste and network transmission costs is achieved.
Patent Information
- Application Number
- CN202210233942.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-10
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2042-03-10
AI Technical Summary
Video storage servers need to store video files in multiple media formats, resulting in high storage space and network transmission costs and waste of user storage space.
By acquiring the video file in the first media format and its conversion package setting information, the video file is serialized, and the video file and description file in the second media format are generated. Only the video file in the second media format is stored in the video storage server, and dynamically converted into the media format required by the user during playback according to the description file.
It reduces the storage space waste and network transmission costs of video storage servers, while maintaining the accessibility of video files, and can provide users with video files in different media formats.
Smart Images

Figure CN114640865B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a video file transpackaging method, device, electronic device and non-transitory computer-readable storage medium. Background Art
[0002] The video storage server stores video files for users to download. In actual applications, some users need video files in MP4 format, while others need video files in FLV or HLS format. Among them, MP4 is a multimedia packaging format for audio and video data storage, FLV is a streaming video format, and HLS is an adaptive bit rate streaming media transmission protocol based on HTTP (Hyper Text Transfer Protocol).
[0003] In the related art, video files can be converted into multiple media formats, and the video files in the multiple media formats are stored together in a video storage server for users with different media format requirements to select and directly access and download through a link address.
[0004] When video files of various media formats are stored in a video storage server, storage costs and network transmission costs are high, resulting in multiple usage and waste of storage space for users. Summary of the invention
[0005] The present invention provides a video file transpackaging method, device, electronic device and non-transitory computer-readable storage medium, which are used to solve the problem in the prior art that video storage servers need to store video files in multiple media formats, thereby reducing the waste of storage space of the video storage server.
[0006] The present disclosure provides a method for transpackaging video files, comprising: obtaining a first video file in a first media format and transpackaging setting information of the first video file, wherein the transpackaging setting information is set by a user who uploads the first video file; serializing the first video file according to the transpackaging setting information to obtain a second video file in a second media format and a description file of the second video file, wherein image media data of the second video file is stored in order according to timestamps, the description file includes field information for format conversion, and a third video file in a media format corresponding to the transpackaging setting information can be generated according to the second video file and the description file.
[0007] According to the video file transpackaging method provided by the present disclosure, if a playback user specifies to play a fourth video file in a third media format, and the fourth video file does not exist in the cache in the source station node corresponding to the playback user, the description file is obtained; a list file of the fourth video file is generated according to the description file and sent to the playback user; after accepting the content request of the playback user, the second video file is obtained and converted into a fourth video file in the third media format according to the description file and then sent to the playback user, wherein the content request is generated and sent by the playback user according to the list file.
[0008] According to the video file transpackaging method provided by the present disclosure, after obtaining the second video file in the second media format and the description file of the second video file, the method also includes storing the second video file and the description file to a cloud platform for downloading and use.
[0009] According to the video file transpackaging method provided by the present disclosure, the serialization processing of the first video file according to the transpackaging setting information includes: obtaining at least one target media format according to the transpackaging setting information; determining the box data information of the description file according to the at least one target media format, wherein the box data information includes the arrangement order of the video data corresponding to the at least one target media format.
[0010] According to the video file transpackaging method provided by the present disclosure, the method also includes: if the playback user specifies to play a fifth video file in a fourth media format, and the fifth video file does not exist in the cache in the source station node corresponding to the playback user, then obtaining the description file and the second video file; converting the second video file into a fifth video file in the fourth media format according to the description file and sending the converted file to the playback user.
[0011] According to the video file transpackaging method provided by the present disclosure, before obtaining the description file, the method also includes: determining whether the fourth video file is cached in the source station node corresponding to the playback user; if so, obtaining a list file of the fourth video file and sending it to the playback user; after accepting a content request from the playback user, obtaining the fourth video file and sending it to the playback user, wherein the content request is generated and sent by the playback user according to the list file.
[0012] According to the video file transpackaging method provided by the present disclosure, before obtaining the first video file in the first media format and the transpackaging setting information of the first video file, the method also includes: obtaining the original video file from the cloud platform, the original video file being uploaded to the cloud platform by the uploading user; if the media format of the original video file is not the first media format, converting the original video file into the first video file in the first media format.
[0013] According to a video file transpackaging device provided in the present disclosure, the device includes: a first acquisition unit, used to acquire a first video file in a first media format and transpackaging setting information of the first video file, wherein the transpackaging setting information is set by an uploading user of the first video file; a processing unit, used to serialize the first video file according to the transpackaging setting information to obtain a second video file in a second media format and a description file of the second video file, wherein image media data of the second video file is stored in order according to timestamps, and the description file includes field information for format conversion, and a third video file in a media format corresponding to the transpackaging setting information can be generated according to the second video file and the description file.
[0014] According to the video file transpackaging device provided by the present disclosure, the device also includes: a second acquisition unit, used to acquire the description file when the playback user specifies to play a fourth video file in a third media format and the fourth video file does not exist in the cache in the source station node corresponding to the playback user; a generation unit, used to generate a list file of the fourth video file according to the description file and send it to the playback user; a first conversion unit, used to acquire the second video file after accepting the content request of the playback user, convert the second video file into a fourth video file in the third media format according to the description file, and then send it to the playback user, wherein the content request is generated and sent by the playback user according to the list file.
[0015] According to the video file transpackaging device provided by the present disclosure, after obtaining the second video file in the second media format and the description file of the second video file, the device also includes a storage unit for storing the second video file and the description file to a cloud platform for downloading.
[0016] According to the video file transpackaging device provided by the present disclosure, the processing unit is also used to: obtain at least one target media format according to the transpackaging setting information; determine the box data information of the description file according to the at least one target media format, wherein the box data information includes the arrangement order of the video data corresponding to the at least one target media format.
[0017] According to the video file transpackaging device provided by the present disclosure, the device also includes: a third acquisition unit, used to acquire the description file and the second video file when the playback user specifies to play a fifth video file in a fourth media format and the fifth video file does not exist in the cache in the source station node corresponding to the playback user; a second conversion unit, used to convert the second video file into a fifth video file in the fourth media format according to the description file and then send it to the playback user.
[0018] According to the video file transpackaging device provided by the present disclosure, the device also includes: a judgment unit, used to judge whether the fourth video file is cached in the source station node corresponding to the playback user; the second acquisition unit is also used to obtain the list file of the fourth video file and send it to the playback user when it exists; a sending unit is used to obtain the fourth video file and send it to the playback user after accepting the content request of the playback user, wherein the content request is generated and sent by the playback user according to the list file.
[0019] According to the video file transpackaging device provided by the present disclosure, the device also includes: a fourth acquisition unit, used to obtain the original video file from the cloud platform, and the original video file is uploaded to the cloud platform by the uploading user; a third conversion unit, used to convert the original video file into a first video file in a first media format when the media format of the original video file is not the first media format.
[0020] The present disclosure also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of any of the above-mentioned video file transpackaging methods are implemented.
[0021] The present disclosure also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of any of the above-mentioned video file transpackaging methods are implemented.
[0022] The video file transpackaging method, device, electronic device and non-transitory computer-readable storage medium provided by the present invention serialize the first video file to obtain video files stored in order according to timestamps and a description file providing format conversion field information, so that only video files in the second media format can be stored on the video storage server, and video files in different media formats can be provided to the playback users, thereby reducing the storage space waste of the video storage server and lowering the network transmission cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions in the present disclosure or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0024] Figure 1 It is a flowchart of the video file transpackaging method provided by the present disclosure;
[0025] Figure 2 It is a schematic diagram of the process of uploading a video file provided by the present disclosure;
[0026] Figure 3 It is a schematic diagram of the process of playing the video file provided by the present disclosure;
[0027] Figure 4 It is a structural schematic diagram of a video file transpackaging device provided by the present disclosure;
[0028] Figure 5 It is a schematic diagram of the structure of an electronic device provided by the present disclosure. DETAILED DESCRIPTION
[0029] In order to make the purpose, technical solutions and advantages of the present disclosure clearer, the technical solutions in the present disclosure will be clearly and completely described below in conjunction with the drawings in the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.
[0030] The terms used in one or more embodiments of the present disclosure are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of the present disclosure. The singular forms of "a", "said" and "the" used in one or more embodiments of the present disclosure and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of the present disclosure refers to and includes any or all possible combinations of one or more associated listed items.
[0031] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of the present disclosure, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of the present disclosure, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0032] The exemplary embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
[0033] like Figure 1 The flowchart of the video file transpackaging method of the embodiment of the present disclosure is shown. The method provided by the embodiment of the present disclosure can be executed by any electronic device with computer processing capabilities, such as a terminal device and / or a server. Figure 1 As shown, the video file transpackaging method includes:
[0034] Step 102: Acquire a first video file in a first media format and transpackaging setting information of the first video file, wherein the transpackaging setting information is set by the user who uploads the first video file.
[0035] Specifically, the first video format may be an MP4 format. After the uploading user uploads the original video file to the video storage server, the transpackaging system may download the first video file from the video storage server. The transpackaging setting information may be sent by the uploading user to the transpackaging system. The video storage server may be a server on a cloud platform.
[0036] Step 104, serialize the first video file according to the transpackaging setting information to obtain a second video file in a second media format and a description file of the second video file, wherein image media data of the second video file is stored in order according to timestamps, and the description file includes field information for format conversion, and a third video file in a media format corresponding to the transpackaging setting information can be generated according to the second video file and the description file.
[0037] Specifically, the first video file is serialized, that is, the image media data of the first video file is stored in order according to the timestamp, so that the second video file can be obtained. The description file may include the encoding information, frame information, frame offset and data storage description information of the second video file, as well as the transpackaging information for format conversion to generate the specified format. The specified format is specified by the packaging setting information sent by the uploading user.
[0038] The technical solution of the embodiment of the present invention can save storage space and network transmission bandwidth while maintaining the accessibility of the original file. Specifically, when the video storage server stores files, the original file is serialized and a description file is generated at the same time, all frame information positions of the video file are recorded and field information supporting format conversion is generated in advance, so that when the user accesses the required format file, it can be dynamically transpackaged into a standard media format, such as MP4, FLV or HLS, etc. Because physical files are no longer produced for formats other than MP4, the storage cost of the video storage server can be reduced.
[0039] In the disclosed embodiment, the uploading user uploads the original video file to the video storage server, generates transpackaging setting information and sends it to the transpackaging system, wherein the video storage server may be a server on a cloud platform.
[0040] Before step 102, the transpackaging system can obtain the original video file from the cloud platform, and the original video file is uploaded to the cloud platform by the uploading user; if the media format of the original video file is not the first media format, the transpackaging system converts the original video file into a first video file in the first media format.
[0041] Specifically, if the video file uploaded by the user to the video storage server is an MP4 file, no format conversion is required before serialization, and the original video file is the first video file in MP4 format. If the video file uploaded by the user to the video storage server is not an MP4 file, format conversion is required before serialization, and the original video file is converted into the first video file in MP4 format.
[0042] In step 102, at least one target media format is acquired according to the transpackaging setting information; and box data information describing the file is determined according to the at least one target media format, wherein the box data information includes an arrangement order of video data corresponding to the at least one target media format.
[0043] Specifically, if there are two target media formats, namely FLV and HLS formats, the arrangement order of the video data corresponding to the two types of data is recorded in the box data information.
[0044] Step 104 belongs to the video production link. In step 104, the video file uploaded by the uploading user is serialized to form a media file in jdc_MP4 format and a description file corresponding to the media file, namely, a jdc_desc file.
[0045] The jdc_MP4 file is a video file storage format that complies with the MP4 standard media format. It complies with the MP4 standard and can be directly accessed as an MP4 file. At the same time, the arrangement and sorting of its A / V data has been redesigned so that the A / V data is stored in order according to the timestamp, which meets the streaming media access requirements and is also suitable for dynamic transcoding of different packaging formats such as FLV\TS\fMP4\HLS. Among them, the TS file is the MPEG2-TS stream file. fMP4 is a streaming packaging format for audio and video information.
[0046] The jdc_desc file is a description file of the jdc_MP4 file. This description file is used to assist in dynamic transpackaging and related video slice production. The jdc_desc file contains transpackaging information for various target formats, as well as various description information of pieces (slices), which can also meet the needs of P2P distribution networks. The video files uploaded by the uploading user are serialized and transpacked to form a media file in the jdc_MP4 format and a description file corresponding to the media file, namely the jdc_desc file.
[0047] The purpose of the jdc_desc file is to describe the required media format without parsing the MP4 source file. You only need to parse the mdat (image media data) or frame data of the corresponding MP4 file. The jdc_desc file is a custom format file. Its format description is based on the MP4 file encapsulation and consists of boxes. Each box identifies a type of data.
[0048] Table 1 below shows the box data type, data and cross references of the description file.
[0049] Table 1 Box data types, data and cross references
[0050]
[0051]
[0052] Specifically, in the video file production stage, after the upload user uploads the MP4 file, the serialization processing tool is called for serialization processing to generate jdc_MP4 file and jdc_desc file, and the jdc_MP4 file and jdc_desc file are uploaded to the video storage server. In the video playback stage, the transpackaging system introduces a playback source station. When the playback user accesses the request file, it directly returns to the playback source station. If the playback source station has no cache, the playback source station dynamically transpacks in real time and responds to the source station node with the transpackaging completed video file.
[0053] like Figure 2As shown, the production process of the video file includes the following steps:
[0054] Step 201, the uploading user uploads the original file, generates transpackaging setting information and sends it to the local server. The original file is not in MP4 format, so it needs to be transpackaged and serialized to output jdc_MP4. The local server is the local server of the transpackaging system.
[0055] Step 202: The local server uploads the original file to the server of the cloud platform.
[0056] Step 203: The local server sends the transcoding task to the transpackaging system according to the transpackaging setting information.
[0057] Step 204, the transpackaging system downloads the original file from the cloud platform.
[0058] Step 205: The transpackaging system transcodes the original file into a file in MP4 format.
[0059] Step 206: The transpackaging system generates a jdc_MP4 file and a jdc_desc file according to the file in the MP4 format.
[0060] Step 207, the transpackaging system uploads the jdc_MP4 file and the jdc_desc file to the cloud platform.
[0061] Step 208: The transcoding system returns transcoding completion callback data to the local server.
[0062] Step 209: The local server generates a playback address.
[0063] Step 210: The local server returns callback data to the uploading user.
[0064] In the disclosed embodiment, the video file production link is the process of the transpackaging system serializing the MP4 file to output the jdc_MP4 file and the jdc_desc file. The video file playback link is the process of the transpackaging system dynamically packaging and outputting the file format requested by the user based on the description file. The user uploads the file to the video storage service through the upload service, and triggers the transcoding service to produce the jdc_MP4 file and the jdc_desc file, and uploads the two files to the video storage service for subsequent access.
[0065] After step 104, the second video file and the description file may be stored in the cloud platform for downloading.
[0066] During the video playback process, the playing user applies to the transpackaging system for access to the video file, and the transpackaging system can obtain the second video file and the description file from the cloud platform.
[0067] If the playback user specifies to play the fourth video file in the third media format, the transpackaging system may first determine whether there is a cached fourth video file in the source station node corresponding to the playback user. The third media format may be the HLS media format, but is not limited thereto.
[0068] If there is a cached fourth video file in the source station node corresponding to the playing user, the transpackaging system obtains the list file of the fourth video file and sends it to the playing user; after accepting the content request of the playing user, the fourth video file is obtained and sent to the playing user, wherein the content request is generated and sent by the playing user based on the list file.
[0069] If the fourth video file does not exist in the cache in the source station node corresponding to the playback user, the description file can be obtained, and a list file of the fourth video file is generated according to the description file and sent to the playback user. After accepting the content request of the playback user, the second video file is obtained and converted into a fourth video file in the third media format according to the description file, and the fourth video file is sent to the playback user, wherein the content request is generated and sent by the playback user according to the list file.
[0070] like Figure 3 As shown, when a user requests to play a video file in HLS media format, the following steps may be included:
[0071] Step 301: The playback user first sends the m3u8 playback address to the distribution network.
[0072] Step 302: When the source station node of the distribution network has no cache, the source station is played back.
[0073] Step 303: The playback source station downloads the jdc_desc file from the cloud platform.
[0074] Step 304: The playback source station generates m3u8 based on the jdc_desc file.
[0075] Step 305: The playback source station sends m3u8 to the distribution network.
[0076] Step 306: The distribution network sends m3u8 to the playback user.
[0077] Step 307: The playback user sends a TS playback request to the distribution network based on m3u8.
[0078] Step 308: When the source station node of the distribution network has no cache, the source station is played back.
[0079] Step 309: The playback source station downloads the jdc_MP4 file from the cloud platform according to the range in the TS playback request.
[0080] Step 310: The playback source station dynamically transcapsulates the jdc_MP4 file into a TS file.
[0081] Step 311: The playback source station sends the TS file to the distribution network.
[0082] Step 312: The distribution network sends the TS file to the playback user.
[0083] In the video playback phase, if the playback user specifies to play a fifth video file in a fourth media format, the transpackaging system may first determine whether there is a cached fifth video file in the source station node corresponding to the playback user. The fourth media format may be an FLV media format, but is not limited thereto.
[0084] If the fifth video file is cached in the source station node corresponding to the playing user, the transpackaging system obtains the fifth video file and sends it to the playing user after receiving the content request of the playing user.
[0085] If the fifth video file does not exist in the cache in the source station node corresponding to the playing user, the description file and the second video file can be obtained from the cloud platform, and the second video file can be converted into a fifth video file in the fourth media format according to the description file and sent to the playing user.
[0086] The video file transpackaging method provided by the present disclosure performs serialization processing on a first video file to obtain video files stored in order according to timestamps and a description file providing format conversion field information, so that only video files in the second media format can be stored in a video storage server, and video files in different media formats can be provided to playback users, thereby reducing the storage space waste of the video storage server and lowering the network transmission cost.
[0087] The video file transpackaging device provided by the present disclosure is described below. The video file transpackaging device described below and the video file transpackaging method described above can be referenced to each other.
[0088] like Figure 4 As shown, the video file transpackaging device of the embodiment of the present disclosure includes:
[0089] The first acquisition unit 402 may be configured to acquire a first video file in a first media format and transpackaging setting information of the first video file, wherein the transpackaging setting information is set by a user who uploads the first video file.
[0090] The processing unit 404 can be used to serialize the first video file according to the transpackaging setting information to obtain a second video file in a second media format and a description file of the second video file, wherein the image media data of the second video file is stored in order according to timestamps, and the description file includes field information for format conversion. A third video file in a media format corresponding to the transpackaging setting information can be generated based on the second video file and the description file.
[0091] In the embodiment of the present disclosure, the device may also include: a second acquisition unit, used to acquire a description file when the playback user specifies to play a fourth video file in a third media format and there is no cached fourth video file in the source station node corresponding to the playback user; a generation unit, used to generate a list file of the fourth video file according to the description file and send it to the playback user; a first conversion unit, used to acquire the second video file after accepting the content request of the playback user, convert the second video file into a fourth video file in the third media format according to the description file, and then send it to the playback user, wherein the content request is generated and sent by the playback user according to the list file.
[0092] In the embodiment of the present disclosure, the device may further include a storage unit for storing the second video file and the description file in a cloud platform for downloading.
[0093] In the embodiment of the present disclosure, the processing unit can also be used to: obtain at least one target media format based on the transpackaging setting information; determine the box data information of the description file based on the at least one target media format, wherein the box data information includes the arrangement order of the video data corresponding to the at least one target media format.
[0094] In the embodiment of the present disclosure, the device may also include: a third acquisition unit, used to acquire a description file and a second video file when a playback user specifies to play a fifth video file in a fourth media format and there is no cached fifth video file in the source station node corresponding to the playback user; a second conversion unit, used to convert the second video file into a fifth video file in a fourth media format according to the description file and then send it to the playback user.
[0095] In the embodiment of the present disclosure, the device may also include: a judgment unit, used to judge whether there is a cached fourth video file in the source station node corresponding to the playback user; the second acquisition unit is also used to obtain a list file of the fourth video file and send it to the playback user when it exists; a sending unit is used to obtain the fourth video file and send it to the playback user after accepting the content request of the playback user, wherein the content request is generated and sent by the playback user based on the list file.
[0096] In the embodiment of the present disclosure, the device may also include: a fourth acquisition unit, used to obtain the original video file from the cloud platform, the original video file is uploaded to the cloud platform by the uploading user; a third conversion unit, used to convert the original video file into a first video file in the first media format when the media format of the original video file is not the first media format.
[0097] Since the various functional modules of the video file transpackaging device of the example embodiment of the present disclosure correspond to the steps of the example embodiment of the video file transpackaging method described above, for details not disclosed in the embodiment of the device of the present disclosure, please refer to the embodiment of the video file transpackaging method described above in the present disclosure.
[0098] The video file transpackaging device provided by the present disclosure performs serialization processing on the first video file to obtain video files stored in order according to timestamps and a description file providing format conversion field information, so that only video files in the second media format can be stored in the video storage server, and video files in different media formats can be provided to the playback users, thereby reducing the storage space waste of the video storage server and reducing the network transmission cost.
[0099] Figure 5 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 5 As shown, the electronic processing sub-device may include: a processor 510, a communication interface 520, a memory 530 and a communication bus 540, wherein the processor 510, the communication interface 520 and the memory 530 communicate with each other through the communication bus 540. The processor 510 may call the logic instructions in the memory 530 to execute a video file transpackaging method, the method comprising: obtaining a first video file of a first media format and transpackaging setting information of the first video file, wherein the transpackaging setting information is set by the uploading user of the first video file; performing serialization processing on the first video file according to the transpackaging setting information to obtain a second video file of a second media format and a description file of the second video file, wherein the image media data of the second video file is stored in order according to the timestamp, the description file includes field information for format conversion, and a third video file of a media format corresponding to the transpackaging setting information can be generated according to the second video file and the description file.
[0100] In addition, the logic instructions in the above-mentioned memory 530 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present disclosure is essentially or the part that contributes to the prior art or the 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, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0101] On the other hand, the present disclosure also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the video file transpackaging method provided by the above-mentioned methods, and the method includes: obtaining a first video file in a first media format and transpackaging setting information of the first video file, wherein the transpackaging setting information is set by the uploading user of the first video file; serializing the first video file according to the transpackaging setting information to obtain a second video file in a second media format and a description file of the second video file, wherein the image media data of the second video file is stored in order according to timestamps, and the description file includes field information for format conversion, and a third video file in a media format corresponding to the transpackaging setting information can be generated according to the second video file and the description file.
[0102] On the other hand, the present disclosure also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the above-mentioned video file transpackaging methods, the method comprising: obtaining a first video file in a first media format and transpackaging setting information of the first video file, wherein the transpackaging setting information is set by the uploading user of the first video file; serializing the first video file according to the transpackaging setting information to obtain a second video file in a second media format and a description file of the second video file, wherein the image media data of the second video file is stored in order according to timestamps, and the description file includes field information for format conversion, and a third video file in a media format corresponding to the transpackaging setting information can be generated according to the second video file and the description file.
[0103] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0104] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0105] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present disclosure, rather than to limit them. Although the present disclosure has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present disclosure.
Claims
1. A video file transpackaging method, characterized in that: The method comprises: Acquire a first video file in a first media format and transpackaging setting information of the first video file, wherein the transpackaging setting information is set by a user who uploads the first video file; The first video file is serialized according to the transpackaging setting information to obtain a second video file of a second media format and a description file of the second video file, wherein the image media data of the second video file is stored in order according to timestamps, and the description file includes field information for format conversion; the serialization process includes: obtaining at least one target media format according to the transpackaging setting information; determining the box data information of the description file according to the at least one target media format, wherein the box data information includes the arrangement order of the video data corresponding to the at least one target media format, wherein the serialization process of the first video file specifically includes: storing the image media data of the first video file in order according to timestamps to obtain a second video file; the field information for format conversion includes encoding information, frame information, frame offset and data storage description information of the second video file, and transpackaging information for format conversion to generate a specified format; A third video file in a media format corresponding to the transpackaging setting information can be generated according to the second video file and the description file.
2. The method according to claim 1, characterized in that The method further comprises: If the playback user specifies to play a fourth video file in a third media format, and the fourth video file does not exist in the cache in the source station node corresponding to the playback user, then obtaining the description file; Generate a list file of the fourth video file according to the description file and send it to the playback user; After accepting the content request of the playback user, the second video file is obtained and converted into a fourth video file in the third media format according to the description file, and then sent to the playback user, wherein the content request is generated and sent by the playback user according to the list file.
3. The method according to claim 1, characterized in that After obtaining the second video file in the second media format and the description file of the second video file, the method further includes storing the second video file and the description file in a cloud platform for downloading.
4. The method according to claim 1, characterized in that: The method further comprises: If the playback user specifies to play a fifth video file in a fourth media format, and the fifth video file does not exist in the cache in the source station node corresponding to the playback user, then obtaining the description file and the second video file; The second video file is converted into a fifth video file in the fourth media format according to the description file and then sent to the playback user.
5. The method according to claim 2, characterized in that: Before obtaining the description file, the method further includes: Determine whether the fourth video file is cached in the source station node corresponding to the playing user; If so, obtaining a list file of the fourth video file and sending it to the playback user; After accepting the content request of the playback user, the fourth video file is acquired and sent to the playback user, wherein the content request is generated and sent by the playback user according to the list file.
6. The method according to claim 4, characterized in that Before obtaining the first video file in the first media format and the transpackaging setting information of the first video file, the method further includes: Acquire an original video file from the cloud platform, the original video file being uploaded to the cloud platform by the uploading user; If the media format of the original video file is not the first media format, the original video file is converted into a first video file in the first media format.
7. A video file transpackaging device, characterized in that: The device is used to implement the video file transpackaging method according to any one of claims 1 to 6, and the device comprises: A first acquisition unit is used to acquire a first video file in a first media format and transpackaging setting information of the first video file, wherein the transpackaging setting information is set by a user who uploads the first video file; A processing unit is used to serialize the first video file according to the transpackaging setting information to obtain a second video file in a second media format and a description file of the second video file, wherein the image media data of the second video file is stored in order according to timestamps, and the description file includes field information for format conversion, and a third video file in a media format corresponding to the transpackaging setting information can be generated according to the second video file and the description file; wherein the serialization processing includes: obtaining at least one target media format according to the transpackaging setting information; determining the box data information of the description file according to the at least one target media format, wherein the box data information includes the arrangement order of the video data corresponding to the at least one target media format.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Internet video on demand method and system based on real-time packaging switching
CN103957469A
Format conversion method and device for multimedia file
CN107038232A