CN106412677B - Method and device for generating playback video file - Google Patents

Method and device for generating playback video file Download PDF

Info

Publication number
CN106412677B
CN106412677B CN201610964634.8A CN201610964634A CN106412677B CN 106412677 B CN106412677 B CN 106412677B CN 201610964634 A CN201610964634 A CN 201610964634A CN 106412677 B CN106412677 B CN 106412677B
Authority
CN
China
Prior art keywords
video
video stream
frame
segment
stream segment
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.)
Active
Application number
CN201610964634.8A
Other languages
Chinese (zh)
Other versions
CN106412677A (en
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 Qihoo Technology Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing 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 Qihoo Technology Co Ltd, Qizhi Software Beijing Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201610964634.8A priority Critical patent/CN106412677B/en
Publication of CN106412677A publication Critical patent/CN106412677A/en
Priority to PCT/CN2017/103836 priority patent/WO2018076998A1/en
Application granted granted Critical
Publication of CN106412677B publication Critical patent/CN106412677B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/433Content storage operation, e.g. storage operation in response to a pause request, caching operations
    • H04N21/4334Recording operations
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/435Processing of additional data, e.g. decrypting of additional data, reconstructing software from modules extracted from the transport stream
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display

Abstract

The invention discloses a method and a device for generating a playback video file. The method comprises the following steps: capturing video stream data, generating a video stream segment according to the captured video stream data, setting the currently generated video stream segment, and storing the processed video stream segment for calling during playback. Compared with the prior art that the playback video file is generated only after the live video is finished, the method and the device can generate the video stream clip for the user to call and play back in the live video playing process, effectively solve the problem of playback delay of the live video, shorten the time for the user to wait for watching the live video again, and ensure the user experience. And the invention also sets the video stream segment, because the size of the video stream segment is smaller, the setting of the video stream segment with smaller size can be completed only by consuming shorter time, the setting of the whole video stream data is basically completed when the live video is finished, and the problem of playback delay of the live video is further solved.

Description

Method and device for generating playback video file
Technical Field
The invention relates to the technical field of information processing, in particular to a method and a device for generating a playback video file.
Background
Streaming data is data that can be transmitted over a Network by streaming, and a large website system usually depends on a Content Delivery Network (CDN) to transmit streaming data.
In the live video broadcasting process, a live video broadcasting end pushes video stream data recorded in real time to a node server in a content distribution network, the node server caches the received video stream data, and after the live video broadcasting is finished, all the cached video stream data are cached into playback video files with specified formats, such as mp4 files, so that users can call and review the files.
However, in the prior art, the playback video file is generated after the live video broadcast is finished, and a user can call the playback video file from the node server only after waiting for the live video broadcast to be finished, so that the live video has the problem of playback delay, and the user experience is poor.
In addition, in order to make the playback video file suitable for multiple playing platforms, the node server performs format conversion on the playback video file and converts the playback video file into a format supported by the multiple playing platforms. However, since the size of the playback video file is large, the format conversion operation needs to take a long time, and therefore, the format conversion operation for the playback video file can further deepen the playback delay problem of the live video, and further reduce the user experience.
Disclosure of Invention
In view of the above problems, the present invention has been made to provide a generation method of a playback video file and a corresponding generation apparatus of a playback video file that overcome or at least partially solve the above problems.
According to an aspect of the present invention, there is provided a method for generating a playback video file, including:
capturing video stream data and generating video stream fragments according to the captured video stream data;
setting the currently generated video stream segment;
and saving the processed video stream segment for calling during playback.
Optionally, after the capturing the video stream data and generating the video stream segment according to the captured video stream data, the method further includes:
adding a first association identifier for the video stream segment;
and associating a plurality of continuous video stream segments according to the first association identification, and forming a playback video file by the associated video stream segments.
Optionally, the video stream segment is composed of at least one video group of pictures.
Optionally, the capturing video stream data and generating a video stream segment according to the captured video stream data includes:
capturing video stream data according to a preset condition and analyzing the captured video stream data by taking a video frame group as a unit;
at least one consecutive group of video pictures is stored as a video stream segment.
Optionally, the setting the currently generated video stream segment includes:
and converting each video stream segment into a set format which can be played by the mobile client.
Optionally, after the capturing the video stream data and generating the video stream segment according to the captured video stream data, the method further includes:
searching a problem video frame with time offset in a video picture group of the video stream fragment;
and repairing the problem video frame.
Optionally, the searching for a problem video frame that is offset in time in a video group of pictures of the video stream segment includes:
and searching for the video frame with the time difference exceeding the set threshold value from the last video frame.
Optionally, before the repairing the problem video frame, the method further includes:
and judging the problem video frame to be an I frame or a P frame.
Optionally, the repairing the problem video frame includes:
and if the problem video frame is a P frame, deleting the P frame and the following P frames continuous to the P frame.
Optionally, the repairing the problem video frame further includes:
slicing the video frame behind the previous video frame of the problem video frame, and taking the previous video frame as the last video data frame of the first target video stream segment;
and adding a second association identifier with a next target video segment aiming at the first target video stream segment.
Optionally, the repairing the problem video frame includes:
if the problem video frame is an I frame, performing slicing processing before the I frame, and taking the I frame as a first video data frame of a second target video stream segment;
and adding a second association identifier with the last target video clip aiming at the second target video stream clip.
Optionally, the second association identifier is at least one of a sequence number, time information, an associated previous video segment and an associated subsequent video segment.
According to another aspect of the present invention, there is provided a playback video file generation apparatus, including:
the video stream segment generation module is used for capturing video stream data and generating video stream segments according to the captured video stream data;
a setting processing performing module, configured to perform setting processing on a currently generated video stream segment;
and the video stream segment storage module is used for storing the processed video stream segment for calling during playback.
Optionally, the apparatus further comprises:
the first association identifier adding module is used for adding a first association identifier for the video stream fragment after the video stream data is grabbed and the video stream fragment is generated according to the grabbed video stream data;
and the video stream segment association module is used for associating a plurality of continuous video stream segments according to the first association identifier and forming a playback video file by the associated video stream segments.
Optionally, the video stream segment is composed of at least one video group of pictures.
Optionally, the video stream segment generating module includes:
the video stream data capturing submodule is used for capturing video stream data according to preset conditions;
the video stream data analysis submodule is used for analyzing the captured video stream data by taking a video frame group as a unit;
and the video stream segment storage sub-module is used for storing at least one continuous video picture group as the video stream segment.
Optionally, the setting processing module is specifically configured to convert each video stream segment into a setting format that can be played by the mobile client.
Optionally, the apparatus further comprises:
the problem video frame searching module is used for searching a problem video frame with time offset in a video frame group of the video stream fragment after the video stream data is grabbed and the video stream fragment is generated according to the grabbed video stream data;
and the problem video frame repairing module is used for repairing the problem video frame.
Optionally, the problem video frame searching module is specifically configured to search for a video frame whose time difference with a previous video frame exceeds a set threshold.
Optionally, the apparatus further comprises:
and the frame type judging module is used for judging that the problem video frame is an I frame or a P frame before repairing the problem video frame.
Optionally, the problem video frame repair module includes:
and the P frame deleting submodule is used for deleting the P frame and the following continuous P frames if the problem video frame is the P frame.
Optionally, the problem video frame repair module further includes:
a first slicing processing submodule, configured to perform slicing processing on a video frame subsequent to a previous video frame of the problem video frame, and use the previous video frame as a last video data frame of a first target video stream segment;
and the second association identifier adding submodule is used for adding a second association identifier of a next target video segment aiming at the first target video stream segment.
Optionally, the problem video frame repair module includes:
a second slicing processing sub-module, configured to, if the problem video frame is an I frame, perform slicing processing before the I frame, and use the I frame as a first video data frame of a second target video stream segment;
and the second association identifier adding submodule is used for adding a second association identifier of the last target video segment aiming at the second target video stream segment.
Optionally, the second association identifier is at least one of a sequence number, time information, an associated previous video segment and an associated subsequent video segment.
According to the embodiment of the invention, the uploaded video stream data is grabbed, and the video stream fragment is generated according to the grabbed video stream data, wherein the size of the video stream fragment is smaller than that of the complete video stream data to which the grabbed video stream data belongs.
And the invention also sets the video stream segment, because the size of the video stream segment is smaller, only shorter time is needed to finish the setting process of the video stream segment with smaller size, compared with the prior art that the whole video stream data cached after the live broadcast is finished is set, the invention basically finishes the setting process of the whole video stream data when the live broadcast is finished, and further solves the problem of playback delay of the live broadcast video.
Meanwhile, the invention also adds a first correlation identifier for each video stream segment, correlates a plurality of continuous video stream segments according to the first correlation identifier, and unconditionally plays the video stream segment after recognizing that a certain video stream segment carries the related first correlation identifier, thereby ensuring the continuous playing of the plurality of video stream segments.
In addition, the video stream segment can be composed of at least one video picture group, before the video stream segment is associated, the problem video frames with time offset in the video picture group of the video stream segment can be searched and repaired, and the repairing operation of the problem video frames ensures the continuous playing of at least one video picture group in the video stream segment.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a flowchart illustrating steps of a method for generating a playback video file according to a first embodiment of the present invention;
fig. 2 is a flowchart illustrating steps of a method for generating a playback video file according to a second embodiment of the present invention;
fig. 3 is a block diagram showing a structure of a generation apparatus for playing back a video file according to a third embodiment of the present invention;
fig. 4 is a block diagram showing a structure of a generation apparatus for playing back a video file according to a fourth embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
Referring to fig. 1, a schematic flowchart illustrating steps of a method for generating a playback video file according to an embodiment of the present invention is shown, where the method specifically includes the following steps:
step 101, capturing video stream data and generating a video stream segment according to the captured video stream data.
The method provided by the embodiment of the invention is applied to scenes with video data transmitted in a streaming transmission mode, such as a live video scene, a video rebroadcasting process and the like. The video stream uploading end uploads the video stream data to the network server, and the video request end acquires the video data from the network server and plays the video data.
In the existing scheme, a playback video file is generated after all video stream data are received, the playback video file has the problem of generation delay, and a live video has the problem of playback delay.
In order to solve the problem of generation delay of a playback video file and shorten the time for a user to wait for reviewing a played video, the embodiment captures received video stream data and generates a video stream segment according to the captured video stream data, wherein the size of the video stream segment is smaller than that of a complete video, the generated video stream segment has functions of calling and playing, and a video request end can call the video stream segment from a network server and play the video stream segment after the video stream segment is generated.
Because the video stream segment is generated in the live video broadcasting process, the video request terminal can call the generated video stream segment in the live video broadcasting process, and the user can review the played video stream data in the live video broadcasting process, the method effectively shortens the time for the user to wait for watching the playback video file, and effectively solves the problem of playback delay of the live video.
In the capturing process of the video stream data, the video stream data may be captured according to a preset rule, for example, the video stream data is captured according to a preset capturing duration, and the video stream data is captured according to a preset data size, so as to generate a video stream segment.
And 102, setting the currently generated video stream segment.
In the existing method, after transmission of all video stream data is finished, all received and cached video stream data is set, for example, format conversion processing is performed on all video stream data. Since the size of all the video stream data is large, setting processing of all the stream data takes a long time, and this operation may extend the generation time of the playback video file and deepen the playback delay problem of the live video.
According to the method and the device, after the received video stream data are captured and the video stream fragments are generated, the video stream fragments are set, and the processed video stream fragments can be played on various playing platforms. For example, format processing is performed on video stream fragments, an mp4(MPEG-4Part 14) file format of video stream data is transcoded into an HLS (HTTP Live Streaming) file format, and the processed video stream data is suitable for various playing platforms.
Since the size of the video stream segment is small, the setting process for the video stream segment only takes a short time. In the receiving process of the video stream data, the video stream segments are continuously generated, the segments are set after a new video stream segment is generated, and the setting of all the video stream segments, namely all the video stream data, can be finished only by setting the last video stream segment in a short time after all the video stream data are received.
And 103, saving the processed video stream segment for calling during playback.
And setting and processing the generated video stream segments to obtain the video stream segments supported by various platforms, and taking the scheme of the application implemented in the network server as an example, the network server stores the processed video stream segments and generates corresponding playing addresses. The network server can send the playing address of the video stream segment to the playing end according to the calling request sent by the playing end, and the playing end can play the corresponding video stream segment by accessing the playing address so that a user can review the played live video content.
Specifically, the processed single video stream segments can be combined into a playback video file, and a play address is generated for each video stream segment for being called by a video request terminal; or forming a playback video file by the processed video stream segments, and generating a play address aiming at the video stream segments; and after the setting processing is finished, all the processed video stream segments can be combined into a complete playback video file, and a playing address is generated aiming at the complete playback video file so as to call out the playback video file according to the playing address.
According to the embodiment of the invention, the uploaded video stream data is grabbed, and the video stream fragment is generated according to the grabbed video stream data, wherein the size of the video stream fragment is smaller than that of the complete video stream data to which the grabbed video stream data belongs.
And the invention also sets the video stream segment, because the size of the video stream segment is smaller, only shorter time is needed to finish the setting process of the video stream segment with smaller size.
Referring to fig. 2, a schematic flow chart illustrating steps of a method for generating a playback video file according to a second embodiment of the present invention is shown, where the method specifically includes the following steps:
step 201, capturing video stream data according to a preset condition and analyzing the captured video stream data by taking a video frame group as a unit.
The method provided by the embodiment of the invention is applied to scenes with video data transmitted in a streaming transmission mode, such as a video live broadcast process, a video rebroadcast process and a video rebroadcast process. The video stream data uploading end can transmit the video stream data in a frame unit, and correspondingly, the network server receives the video stream data transmitted by the frame.
The embodiment of the invention can preset the condition for capturing the video stream data, and the preset condition can limit the size of the captured video stream data and the time length of the video stream data. Aiming at the condition that the network server has better performance, the size or the duration of the video stream data can be limited to be smaller, so that the video stream data captured in real time can be transmitted as soon as possible, and the transmission of the video stream data has better real-time performance.
Group of Pictures (GOP), a GOP is a Group of consecutive Pictures. In the MPEG (Moving Picture Experts Group) coding standard, a Picture is divided into an I frame (intra Picture), a P frame (predictive-frame), and a B frame (bi-directional predictive-interpolated frame), and a combination of a plurality of consecutive frames belonging to one Picture is called a video Group, for example, IBBPBBPBBPB BPBBP.
After the video stream data is captured according to the preset conditions, the captured video stream data can be analyzed by taking the video frame group as a unit, so that the information such as the number of the video frame groups, the incidence relation among the video frame groups and the like can be obtained.
In the embodiment of the present invention, the preset condition for capturing video stream data may further limit the number of captured video frame groups, where the video frame groups are used as a unit.
At least one consecutive group of video pictures is stored as a video stream fragment, step 202.
A video stream segment may be composed of at least one video group of pictures. The video stream segments grabbed according to the video picture groups include an integer number of video picture groups, and the video stream data grabbed according to other preset conditions may include an integer number of video picture groups and may include partial video picture groups. After the analysis of the video stream data is completed, if the incomplete partial video picture group exists in the current video stream data, the partial video picture group can be divided into the video stream data which is captured next time, and the video stream segment is generated according to the complete video picture group in the current video stream data.
The video stream data transmitted according to the frames are received, and the timestamp offset may exist between the received video frames based on reasons such as frame skipping and network delay, and the timestamp offset may cause that a plurality of video frames cannot be continuously played and a video stream segment cannot be continuously played, so that the user experience is reduced. In order to solve the above problem and ensure that a plurality of video stream segments and a plurality of video frames stored in the server can be continuously played, the embodiment of the present invention may further process different video stream segments and problem video frames in the video stream segments.
Specifically, the processing between different video stream segments may include the following steps: after video stream data are grabbed and video stream fragments are generated according to the grabbed video stream data, adding a first association identifier for the video stream fragments; and associating a plurality of continuous video stream segments according to the first association identification, and forming the associated video stream segments into a playback video file. Wherein playing back the video file may include including one or more video stream segments. After the video request terminal identifies the first association identifier, unconditionally playing the video stream segment corresponding to the first association identifier, so that continuous playing of a plurality of video stream segments is ensured, and continuous playing of a playback video file is ensured.
Processing problem video frames in a video stream segment may include the steps of: after video stream data is captured and a video stream segment is generated according to the captured video stream data, searching a time-offset problem video frame in a video frame group of the video stream segment; and repairing the problem video frame. After repairing the problem video frame, the video stream segment can be played normally.
The video stream data uploading end uploads the video stream data according to frames, the time interval between two adjacent video frames is very short, for example, the time difference between two adjacent video frames is less than 1s, and if the video frames normally have no time offset and other problems during uploading and uploading, the time difference between two adjacent video frames received by the network server is unchanged; if a serious problem occurs during and during uploading, resulting in a large time offset, the time difference between two adjacent video frames received by the network server becomes very large; if a slight problem occurs at and during the uploading process, resulting in a small time offset, the time difference between two adjacent video frames received by the network server becomes large, but the large amplitude is small.
The embodiment of the invention can preset the time difference threshold value between two adjacent video frames. When the time difference between two adjacent video frames is smaller than the time difference threshold, it can be said that no time offset occurs between the two adjacent video frames, or that the time offset occurs between the two adjacent video frames, but the occurring time offset is within an acceptable range, and the playing of the video frames is not seriously affected; when the time difference between two adjacent video frames exceeds the time difference threshold, it can be shown that the video frame received later has time offset from the previous video frame, and the video frame received later is a problem video frame. Therefore, the step of searching for the video frame with time offset problem in the video frame group of the video stream segment can be realized by searching for the video frame with time difference exceeding the set threshold value from the previous video frame.
The video stream segment comprises at least one video picture group, the image frames in the video picture group comprise I frames and P frames, the I frame in one video picture group is adjacent to the P frame in the last video picture group, the last P frame in one video picture group is adjacent to the I frame in the next video picture group, and different repairing methods are adopted for the I frames and the P frames based on different functions and positions of the I frames and the P frames. Therefore, before repairing the problem video frame, it is necessary to determine whether the type of the problem video frame is an I frame or a P frame.
For a video picture group, if a video frame in question is determined to be a P frame, since the P frame is a forward predicted frame, although a dominant situation may occur when the P frame is removed, but a picture still exists, a black screen does not occur, and a user can continue to watch the picture, the method for repairing the P frame may be to delete the P frame and a subsequent P frame. For example, one video group of pictures is (I P PP P P P P P), if the fifth P frame is a problem video frame, the fifth P frame and its following consecutive P frames are deleted, and the repaired video group of pictures is (ip P).
In one video stream segment, if other video picture groups exist behind the video picture group where the video frame in question is located, after deleting the inter-P frame and the following continuous P frames thereof according to the method, the time offset exists between the last P frame in the repaired video picture group and the I frame in the next video picture group, so that the two video picture groups cannot be played normally.
In order to solve the above problems and ensure that the repaired video frame group and the next adjacent video frame group are played normally, the embodiment of the present invention can perform slicing processing on the repaired video frame group and the next adjacent video frame group to obtain two video stream segments; and then adding a second association identifier to the video stream segments, and continuously playing the two video stream segments after the player identifies the second association identifier.
The second association identifier may be added to a video stream segment containing the repaired video group of pictures. If the video request end identifies that the currently played video stream segment carries the second correlation identifier, the video request end directly plays the next video stream segment after the currently played video stream segment is played, regardless of whether the next video stream segment has time offset, so that continuous playing of a plurality of video frame groups is realized.
The second association identification may also be added to a video stream segment containing the next video group of pictures. After the currently played video stream segment is played, if the video request end identifies that the next video stream segment carries the second association identifier, the next video stream segment is directly played without considering whether the time offset exists in the next video stream segment.
The second association identifier may be in a variety of forms, such as at least one of a sequence number, time information, an associated previous video segment, and an associated subsequent video segment. In the embodiment of the present invention, the first association identifier and the second association identifier may be the same identifier or different identifiers.
As can be seen from the above analysis, after deleting a P frame and a subsequent consecutive P frame, repairing a problem video frame may further include: slicing the rear part of the previous video frame of the problem video frame, and taking the previous video frame as the last video data frame of the first target video stream segment; and adding a second association identification with the next target video segment aiming at the first target video stream segment.
For example, a video stream segment includes two adjacent groups of video pictures (I P P P P P P P P I P P P PP P P P), and if a problem occurs with the sixth P frame in the first group of video pictures, the sixth P frame, the seventh P frame, and the eighth P frame in the first group of video pictures are first deleted; secondly, slicing is performed after the fifth P frame in the first video group of pictures to obtain two video stream slices, i.e., (ip P) and (I P P P P P P P P); finally, a second association identifier is added to the video stream segment (ip P).
When a video stream segment includes a plurality of video groups, if it is determined that an I-frame in a video group at the middle position is in a problem, that is, the problem video frame is an I-frame, the step of repairing the problem video frame may include: firstly, slicing processing is carried out before an I frame, and the I frame is used as a first video data frame of a second target video stream segment; secondly, a second association identifier of the last target video clip is added aiming at the second target video stream clip. And after recognizing that the last target video clip or the second target video stream clip currently played carries the second association identifier, the video request end unconditionally plays the second target video stream clip, thereby ensuring the continuous playing of the two video picture groups.
Step 203, converting each video stream segment into a setting format that can be played by the mobile client.
In order to make the generated video stream segment playable on the mobile client, the embodiment converts the generated video stream segment into a format playable by the mobile client, for example, an mp4(MPEG-4Part 14) file format of the video stream data may be transcoded into an HLS (HTTP Live Streaming) file format.
In the receiving process of the video stream data, the video stream segments are continuously generated, after a new video stream segment is generated, format conversion is carried out on the video stream segment with a smaller size, and after all the video stream data are received, format conversion of all the video stream data can be completed only by consuming shorter time to carry out format processing on the last video stream segment.
And step 204, saving the processed video stream segment for calling during playback.
According to the embodiment of the invention, the uploaded video stream data is grabbed, and the video stream fragment is generated according to the grabbed video stream data, wherein the size of the video stream fragment is smaller than that of the complete video stream data to which the grabbed video stream data belongs.
And the invention also sets the video stream segment, because the size of the video stream segment is smaller, only shorter time is needed to finish the setting process of the video stream segment with smaller size.
Meanwhile, the invention also adds a first associated identifier for each video stream segment, associates a plurality of continuous video stream segments according to the first associated identifier, and unconditionally plays a certain video stream segment after the exclusive player identifies the first associated identifier of the video stream segment, thereby ensuring the continuous playing of the plurality of video stream segments.
In addition, the video stream segment can be composed of at least one video picture group, before the video stream segment is associated, the problem video frames with time offset in the video picture group of the video stream segment can be searched and repaired, and the repairing operation of the problem video frames ensures the continuous playing of at least one video picture group in the video stream segment.
Fig. 3 shows a block diagram of a generating apparatus for playing back a video file according to a third embodiment of the present invention. The generation apparatus of the playback video file in fig. 3 includes:
the video stream segment generating module 301 is configured to capture video stream data and generate a video stream segment according to the captured video stream data.
A setting processing proceeding module 302, configured to perform setting processing on the currently generated video stream segment.
And a video stream segment saving module 303, configured to save the processed video stream segment for call when playing back.
According to the embodiment of the invention, the uploaded video stream data is grabbed, and the video stream fragment is generated according to the grabbed video stream data, wherein the size of the video stream fragment is smaller than that of the complete video stream data to which the grabbed video stream data belongs.
And the invention also sets the video stream segment, because the size of the video stream segment is smaller, only shorter time is needed to finish the setting process of the video stream segment with smaller size.
Fig. 4 is a block diagram showing a structure of a generation apparatus for playing back a video file according to a fourth embodiment of the present invention. The generation apparatus of the playback video file in fig. 4 includes:
the video stream segment generating module 401 is configured to capture video stream data and generate a video stream segment according to the captured video stream data.
A setting processing proceeding module 402, configured to perform setting processing on the currently generated video stream segment.
And a video stream segment saving module 403, configured to save the processed video stream segment for call when playing back.
The video stream segment generation module 401 includes:
the video stream data capturing submodule 4011 is configured to capture video stream data according to a preset condition;
the video stream data analysis submodule 4012 is configured to analyze the captured video stream data in units of video frame groups;
the video stream segment storing submodule 4013 is configured to store at least one consecutive video group of pictures as a video stream segment.
In this embodiment of the present invention, preferably, the setting processing performing module 402 is specifically configured to convert each video stream segment into a setting format that can be played by the mobile client.
In the embodiment of the present invention, preferably, the apparatus further includes:
the first association identifier adding module is used for adding a first association identifier for the video stream fragment after the video stream data is grabbed and the video stream fragment is generated according to the grabbed video stream data;
and the video stream segment association module is used for associating a plurality of continuous video stream segments according to the first association identifier and forming a playback video file by the associated video stream segments.
In the embodiment of the present invention, preferably, the video stream segment is composed of at least one video picture group.
In this embodiment of the present invention, preferably, the apparatus for generating a playback video file further includes:
the problem video frame searching module is used for searching a problem video frame with time offset in a video frame group of the video stream fragment after the video stream data is grabbed and the video stream fragment is generated according to the grabbed video stream data;
and the problem video frame repairing module is used for repairing the problem video frame.
In the embodiment of the present invention, preferably, the problem video frame searching module is specifically configured to search for a video frame whose time difference with a previous video frame exceeds a set threshold.
In this embodiment of the present invention, preferably, the apparatus for generating a playback video file further includes:
and the frame type judging module is used for judging that the problem video frame is an I frame or a P frame before repairing the problem video frame.
In this embodiment of the present invention, preferably, the problem video frame repairing module includes:
and the P frame deleting submodule is used for deleting the P frame and the following continuous P frames if the problem video frame is the P frame.
In this embodiment of the present invention, preferably, the problem video frame repairing module further includes:
a first slicing processing submodule, configured to perform slicing processing on a video frame subsequent to a previous video frame of the problem video frame, and use the previous video frame as a last video data frame of a first target video stream segment;
and the second association identifier adding submodule is used for adding a second association identifier of a next target video segment aiming at the first target video stream segment.
In this embodiment of the present invention, preferably, the problem video frame repairing module includes:
a second slicing processing sub-module, configured to, if the problem video frame is an I frame, perform slicing processing before the I frame, and use the I frame as a first video data frame of a second target video stream segment;
and the second association identifier adding submodule is used for adding a second association identifier of the last target video segment aiming at the second target video stream segment.
In this embodiment of the present invention, preferably, the second association identifier is at least one of a sequence number, time information, an associated previous video segment, and an associated next video segment.
According to the embodiment of the invention, the uploaded video stream data is grabbed, and the video stream fragment is generated according to the grabbed video stream data, wherein the size of the video stream fragment is smaller than that of the complete video stream data to which the grabbed video stream data belongs.
And the invention also sets the video stream segment, because the size of the video stream segment is smaller, only shorter time is needed to finish the setting process of the video stream segment with smaller size.
Meanwhile, the invention also adds a first associated identifier for each video stream segment, associates a plurality of continuous video stream segments according to the first associated identifier, and unconditionally plays a certain video stream segment after the exclusive player identifies the first associated identifier of the video stream segment, thereby ensuring the continuous playing of the plurality of video stream segments.
In addition, the video stream segment can be composed of at least one video picture group, before the video stream segment is associated, the problem video frames with time offset in the video picture group of the video stream segment can be searched and repaired, and the repairing operation of the problem video frames ensures the continuous playing of at least one video picture group in the video stream segment.
The algorithms and displays presented herein are not inherently related to any particular computer, virtual machine, or other apparatus. Various general purpose systems may also be used with the teachings herein. The required structure for constructing such a system will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
The various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It will be appreciated by those skilled in the art that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components of a playback video file generating device according to embodiments of the present invention. The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.

Claims (20)

1. A method of generating a playback video file, comprising:
capturing video stream data and generating a video stream segment according to the captured video stream data, wherein the video stream segment is generated in the live video broadcasting process and is used for calling and playing back in the live video broadcasting process;
performing setting processing on a currently generated video stream segment, where the performing setting processing on the currently generated video stream segment includes: converting each video stream segment into a setting format which can be played by a mobile client;
storing the processed video stream segment for calling during playback; wherein after said capturing video stream data and generating a video stream segment from the captured video stream data, the method further comprises:
adding a first association identifier for the video stream segment;
associating a plurality of continuous video stream segments according to the first association identification, and forming the associated video stream segments into a playback video file, wherein the playback video file comprises one or more video stream segments; and after the video request terminal identifies the first association identifier, unconditionally playing the video stream segment corresponding to the first association identifier.
2. The method of claim 1, wherein the video stream segment is comprised of at least one video group of pictures.
3. The method of claim 2, wherein said crawling video stream data and generating video stream segments from the crawled video stream data comprises:
capturing video stream data according to a preset condition and analyzing the captured video stream data by taking a video frame group as a unit;
at least one consecutive group of video pictures is stored as a video stream segment.
4. The method of claim 2, wherein after said grabbing video stream data and generating a video stream segment from the grabbed video stream data, the method further comprises:
searching a problem video frame with time offset in a video picture group of the video stream fragment;
and repairing the problem video frame.
5. The method of claim 4, wherein said finding a problem video frame that is time-shifted in a video group of pictures of the video stream segment comprises:
and searching for the video frame with the time difference exceeding the set threshold value from the last video frame.
6. The method of claim 4, wherein prior to said repairing the problem video frame, the method further comprises:
and judging the problem video frame to be an I frame or a P frame.
7. The method of claim 6, wherein the repairing the problem video frame comprises:
and if the problem video frame is a P frame, deleting the P frame and the following P frames continuous to the P frame.
8. The method of claim 7, wherein the repairing the problem video frame further comprises:
slicing the video frame behind the previous video frame of the problem video frame, and taking the previous video frame as the last video data frame of the first target video stream segment;
and adding a second association identifier with a next target video segment aiming at the first target video stream segment.
9. The method of claim 8, wherein the repairing the problem video frame comprises:
if the problem video frame is an I frame, performing slicing processing before the I frame, and taking the I frame as a first video data frame of a second target video stream segment;
and adding a second association identifier with the last target video clip aiming at the second target video stream clip.
10. The method of claim 8, wherein the second association identification is at least one of a sequence number, temporal information, an associated previous video segment, and an associated subsequent video segment.
11. A generation apparatus for playing back a video file, comprising:
the video stream segment generation module is used for capturing video stream data and generating a video stream segment according to the captured video stream data, wherein the video stream segment is generated in the live video broadcasting process, and the video stream segment is used for calling and playing back in the live broadcasting process;
a setting processing performing module, configured to perform setting processing on currently generated video stream segments, where the setting processing performing module is specifically configured to convert each video stream segment into a setting format that can be played by a mobile client;
the video stream segment storage module is used for storing the processed video stream segment for calling during playback; wherein the apparatus further comprises:
the first association identifier adding module is used for adding a first association identifier for the video stream fragment after the video stream data is grabbed and the video stream fragment is generated according to the grabbed video stream data;
a video stream segment association module, configured to associate multiple consecutive video stream segments according to the first association identifier, and compose the associated video stream segments into a playback video file, where the playback video file includes one or more video stream segments; and after the video request terminal identifies the first association identifier, unconditionally playing the video stream segment corresponding to the first association identifier.
12. The apparatus of claim 11, wherein the video stream segment is comprised of at least one video group of pictures.
13. The apparatus of claim 12, wherein the video stream segment generation module comprises:
the video stream data capturing submodule is used for capturing video stream data according to preset conditions;
the video stream data analysis submodule is used for analyzing the captured video stream data by taking a video frame group as a unit;
and the video stream segment storage sub-module is used for storing at least one continuous video picture group as the video stream segment.
14. The apparatus of claim 12, wherein the apparatus further comprises:
the problem video frame searching module is used for searching a problem video frame with time offset in a video frame group of the video stream fragment after the video stream data is grabbed and the video stream fragment is generated according to the grabbed video stream data;
and the problem video frame repairing module is used for repairing the problem video frame.
15. The apparatus of claim 14, wherein:
the problem video frame searching module is specifically used for searching the video frame of which the time difference with the previous video frame exceeds the set threshold value.
16. The apparatus of claim 14, wherein the apparatus further comprises:
and the frame type judging module is used for judging that the problem video frame is an I frame or a P frame before repairing the problem video frame.
17. The apparatus of claim 16, wherein the problem video frame repair module comprises:
and the P frame deleting submodule is used for deleting the P frame and the following continuous P frames if the problem video frame is the P frame.
18. The apparatus of claim 17, wherein the problem video frame repair module further comprises:
a first slicing processing submodule, configured to perform slicing processing on a video frame subsequent to a previous video frame of the problem video frame, and use the previous video frame as a last video data frame of a first target video stream segment;
and the second association identifier adding submodule is used for adding a second association identifier of a next target video segment aiming at the first target video stream segment.
19. The apparatus of claim 16, wherein the problem video frame repair module comprises:
a second slicing processing sub-module, configured to, if the problem video frame is an I frame, perform slicing processing before the I frame, and use the I frame as a first video data frame of a second target video stream segment;
and the second association identifier adding submodule is used for adding a second association identifier of the last target video segment aiming at the second target video stream segment.
20. The apparatus of claim 19, wherein the second association identifier is at least one of a sequence number, temporal information, an associated previous video segment, and an associated subsequent video segment.
CN201610964634.8A 2016-10-28 2016-10-28 Method and device for generating playback video file Active CN106412677B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201610964634.8A CN106412677B (en) 2016-10-28 2016-10-28 Method and device for generating playback video file
PCT/CN2017/103836 WO2018076998A1 (en) 2016-10-28 2017-09-28 Method and device for generating playback video file

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610964634.8A CN106412677B (en) 2016-10-28 2016-10-28 Method and device for generating playback video file

Publications (2)

Publication Number Publication Date
CN106412677A CN106412677A (en) 2017-02-15
CN106412677B true CN106412677B (en) 2020-06-02

Family

ID=58014147

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610964634.8A Active CN106412677B (en) 2016-10-28 2016-10-28 Method and device for generating playback video file

Country Status (2)

Country Link
CN (1) CN106412677B (en)
WO (1) WO2018076998A1 (en)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106412677B (en) * 2016-10-28 2020-06-02 北京奇虎科技有限公司 Method and device for generating playback video file
CN108040286A (en) * 2017-11-28 2018-05-15 北京潘达互娱科技有限公司 Video previewing method, device, electronic equipment and computer-readable recording medium
CN107948715A (en) * 2017-11-28 2018-04-20 北京潘达互娱科技有限公司 Live network broadcast method and device
CN108965831B (en) * 2018-09-05 2020-09-25 北京疯景科技有限公司 Video processing method and device and intelligent visual doorbell
CN111447455A (en) * 2018-12-29 2020-07-24 北京奇虎科技有限公司 Live video stream playback processing method and device and computing equipment
CN112289429A (en) * 2019-07-25 2021-01-29 深圳市理邦精密仪器股份有限公司 Central monitoring station, monitoring system, data reviewing method and device
CN111031385B (en) * 2019-12-20 2022-03-08 北京爱奇艺科技有限公司 Video playing method and device
CN111787341B (en) * 2020-05-29 2023-12-05 北京京东尚科信息技术有限公司 Guide broadcasting method, device and system
CN112468839B (en) 2020-11-26 2022-11-25 上海哔哩哔哩科技有限公司 Playback method, system, device and readable storage medium of live content
CN113630618B (en) * 2021-08-06 2024-02-13 上海哔哩哔哩科技有限公司 Video processing method, device and system
CN113873288A (en) * 2021-12-02 2021-12-31 北京微吼时代科技有限公司 Method and device for generating playback in live broadcast process
CN114339289B (en) * 2021-12-30 2023-08-15 杭州当虹科技股份有限公司 Video playing processing method

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101193311A (en) * 2006-12-21 2008-06-04 腾讯科技(深圳)有限公司 Audio and video data synchronization method in P2P system
CN101917389A (en) * 2009-12-17 2010-12-15 新奥特(北京)视频技术有限公司 Network television direct broadcasting system
CN104683884A (en) * 2015-02-09 2015-06-03 网宿科技股份有限公司 Live method and system for stream medium
CN104822079A (en) * 2014-12-31 2015-08-05 北京奇艺世纪科技有限公司 Video file real-time publication method and system
CN104980767A (en) * 2015-07-29 2015-10-14 北京视信互动科技有限公司 Method for grabbing and sharing instant DVB video clips
CN105846940A (en) * 2016-03-30 2016-08-10 乐视控股(北京)有限公司 Timestamp fault-tolerant control method and device

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101901620A (en) * 2010-07-28 2010-12-01 复旦大学 Automatic generation method and edit method of video content index file and application
CN102625140A (en) * 2012-03-19 2012-08-01 烽火通信科技股份有限公司 Method for frame-granularity real-time downloading and play of streaming media server
JP5909546B2 (en) * 2012-04-03 2016-04-26 株式会社ビットメディア Apparatus and method for streaming video
CN104469433B (en) * 2013-09-13 2018-09-07 深圳市腾讯计算机系统有限公司 Method and device is reviewed in a kind of net cast
CN105100892B (en) * 2015-07-28 2018-05-15 努比亚技术有限公司 Video play device and method
CN105120321A (en) * 2015-08-21 2015-12-02 北京佳讯飞鸿电气股份有限公司 Video searching method, video storage method and related devices
CN105357593B (en) * 2015-10-30 2019-06-07 努比亚技术有限公司 A kind of methods, devices and systems of uploaded videos
CN106412677B (en) * 2016-10-28 2020-06-02 北京奇虎科技有限公司 Method and device for generating playback video file

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101193311A (en) * 2006-12-21 2008-06-04 腾讯科技(深圳)有限公司 Audio and video data synchronization method in P2P system
CN101917389A (en) * 2009-12-17 2010-12-15 新奥特(北京)视频技术有限公司 Network television direct broadcasting system
CN104822079A (en) * 2014-12-31 2015-08-05 北京奇艺世纪科技有限公司 Video file real-time publication method and system
CN104683884A (en) * 2015-02-09 2015-06-03 网宿科技股份有限公司 Live method and system for stream medium
CN104980767A (en) * 2015-07-29 2015-10-14 北京视信互动科技有限公司 Method for grabbing and sharing instant DVB video clips
CN105846940A (en) * 2016-03-30 2016-08-10 乐视控股(北京)有限公司 Timestamp fault-tolerant control method and device

Also Published As

Publication number Publication date
WO2018076998A1 (en) 2018-05-03
CN106412677A (en) 2017-02-15

Similar Documents

Publication Publication Date Title
CN106412677B (en) Method and device for generating playback video file
US10720188B2 (en) Systems and methods of thumbnail generation
CN106060578B (en) Generate the method and system of video data
US9578366B2 (en) Companion device services based on the generation and display of visual codes on a display device
WO2016029804A1 (en) Video play method, media device, player and multimedia system
US8855471B2 (en) Media generation system
US20090097815A1 (en) System and method for distributed and parallel video editing, tagging, and indexing
US9137586B2 (en) Content creation method and media cloud server
JPWO2012096372A1 (en) Content playback apparatus, content playback method, distribution system, content playback program, recording medium, and data structure
CN103581705A (en) Method and system for recognizing video program
CN111447455A (en) Live video stream playback processing method and device and computing equipment
CN109155840B (en) Moving image dividing device and monitoring method
US20200117910A1 (en) Methods and apparatus for generating a video clip
CN107071549A (en) Many player fast switch over method, device and storage medium under single decoder
CN111726657A (en) Live video playing processing method and device and server
CN108471548B (en) Live video quick playing method and device
US20170013037A1 (en) Media fragment rotation method, client and system
JP2006270634A (en) Digital broadcast synchronizing reproducing apparatus, stream synchronization reproducing apparatus, and stream synchronization reproducing system
CN108881119B (en) Method, device and system for video concentration
KR102069897B1 (en) Method for generating user video and Apparatus therefor
US20180124435A1 (en) Systems and methods for live multimedia information collection, presentation, and standardization
US20230300430A1 (en) Method and system to highlight video segments in a video stream
CN110545447B (en) Audio and video synchronization method and device
KR102036383B1 (en) Content creation method and apparatus
CN111918092A (en) Video stream processing method, device, server and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20220722

Address after: Room 801, 8th floor, No. 104, floors 1-19, building 2, yard 6, Jiuxianqiao Road, Chaoyang District, Beijing 100015

Patentee after: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Address before: Room 112, block D, No. 28, Xinjiekou outer street, Xicheng District, Beijing 100088 (Desheng Park)

Patentee before: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Patentee before: Qizhi software (Beijing) Co.,Ltd.