Video processing method and system, electronic equipment and computer program product
By splitting the video into a video header file and multiple video frame groups, and encapsulating and auditing it in the target order on the server side, the problem of long video release time is solved, and the rapid release and playback of videos is achieved.
Patent Information
- Application Number
- CN202411903354.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-03-21
AI Technical Summary
It takes a lot of time to publish existing videos to a video website, resulting in the user's videos being unable to be viewed by other users in time.
By splitting the video to be published into a video header file and a plurality of video frame groups, each video frame group includes at least one keyframe, the server encapsulates and reviews the video frame group in sequence in the target order, and processes the video frame group of viewing requests in advance to achieve rapid publishing and playback.
It effectively reduces the time required for video to be published to the video website, enables the user's video to be viewed quickly by other users, and can send the required video clips in advance according to the user's viewing request.
Smart Images

Figure CN119676475A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of video processing technology, and in particular to a video processing method, system, electronic device and computer program product. Background Art
[0002] With the development of the Internet, the use of video websites has become more and more common. Users can not only watch videos on video websites, but also publish videos to video websites for other users to watch.
[0003] Currently, the process of posting a video on a video website for other users to watch generally includes the following steps:
[0004] 1. The user uploads the video to the video website server;
[0005] 2. The video website server transcodes the video;
[0006] 3. The video website reviews the video and releases it after it passes the review;
[0007] 4. After another user chooses to watch the published video, the video website server sends the video to the device of the other user.
[0008] The above process takes a long time, resulting in that the user's video often cannot be viewed by other users in a timely manner. Summary of the invention
[0009] In view of the above problems, the present application provides a video processing method, system, electronic device and computer program product to achieve the purpose of reducing the video publishing time. The specific scheme is as follows:
[0010] A first aspect of the present application provides a video processing method, the video processing method comprising:
[0011] The server receives a video header file and at least one video frame group of a video to be published uploaded by a first client device, wherein the video header file and the at least one video frame group are generated after the video to be published is split, and each of the video frame groups includes at least one key frame;
[0012] The server determines a video frame group of the video to be published as the current group in sequence according to the target order, and encapsulates the current group in sequence according to the video header file of the video to be published, obtains the current transport stream file, and reviews the current transport stream file. If the current transport stream file passes the review, the current transport stream file is published;
[0013] If the server receives a viewing request sent by the second client device, and the target transport stream file corresponding to the video frame group requested by the viewing request has not been released, the server encapsulates the video frame group corresponding to the target transport stream file in advance according to the video header file of the video to be released, and obtains the target transport stream file;
[0014] The server examines the target transport stream file in advance, and sends the examined target transport stream file to the second client device.
[0015] In a possible implementation, the video to be published includes video header information and video data. Before the server receives the video header file and at least one video frame group of the video to be published uploaded by the first client device, the method further includes:
[0016] The first client device splits the video data according to key frames to obtain multiple video frame groups and marks header information for each video frame group, wherein the header information includes the duration of the video frame group, the key frame time point and the playback sequence number;
[0017] The first client device uploads the video header file containing the video header information and the multiple video frame groups with marked header information to the server respectively.
[0018] In a possible implementation, the video processing method further includes:
[0019] When encapsulating the current group, the server modifies the duration information and key frame timestamp information in the header information of the current group.
[0020] In a possible implementation, the video processing method further includes:
[0021] If the current transport stream file fails to pass the review, the server will take offline all the published transport stream files of the video to be published.
[0022] In a possible implementation, after publishing the current transport stream file, the video processing method further includes:
[0023] In response to the viewing request for the to-be-published video sent by the second client device, the server sends the published transport stream files obtained by encapsulating each video frame group in sequence according to the target order to the second client device.
[0024] A second aspect of the present application provides a video processing system, the video processing system comprising a server side,
[0025] The server receives a video header file and at least one video frame group of a video to be published uploaded by a first client, wherein the video header file and the at least one video frame group are generated after the video to be published is split, and each of the video frame groups includes at least one key frame;
[0026] The server determines a video frame group of the video to be published as the current group in sequence according to the target order, and encapsulates the current group in sequence according to the video header file of the video to be published, obtains the current transport stream file, and reviews the current transport stream file. If the current transport stream file passes the review, the current transport stream file is published;
[0027] If the server receives a viewing request sent by the second client, and the target transport stream file corresponding to the video frame group requested by the viewing request has not been released, the server encapsulates the video frame group corresponding to the target transport stream file in advance according to the video header file of the video to be released, and obtains the target transport stream file;
[0028] The server side examines the target transport stream file in advance, and sends the examined target transport stream file to the second client side.
[0029] In a possible implementation, the video to be published includes video header information and video data, and the video processing system further includes a first client.
[0030] Before the server receives the video header file and at least one video frame group of the video to be published uploaded by the first client, the first client splits the video data according to key frames, obtains multiple video frame groups and marks header information for each video frame group, wherein the header information includes the duration of the video frame group, the key frame time point and the playback sequence number;
[0031] The first client uploads the video header file containing the video header information and a plurality of video frame groups marked with header information to the server.
[0032] In a possible implementation, when encapsulating the current group, the server side modifies the duration information and key frame timestamp information in the header information of the current group.
[0033] A third aspect of the present application provides an electronic device, comprising at least one processor and a memory connected to the processor, wherein:
[0034] The memory is used to store computer programs;
[0035] The processor is used to execute the computer program so that the electronic device can implement the video processing method of the first aspect or any implementation manner of the first aspect.
[0036] A fourth aspect of the present application provides a computer program product, comprising computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements the video processing method of the first aspect or any implementation of the first aspect.
[0037] By means of the above technical scheme, the present application provides a video processing method, system, electronic device and computer program product. The method receives a video header file and a plurality of video frame groups uploaded by a first client device after splitting the video to be released, each video frame group includes at least one key frame, and during the video transcoding process, each video frame group is encapsulated into a transport stream file, which is different from the way of changing the encoding format in the traditional transcoding process. As long as a transport stream file passes the server review, it can be published to the video website. And when the server receives a viewing request sent by a second client device, the video frame group requested to be viewed by the viewing request can be encapsulated and reviewed in advance. If the review is passed, the encapsulated target transport stream file is sent to the second client device. During video transcoding, the method replaces the change of the video encoding format with video frame encapsulation, and a transport stream file can be published to the video website after the review is completed, without waiting for the review of other transport stream files of the video, which can effectively reduce the time required for the video to be published to the video website, and the audit of a transport stream file after splitting can also effectively reduce the time required for the video to be published to the video website compared to the entire video. A transport stream file is published to the video website after the review is completed, so that the user's video can be quickly viewed by other users, and the video clips that the user wants to watch can be quickly sent to the user in advance according to the viewing request sent by the user. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0039] Figure 1 A signaling flow chart of a video processing method provided in an embodiment of the present application;
[0040] Figure 2 A schematic diagram of the structure of an mp4 file provided in an embodiment of the present application;
[0041] Figure 3 A hardware structure block diagram of an electronic device provided in this application. DETAILED DESCRIPTION
[0042] The following describes the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. The terms used in the implementation method section of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application.
[0043] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0044] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, which is only to describe the distinction mode adopted by the objects of the same attributes when describing in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0045] As video websites become more popular, more and more PUGC users publish videos on video websites to earn revenue. From the time a user uploads a video to the time the video can be viewed on the client side of the video website, there are four processes: uploading, transcoding, reviewing, and client playback. Among them, PUGC users are content creators and suppliers of the platform. They have a clear focus, specialized technology, or better qualifications, experience, and background, and specialize in a certain type of content production.
[0046] At present, the time spent by users uploading videos to video websites for playback has a huge impact on users' revenue. For example, for a piece of news, the number of clicks on the user's video that first appears on the video website is significantly higher than similar content uploaded later, and it is also easier to enter the recommendation system of major search engines, thereby gaining wider dissemination. The video files that users need to upload to video websites are generally large, and large-volume video files require a lot of time to be released during the video release process, resulting in users spending a lot of time to release videos on video websites, making it difficult for other users to watch them in time. For example, a 5-minute video file is usually 500M. At an upload speed of 10MB / s, it takes 50 seconds to upload to the server, and video transcoding is even more time-consuming. The server also needs 1 minute to transcode a 5-minute video file, and it also takes about 1 minute to review a 5-minute video file.
[0047] In order to solve the above problems, the embodiment of the present application provides a video processing method. The video processing method of the embodiment of the present application is described in detail below with reference to the accompanying drawings.
[0048] Reference Figure 1 , Figure 1 A signaling flow chart of a video processing method provided in an embodiment of the present application, such as Figure 1 As shown, a video processing method provided in an embodiment of the present application may include steps S10 to S14, and these steps are described in detail below.
[0049] S10, the first client device splits the video data according to key frames, obtains multiple video frame groups and marks header information for each video frame group, where the header information includes the duration of the video frame group, the key frame time point and the playback sequence number;
[0050] S11. The first client device uploads a video header file containing video header information and a plurality of video frame groups marked with header information to a server respectively.
[0051] The first client device is a device used by the user to upload videos, and may be a mobile device or a non-portable device of the user, or may be a device equipped with a port for enterprise use.
[0052] In this embodiment, the file type of the video to be published can be an mp4 type. The video to be published can include video header information and video data. The video header information can refer to metadata that describes the entire video file, such as a moov type box in an mp4 file structure. Figure 2 The schematic diagram of the structure of the mp4 file shown in the figure shows that the mp4 file consists of several boxes (data object blocks). All data in the mp4 file is contained in the box, and each box has a type and length. A box can contain another box, and such a box containing other boxes can be called a container box. The mp4 file as a whole consists of three types of container boxes (ftyp type box, moov type box and mdat type box). Video data can be the video content part of the video to be released, and can include multiple video frames and corresponding audio frames.
[0053] The video header information of this embodiment may include descriptions such as video width and height, duration, and key frame position information. In order to reduce the time spent on uploading the video to the server, the first client device of this embodiment uploads the video file of the video to be released to the server in segments. Specifically, the first client device divides the video to be released into video header information and video data (the picture content of each video frame and the content of each audio frame), and then splits the video data in units of key frames, and encodes to obtain multiple video frame groups. When encoding, the first client device can use H.264 encoding to encode multiple video frames. H.264 encoding is a highly compressed digital video codec standard, and H.264 encoding has a very high data compression ratio. Under the same image quality, the compression ratio of H.264 encoding is more than twice that of MPEG-2 and 1.5 to 2 times that of MPEG-4. For example, an original file of 88GB is compressed to 3.5GB using the MPEG-2 compression standard, with a compression ratio of 25:1; and after compression using the H.264 compression standard, it becomes 879MB, and the compression ratio can reach 102:1. Compared with compression technologies such as MPEG-2 and MPEG-4, H.264 encoding can greatly save users' downloading time and data traffic charges. In addition, H.264 encoding can have high compression ratio and high-quality and smooth images. Therefore, video data compressed by H.264 encoding requires less bandwidth during network transmission, which is more economical for users.
[0054] The H.264 protocol defines three types of frames: fully encoded frames are I frames (key frames), P frames (forward prediction coded frames) that refer to the previous I frames and contain only the difference part of the coding, and B frames (bidirectional prediction interpolation coded frames) that refer to the previous and next frames. The core algorithms used by H.264 are intra-frame compression and inter-frame compression. Intra-frame compression is the algorithm for generating I frames, and inter-frame compression is the algorithm for generating P frames and B frames.
[0055] A video frame group in this embodiment is a data stream generated by encoding an image with little content difference. When the content of the image screen changes slightly, a video frame group is longer, and an I frame can be compiled, and then P frames and B frames are alternated. When the content of the image screen changes greatly, a video frame group is shorter, and an I frame can be compiled, and the number of P frames and B frames is appropriately reduced. For example, the key frame is an I frame, and other video frames can include B frames and P frames, then the format of a group of video frame groups can be: IBBBPBBBPBBBP. Therefore, each video frame group is a group of image sequences (a group of continuous pictures) containing key frames. The number of image frames contained in the video frame group is related to the picture changes, and in order to ensure that the subsequent transmission stream file can be independently decoded and played after being published to the video website, the first video frame of each video frame group needs to be a key frame.
[0056] After the video data is divided into multiple video frame groups, each video frame group needs to be marked with header information according to the information of the video frame group in the video to be released. The header information records the duration, key frame time point and playback sequence number of each video frame group in the video to be released. After completing the marking of the header information, the first client device can upload the video header file containing the video header information and multiple video frame groups with marked header information to the server one by one in sequence. Compared with uploading the whole to the server, the time consumption of uploading in pieces can be effectively reduced.
[0057] S12. The server receives a video header file and at least one video frame group of the video to be published uploaded by the first client device, where the video header file and the at least one video frame group are generated after the video to be published is split, and each video frame group includes at least one key frame;
[0058] S13, the server determines a video frame group of the video to be released as the current group in sequence according to the target order, and encapsulates the current group in sequence according to the video header file of the video to be released, obtains the current transport stream file, and reviews the current transport stream file. If the current transport stream file passes the review, the current transport stream file is released;
[0059] Among them, the server can refer to the background system of the user's video upload object, such as the background system of a video website. The target order can be the playback order of the video frame group in the video, and the target order can be determined by the upload order when the first client device uploads multiple video frame groups in sequence, or can be determined according to the playback order number in the video frame group. Of course, in some specific cases, the target order can be different from the playback order, such as when there are advertisements in the video to be released, although the playback order of the advertisements in the video to be released is in the middle part of the video content, the video frame group containing the substantial video content can be processed first, and the video frame group containing the advertisements can be processed last.
[0060] Video encapsulation is also called container format, which is to put multiple video frames, audio frames and subtitles that have been encoded and compressed into a file in a certain way, so as to form an independent file that is easy to play. In this embodiment, the server encapsulates the video frame group into TS format, and the TS format does not change the original encoding format of the video frame group. For example, if the video frame group is originally H.264 encoded, the encoding format of the transport stream file obtained after the video frame group is encapsulated is still H.264 encoded. Among them, the TS format, the full name is MPEG2-TS, which is a standard format for transmitting and storing various data including video, audio and communication protocols. MPEG2-TS is usually transmitted at a fixed bit rate. If the upper layer does not have enough content to be transmitted, an empty packet will be sent to take up space. This transmission method is particularly meaningful for scenes with high real-time requirements, because the damage of a single packet will not cause a large voice delay. And MPEG2-TS has good fault tolerance and can be applied to real-time transmission programs. Its format characteristics are: it can be independently decoded from any segment of the video stream.
[0061] The server encapsulates the video frame groups one by one according to the video header file. Specifically, since the video frame groups are divided into key frames, the server can locate the key frames in sequence according to the key frame position information in the video header file, thereby locating the current video frame group that needs to be encapsulated in sequence. In this embodiment, in order to facilitate the server to encapsulate, each video frame group obtained by splitting the first client device only contains one key frame. At this time, the server can determine the position of the key frame according to the key frame position information in the video header file, thereby obtaining the video frame group where the key frame is located (the video data information carried by the key frame), thereby determining the current video frame group that needs to be encapsulated. Of course, the video frame group can also contain multiple key frames. When the video frame group contains multiple key frames, the server can first determine the position of the key frame, thereby determining the current group that needs to be encapsulated, and determine whether the video frame group where the key frame is located contains other key frames. If other key frames are included, other key frames are skipped when determining the key frame position to prevent the same video frame group from being encapsulated multiple times.
[0062] Furthermore, when the server encapsulates the current group, since the duration information and key frame timestamp information of the video frame group will change after the video data is divided, it is necessary to correct the duration information and key frame timestamp information in the header information of the current group so that the encapsulated transport stream file can be played separately later, wherein the timestamp information of the key frame can refer to the key frame time point. Specifically, after the first client device uploads the video frame group to the server, each video frame group may have header information, and the header information of each video frame group may include the original duration, key frame time point and playback sequence number of the video frame group in the video to be released. Therefore, the process of correcting the header information of each video frame group in this embodiment may include: correcting the duration of each video frame group in the video to be released to the duration of the video frame group alone, and correcting the time point of the key frame in the video to be released to the time point of the key frame in the video frame group.
[0063] For example, a video frame group includes video frames from the 100th frame to the 200th frame in the video to be released, and the video to be released is the main body. Then, the video frame group is the video content from the 10th second to the 15th second in the video to be released, and the key frame time point is the video frame at the 11th second in the video to be released. Therefore, the header information of the video frame group may include: five seconds, from the 10th second to the 15th second, and the key frame time point is the 11th second. When the server is correcting the header information, the video frame group is the main body, and the video frame group is a frame group including 100 video frames. In the video frame group, the duration can be: five seconds, from the first second to the fifth second, and the key frame time point can be the video frame at the second second of the video frame group. Therefore, the duration of the video frame can be corrected from "five seconds, from the 10th second to the 15th second" to "five seconds, from the first second to the fifth second", and the key frame time point can be corrected from "the 11th second" to "the second second".
[0064] After the transport stream file of a TS format is encapsulated in the server every time, it will be placed in the generated m3u8 file. The m3u8 file is a text file format for storing multimedia playlists, which is an extended version of the m3u file, and the support for UTF-8 character encoding is added, so that it can better handle multilingual content. Specifically, the present embodiment can generate an m3u8 file without an actual address in advance, because the content of the m3u8 file is usually in plain text format, and can include a URL link pointing to an audio or video file, or the URL of a nested playlist. Therefore, whenever a transport stream file of a TS format is encapsulated, the invalid address of a time position in the m3u8 file can be replaced, so that the transport stream file is indexed and played. The time position corresponding to the transport stream file in the m3u8 file corresponds to the time position of the video frame group (key frame) in the video to be released. When the invalid address of a time position in the m3u8 file is requested during playback (indicating that there is no transport stream file or no corresponding link under this time position), the server can give priority to quickly generating the transport stream file of the corresponding time position.
[0065] The m3u8 file indexes and plays the multiple transport stream files it contains according to time, and the server reviews the current transport stream file in turn. If the current transport stream file passes the review, the transport stream file will be published on the video website; if the current transport stream file fails the review, the server will take all the published transport stream files of the video to be released offline, and other unpublished transport stream files that have passed the review will no longer be published. Among them, the review criteria for the transport stream file are mainly whether it involves sensitive content or illegal content. When the first transport stream file of the video is published to the video website for playback, the user can see the content in the first transport stream file, so that the first client device uploads the video and the viewing end device can watch it in seconds. Furthermore, when the transport stream file is played on the video website, the server can determine in real time whether other video frame groups of the video have completed encapsulation and update the m3u8 file once per second to complete subsequent playback.
[0066] In addition, in this embodiment, the first client device uploads the video frame group, the server encapsulates the video frame group, and puts the transport stream file into the m3u8 file. The review of the transport stream file and the playback of the transport stream file can be performed simultaneously to further reduce the time required for uploading the video to the video website, so that other users can watch the newly released video faster.
[0067] S14. If the server receives a viewing request sent by the second client device, and the target transport stream file corresponding to the video frame group requested to be viewed by the viewing request has not been released, the server encapsulates the video frame group corresponding to the target transport stream file in advance according to the video header file of the video to be released, and obtains the target transport stream file;
[0068] S15. The server reviews the target transport stream file in advance, and sends the reviewed target transport stream file to the second client device.
[0069] Wherein, the second client device is the device used when the user watches the video, which can be the user's mobile terminal device or non-portable device. After the current transport stream file is released, the second client can immediately watch the transport stream file of the video to be released on the video website. If the second client device wants to view the video to be released on the video website, a viewing request can be sent to the server. The server can respond to the viewing request sent by the client device, and send the released transport stream file to the second client device for playback according to the target order. Of course, the second client device can also be indexed and played by the m3u8 file.
[0070] A viewing request may refer to a request sent by the second client device to the server when the second client device wants to watch a video or wants to change the playback status of the current video. Specifically, the viewing request may be a start viewing request, that is, the user needs to watch the video from the beginning, such as the user clicks on a new video to watch. The viewing request may also be a jump viewing request. When the user is watching a video and performs a fast forward or rewind operation, the second client device may send a jump viewing request to the server. Of course, when the user wants to view other videos, the second client device may also send a jump viewing request to the server.
[0071] Specifically, if the target transport stream file corresponding to the video frame group requested by the second client device to watch has been released, the target transport stream file can be sent directly to the second client device; if the target transport stream file corresponding to the video frame group requested by the second client device to watch has not been released, the server will give priority to the video frame group requested by the second client device to watch. Specifically, the server directly sets the video frame group requested to watch as the current group, and encapsulates it (pauses the video frame group being encapsulated or encapsulates it at the same time) to obtain the target transport stream file. And when reviewing the transport stream file, the server also directly reviews the target transport stream file first (pauses the transport stream file being reviewed or reviews it at the same time), and when the review is passed, the target transport stream file is directly sent to the second client device.
[0072] In this embodiment, when the user needs to watch in advance, the server can accelerate the processing of the corresponding video frame group in advance according to the user's needs, and quickly send the processed transmission stream file to the user's device end, so that the user can quickly watch the video content he wants to watch.
[0073] A video processing method provided by an embodiment of the present application adopts the idea of divide and conquer. The video file received by the server is a video header file and multiple video frame groups uploaded by the first client device after the video to be released is split, each video frame group includes at least one key frame, and in the video transcoding process, each video frame group is encapsulated as a transport stream file, which is different from the way of changing the encoding format in the traditional transcoding process. As long as a transport stream file passes the server review, it can be published to the video website. And when the server receives a viewing request sent by the second client device, the video frame group requested to be viewed by the viewing request can be encapsulated and reviewed in advance. If the review is passed, the encapsulated target transport stream file is sent to the second client device. In the video transcoding, the method replaces the change of the video encoding format with video frame encapsulation, and a transport stream file can be published to the video website after the review is completed, without waiting for the review of other transport stream files of the video, which can effectively reduce the time required for the video to be published to the video website, and the audit of a transport stream file after the split is compared with the entire video, which can also effectively reduce the time required for the video to be published to the video website. A transport stream file is published to the video website after the review is completed, so that the user's video can be quickly viewed by other users, and the video clips that the user wants to watch can be quickly sent to the user in advance according to the viewing request sent by the user.
[0074] The above describes a video processing method provided by an embodiment of the present application. The following describes a system for executing the above video processing method. The video processing system includes a server side,
[0075] The server receives a video header file and at least one video frame group of a video to be published uploaded by a first client, where the video header file and the at least one video frame group are generated after the video to be published is split, and each video frame group includes at least one key frame;
[0076] The server determines a video frame group of the video to be released as the current group in the target order, and encapsulates the current group in turn according to the video header file of the video to be released, obtains the current transport stream file, and reviews the current transport stream file. If the current transport stream file passes the review, the current transport stream file is released;
[0077] If the server receives a viewing request sent by the second client, and the target transport stream file corresponding to the video frame group requested by the viewing request has not been released, the server encapsulates the video frame group corresponding to the target transport stream file in advance according to the video header file of the video to be released, and obtains the target transport stream file;
[0078] The server side reviews the target transport stream file in advance, and sends the reviewed target transport stream file to the second client side.
[0079] In a possible implementation, the video to be published includes video header information and video data, and the video processing system further includes a first client.
[0080] Before receiving, at the server end, a video header file and at least one video frame group of a video to be published uploaded by a first client, the first client splits the video data according to key frames, obtains multiple video frame groups, and marks header information for each video frame group, wherein the header information includes the duration of the video frame group, the key frame time point, and the playback sequence number;
[0081] The first client uploads the video header file containing the video header information and the multiple video frame groups marked with the header information to the server.
[0082] In a possible implementation, when encapsulating the current group, the server side modifies the duration information and key frame timestamp information in the header information of the current group.
[0083] In a possible implementation, if the current transport stream file fails to pass the review, the server will take offline all the published transport stream files of the video to be published.
[0084] In a possible implementation, after publishing the current transport stream file, the server responds to a viewing request for the video to be published sent by the second client, and sends the published transport stream file obtained by encapsulating each video frame group in sequence according to the target order to the second client.
[0085] The present application also provides an electronic device in an embodiment. Figure 3 As shown, it shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiment of the present application. The electronic device in the embodiment of the present application may include but is not limited to fixed terminals such as mobile phones, laptops, PDAs (personal digital assistants), PADs (tablet computers), desktop computers, etc. Figure 3 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0086] like Figure 3As shown, the electronic device may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 301, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 302 or a program loaded from a storage device 308 to a random access memory (RAM) 303. When the electronic device is powered on, various programs and data required for the operation of the electronic device are also stored in the RAM 303. The processing device 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.
[0087] Typically, the following devices may be connected to the I / O interface 305: an input device 306 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 307 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 308 including, for example, a memory card, a hard disk, etc.; and a communication device 309. The communication device 309 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although Figure 3 An electronic device having various devices is shown, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0088] An embodiment of the present application also provides a computer program product including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements any one of the video processing methods provided in the embodiments of the present application.
[0089] A computer-readable storage medium is also provided in an embodiment of the present application. The storage medium carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any video processing method provided in the embodiment of the present application.
[0090] Through the description of the above implementation mode, the technicians in the field can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course, it can also be implemented by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. In general, all functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be various, such as analog circuits, digital circuits or special circuits. However, for the present application, software program implementation is a better implementation mode in more cases. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer floppy disk, a U disk, a mobile hard disk, a ROM, a RAM, a disk or an optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, a training device, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0091] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.
[0092] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a training device, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, training device, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.
Claims
1. A video processing method, characterized in that: The video processing method comprises: The server receives a video header file and at least one video frame group of a video to be published uploaded by a first client device, wherein the video header file and the at least one video frame group are generated after the video to be published is split, and each of the video frame groups includes at least one key frame; The server determines a video frame group of the video to be published as the current group in sequence according to the target order, and encapsulates the current group in sequence according to the video header file of the video to be published, obtains the current transport stream file, and reviews the current transport stream file. If the current transport stream file passes the review, the current transport stream file is published; If the server receives a viewing request sent by the second client device, and the target transport stream file corresponding to the video frame group requested by the viewing request has not been released, the server encapsulates the video frame group corresponding to the target transport stream file in advance according to the video header file of the video to be released, and obtains the target transport stream file; The server examines the target transport stream file in advance, and sends the examined target transport stream file to the second client device.
2. The video processing method according to claim 1, characterized in that: The video to be published includes video header information and video data. Before the server receives the video header file and at least one video frame group of the video to be published uploaded by the first client device, the method further includes: The first client device splits the video data according to key frames to obtain multiple video frame groups and marks header information for each video frame group, wherein the header information includes the duration of the video frame group, the key frame time point and the playback sequence number; The first client device uploads the video header file containing the video header information and the multiple video frame groups with marked header information to the server respectively.
3. The video processing method according to claim 2, characterized in that: The video processing method further includes: When encapsulating the current group, the server modifies the duration information and key frame timestamp information in the header information of the current group.
4. The video processing method according to claim 1, characterized in that: The video processing method further includes: If the current transport stream file fails to pass the review, the server will take offline all the published transport stream files of the video to be published.
5. The video processing method according to claim 1, characterized in that: After publishing the current transport stream file, the video processing method further includes: In response to the viewing request for the to-be-published video sent by the second client device, the server sends the published transport stream files obtained by encapsulating each video frame group in sequence according to the target order to the second client device.
6. A video processing system, characterized in that: The video processing system comprises a server side, The server receives a video header file and at least one video frame group of a video to be published uploaded by a first client, wherein the video header file and the at least one video frame group are generated after the video to be published is split, and each of the video frame groups includes at least one key frame; The server determines a video frame group of the video to be published as the current group in sequence according to the target order, and encapsulates the current group in sequence according to the video header file of the video to be published, obtains the current transport stream file, and reviews the current transport stream file. If the current transport stream file passes the review, the current transport stream file is published; If the server receives a viewing request sent by the second client, and the target transport stream file corresponding to the video frame group requested by the viewing request has not been released, the server encapsulates the video frame group corresponding to the target transport stream file in advance according to the video header file of the video to be released, and obtains the target transport stream file; The server side examines the target transport stream file in advance, and sends the examined target transport stream file to the second client side.
7. The video processing system according to claim 6, characterized in that: The video to be released includes video header information and video data, and the video processing system also includes a first client. Before the server receives the video header file and at least one video frame group of the video to be published uploaded by the first client, the first client splits the video data according to key frames, obtains multiple video frame groups and marks header information for each video frame group, wherein the header information includes the duration of the video frame group, the key frame time point and the playback sequence number; The first client uploads the video header file containing the video header information and a plurality of video frame groups marked with header information to the server.
8. The video processing system according to claim 6, characterized in that: When encapsulating the current group, the server side modifies the duration information and key frame timestamp information in the header information of the current group.
9. An electronic device, characterized in that: The method comprises at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program so that the electronic device can implement the video processing method as described in any one of claims 1 to 5.
10. A computer program product, characterized in that The method comprises computer-readable instructions, and when the computer-readable instructions are executed on an electronic device, the electronic device implements the video processing method as claimed in any one of claims 1 to 5.