CN110740344A - Video extraction method and related device - Google Patents

Video extraction method and related device Download PDF

Info

Publication number
CN110740344A
CN110740344A CN201910877519.0A CN201910877519A CN110740344A CN 110740344 A CN110740344 A CN 110740344A CN 201910877519 A CN201910877519 A CN 201910877519A CN 110740344 A CN110740344 A CN 110740344A
Authority
CN
China
Prior art keywords
frame
target
video
image group
target image
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.)
Granted
Application number
CN201910877519.0A
Other languages
Chinese (zh)
Other versions
CN110740344B (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.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN201910877519.0A priority Critical patent/CN110740344B/en
Publication of CN110740344A publication Critical patent/CN110740344A/en
Application granted granted Critical
Publication of CN110740344B publication Critical patent/CN110740344B/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/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/23418Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving operations for analysing video streams, e.g. detecting features or characteristics
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/2343Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
    • H04N21/234309Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements by transcoding between formats or standards, e.g. from MPEG-2 to MPEG-4 or from Quicktime to Realvideo
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/2343Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
    • H04N21/234345Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements the reformatting operation being performed only on part of the stream, e.g. a region of the image or a time segment
    • 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 or rendering scenes according to encoded video stream scene graphs
    • H04N21/44008Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving operations for analysing video streams, e.g. detecting features or characteristics in the video 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 or rendering scenes according to encoded video stream scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • H04N21/440218Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display by transcoding between formats or standards, e.g. from MPEG-2 to MPEG-4
    • 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 or rendering scenes according to encoded video stream scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • H04N21/440245Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display the reformatting operation being performed only on part of the stream, e.g. a region of the image or a time segment

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses video extraction methods and related devices, wherein the video extraction method comprises the steps of obtaining a target image group corresponding to query time input by a user in a video to be extracted, and extracting a target video from the video to be extracted by taking a target frame as an initial frame and adopting an extraction strategy matched with the position relation based on the position relation between an I frame in the target image group and a target frame corresponding to the query time.

Description

Video extraction method and related device
Technical Field
The present application relates to the field of information technology, and in particular, to video extraction methods and related apparatuses.
Background
However, limited by the video encoding and decoding principle, the th frame Of the extracted video must be an I frame, which causes the existing video extraction method to focus on how to quickly locate the first I frames Of the target frame corresponding to the query time, however, the extraction Of the video in this way causes an error Of GOPs (Group Of Pictures) between the target frame and the th frame Of the extracted video to be maximum.
Disclosure of Invention
The technical problem that this application mainly solved is to provide kinds of video extraction methods and relevant devices, can improve the precision of video extraction.
In order to solve the above problems, the th aspect of the present application provides a video extraction method, including obtaining a target image group corresponding to a query time input by a user in a video to be extracted, and extracting a target video from the video to be extracted by using an extraction policy matched with a position relationship between an I frame in the target image group and a target frame corresponding to the query time, with the target frame as a start frame, based on the position relationship between the I frame and the target frame.
In order to solve the above problems, a second aspect of the present application provides video extraction apparatuses, including an obtaining module and an extracting module, where the obtaining module is configured to obtain a target image group corresponding to a query time input by a user in a video to be extracted, and the extracting module is configured to extract a target video from the video to be extracted by using an extraction policy matched with a position relation, with a target frame as an initial frame, based on the position relation between an I frame in the target image group and a target frame corresponding to the query time.
In order to solve the above problem, the third aspect of the present application provides video capturing devices, which include a memory and a processor coupled to each other, wherein the processor is configured to execute program instructions stored in the memory to implement the method of the above aspect.
In order to solve the above problem, a fourth aspect of the present application provides storage devices storing program instructions capable of being executed by a processor, the program instructions being for implementing the method of the above aspect.
According to the scheme, the target image group corresponding to the query time input by the user in the video to be extracted is obtained, the target video is extracted from the video to be extracted by taking the target frame as the starting frame and adopting the extraction strategy matched with the position relation based on the position relation between the I frame in the target image group and the target frame corresponding to the query time, so that no error exists between the starting frame of the extracted target video and the target frame corresponding to the query time input by the user, the video extraction precision is accurate to the frame, and the video extraction precision can be improved.
Drawings
FIG. 1 is a schematic flow chart diagram of an embodiment of a video extraction method of the present application;
FIG. 2 is a block diagram of an embodiment of an image group ;
FIG. 3 is a block diagram of an alternative embodiment of an image group ;
FIG. 4 is a schematic flow chart of an embodiment of step S12 in FIG. 1;
FIG. 5 is a schematic flow chart of an embodiment of step S123 in FIG. 4;
fig. 6 is a schematic block diagram of an embodiment of a video extracting apparatus of the present application;
FIG. 7 is a block diagram of another embodiment of the video capture device of the present application;
fig. 8 is a block diagram of an embodiment of a memory device of the present application.
Detailed Description
The following describes in detail the embodiments of the present application with reference to the drawings attached hereto.
In the following description, for purposes of explanation and not limitation, specific details are set forth such as particular system structures, interfaces, techniques, etc. in order to provide a thorough understanding of the present application.
The term "and/or" herein, simply , describes the association of associated objects, meaning that there may be three relationships, e.g., A and/or B, may mean that there are three cases of A alone, A and B together, and B alone.
Referring to fig. 1, fig. 1 is a schematic flow chart of an embodiment of a video extraction method of the present application, which specifically includes the following steps:
step S11: and acquiring a target image group corresponding to the query time input by the user in the video to be extracted.
In implementation scenarios, the query time input by the user can be determined by the time selection of the user on the time axis, in another implementation scenarios, the query time input by the user can also be determined by the time selected by the user in the drop-down list, in yet another implementation scenarios, the query time input by the user can also be determined by the query time directly input by the user.
Referring to fig. 2 in conjunction, fig. 2 is a block diagram Of an embodiment Of a Group Of pictures , a Group Of Pictures (GOP) in the conventional sense begins with an I-frame and ends with a frame before the next I-frames, all frames in GOPs are independent Of their previous GOPs and their subsequent GOPs, i.e., Closed Group Of pictures (Closed GOP), i.e., all frames in GOPs cannot depend on GOPs before or after the GOP, but only on frames in the GOP.
Generally, the th frame after the scene change is an I frame, the I frame should be transmitted in a full frame, and from the perspective of compression, the compression amount of the I frame is the smallest, the compression amount of the B frame is the largest next to the P frame.
Referring to fig. 2 in combination, for example, if the query time input by the user is ": 09", the target image group is the group of pictures (GOP) shown in fig. 2, and so on in other cases, this embodiment is not illustrated in .
Step S12: and based on the position relation between the I frame in the target image group and the target frame corresponding to the query time, extracting the target video from the video to be extracted by using the target frame as a starting frame and adopting an extraction strategy matched with the position relation.
Please refer to fig. 2, if the query time is ": 03", the target frame is the I frame in the target image group, then extraction strategies may be determined, or, if the query time is ": 09", the target frame is not the same as the I frame in the target image group, then another extraction strategies may be determined, and the specific extraction strategies are not described herein for the moment.
In the embodiment, a determined extraction strategy is adopted to extract a video from a video to be extracted by taking a target frame as a starting frame, so as to obtain a target video, in implementation scenes, the target video can be played after the target video is extracted based on specific requirements of a user, in another implementation scenes, the target video can be downloaded after the target video is extracted based on the specific requirements of the user, and the embodiment is not limited specifically herein.
According to the scheme, the target image group corresponding to the query time input by the user in the video to be extracted is obtained, the target video is extracted from the video to be extracted by taking the target frame as the starting frame and adopting the extraction strategy matched with the position relation based on the position relation between the I frame in the target image group and the target frame corresponding to the query time, so that no error exists between the starting frame of the extracted target video and the target frame corresponding to the query time input by the user, the video extraction precision is accurate to the frame, and the video extraction precision can be improved.
Referring to fig. 4, fig. 4 is a schematic flowchart illustrating an embodiment of step S12 in fig. 1, specifically, step S12 may include:
and step S121, judging whether the I frame and the target frame in the target image group are the same frames, if so, executing step S122, otherwise, executing step S123.
In implementation scenarios, the query time inputted by the user can be compared with the time of the I frame in the target image group, if the two are the same, the I frame and the target frame in the target image group are the same frames, and if the two are different, the I frame and the target frame in the target image group are not the same frames.
Step S122: and directly extracting a frame sequence behind the target frame in the video to be extracted as the target video.
If the I frame and the target frame in the target image group are the same frames, since the frames after the I frame in the target image group are all encoded based on the I frame, the frame sequence after the target frame in the video to be extracted can be directly extracted as the target video.
Referring to fig. 2, if the query time input by the user is ": 03", the target frame corresponding to the query time is an I frame in the target image group, and at this time, the frame sequence after the target frame may be directly extracted as the target video.
Step S123: and respectively recoding the original frames behind the target frames in the target image group, and extracting the frame sequence behind the recoded target frames as the target video.
In implementation scenes, a target frame is located after an I frame in a target image group, as shown in fig. 2, if the query time input by the user is ": 05", the target frame corresponding to the query time is located after the I frame, and since the frame sequence after the target frame is essentially based on I frame coding, the original B frame and P frame cannot be used as the B frame and P frame of the target video, and the frame sequence after the target frame needs to be re-coded as the target video.
According to the scheme, when the I frame and the target frame in the target image group are the same frames, the frame sequence behind the target frame in the video to be extracted is directly extracted as the target video, and when the I frame and the target frame in the target image group are not the same frames, the original frame behind the target frame in the target image group is re-encoded respectively, and the frame sequence behind the re-encoded target frame is extracted as the target video, so that the code stream characteristics of the extracted target video are the same as those of the original video to be extracted, and further, the subsequent use of the target video cannot be influenced.
In addition, because only the frames in the target image group are subjected to encoding and decoding processing, the amount of secondary calculation generated by extracting the target video is controllable, and the influence on the whole system is reduced as much as possible.
Referring to fig. 5, fig. 5 is a schematic flowchart of an embodiment of step S123 in fig. 4, in this embodiment, in order to make a frame sequence after a target frame after re-encoding identical to a code stream characteristic of an original video to be extracted, the following steps may be sampled to implement:
step S1231: and determining the encoding strategy of the video to be extracted based on the target image group.
In the present embodiment, parameter definition sets in a target group of pictures can be extracted, and a plurality of encoding parameters can be obtained based on the parameter definition sets.
In specific embodiments, if the video to be extracted is an h.264 code stream, a Sequence Parameter Set (SPS) and a Picture Parameter Set (PPS) may be extracted based on a target image group, and on this basis, the Sequence Parameter Set and the Picture Parameter Set are parsed to obtain a plurality of encoding parameters, such as resolution, encoding level, frame rate, consecutive B frames, group of pictures length, and the like.
Besides, when the video to be extracted is other code streams such as h.265, RealVideo, VC-1, etc., the encoding strategy of the video to be extracted can be obtained by analogy, and this embodiment is not exemplified by .
Step S1232: and decoding the target image group based on the decoding strategy matched with the coding strategy to acquire the original frame of the target image group.
In this embodiment, a plurality of decoding parameters matching the encoding parameters may be obtained based on the obtained encoding parameters, so as to decode the target image group using the decoding parameters, and obtain the original frame of the target image group, for example, the original frame in YUV format, which is not limited in this embodiment.
In addition, please refer to fig. 3 in combination, fig. 3 is a schematic diagram of a frame of another group of pictures, in practical application, in order to obtain a larger compression ratio, there are Open group of pictures (Open GOP), the Open group of pictures starts with or more B frames, the B frames refer to the last P frame of the previous GOPs and the th I frame of the current GOP for encoding, it can also be considered that the previous GOPs do not end with the P frame, but end with the B frame, the B frames refer to the last P frames of the GOP and the beginning I frame of the next GOPs for encoding, when the group of pictures is the Open group of pictures shown in fig. 3, the previous two B frames (i.e., the two B frames with time ": 19" and ": 20" in fig. 3) in groups of the target group of pictures need to be decoded by steps to obtain the original frames.
Step S1233: and re-encoding the original frame after the target frame by adopting an encoding strategy.
In implementation scenarios, the original frame before the target frame (excluding the target frame) in the target image group may be discarded, so that the original frame after the target frame (including the target frame) may be re-encoded by adopting the obtained encoding strategy.
In implementation scenarios, the original frame after the target frame may be re-encoded by using the above-mentioned acquisition of multiple codes.
In addition, in implementation scenarios, when the group of pictures is the open group of pictures shown in fig. 3, steps are further required to decode the first two B frames (i.e., the two B frames with time ": 19" and ": 20" in fig. 3) in the groups of the target group of pictures to obtain their original frames, and re-encode them.
Step S1234: and extracting a frame sequence after the target frame after the recoding as the target video.
In implementation scenes, the original frame group after the target frame after re-encoding can be packaged as a new target image group, and the original target image group in the video to be extracted is replaced by the new target image group, so that a new target image group and the following image group are extracted as the target video.
Referring to fig. 2, when the query time input by the user is ": 07", since the target frame corresponding to the query time is not frames different from the I frame in the target image group, the frame sequence after the target frame in the target image group is re-encoded and packaged as a new target image group, i.e. the re-encoded frame sequence between the time ": 07" -: 17 "in fig. 2 constitutes a new target image group, and the new target image group replaces the original target image group, so that the new target image group and the image group after the new target image group are used as the target video.
Referring to fig. 6, fig. 6 is a schematic frame diagram of an embodiment of a video extraction device 60 according to the present application, where the video extraction device 60 specifically includes an acquisition module 61 and an extraction module 62, the acquisition module 61 is configured to acquire a target image group corresponding to query time input by a user in a video to be extracted, and the extraction module 62 is configured to extract a target video from the video to be extracted by using an extraction policy matched with a position relation with an I frame in the target image group as a starting frame based on the position relation between the I frame and a target frame corresponding to the query time.
According to the scheme, the target image group corresponding to the query time input by the user in the video to be extracted is obtained, the target video is extracted from the video to be extracted by taking the target frame as the starting frame and adopting the extraction strategy matched with the position relation based on the position relation between the I frame in the target image group and the target frame corresponding to the query time, so that no error exists between the starting frame of the extracted target video and the target frame corresponding to the query time input by the user, the video extraction precision is accurate to the frame, and the video extraction precision can be improved.
In , the extracting module 62 includes a extracting sub-module, configured to directly extract a frame sequence after the target frame in the video to be extracted as the target video when it is determined that the I frame and the target frame in the target group of pictures are the same frames, and the extracting module 62 further includes a second extracting sub-module, configured to re-encode the original frame after the target frame in the target group of pictures and extract the frame sequence after the re-encoded target frame as the target video when it is determined that the I frame and the target frame in the target group of pictures are not the same frames.
In , the second extraction sub-module includes a policy determination unit for determining an encoding policy of the video to be extracted based on the target image group, the second extraction sub-module further includes a decoding unit for decoding the target image group based on a decoding policy matching the encoding policy and obtaining an original frame of the target image group, the second extraction sub-module further includes an encoding unit for re-encoding the original frame after the target frame with the encoding policy, and the second extraction sub-module further includes an extraction sub-unit for extracting a frame sequence after the re-encoded target frame as the target video.
Different from the above embodiments, in this embodiment, an original frame after a target frame in a target image group is re-encoded based on an encoding policy of a video to be extracted, and a frame sequence after the target frame after re-encoding is extracted as a target video, so that a code stream characteristic of the target video remains unchanged, and further, use of a subsequent target video is not affected.
In addition, because only the frames in the target image group are subjected to encoding and decoding processing, the amount of secondary calculation generated by extracting the target video is controllable, and the influence on the whole system is reduced as much as possible.
In , the encoding policy includes a plurality of encoding parameters, the decoding policy includes a plurality of decoding parameters, the policy determining unit is specifically configured to extract a parameter definition set in the target image group and obtain the plurality of encoding parameters based on the parameter definition set, and the decoding unit is specifically configured to obtain a plurality of decoding parameters matching the plurality of encoding parameters and decode the target image group using the plurality of decoding parameters to obtain the original frame.
In embodiments, the video to be extracted is an h.264 code stream, and the policy determining unit is specifically configured to extract a sequence parameter set and an image parameter set in a target group of pictures, parse the sequence parameter set and the image parameter set, and obtain a plurality of encoding parameters, where in implementation scenarios, the plurality of encoding parameters include resolution, encoding level, frame rate, consecutive B frames, and group of pictures length.
In , the video extraction device 60 further comprises a playing module for playing the target video.
In , the video extraction device 60 further comprises a download module for downloading the target video.
Referring to fig. 7, fig. 7 is a block diagram of another embodiment of the video capture device 70 according to the present application, the video capture device 70 includes a memory 71 and a processor 72 coupled to each other, and the processor 72 is configured to execute program instructions stored in the memory 71 to implement the steps of any of the embodiments video capture methods described above.
Specifically, Processor 72 is configured to control itself and memory 71 to implement the steps of any of the video extraction method embodiments described above, Processor 72 may also be referred to as a CPU (Central Processing Unit). Processor 72 may be a variety of integrated Circuit chips having the Processing capability of signals Processor 72 may also be a general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Array (FPGA) or other Programmable logic device, discrete or transistor logic, discrete hardware components.
In this embodiment, the processor 72 is configured to obtain a target image group corresponding to query time input by a user in a video to be extracted, and the processor 72 is further configured to extract the target video from the video to be extracted by using an extraction policy matched with a position relation with the target frame as a start frame based on the position relation between an I frame in the target image group and a target frame corresponding to the query time.
According to the scheme, the target image group corresponding to the query time input by the user in the video to be extracted is obtained, the target video is extracted from the video to be extracted by taking the target frame as the starting frame and adopting the extraction strategy matched with the position relation based on the position relation between the I frame in the target image group and the target frame corresponding to the query time, so that no error exists between the starting frame of the extracted target video and the target frame corresponding to the query time input by the user, the video extraction precision is accurate to the frame, and the video extraction precision can be improved.
In , the processor 72 is further configured to directly extract a frame sequence after the target frame in the video to be extracted as the target video when it is determined that the I frame and the target frame in the target group of pictures are the same frames, and the processor 72 is further configured to re-encode the original frame after the target frame in the target group of pictures and extract a frame sequence after the re-encoded target frame as the target video when it is determined that the I frame and the target frame in the target group of pictures are not the same frames, respectively.
In , the processor 72 is further configured to determine an encoding policy of the video to be extracted based on the target image group, the processor 72 is further configured to decode the target image group based on a decoding policy matching the encoding policy to obtain an original frame of the target image group, the processor 72 is further configured to re-encode the original frame after the target frame with the encoding policy, and the processor 72 is further configured to extract a frame sequence after the re-encoded target frame as the target video.
Different from the above embodiments, in this embodiment, an original frame after a target frame in a target image group is re-encoded based on an encoding policy of a video to be extracted, and a frame sequence after the target frame after re-encoding is extracted as a target video, so that a code stream characteristic of the target video remains unchanged, and further, use of a subsequent target video is not affected.
In addition, because only the frames in the target image group are subjected to encoding and decoding processing, the amount of secondary calculation generated by extracting the target video is controllable, and the influence on the whole system is reduced as much as possible.
In , the encoding strategy comprises a plurality of encoding parameters, the decoding strategy comprises a plurality of decoding parameters, the processor 72 is further configured to extract a parameter definition set in the target image group, the processor 72 is further configured to obtain a plurality of encoding parameters based on the parameter definition set, the processor 72 is further configured to obtain a plurality of decoding parameters matching the plurality of encoding parameters, and the processor 72 is further configured to decode the target image group using the plurality of decoding parameters to obtain the original frame.
In embodiments, the video to be extracted is an h.264 code stream, the processor 72 is further configured to extract a sequence parameter set and an image parameter set in a target group of pictures, and the processor 72 is further configured to parse the sequence parameter set and the image parameter set to obtain a plurality of encoding parameters.
In , the video extraction device 70 further comprises a human-computer interaction circuit for playing the target video.
In , the video extraction device 70 further includes a communication circuit for downloading the target video.
Referring to fig. 8, fig. 8 is a block diagram of an embodiment of a storage device 80 of the present application, the storage device 80 stores program instructions 81 capable of being executed by a processor, and the program instructions 81 are used for implementing the steps of any of the embodiments of video extraction methods described above.
According to the scheme, the target image group corresponding to the query time input by the user in the video to be extracted is obtained, the target video is extracted from the video to be extracted by taking the target frame as the starting frame and adopting the extraction strategy matched with the position relation based on the position relation between the I frame in the target image group and the target frame corresponding to the query time, so that no error exists between the starting frame of the extracted target video and the target frame corresponding to the query time input by the user, the video extraction precision is accurate to the frame, and the video extraction precision can be improved.
For example, the above-described apparatus embodiments are merely illustrative, e.g., a module or a unit may be divided into only logical functional divisions, and in practice there may be other divisions, e.g., a plurality of units or components may be combined or may be integrated into another systems, or features may be omitted or not executed, in addition, at point, the shown or discussed mutual coupling or direct coupling or communication connection may be through interfaces, and the indirect coupling or communication connection of the apparatuses or units may be electrical, mechanical or other forms.
The units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, that is, may be located in places, or may also be distributed on a plurality of network units.
In addition, the functional units in the embodiments of the present application may be integrated into processing units, or each unit may exist alone physically, or two or more units are integrated into units.
Based on the understanding, the technical solution of the present application, which is essentially or partially contributed to by the prior art, or all or part of the technical solution, may be embodied in the form of a software product stored in storage media, which includes several instructions for causing computer devices (which may be personal computers, servers, or network devices, etc.) or processors (processors) to execute all or part of the steps of the methods of the embodiments of the present application.

Claims (11)

1, A video extraction method, comprising:
acquiring a target image group corresponding to query time input by a user in a video to be extracted;
and extracting a target video from the video to be extracted by taking the target frame as a starting frame and adopting an extraction strategy matched with the position relation based on the position relation between the I frame in the target image group and the target frame corresponding to the query time.
2. The video extraction method according to claim 1, wherein the extracting, with the target frame as a starting frame, the target video from the video to be extracted by using the extraction policy matched with the position relationship based on the position relationship between the I frame in the target image group and the target frame corresponding to the query time comprises:
if the I frame and the target frame in the target image group are determined to be frames, directly extracting a frame sequence behind the target frame in the video to be extracted as the target video;
if the I frame and the target frame in the target image group are determined to be different frames, respectively re-encoding the original frame after the target frame in the target image group, and extracting the frame sequence after the re-encoded target frame as the target video.
3. The video extraction method according to claim 2, wherein said re-encoding the original frames after the target frame in the target image group and extracting the frame sequence after the re-encoded target frame as the target video respectively comprises:
determining an encoding strategy of the video to be extracted based on the target image group;
decoding the target image group based on a decoding strategy matched with the coding strategy to acquire an original frame of the target image group;
re-encoding an original frame after the target frame by adopting the encoding strategy;
and extracting a frame sequence after the target frame after the recoding as the target video.
4. The video extraction method of claim 3, wherein the encoding policy contains a plurality of encoding parameters, wherein the decoding policy contains a plurality of decoding parameters, and wherein the determining the encoding policy of the video to be extracted based on the target group of pictures comprises:
extracting a parameter definition set in the target image group;
acquiring the plurality of encoding parameters based on the parameter definition set;
the decoding the target image group based on the decoding strategy matched with the encoding strategy, and the acquiring of the original frame of the target image group comprises:
acquiring the plurality of decoding parameters matched with the plurality of coding parameters;
and decoding the target image group by using the plurality of decoding parameters to obtain the original frame.
5. The video extraction method according to claim 4, wherein the video to be extracted is an H.264 code stream, and the extracting the parameter definition set in the target image group includes:
extracting a sequence parameter set and an image parameter set in the target image group;
the obtaining the plurality of encoding parameters based on the parameter definition set comprises:
and analyzing the sequence parameter set and the image parameter set to acquire the plurality of encoding parameters.
6. The video extraction method of claim 5, wherein the plurality of encoding parameters comprise resolution, encoding level, frame rate, number of consecutive B frames, group of pictures length.
7. The video extraction method according to claim 3, wherein the extracting, as the target video, a sequence of frames following the re-encoded target frame comprises:
packaging the original frame group after the target frame after re-encoding into a new target image group;
replacing the original target image group in the video to be extracted with the new target image group;
and extracting the new target image group and the subsequent image group as the target video.
8. The video extraction method according to claim 1, wherein after extracting the target video from the video to be extracted by using the target frame as a starting frame and adopting an extraction policy matched with the position relationship based on the position relationship between the I frame in the target image group and the target frame corresponding to the query time, the method further comprises:
playing the target video; and/or the presence of a gas in the gas,
and downloading the target video.
9, A video extracting apparatus, comprising:
the acquisition module is used for acquiring a target image group corresponding to the query time input by the user in the video to be extracted;
and the extraction module is used for extracting a target video from the video to be extracted by taking the target frame as an initial frame and adopting an extraction strategy matched with the position relation based on the position relation between the I frame in the target image group and the target frame corresponding to the query time.
10, video extraction device, comprising a memory and a processor coupled to each other, the processor being configured to execute program instructions stored in the memory to implement the video extraction method of any of claims 1 to 8 through .
Storage means of 11, , storing program instructions executable by a processor for implementing the video extraction method of any of claims 1 to 8 to .
CN201910877519.0A 2019-09-17 2019-09-17 Video extraction method and device and storage device Active CN110740344B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910877519.0A CN110740344B (en) 2019-09-17 2019-09-17 Video extraction method and device and storage device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910877519.0A CN110740344B (en) 2019-09-17 2019-09-17 Video extraction method and device and storage device

Publications (2)

Publication Number Publication Date
CN110740344A true CN110740344A (en) 2020-01-31
CN110740344B CN110740344B (en) 2022-10-04

Family

ID=69267974

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910877519.0A Active CN110740344B (en) 2019-09-17 2019-09-17 Video extraction method and device and storage device

Country Status (1)

Country Link
CN (1) CN110740344B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111405288A (en) * 2020-03-19 2020-07-10 北京字节跳动网络技术有限公司 Video frame extraction method and device, electronic equipment and computer readable storage medium

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0989756A2 (en) * 1998-09-25 2000-03-29 Sarnoff Corporation Splicing information streams
CN1344106A (en) * 2000-09-15 2002-04-10 北京算通数字技术研究中心有限公司 Edition method for non-linear edition system based on MPEG-2 code stream
US20060159172A1 (en) * 2005-01-18 2006-07-20 Canon Kabushiki Kaisha Video Signal Encoding Apparatus and Video Data Encoding Method
CN103024394A (en) * 2012-12-31 2013-04-03 传聚互动(北京)科技有限公司 Video file editing method and device
CN104967862A (en) * 2015-07-22 2015-10-07 东方网力科技股份有限公司 Video storage method and device, and video searching method and device
CN106254869A (en) * 2016-08-25 2016-12-21 腾讯科技(深圳)有限公司 The decoding method of a kind of video data, device and system
CN106803992A (en) * 2017-02-14 2017-06-06 北京时间股份有限公司 Video clipping method and device
US20170180762A1 (en) * 2015-12-22 2017-06-22 Harmonic, Inc. Video stream splicing
CN108989846A (en) * 2018-07-09 2018-12-11 武汉斗鱼网络科技有限公司 A kind of video transformation assay method, apparatus, equipment and medium
CN110121071A (en) * 2018-02-05 2019-08-13 广东欧珀移动通信有限公司 Method for video coding and Related product

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0989756A2 (en) * 1998-09-25 2000-03-29 Sarnoff Corporation Splicing information streams
US6912251B1 (en) * 1998-09-25 2005-06-28 Sarnoff Corporation Frame-accurate seamless splicing of information streams
CN1344106A (en) * 2000-09-15 2002-04-10 北京算通数字技术研究中心有限公司 Edition method for non-linear edition system based on MPEG-2 code stream
US20060159172A1 (en) * 2005-01-18 2006-07-20 Canon Kabushiki Kaisha Video Signal Encoding Apparatus and Video Data Encoding Method
CN103024394A (en) * 2012-12-31 2013-04-03 传聚互动(北京)科技有限公司 Video file editing method and device
CN104967862A (en) * 2015-07-22 2015-10-07 东方网力科技股份有限公司 Video storage method and device, and video searching method and device
US20170180762A1 (en) * 2015-12-22 2017-06-22 Harmonic, Inc. Video stream splicing
CN106254869A (en) * 2016-08-25 2016-12-21 腾讯科技(深圳)有限公司 The decoding method of a kind of video data, device and system
CN106803992A (en) * 2017-02-14 2017-06-06 北京时间股份有限公司 Video clipping method and device
CN110121071A (en) * 2018-02-05 2019-08-13 广东欧珀移动通信有限公司 Method for video coding and Related product
CN108989846A (en) * 2018-07-09 2018-12-11 武汉斗鱼网络科技有限公司 A kind of video transformation assay method, apparatus, equipment and medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
程德强等: "基于帧损伤位置感知的GOP视频质量评价机制", 《电视技术》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111405288A (en) * 2020-03-19 2020-07-10 北京字节跳动网络技术有限公司 Video frame extraction method and device, electronic equipment and computer readable storage medium

Also Published As

Publication number Publication date
CN110740344B (en) 2022-10-04

Similar Documents

Publication Publication Date Title
KR102004637B1 (en) Segment detection of video programs
US20170180746A1 (en) Video transcoding method and electronic apparatus
US9832493B2 (en) Method and apparatus for processing audio/video file
CN110662084B (en) MP4 file stream live broadcasting method, mobile terminal and storage medium
EP3175621B1 (en) Video-segment identification systems and methods
US20060059509A1 (en) System and method for embedding commercial information in a video bitstream
US10264273B2 (en) Computed information for metadata extraction applied to transcoding
US20220232266A1 (en) Method for on-demand video editing at transcode-time in a video streaming system
US20220167043A1 (en) Method and system for playing streaming content
CN115119009A (en) Video alignment method, video encoding device and storage medium
CN115134622A (en) Video data alignment method, device, equipment and storage medium
CN110740344A (en) Video extraction method and related device
WO2012027891A1 (en) Video analytics for security systems and methods
US10942914B2 (en) Latency optimization for digital asset compression
CN106937127B (en) Display method and system for intelligent search preparation
US9520156B2 (en) Content preview generation
US20160142456A1 (en) Method and Device for Acquiring Media File
US20200382826A1 (en) Background enhancement in discriminatively encoded video
KR102455406B1 (en) Transcoder conditioning for segment fluidity
WO2022061194A1 (en) Method and system for real-time content-adaptive transcoding of video content on mobile devices
CN110139157B (en) Accurate positioning playing method, device, equipment and medium
CN109274902B (en) Video file processing method and device
CN112672163B (en) Transcoder adjustment for segment mobility
KR102314373B1 (en) Http-based live streaming method and apparatus
Grape Unlimited seeking during videotranscoding

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant