CN112911410A - Online video processing method and device - Google Patents

Online video processing method and device Download PDF

Info

Publication number
CN112911410A
CN112911410A CN202110160792.9A CN202110160792A CN112911410A CN 112911410 A CN112911410 A CN 112911410A CN 202110160792 A CN202110160792 A CN 202110160792A CN 112911410 A CN112911410 A CN 112911410A
Authority
CN
China
Prior art keywords
video
file
video file
compressed
image group
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110160792.9A
Other languages
Chinese (zh)
Inventor
于乐洋
张庆林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Lexuebang Network Technology Co ltd
Original Assignee
Beijing Lexuebang Network Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Lexuebang Network Technology Co ltd filed Critical Beijing Lexuebang Network Technology Co ltd
Priority to CN202110160792.9A priority Critical patent/CN112911410A/en
Publication of CN112911410A publication Critical patent/CN112911410A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/83Generation or processing of protective or descriptive data associated with content; Content structuring
    • H04N21/845Structuring of content, e.g. decomposing content into time segments
    • H04N21/8456Structuring of content, e.g. decomposing content into time segments by decomposing the content in the time domain, e.g. in time segments
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/42Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/23424Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving splicing one content stream with another content stream, e.g. for inserting or substituting an advertisement
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/2343Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
    • H04N21/234309Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements by transcoding between formats or standards, e.g. from MPEG-2 to MPEG-4 or from Quicktime to Realvideo

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Business, Economics & Management (AREA)
  • Marketing (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The present disclosure provides an online video processing method and device, firstly, obtaining an initial resource file of a target video, and dividing the initial resource file into a first video file and a second video file; then, performing video compression on the first video file to obtain a compressed video file corresponding to the first video file; and finally, splicing the compressed video file and the second video file to obtain the optimized resource file of the target video. According to the embodiment of the disclosure, the first image group data in the initial resource file of the target video can be compressed, and the optimized resource file containing the compressed video file is generated, so that the storage space occupied by the first image group data in the optimized resource file is reduced, the time consumption for transmitting the first image group data is reduced when the online video is transmitted, and then the client can receive the data required for rendering the first frame of the video earlier, thereby shortening the display duration of the first frame.

Description

Online video processing method and device
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to an online video processing method and apparatus.
Background
Along with the popularization of the internet and intelligent terminals, the occupation ratio of online videos in the public entertainment life is higher and higher, and correspondingly, the requirements of users on the online video playing quality are higher and higher. The online video is a streaming media, a series of media data are compressed, and then sent by network segments, a technology and a process for instantly transmitting video and audio on the network for viewing are streaming transmission, the streaming transmission can transmit the on-site video and audio or video prestored on a server, when a viewer watches the videos, the videos are immediately played by specific playing software after being sent to the computer of the viewer.
For the online video, the video is transmitted in a streaming segment, so that the client can immediately play the segment after transmitting the segment to the client, and can continue to transmit other segments of video while playing, and therefore, a user cannot perceive switching between different segments in the playing process of the online video. However, the time consumed by the display of the first frame is perceivable by the user, the display duration of the first frame is an important video quality index, and the display duration of the first frame is the time consumed from the user clicking the video to the playing of the first frame of the video.
Disclosure of Invention
The embodiment of the disclosure at least provides an online video processing method and device.
In a first aspect, an embodiment of the present disclosure provides an online video processing method, applied to a server, including:
acquiring an initial resource file of a target video, and dividing the initial resource file into a first video file and a second video file; the first video file comprises first image group data in the initial resource file; the second video file comprises the data of the rest image groups except the first image group data in the initial resource file;
performing video compression on the first video file to obtain a compressed video file corresponding to the first video file; the file size of the compressed video file is smaller than that of the first video file;
and splicing the compressed video file and the second video file to obtain the optimized resource file of the target video.
In an optional embodiment, the method further comprises:
and responding to a playing request of a client aiming at the target video, and sending the optimized resource file corresponding to the target video to the client according to a preset online video transmission protocol so that the client plays the optimized resource file.
In an optional embodiment, the dividing the initial resource file into a first video file and a second video file includes:
intercepting first image group data from the initial resource file;
generating the first video file based on the intercepted first image group data and the first metadata of the initial resource file; and generating the second video file based on the first metadata and the remaining data in the initial resource file except the first image group data.
In an optional implementation manner, the performing video compression on the first video file to obtain a compressed video file corresponding to the first video file includes:
and performing video compression on the first video file based on a preset target transcoding parameter and a preset transcoding tool to obtain the compressed video file.
In an optional implementation manner, splicing the compressed video file and the second video file to obtain an optimized resource file of the target video includes:
splicing the tail part of the image group data of the compressed video file with the head part of the image group data of the second video file to obtain the optimized image group data;
merging second metadata of the compressed video file with the first metadata of the second video file to obtain the optimized metadata;
and combining the optimized image group data and the optimized metadata to obtain the optimized resource file.
In an optional implementation manner, the performing video compression on the first video file to obtain a compressed video file corresponding to the first video file includes:
segmenting the first video file into at least two first video subfiles;
compressing the at least two first video subfiles respectively based on at least two target transcoding parameters and the transcoding tool to obtain at least two first compressed video files;
and splicing the at least two first compressed video files into the compressed video file.
In an optional implementation manner, the splicing the compressed video file and the second video file to obtain the optimized resource file of the target video includes:
cutting the second video file into at least two second video subfiles;
compressing the at least two second video subfiles to obtain at least two second compressed video files;
and splicing the compressed video file and the at least two second compressed video files to obtain the optimized resource file of the target video.
In an optional embodiment, the optimization metadata is header information of the optimized resource file.
In a second aspect, an embodiment of the present disclosure further provides an online video processing apparatus, configured for a server, including:
the system comprises a segmentation module, a storage module and a processing module, wherein the segmentation module is used for acquiring an initial resource file of a target video and segmenting the initial resource file into a first video file and a second video file; the first video file comprises first image group data in the initial resource file; the second video file comprises the data of the rest image groups except the first image group data in the initial resource file;
the compression module is used for performing video compression on the first video file to obtain a compressed video file corresponding to the first video file; the file size of the compressed video file is smaller than that of the first video file;
and the splicing module is used for splicing the compressed video file and the second video file to obtain the optimized resource file of the target video.
In an optional implementation manner, the online video processing apparatus further includes:
and the sending module responds to a playing request of a client for the target video, and sends the optimized resource file corresponding to the target video to the client according to a preset online video transmission protocol so that the client plays the optimized resource file.
In an optional implementation manner, the cutting module is specifically configured to:
intercepting first image group data from the initial resource file;
generating the first video file based on the intercepted first image group data and the first metadata of the initial resource file; and generating the second video file based on the first metadata and the remaining data in the initial resource file except the first image group data.
In an alternative embodiment, the compression module is specifically configured to:
and performing video compression on the first video file based on a preset target transcoding parameter and a preset transcoding tool to obtain the compressed video file.
In an optional implementation manner, the splicing module is specifically configured to:
splicing the tail part of the image group data of the compressed video file with the head part of the image group data of the second video file to obtain the optimized image group data;
merging second metadata of the compressed video file with the first metadata of the second video file to obtain the optimized metadata;
and combining the optimized image group data and the optimized metadata to obtain the optimized resource file.
In a possible implementation, the compression module is specifically configured to:
segmenting the first video file into at least two first video subfiles;
compressing the at least two first video subfiles respectively based on at least two target transcoding parameters and the transcoding tool to obtain at least two first compressed video files;
and splicing the at least two first compressed video files into the compressed video file.
In a possible implementation, the splicing module is specifically configured to:
cutting the second video file into at least two second video subfiles;
compressing the at least two second video subfiles to obtain at least two second compressed video files;
and splicing the compressed video file and the at least two second compressed video files to obtain the optimized resource file of the target video.
In an optional embodiment, the optimization metadata is header information of the optimized resource file.
In a third aspect, an embodiment of the present disclosure further provides a computer device, including: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory communicating via the bus when the computer device is running, the machine-readable instructions when executed by the processor performing the steps of the first aspect described above, or any possible implementation of the first aspect.
In a fourth aspect, this disclosed embodiment also provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to perform the steps in the first aspect or any one of the possible implementation manners of the first aspect.
The online video processing method and the online video processing device provided by the embodiment of the disclosure are characterized in that an initial resource file of a target video is obtained firstly, and the initial resource file is divided into a first video file and a second video file; the first video file comprises first image group data in the initial resource file; the second video file comprises the data of the rest image groups except the first image group data in the initial resource file; then, performing video compression on the first video file to obtain a compressed video file corresponding to the first video file; the file size of the compressed video file is smaller than that of the first video file; and finally, splicing the compressed video file and the second video file to obtain the optimized resource file of the target video. According to the embodiment of the disclosure, the first image group data in the initial resource file of the target video can be compressed, and the optimized resource file containing the compressed video file is generated, so that the storage space occupied by the first image group data in the optimized resource file is reduced, the time consumption for transmitting the first image group data is reduced when the online video is transmitted, and then the client can receive the data required for rendering the first frame of the video earlier, thereby shortening the display duration of the first frame.
In order to make the aforementioned objects, features and advantages of the present disclosure more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings required for use in the embodiments will be briefly described below, and the drawings herein incorporated in and forming a part of the specification illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the technical solutions of the present disclosure. It is appreciated that the following drawings depict only certain embodiments of the disclosure and are therefore not to be considered limiting of its scope, for those skilled in the art will be able to derive additional related drawings therefrom without the benefit of the inventive faculty.
Fig. 1 shows a flowchart of an online video processing method provided by an embodiment of the present disclosure;
fig. 2 is a schematic diagram illustrating the structure of each file in an online video processing method according to an embodiment of the present disclosure;
fig. 3 is a schematic diagram of an online video processing apparatus provided by an embodiment of the present disclosure;
fig. 4 shows a schematic diagram of a computer device provided by an embodiment of the present disclosure.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present disclosure more clear, the technical solutions of the embodiments of the present disclosure will be described clearly and completely with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are only a part of the embodiments of the present disclosure, not all of the embodiments. The components of the embodiments of the present disclosure, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present disclosure, presented in the figures, is not intended to limit the scope of the claimed disclosure, but is merely representative of selected embodiments of the disclosure. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the disclosure without making creative efforts, shall fall within the protection scope of the disclosure.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
The term "and/or" herein merely describes an associative relationship, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the term "at least one" herein means any one of a plurality or any combination of at least two of a plurality, for example, including at least one of A, B, C, and may mean including any one or more elements selected from the group consisting of A, B and C.
At present, methods for reducing the display duration of the first frame of the online video generally start with the speed of rendering the first frame of the video at the client and the downloading speed of the video resource, for example, the playing flow of the video player at the client can be optimized, the video frame can be quickly rendered, or the downloading node of the video resource can be optimized, so that the data transmission speed is higher. However, when the data transmission technology and the picture rendering technology are both developed to a higher degree, it is difficult to further improve the data transmission and picture rendering rates, so that the display duration of the first frame is difficult to be significantly improved.
Based on the research, the present disclosure provides an online video processing method, which can compress first image group data in an initial resource file of a target video and generate an optimized resource file containing the compressed video file, so that a storage space occupied by the first image group data in the optimized resource file is reduced, when an online video is transmitted, time consumed for transmitting the first image group data is reduced, and a client can receive data required for rendering a first frame of the video earlier, thereby shortening the display duration of the first frame.
To facilitate understanding of the present embodiment, first, an online video processing method disclosed in the embodiments of the present disclosure is described in detail, where an execution subject of the online video processing method provided in the embodiments of the present disclosure is generally a computer device with certain computing capability, and the computer device includes, for example: terminal equipment or servers or other processing devices. In some possible implementations, the online video processing method may be implemented by a processor calling computer readable instructions stored in a memory. The online video processing method provided by the embodiment of the disclosure is described below with an execution subject as a server.
Referring to fig. 1, a flowchart of an online video processing method provided in the embodiment of the present disclosure is shown, where the method includes steps S101 to S103, where:
s101: acquiring an initial resource file of a target video, and dividing the initial resource file into a first video file and a second video file; the first video file comprises first image group data in the initial resource file; the second video file comprises the image group data except the first image group data in the initial resource file.
In this step, the server may obtain an initial resource file of the target video from the database, or obtain the initial resource file through the upload interface, where the target video may be an online video, the initial resource file may be a file containing data corresponding to the target video, and may transmit the target video to the client in the form of a streaming media according to a preset online video transmission protocol, and the client may start playing the target video after receiving part of the initial resource file.
Here, the initial resource file may be in a Flash Video (FLV) format, and the FLV format file has the characteristics of small occupied space and high loading speed, is a streaming media format, and is suitable for playing an online Video.
After receiving a part of an initial resource file, a client can start to render a picture corresponding to the part, because the client usually plays from a first frame picture when playing an online video, in the video, because a large number of same pixel points exist among pictures, in order to reduce the size of the file, picture frames with repeated contents can be simplified, and the picture of the frame is simplified by utilizing the difference between the frame and a key frame, for example, the first frame picture is usually the first key frame of the whole video, namely an inner coding frame (I frame), which is a complete picture frame, each pixel point is complete data, and some subsequent frame pictures can be a forward prediction frame (P frame) and a bidirectional interpolation frame (B frame) until the next I frame, the P frame can determine the data of the pixel point according to the I frame before the frame, and the B frame needs the previous I frame and the next I frame to determine the data of the pixel point, therefore, when a client acquires a P frame or a B frame, the client can render the frame only by acquiring an I frame corresponding to the frame at the same time, and the I frame and the corresponding P frame and B frame thereof can form an image group. Therefore, the client can perform the rendering of the first frame after receiving the data corresponding to the first image group. Further, in order to reduce the display duration of the first frame, the time consumed by the client to download the first image group can be reduced.
In this step, the initial resource file may be divided into a first video file containing first image group data and a second video file containing remaining image group data except the first image group data, where the first video file and the second video file may further include Metadata, which is also called intermediary data and relay data, as data about description data (data about), mainly information about description data attribute (property), and is used to support functions such as indicating storage location, history data, resource search, file record, and the like. In video rendering, it is often necessary to utilize information in the metadata.
In one possible embodiment, the dividing the initial resource file into a first video file and a second video file includes:
intercepting first image group data from the initial resource file;
generating the first video file based on the intercepted first image group data and the first metadata of the initial resource file; and generating the second video file based on the first metadata and the remaining data in the initial resource file except the first image group data.
Referring to fig. 2, a schematic structural diagram of each file in the online video processing method provided by the embodiment of the present disclosure is shown. The initial resource file A comprises first metadata x, image group data a, image group data B, image group data C, … … and image group data h, after the first image group data a and the first metadata x are intercepted from the initial resource file A, the image group data a and the first metadata x can be spliced to obtain a first video file B, and then the remaining data of the intercepted initial resource file A, namely the image group data B, the image group data C, … … and the image group data h, are spliced with the first metadata x to obtain a second video file C, wherein the initial resource file is in an FLV format.
S102: performing video compression on the first video file to obtain a compressed video file corresponding to the first video file; the file size of the compressed video file is smaller than the first video file.
In this step, video compression can be performed by adjusting the resolution of the first video file, reducing the number of frames in the image group, or the like, and the file size of the first video file can be reduced by video compression.
In one possible implementation, video compression may be performed by:
and performing video compression on the first video file based on a preset target transcoding parameter and a preset transcoding tool to obtain the compressed video file.
The target transcoding parameter may be preset, or may be determined based on attribute information of the first video file recorded in the metadata of the first video file, for example, the target resolution in the target transcoding parameter may be determined according to a resolution of the first video file in the metadata, and whether to delete a B frame may be determined according to a frame picture type in the first video file recorded in the metadata.
After the compressed video file is generated, second metadata corresponding to the compressed video file may be generated.
Further, compression rates of respective portions in the compressed video file may be different, and specifically, the compressed video file may be obtained through the following steps:
segmenting the first video file into at least two first video subfiles;
compressing the at least two first video subfiles respectively based on at least two target transcoding parameters and the transcoding tool to obtain at least two first compressed video files;
and splicing the at least two first compressed video files into the compressed video file.
In this step, the first video file may be divided into at least two first video subfiles according to a preset division rule, each first video subfile may include at least one frame of picture, each first video subfile may be deployed with a corresponding target transcoding parameter, the first video file may be compressed by using a transcoding tool according to the corresponding target transcoding parameter, so as to obtain first compressed video files with different resolutions, and then the plurality of first compressed video files are spliced together according to a playing sequence, so as to obtain the compressed video file.
Here, the target transcoding parameters corresponding to each first video subfile may be preset according to requirements, for example, the first frame is compressed to a high-definition resolution, the second frame is compressed to a high-definition resolution, the third frame maintains the high-definition resolution, the fourth frame is compressed to a smooth resolution, and the like; the transcoding parameter may also be determined according to the corresponding position of the first video subfile in the first video file, for example, if the first video file is split into three first video subfiles, the target transcoding parameter of the first video subfile at the first playing position in the first video file may be set to a lower bitrate or resolution, so that the first playing part can be transmitted faster; the target transcoding parameters of the first video sub-file at the last playing position can be set to be higher in bitrate or resolution, and can be closer to the bitrate or resolution of the second video file than the target transcoding parameters corresponding to the first playing position; the target transcoding parameters of the first video subfiles in the middle playing position can be located between the target transcoding parameters of the two first video subfiles, so that the resolution of the compressed video file is increased in a step mode and gradually restored to the normal resolution, and the previous frame pictures can be transmitted to the client side more quickly.
Referring to fig. 2, the compressed video file D includes compressed image group data a ' and second metadata x ' corresponding to the image group data a '.
S103: and splicing the compressed video file and the second video file to obtain the optimized resource file of the target video.
In this step, the compressed video file obtained by transcoding the first video file and the second video file may be spliced, so that the compressed video file and the second video file are merged into an optimized resource file.
Here, in the case where the initial resource file is in the FLV format, the first video file, the second video file, and the optimized resource file may also be in the FLV format.
Here, the second video file may be compressed to obtain a second compressed video file, and then the compressed video file and the second compressed video subfile are spliced, so that a portion corresponding to the second video file in the optimized resource file is also compressed, thereby increasing the transmission speed of the specific frame.
Specifically, the second video file may be first divided into at least two second video subfiles; then, compressing the at least two second video subfiles to obtain at least two second compressed video files; and finally, splicing the compressed video file and the at least two second compressed video files to obtain the optimized resource file of the target video.
The second video file can be segmented and compressed according to a preset segmentation rule and a preset compression strategy, and various play modes such as gradual definition, stage definition and the like can be realized on the optimized resource file according to different requirements of application scenes.
In a possible implementation manner, the splicing the compressed video file and the second video file to obtain the optimized resource file of the target video includes:
splicing the tail part of the image group data of the compressed video file with the head part of the image group data of the second video file to obtain the optimized image group data;
merging second metadata of the compressed video file with the first metadata of the second video file to obtain the optimized metadata;
and combining the optimized image group data and the optimized metadata to obtain the optimized resource file.
As shown in fig. 2, in the optimized resource file E, the tail of the image group data a 'of the compressed video file D is connected to the image group data b in the second video file C, and the second metadata x' of the compressed video file D is merged with the first metadata x of the second video file C to obtain the optimized metadata z of the optimized resource file E.
Wherein the optimization metadata is header information of the optimized resource file. Therefore, when the client side carries out the picture rendering of the video, the client side can directly obtain the optimized metadata without searching, the picture rendering speed can be improved to a certain degree, and the display duration of the first frame is further reduced.
In order to enable the client to download the optimized resource file more quickly, after the optimized resource file is obtained, the optimized resource file can be sent to the client through the following steps:
and responding to a playing request of a client aiming at the target video, and sending the optimized resource file corresponding to the target video to the client according to a preset online video transmission protocol so that the client plays the optimized resource file.
In this step, when a play request of the client for the target video is received, the optimized resource file corresponding to the target video may be sent to the client in a streaming manner according to a preset online video transmission protocol, so that the client plays the optimized resource file.
When the optimized resource file is transmitted, the first image group data of the optimized resource file is compressed, the file size is small, the first image group data can be quickly transmitted to the client, the client can immediately render images after receiving the first image group data, and the display duration of a first frame is reduced.
In a possible implementation manner, the sending the optimized resource file corresponding to the target video to the client according to a preset online video transmission protocol may include:
determining data transmission distances between a plurality of distribution nodes in a content distribution network and the client;
selecting a target distribution node from the plurality of distribution nodes based on the data transmission distance;
and sending the optimized resource file to the client according to a preset online video transmission protocol by using the target distribution node.
In the step, when the optimized resource file is sent to the client, data transmission distances between the client and a plurality of distribution nodes in a content distribution network can be determined, the content distribution network can be a node used for sending online video data to the client, the distribution node with the shortest distance can be selected as a target distribution node, and then the optimized resource file is sent to the client by using the target distribution node, so that the physical transmission distance of the optimized resource file can be reduced, the speed of transmitting the optimized resource file to the client is increased, the time required by the client for obtaining the first image group data in the optimized resource file is reduced, and the display duration of the first frame is shortened.
The online video processing method provided by the embodiment of the disclosure comprises the steps of firstly obtaining an initial resource file of a target video, and dividing the initial resource file into a first video file and a second video file; the first video file comprises first image group data in the initial resource file; the second video file comprises the data of the rest image groups except the first image group data in the initial resource file; then, performing video compression on the first video file to obtain a compressed video file corresponding to the first video file; the file size of the compressed video file is smaller than that of the first video file; and finally, splicing the compressed video file and the second video file to obtain the optimized resource file of the target video.
According to the embodiment of the disclosure, the first image group data in the initial resource file of the target video can be compressed, and the optimized resource file containing the compressed video file is generated, so that the storage space occupied by the first image group data in the optimized resource file is reduced, the time consumption for transmitting the first image group data is reduced when the online video is transmitted, and then the client can receive the data required for rendering the first frame of the video earlier, thereby shortening the display duration of the first frame.
It will be understood by those skilled in the art that in the method of the present invention, the order of writing the steps does not imply a strict order of execution and any limitations on the implementation, and the specific order of execution of the steps should be determined by their function and possible inherent logic.
Based on the same inventive concept, an online video processing apparatus corresponding to the online video processing method is also provided in the embodiments of the present disclosure, and since the principle of the apparatus in the embodiments of the present disclosure for solving the problem is similar to the online video processing method in the embodiments of the present disclosure, the implementation of the apparatus may refer to the implementation of the method, and repeated details are not described again.
Referring to fig. 3, a schematic diagram of an online video processing apparatus according to an embodiment of the present disclosure is shown, where the online video processing apparatus 300 includes: a slicing module 310, a compression module 320, and a splicing module 330; wherein the content of the first and second substances,
the segmentation module 310 is configured to obtain an initial resource file of a target video, and segment the initial resource file into a first video file and a second video file; the first video file comprises first image group data in the initial resource file; the second video file comprises the data of the rest image groups except the first image group data in the initial resource file;
the compression module 320 is configured to perform video compression on the first video file to obtain a compressed video file corresponding to the first video file; the file size of the compressed video file is smaller than that of the first video file;
and the splicing module 330 is configured to splice the compressed video file and the second video file to obtain an optimized resource file of the target video.
According to the embodiment of the disclosure, the first image group data in the initial resource file of the target video can be compressed, and the optimized resource file containing the compressed video file is generated, so that the storage space occupied by the first image group data in the optimized resource file is reduced, the time consumption for transmitting the first image group data is reduced when the online video is transmitted, and then the client can receive the data required for rendering the first frame of the video earlier, thereby shortening the display duration of the first frame.
In an optional implementation manner, the online video processing apparatus 300 further includes:
the sending module 340, in response to a playing request of a client for the target video, sends the optimized resource file corresponding to the target video to the client according to a preset online video transmission protocol, so that the client plays the optimized resource file.
In an optional implementation manner, the segmentation module 310 is specifically configured to:
intercepting first image group data from the initial resource file;
generating the first video file based on the intercepted first image group data and the first metadata of the initial resource file; and generating the second video file based on the first metadata and the remaining data in the initial resource file except the first image group data.
In an alternative embodiment, the compressing module 320 is specifically configured to:
and performing video compression on the first video file based on a preset target transcoding parameter and a preset transcoding tool to obtain the compressed video file.
In an optional implementation manner, the splicing module 330 is specifically configured to:
splicing the tail part of the image group data of the compressed video file with the head part of the image group data of the second video file to obtain the optimized image group data;
merging second metadata of the compressed video file with the first metadata of the second video file to obtain the optimized metadata;
and combining the optimized image group data and the optimized metadata to obtain the optimized resource file.
In a possible implementation, the compression module 320 is specifically configured to:
segmenting the first video file into at least two first video subfiles;
compressing the at least two first video subfiles respectively based on at least two target transcoding parameters and the transcoding tool to obtain at least two first compressed video files;
and splicing the at least two first compressed video files into the compressed video file.
In a possible implementation, the splicing module 330 is specifically configured to:
cutting the second video file into at least two second video subfiles;
compressing the at least two second video subfiles to obtain at least two second compressed video files;
and splicing the compressed video file and the at least two second compressed video files to obtain the optimized resource file of the target video.
In an optional embodiment, the optimization metadata is header information of the optimized resource file.
The description of the processing flow of each module in the device and the interaction flow between the modules may refer to the related description in the above method embodiments, and will not be described in detail here.
Corresponding to the online video processing method in fig. 1, an embodiment of the present disclosure further provides a computer device 400, and as shown in fig. 4, a schematic structural diagram of the computer device 400 provided in the embodiment of the present disclosure includes:
a processor 41, a memory 42, and a bus 43; the memory 42 is used for storing execution instructions and includes a memory 421 and an external memory 422; the memory 421 is also referred to as an internal memory, and is used for temporarily storing the operation data in the processor 41 and the data exchanged with the external memory 422 such as a hard disk, the processor 41 exchanges data with the external memory 422 through the memory 421, and when the computer apparatus 400 operates, the processor 41 communicates with the memory 42 through the bus 43, so that the processor 41 executes the following instructions:
acquiring an initial resource file of a target video, and dividing the initial resource file into a first video file and a second video file; the first video file comprises first image group data in the initial resource file; the second video file comprises the data of the rest image groups except the first image group data in the initial resource file;
performing video compression on the first video file to obtain a compressed video file corresponding to the first video file; the file size of the compressed video file is smaller than that of the first video file;
and splicing the compressed video file and the second video file to obtain the optimized resource file of the target video.
In a possible implementation, the instructions executed by the processor 41 further include:
and responding to a playing request of a client aiming at the target video, and sending the optimized resource file corresponding to the target video to the client according to a preset online video transmission protocol so that the client plays the optimized resource file.
In one possible embodiment, the instructions executed by processor 41 for splitting the initial resource file into a first video file and a second video file include:
intercepting first image group data from the initial resource file;
generating the first video file based on the intercepted first image group data and the first metadata of the initial resource file; and generating the second video file based on the first metadata and the remaining data in the initial resource file except the first image group data.
In a possible implementation manner, in the instructions executed by the processor 41, the performing video compression on the first video file to obtain a compressed video file corresponding to the first video file includes:
and performing video compression on the first video file based on a preset target transcoding parameter and a preset transcoding tool to obtain the compressed video file.
In an alternative embodiment, the splicing the compressed video file and the second video file in the instruction executed by the processor 41 to obtain the optimized resource file of the target video includes:
splicing the tail part of the image group data of the compressed video file with the head part of the image group data of the second video file to obtain the optimized image group data;
merging second metadata of the compressed video file with the first metadata of the second video file to obtain the optimized metadata;
and combining the optimized image group data and the optimized metadata to obtain the optimized resource file.
In an optional implementation manner, in the instructions executed by the processor 41, the performing video compression on the first video file to obtain a compressed video file corresponding to the first video file includes:
segmenting the first video file into at least two first video subfiles;
compressing the at least two first video subfiles respectively based on at least two target transcoding parameters and the transcoding tool to obtain at least two first compressed video files;
and splicing the at least two first compressed video files into the compressed video file.
In an alternative embodiment, the splicing the compressed video file and the second video file to obtain the optimized resource file of the target video in the instructions executed by the processor 41 includes:
cutting the second video file into at least two second video subfiles;
compressing the at least two second video subfiles to obtain at least two second compressed video files;
and splicing the compressed video file and the at least two second compressed video files to obtain the optimized resource file of the target video.
In one possible embodiment, in the instructions executed by processor 41, the optimization metadata is header information of the optimized resource file.
The embodiments of the present disclosure also provide a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, performs the steps of the online video processing method described in the above method embodiments. The storage medium may be a volatile or non-volatile computer-readable storage medium.
The embodiments of the present disclosure also provide a computer program product, where the computer program product carries a program code, and instructions included in the program code may be used to execute the steps of the online video processing method in the foregoing method embodiments, which may be referred to specifically in the foregoing method embodiments, and are not described herein again.
The computer program product may be implemented by hardware, software or a combination thereof. In an alternative embodiment, the computer program product is embodied in a computer storage medium, and in another alternative embodiment, the computer program product is embodied in a Software product, such as a Software Development Kit (SDK), or the like.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the system and the apparatus described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again. In the several embodiments provided in the present disclosure, it should be understood that the disclosed system, apparatus, and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present disclosure may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such understanding, the technical solution of the present disclosure may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present disclosure. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
Finally, it should be noted that: the above-mentioned embodiments are merely specific embodiments of the present disclosure, which are used for illustrating the technical solutions of the present disclosure and not for limiting the same, and the scope of the present disclosure is not limited thereto, and although the present disclosure is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive of the technical solutions described in the foregoing embodiments or equivalent technical features thereof within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the embodiments of the present disclosure, and should be construed as being included therein. Therefore, the protection scope of the present disclosure shall be subject to the protection scope of the claims.

Claims (11)

1. An online video processing method applied to a server includes:
acquiring an initial resource file of a target video, and dividing the initial resource file into a first video file and a second video file; the first video file comprises first image group data in the initial resource file; the second video file comprises the data of the rest image groups except the first image group data in the initial resource file;
performing video compression on the first video file to obtain a compressed video file corresponding to the first video file; the file size of the compressed video file is smaller than that of the first video file;
and splicing the compressed video file and the second video file to obtain the optimized resource file of the target video.
2. The method of claim 1, further comprising:
and responding to a playing request of a client aiming at the target video, and sending the optimized resource file corresponding to the target video to the client according to a preset online video transmission protocol so that the client plays the optimized resource file.
3. The method of claim 1, wherein the segmenting the initial resource file into a first video file and a second video file comprises:
intercepting first image group data from the initial resource file;
generating the first video file based on the intercepted first image group data and the first metadata of the initial resource file; and generating the second video file based on the first metadata and the remaining data in the initial resource file except the first image group data.
4. The method according to claim 3, wherein the performing video compression on the first video file to obtain a compressed video file corresponding to the first video file comprises:
and performing video compression on the first video file based on a preset target transcoding parameter and a preset transcoding tool to obtain the compressed video file.
5. The method of claim 1, wherein splicing the compressed video file with the second video file to obtain the optimized resource file of the target video comprises:
splicing the tail part of the image group data of the compressed video file with the head part of the image group data of the second video file to obtain the optimized image group data;
merging second metadata of the compressed video file with the first metadata of the second video file to obtain the optimized metadata;
and combining the optimized image group data and the optimized metadata to obtain the optimized resource file.
6. The method according to claim 1, wherein the performing video compression on the first video file to obtain a compressed video file corresponding to the first video file comprises:
segmenting the first video file into at least two first video subfiles;
compressing the at least two first video subfiles respectively based on at least two target transcoding parameters and the transcoding tool to obtain at least two first compressed video files;
and splicing the at least two first compressed video files into the compressed video file.
7. The method of claim 1, wherein the splicing the compressed video file with the second video file to obtain the optimized resource file of the target video comprises:
cutting the second video file into at least two second video subfiles;
compressing the at least two second video subfiles to obtain at least two second compressed video files;
and splicing the compressed video file and the at least two second compressed video files to obtain the optimized resource file of the target video.
8. The method of claim 5, wherein the optimization metadata is header information of the optimized resource file.
9. An online video processing apparatus, for a server, comprising:
the system comprises a segmentation module, a storage module and a processing module, wherein the segmentation module is used for acquiring an initial resource file of a target video and segmenting the initial resource file into a first video file and a second video file; the first video file comprises first image group data in the initial resource file; the second video file comprises the data of the rest image groups except the first image group data in the initial resource file;
the compression module is used for performing video compression on the first video file to obtain a compressed video file corresponding to the first video file; the file size of the compressed video file is smaller than that of the first video file;
and the splicing module is used for splicing the compressed video file and the second video file to obtain the optimized resource file of the target video.
10. A computer device, comprising: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory communicating over the bus when a computer device is running, the machine-readable instructions when executed by the processor performing the steps of the online video processing method of any of claims 1 to 8.
11. A computer-readable storage medium, having stored thereon a computer program which, when being executed by a processor, carries out the steps of the online video processing method according to any one of claims 1 to 8.
CN202110160792.9A 2021-02-05 2021-02-05 Online video processing method and device Pending CN112911410A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110160792.9A CN112911410A (en) 2021-02-05 2021-02-05 Online video processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110160792.9A CN112911410A (en) 2021-02-05 2021-02-05 Online video processing method and device

Publications (1)

Publication Number Publication Date
CN112911410A true CN112911410A (en) 2021-06-04

Family

ID=76122807

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110160792.9A Pending CN112911410A (en) 2021-02-05 2021-02-05 Online video processing method and device

Country Status (1)

Country Link
CN (1) CN112911410A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101795264A (en) * 2009-12-30 2010-08-04 北京新岸线网络技术有限公司 Video data transmission method and system
CN103686203A (en) * 2013-12-04 2014-03-26 深圳市融创天下科技股份有限公司 Video transcoding method and device
US20140139735A1 (en) * 2012-04-10 2014-05-22 Huawei Technologies Co., Ltd. Online Media Data Conversion Method, Online Video Playing Method and Corresponding Device
CN103957341A (en) * 2014-04-30 2014-07-30 华为软件技术有限公司 Image transmission method and related device
CN103974087A (en) * 2013-09-09 2014-08-06 福州瑞芯微电子有限公司 Video image file compressing system, client and method
CN110784740A (en) * 2019-11-25 2020-02-11 北京三体云时代科技有限公司 Video processing method, device, server and readable storage medium
US10582232B1 (en) * 2018-10-31 2020-03-03 Amazon Technologies, Inc. Transcoding frame-synchronous metadata for segmented video delivery

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101795264A (en) * 2009-12-30 2010-08-04 北京新岸线网络技术有限公司 Video data transmission method and system
US20140139735A1 (en) * 2012-04-10 2014-05-22 Huawei Technologies Co., Ltd. Online Media Data Conversion Method, Online Video Playing Method and Corresponding Device
CN103974087A (en) * 2013-09-09 2014-08-06 福州瑞芯微电子有限公司 Video image file compressing system, client and method
CN103686203A (en) * 2013-12-04 2014-03-26 深圳市融创天下科技股份有限公司 Video transcoding method and device
CN103957341A (en) * 2014-04-30 2014-07-30 华为软件技术有限公司 Image transmission method and related device
US10582232B1 (en) * 2018-10-31 2020-03-03 Amazon Technologies, Inc. Transcoding frame-synchronous metadata for segmented video delivery
CN110784740A (en) * 2019-11-25 2020-02-11 北京三体云时代科技有限公司 Video processing method, device, server and readable storage medium

Similar Documents

Publication Publication Date Title
US11417341B2 (en) Method and system for processing comment information
CN108989885B (en) Video file transcoding system, segmentation method, transcoding method and device
EP2940940B1 (en) Methods for sending and receiving video short message, apparatus and handheld electronic device thereof
CN105451031B (en) Video transcoding method and system
CN108449409B (en) Animation pushing method, device, equipment and storage medium
US10104143B1 (en) Manifest segmentation
US10116719B1 (en) Customized dash manifest
CN111901666B (en) Image processing method, image processing apparatus, electronic device, and storage medium
US20200296470A1 (en) Video playback method, terminal apparatus, and storage medium
KR20210019017A (en) Content processing method and device
CN111836076A (en) Video resolution switching method and device and electronic equipment
CN112532998B (en) Method, device and equipment for extracting video frame and readable storage medium
CN111356023B (en) Playing mode determining method and device
CN110719526B (en) Video playing method and device
CN112044078A (en) Access method, device, equipment and storage medium for virtual scene application
US8582664B2 (en) Method and device for creating a video sequence representative of a digital video sequence and associated methods and devices for transmitting and receiving video data
CN114173160A (en) Live broadcast stream pushing method and device
CN114040245A (en) Video playing method and device, computer storage medium and electronic equipment
CN114257572B (en) Data processing method, device, computer readable medium and electronic equipment
CN111436009A (en) Real-time video stream transmission and display method and transmission and play system
CN113473165A (en) Live broadcast control system, live broadcast control method, device, medium and equipment
CN113973224A (en) Method for transmitting media information, computing device and storage medium
CN113315987A (en) Video live broadcast method and video live broadcast device
CN112714338A (en) Video transmission method, video playing method, video transmission device, video playing device, computer equipment and storage medium
JP2005136566A (en) Apparatus and method for converting moving picture, moving picture distribution apparatus, mail repeating device and program

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20210604