CN112019852A - Target type frame identification method and device and electronic equipment - Google Patents

Target type frame identification method and device and electronic equipment Download PDF

Info

Publication number
CN112019852A
CN112019852A CN201910455212.1A CN201910455212A CN112019852A CN 112019852 A CN112019852 A CN 112019852A CN 201910455212 A CN201910455212 A CN 201910455212A CN 112019852 A CN112019852 A CN 112019852A
Authority
CN
China
Prior art keywords
frame
byte
header information
identified
target type
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910455212.1A
Other languages
Chinese (zh)
Inventor
杨鹏飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Hikvision Digital Technology Co Ltd
Original Assignee
Hangzhou Hikvision Digital 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 Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Priority to CN201910455212.1A priority Critical patent/CN112019852A/en
Publication of CN112019852A publication Critical patent/CN112019852A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/157Assigned coding mode, i.e. the coding mode being predefined or preselected to be further used for selection of another element or parameter
    • H04N19/159Prediction type, e.g. intra-frame, inter-frame or bidirectional frame prediction

Abstract

The embodiment of the invention provides a target type frame identification method, a target type frame identification device and electronic equipment, wherein a header information byte of a coded frame to be identified is obtained; judging whether the header information byte contains a preset feature code of the target type frame or not; if the header information byte contains the feature code of the target type frame, determining the coding frame to be identified as the target type frame; and if the header information byte does not contain the feature code of the target type frame, determining that the coding frame to be identified is a non-target type frame. In the embodiment of the invention, the identification of the target type frame can be carried out only by acquiring the head information byte in the coding frame to be identified, namely only acquiring partial bytes in the coding frame to be identified without acquiring complete frame data of the coding frame to be identified and decoding operation, so that the time consumption of the identification process is less, and the identification efficiency of the target type frame is improved.

Description

Target type frame identification method and device and electronic equipment
Technical Field
The present invention relates to the field of video communication technologies, and in particular, to a method and an apparatus for identifying a target type frame, and an electronic device.
Background
H.264 is a standard for digital video coding and decoding technology, in which three frames are defined: the frame coding method comprises an intra-frame I frame, an inter-frame predictive coding frame P frame and a bidirectional predictive coding frame B frame, wherein the I frame is an independent frame with all information, and can be independently decoded without referring to other frames.
In some application scenarios, it is necessary to identify the type of coded frame from the video stream that is completed based on h.264 coding, for example: an intra-coded frame I frame is identified and some functions are implemented based on the I frame. For example, in the video playing process, it is necessary to recognize the first I frame and then start playing from this I frame.
In the related art, each encoded frame in a video stream is sequentially stored in a memory of an electronic device that performs an identification process, and the electronic device decodes a complete encoded frame in the memory and performs target type frame identification according to decoded data.
In the identification process of the target type frame, the whole to-be-identified coded frame needs to be decoded, so that the time consumption is high, and the identification efficiency is low.
Disclosure of Invention
The embodiment of the invention aims to provide a method and a device for identifying a target type frame and electronic equipment, so as to improve the identification efficiency of the target type frame. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a method for identifying a target type frame, where the method includes:
acquiring a header information byte of a coded frame to be identified;
judging whether the header information byte contains a preset feature code of the target type frame or not;
if the header information byte contains the feature code of the target type frame, determining the coding frame to be identified as the target type frame;
and if the header information byte does not contain the feature code of the target type frame, determining that the coding frame to be identified is a non-target type frame.
Further, the feature code of the target type frame is predetermined according to the type code of the target type frame and the binary format of the coded frame to be identified.
Further, the step of obtaining the header information byte of the encoded frame to be identified includes:
acquiring a front preset number of bytes of a coded frame to be identified; the preset number is greater than the preset minimum number of the header information bytes and less than the preset maximum number of the header information bytes;
and determining the front preset number of bytes as the header information bytes of the coding frame to be identified.
Further, the step of obtaining the header information byte of the encoded frame to be identified includes:
acquiring a front preset number of bytes of a coded frame to be identified; the preset number is greater than the preset minimum number of the header information bytes and less than the preset maximum number of the header information bytes;
determining all bytes from a first byte to a key byte after a last delimiter in the former preset number of bytes as a header information byte of the coding frame to be identified.
Further, the step of obtaining the header information byte of the encoded frame to be identified includes:
receiving video frame data in real time;
judging whether a complete current delimiter is received or not;
when receiving the complete current delimiters, judging whether the delimiters are marked as initial delimiters or not;
if any delimiter is marked as a start delimiter, judging whether a first key byte after the current delimiter is a sequence parameter set byte or a picture parameter set byte;
if no delimiter is marked as a start delimiter, marking a current delimiter as a start delimiter and determining whether a first key byte following the current delimiter is a sequence parameter set or a picture parameter set byte;
if the first key byte after the current delimiter is a sequence parameter set byte or a picture parameter set byte, returning to the step of judging whether a complete current delimiter is received;
if the first key byte following the current delimiter is not a sequence parameter set or picture parameter set byte, all bytes from the start delimiter until the first key byte are determined to be header information bytes of an encoded frame to be identified.
Further, the target type frame is: an intra-coded frame I frame, a forward predictive coded frame P frame, or a bi-directional predictive coded frame B frame.
In a second aspect, an embodiment of the present invention provides an apparatus for identifying a target type frame, including:
the header information byte acquisition module is used for acquiring header information bytes of the coding frame to be identified;
the characteristic code judging module is used for judging whether the header information byte contains a preset characteristic code of the target type frame or not;
a target type frame determining module, configured to determine that the encoded frame to be identified is a target type frame if the header information byte includes a feature code of the target type frame;
and the non-target type frame determining module is used for determining the coding frame to be identified as the non-target type frame if the header information byte does not contain the feature code of the target type frame.
Further, the feature code of the target type frame is predetermined according to the type code of the target type frame and the binary format of the coded frame to be identified.
Further, the header information byte obtaining module includes: a first obtaining submodule and a first header information byte determining submodule;
the first obtaining submodule is used for obtaining the front preset number of bytes of the coding frame to be identified; the preset number is greater than the preset minimum number of the header information bytes and less than the preset maximum number of the header information bytes;
and the first header information byte determining submodule is used for determining the preset number of bytes as the header information bytes of the coding frame to be identified.
Further, the header information byte obtaining module includes: a second obtaining submodule and a second header information byte determining submodule;
the second obtaining submodule is used for obtaining the front preset number of bytes of the coding frame to be identified; the preset number is greater than the preset minimum number of the header information bytes and less than the preset maximum number of the header information bytes;
the second header information byte determining submodule is used for determining all bytes from a first byte to a key byte after a last delimiter in the preset number of bytes as the header information byte of the coding frame to be identified.
Further, the header information byte obtaining module includes: the data receiving submodule, the first judging submodule, the second judging submodule, the third judging submodule, the fourth judging submodule and the third head information byte determining submodule;
the data receiving submodule is used for receiving video frame data in real time;
the first judgment submodule is used for judging whether a complete current delimiter is received or not, and triggering the second judgment module when the complete current delimiter is received;
the second judging submodule is used for judging whether the delimiters are marked as initial delimiters or not, and triggering the third judging module when the delimiters are marked as initial delimiters; when no delimiters are marked as start delimiters, triggering the fourth judging module;
the third determining sub-module is configured to determine whether a first key byte after the current delimiter is a sequence parameter set byte or a picture parameter set byte; when a first key byte after the current delimiter is a sequence parameter set or a picture parameter set byte, triggering the first judgment sub-module; triggering the second header information byte determination sub-module when a first key byte following the current delimiter is not a sequence parameter set or a picture parameter set byte;
the fourth determining sub-module is configured to mark the current delimiter as a start delimiter and determine whether a first key byte following the current delimiter is a sequence parameter set byte or a picture parameter set byte; when a first key byte after the current delimiter is a sequence parameter set or a picture parameter set byte, triggering the first judgment sub-module; triggering the second header information byte determination sub-module when a first key byte following the current delimiter is not a sequence parameter set or a picture parameter set byte;
the third header information byte determination submodule is used for determining all bytes from the start delimiter to the first key byte as the header information byte of the coding frame to be identified.
Further, the target type frame is: an intra-coded frame I frame, a forward predictive coded frame P frame, or a bi-directional predictive coded frame B frame.
In a third aspect, an embodiment of the present invention provides an electronic device, including a processor and a memory, wherein,
the memory is used for storing a computer program;
the processor is used for realizing any one of the target type frame identification methods when executing the program stored in the memory.
In a fourth aspect, the present invention further provides a computer-readable storage medium, in which a computer program is stored, and when the computer program runs on a computer, the computer program causes the computer to execute any one of the above target type frame identification methods.
The method, the device and the electronic equipment for identifying the target type frame, provided by the embodiment of the invention, are used for acquiring the head information byte of the coded frame to be identified; judging whether the header information byte contains a preset feature code of the target type frame or not; if the header information byte contains the feature code of the target type frame, determining the coding frame to be identified as the target type frame; and if the header information byte does not contain the feature code of the target type frame, determining that the coding frame to be identified is a non-target type frame. In the embodiment of the invention, the identification of the target type frame can be carried out only by acquiring the head information byte in the coding frame to be identified, namely only acquiring partial bytes in the coding frame to be identified without acquiring complete frame data of the coding frame to be identified and decoding operation, so that the time consumption of the identification process is less, and the identification efficiency of the target type frame is improved.
Of course, not all of the advantages described above need to be achieved at the same time in the practice of any one product or method of the invention.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flowchart of a target type frame identification method according to an embodiment of the present invention;
FIG. 2 is a diagram illustrating the structure of an encoded frame;
fig. 3 is another schematic flow chart of a target type frame identification method according to an embodiment of the present invention;
fig. 4 is a schematic flowchart of a target type frame identification method according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an apparatus for identifying a target type frame according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In order to improve the efficiency of identifying a target type frame, embodiments of the present invention provide a method and an apparatus for identifying a target type frame, and an electronic device, which are described in detail below.
Referring to fig. 1, fig. 1 is a schematic flow chart of a target type frame identification method according to an embodiment of the present invention, which specifically includes the following steps:
step 101, acquiring a header information byte of a coded frame to be identified.
In this step, in the process of receiving the data of the coding frame to be identified, based on the content of the received data, the header information byte of the coding frame to be identified is determined; the header information byte of the coding frame to be identified can also be determined from the first preset number of bytes of the coding frame to be identified after the whole coding frame to be identified is received.
Step 102, judging whether the header information byte contains the feature code of the preset target type frame. If the header information byte contains the feature code of the target type frame, execute step 103; if the header information byte does not contain the signature of the target type frame, go to step 104.
Specifically, the target type frame may be: an intra-coded frame I frame, a forward predictive coded frame P frame, or a bi-directional predictive coded frame B frame.
Since the type information of the video coding frame is contained in the header information byte, the embodiment of the present invention determines whether the header information byte contains the feature code of the preset target type frame.
Referring to fig. 2, fig. 2 is an example of an encoding frame structure, including: header information bytes and video content data, in which header information bytes include 3 delimiters, followed by a sequence parameter set or picture parameter set byte, followed by a delimiter 2, also followed by a sequence parameter set (PPS) or picture parameter set (SPS) byte, followed by a last delimiter 3, is a type identification byte of the encoded frame. The delimiter is used as the start data of the encoded frame, and generally has two forms: 00000001 or 000001, a complete encoded frame may include multiple delimiters.
Further, the feature code of the target type frame is predetermined according to the type code of the target type frame and the binary format of the coded frame to be identified. For example, the I-frame type code is 5 decimal, and when the binary format of the encoded frame to be identified is hexadecimal, the corresponding I-frame feature code may be 0000000165. If the binary format of the encoded frame to be identified is binary, the corresponding I-frame signature is determined in the manner described above.
And 103, determining the coded frame to be identified as a target type frame.
And 104, determining the coded frame to be identified as a non-target type frame.
It can be seen from the above embodiments that, by applying the embodiments of the present invention, the target type frame can be identified without acquiring the complete frame data of the encoded frame to be identified and without performing the decoding operation, and only the header information byte in the encoded frame to be identified needs to be acquired, that is, only the partial byte in the encoded frame to be identified needs to be acquired, so that the time consumption of the identification process is small, and the identification efficiency of the target type frame is improved.
In addition, in the related art, after the entire encoded frame is decoded and identified, the entire encoded frame can be transferred from the memory to another storage space, and the subsequent video frames of the video stream are stored in the memory in this time period, so that the number of encoded frames in the memory of the electronic device is large and the occupancy rate of the memory of the device is high in the process of identifying the target type frame. By applying the embodiment of the invention, the time consumption of the identification process is shortened, and the number of the coding frames in the memory of the electronic equipment is less, so that the memory occupancy rate of the electronic equipment executing the identification process can be reduced.
The embodiment of the invention can identify the frame I of the intra-frame coding frame, the frame P of the forward predictive coding frame or the frame B of the bidirectional predictive coding frame, and the frame I is an independent frame with all information, and can be independently decoded without referring to other frames, so that the frame I needs to be identified in a plurality of video processing processes to realize some functions, for example, all the frame I is extracted from a certain monitoring video stream, and then the frame I with the target human face characteristic is found out by comparing the target human face characteristic of each frame I, thereby finding out the target person. The following describes embodiments of the present invention in further detail by taking the target type frame as an I frame as an example.
Referring to fig. 3, fig. 3 is another schematic flow chart of a target type frame identification method according to an embodiment of the present invention, and the specific steps may include:
step 301, obtaining a first preset number of bytes of the encoded frame to be identified.
Specifically, the step of obtaining the first preset number of bytes of the encoded frame to be identified may be: receiving video frame data in real time; judging whether the first preset number of bytes of the coding frame is received, and executing the step 302 when the first preset number of bytes of the coding frame is received; when the first preset number of bytes of the encoded frame is not received, step 301 is re-executed based on the new video frame data received in real time.
Since the number of delimiters in different video frames is not constant, there may be 3 delimiters as shown in fig. 2, or there may be 1 delimiter or more or less, and there are two kinds of delimiter bits: for example, in a hexadecimal format video frame, the number of delimiter bits may be 6 bits (000001) or 8 bits (00000001), and thus the byte length of the header information byte is not fixed.
In order to ensure that the acquired first preset number of bytes contains no video content data as much as possible. In this embodiment, the number of the preset bytes may be set as: greater than a preset minimum number of header information bytes and less than a preset maximum number of header information bytes.
Step 302, determining all bytes from the first byte to the key byte after the last delimiter in the first preset number of bytes as the header information byte of the encoding frame to be identified.
The key byte in the embodiment of the present invention refers to a sequence parameter set byte or a picture parameter set byte or a type identification byte of a coding frame.
The first preset number of bytes of the coding frame to be identified can be obtained, and then all bytes from the first byte to the key byte after the last delimiter are determined as the header information byte of the coding frame to be identified according to the structure of the coding frame.
Step 303, determine whether the header information byte contains a preset I-frame feature code. If the header information byte contains the I-frame feature code, go to step 304; if the header information byte does not contain the I-frame signature, go to step 305.
The content of this step is the same as that of step 102, and is not described here again.
And step 304, determining the coded frame to be identified as an I frame.
Step 305, determining the coding frame to be identified as a non-I frame.
In the embodiment of the invention, the identification of the target type frame can be carried out only by acquiring the head information byte in the coding frame to be identified, namely only acquiring partial bytes in the coding frame to be identified without acquiring complete frame data of the coding frame to be identified and decoding operation, so that the time consumption of the identification process is less, and the identification efficiency of the target type frame is improved. Meanwhile, the time consumption of the identification process is less, so that the number of the coded frames in the memory of the electronic equipment is less, and the memory occupancy rate of the electronic equipment executing the identification process can be reduced.
Referring to fig. 4, fig. 4 is a schematic flow chart of a target type frame identification method according to an embodiment of the present invention, and the specific steps may include:
step 401, receiving video frame data in real time.
At step 402, it is determined whether a complete current delimiter has been received. When the complete current delimiter is received, go to step 403; when the complete current delimiter is not received, step 402 is re-executed based on new video frame data received in real time.
At step 403, it is determined whether any delimiters have been marked as start delimiters. If no delimiter is marked as a start delimiter, go to step 404; if any delimiter is marked as a start delimiter, go to step 405.
At step 404, the current delimiter is marked as a start delimiter. Step 405 is then performed.
Step 405, determining whether a first key byte after the current delimiter is a sequence parameter set or a picture parameter set byte; if the first key byte after the current delimiter is the sequence parameter set or the image parameter set byte, returning to execute step 402 based on the new video frame data received in real time in step 401; if the first key byte after the current delimiter is not the sequence parameter set or picture parameter set byte, step 406 is performed.
All bytes starting from the start delimiter and up to the first key byte are determined as header information bytes of the encoded frame to be identified, step 406.
In step 407, the start delimiter mark is deleted.
Step 408, determine whether the header information byte contains a preset I-frame feature code. If the header information byte contains the I-frame feature code, go to step 409; if the header information byte does not contain the I-frame signature, go to step 410.
The content of this step is the same as that of step 102, and is not described here again.
Step 409, determining the coded frame to be identified as an I frame.
Step 410, determining the coding frame to be identified as a non-I frame.
In the embodiment of the invention, whether the coding frame to be identified is an I frame can be determined only by identifying the header information byte in the coding frame to be identified without decoding the whole coding frame to be identified, so that the time consumption of the identification process is less, and the identification efficiency of the target type frame is improved.
In addition, in the process of receiving video frame data, the header information byte in the coding frame to be identified can be determined by judging the received frame data, and then the identification of the coding frame to be identified is completed by judging the header information byte, so that the I frame identification can be started after the header information byte in the coding frame to be identified is acquired, and the identification does not need to be started after the complete frame data to be encoded is acquired, therefore, the time consumption of the identification process can be further reduced, the number of the coding frames in the memory of the electronic equipment is further reduced, and the memory occupancy rate of the electronic equipment executing the identification process is further reduced.
Furthermore, if the electronic device performing the identification process is an electronic device with a video display function, such as a touch large-screen device, and the like, when the I-frame identification is performed by decoding the entire encoded frame to be identified, because the identification process takes a lot of time, the number of encoded frames in the memory of the electronic device is large, and the device memory occupancy rate is high, a stuck phenomenon may occur during the video playing process.
Based on the same inventive concept, according to the method for identifying an intra-coded frame provided in the foregoing embodiment of the present invention, correspondingly, an embodiment of the present invention further provides an apparatus for identifying a target type frame, where a schematic structural diagram of the apparatus is shown in fig. 5, and the apparatus includes:
a header information byte obtaining module 501, configured to obtain a header information byte of a coded frame to be identified;
a feature code determining module 502, configured to determine whether the header information byte contains a feature code of a preset target type frame;
a target type frame determining module 503, configured to determine, if the header information byte includes a feature code of the target type frame, that the encoded frame to be identified is the target type frame;
a non-target type frame determining module 504, configured to determine that the encoded frame to be identified is a non-target type frame if the header information byte does not include the feature code of the target type frame.
Further, the feature code of the target type frame is predetermined according to the type code of the target type frame and the binary format of the coded frame to be identified.
Further, the header information byte obtaining module 501 includes: a first obtaining submodule and a first header information byte determining submodule;
the first acquisition submodule is used for acquiring the front preset number of bytes of the coded frame to be identified; the preset number is larger than the preset minimum number of the head information bytes and is smaller than the preset maximum number of the head information bytes;
and the first header information byte determining submodule is used for determining the front preset number of bytes as the header information bytes of the coding frame to be identified.
Further, the header information byte obtaining module 501 includes: a second obtaining submodule and a second header information byte determining submodule;
the second obtaining submodule is used for obtaining the front preset number of bytes of the coding frame to be identified; the preset number is larger than the preset minimum number of the head information bytes and is smaller than the preset maximum number of the head information bytes;
and the second header information byte determining submodule is used for determining all bytes from the first byte to the key byte after the last delimiter in the preset number of bytes as the header information byte of the coding frame to be identified.
Further, the header information byte obtaining module 501 includes: the data receiving submodule, the first judging submodule, the second judging submodule, the third judging submodule, the fourth judging submodule and the third head information byte determining submodule;
the data receiving submodule is used for receiving video frame data in real time;
the first judgment submodule is used for judging whether the complete current delimiters are received or not, and triggering the second judgment module when the complete current delimiters are received;
the second judgment submodule is used for judging whether the delimiters are marked as initial delimiters or not, and triggering a third judgment module when the delimiters are marked as initial delimiters; when no delimiters are marked as the initial delimiters, triggering a fourth judging module;
a third determining sub-module, configured to determine whether a first key byte after the current delimiter is a sequence parameter set byte or an image parameter set byte; when the first key byte after the current delimiter is a sequence parameter set or an image parameter set byte, triggering a first judgment sub-module; triggering a second header information byte determination sub-module when a first key byte following the current delimiter is not a sequence parameter set or a picture parameter set byte;
a fourth determining sub-module, configured to mark the current delimiter as a start delimiter and determine whether a first key byte following the current delimiter is a sequence parameter set byte or a picture parameter set byte; when the first key byte after the current delimiter is a sequence parameter set or an image parameter set byte, triggering a first judgment sub-module; triggering a second header information byte determination sub-module when a first key byte following the current delimiter is not a sequence parameter set or a picture parameter set byte;
and a third header information byte determination submodule for determining all bytes from the start delimiter to the first key byte as the header information byte of the encoded frame to be identified.
In the embodiment of the present invention, after the header information byte obtaining module 501 obtains the header information byte of the encoded frame to be identified, the feature code determining module 502 only determines the header information byte in the encoded frame to be identified, and the target type frame determining module 503 and the non-target type frame determining module 504 can determine whether the encoded frame to be identified is the target type frame, so that the time consumption of the identification process is small, the number of encoded frames in the memory of the electronic device is small, and therefore, the identification efficiency of the target type frame can be improved.
Based on the same inventive concept, according to the method for identifying a target type frame provided by the above embodiment of the present invention, correspondingly, the embodiment of the present invention further provides an electronic device, as shown in fig. 6, comprising a processor 601, a communication interface 602, a memory 603 and a communication bus 604, wherein the processor 601, the communication interface 602 and the memory 603 complete mutual communication through the communication bus 604,
a memory 603 for storing a computer program;
the processor 601 is configured to implement the following steps when executing the program stored in the memory 603:
acquiring a header information byte of a coded frame to be identified;
judging whether the header information byte contains a feature code of a preset target type frame or not;
if the header information byte contains the feature code of the target type frame, determining the coding frame to be identified as the target type frame;
and if the header information byte does not contain the feature code of the target type frame, determining that the coding frame to be identified is a non-target type frame.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
In yet another embodiment of the present invention, a computer-readable storage medium is further provided, in which a computer program is stored, which, when run on a computer, causes the computer to execute the object type frame identification method described in any of the above embodiments.
In a further embodiment of the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the method of object type frame identification as described in any of the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the device and electronic apparatus embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference may be made to some descriptions of the method embodiments for relevant points.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (13)

1. A method for identifying a target type frame, the method comprising:
acquiring a header information byte of a coded frame to be identified;
judging whether the header information byte contains a preset feature code of the target type frame or not;
if the header information byte contains the feature code of the target type frame, determining the coding frame to be identified as the target type frame;
and if the header information byte does not contain the feature code of the target type frame, determining that the coding frame to be identified is a non-target type frame.
2. The method according to claim 1, wherein the feature code of the target type frame is predetermined according to the type code of the target type frame and the binary format of the encoded frame to be identified.
3. The method according to claim 1, wherein the step of obtaining the header information byte of the encoded frame to be identified comprises:
acquiring a front preset number of bytes of a coded frame to be identified; the preset number is greater than the preset minimum number of the header information bytes and less than the preset maximum number of the header information bytes;
and determining the front preset number of bytes as the header information bytes of the coding frame to be identified.
4. The method according to claim 1, wherein the step of obtaining the header information byte of the encoded frame to be identified comprises:
acquiring a front preset number of bytes of a coded frame to be identified; the preset number is greater than the preset minimum number of the header information bytes and less than the preset maximum number of the header information bytes;
determining all bytes from a first byte to a key byte after a last delimiter in the former preset number of bytes as a header information byte of the coding frame to be identified.
5. The method according to claim 1, wherein the step of obtaining the header information byte of the encoded frame to be identified comprises:
receiving video frame data in real time;
judging whether a complete current delimiter is received or not;
when receiving the complete current delimiters, judging whether the delimiters are marked as initial delimiters or not;
if any delimiter is marked as a start delimiter, judging whether a first key byte after the current delimiter is a sequence parameter set byte or a picture parameter set byte;
if no delimiter is marked as a start delimiter, marking a current delimiter as a start delimiter and determining whether a first key byte following the current delimiter is a sequence parameter set or a picture parameter set byte;
if the first key byte after the current delimiter is a sequence parameter set byte or a picture parameter set byte, returning to the step of judging whether a complete current delimiter is received;
if the first key byte following the current delimiter is not a sequence parameter set or picture parameter set byte, all bytes from the start delimiter until the first key byte are determined to be header information bytes of an encoded frame to be identified.
6. The method according to any of claims 1-5, wherein the target type frame is: an intra-coded frame I frame, a forward predictive coded frame P frame, or a bi-directional predictive coded frame B frame.
7. An object type frame recognition apparatus, comprising:
the header information byte acquisition module is used for acquiring header information bytes of the coding frame to be identified;
the characteristic code judging module is used for judging whether the header information byte contains a preset characteristic code of the target type frame or not;
a target type frame determining module, configured to determine that the encoded frame to be identified is a target type frame if the header information byte includes a feature code of the target type frame;
and the non-target type frame determining module is used for determining the coding frame to be identified as the non-target type frame if the header information byte does not contain the feature code of the target type frame.
8. The apparatus according to claim 7, wherein the feature code of the target type frame is predetermined according to the type code of the target type frame and the binary format of the encoded frame to be identified.
9. The apparatus of claim 7, wherein the header information byte obtaining module comprises: a first obtaining submodule and a first header information byte determining submodule;
the first obtaining submodule is used for obtaining the front preset number of bytes of the coding frame to be identified; the preset number is greater than the preset minimum number of the header information bytes and less than the preset maximum number of the header information bytes;
and the first header information byte determining submodule is used for determining the preset number of bytes as the header information bytes of the coding frame to be identified.
10. The apparatus of claim 7, wherein the header information byte obtaining module comprises: a second obtaining submodule and a second header information byte determining submodule;
the second obtaining submodule is used for obtaining the front preset number of bytes of the coding frame to be identified; the preset number is greater than the preset minimum number of the header information bytes and less than the preset maximum number of the header information bytes;
the second header information byte determining submodule is used for determining all bytes from a first byte to a key byte after a last delimiter in the preset number of bytes as the header information byte of the coding frame to be identified.
11. The apparatus of claim 7, wherein the header information byte obtaining module comprises: the data receiving submodule, the first judging submodule, the second judging submodule, the third judging submodule, the fourth judging submodule and the third head information byte determining submodule;
the data receiving submodule is used for receiving video frame data in real time;
the first judgment submodule is used for judging whether a complete current delimiter is received or not, and triggering the second judgment module when the complete current delimiter is received;
the second judging submodule is used for judging whether the delimiters are marked as initial delimiters or not, and triggering the third judging module when the delimiters are marked as initial delimiters; when no delimiters are marked as start delimiters, triggering the fourth judging module;
the third determining sub-module is configured to determine whether a first key byte after the current delimiter is a sequence parameter set byte or a picture parameter set byte; when a first key byte after the current delimiter is a sequence parameter set or a picture parameter set byte, triggering the first judgment sub-module; triggering the second header information byte determination sub-module when a first key byte following the current delimiter is not a sequence parameter set or a picture parameter set byte;
the fourth determining sub-module is configured to mark the current delimiter as a start delimiter and determine whether a first key byte following the current delimiter is a sequence parameter set byte or a picture parameter set byte; when a first key byte after the current delimiter is a sequence parameter set or a picture parameter set byte, triggering the first judgment sub-module; triggering the second header information byte determination sub-module when a first key byte following the current delimiter is not a sequence parameter set or a picture parameter set byte;
the third header information byte determination submodule is used for determining all bytes from the start delimiter to the first key byte as the header information byte of the coding frame to be identified.
12. An electronic device comprising a processor and a memory, wherein,
the memory is used for storing a computer program;
the processor, when executing the program stored in the memory, implementing the method steps of any of claims 1-6.
13. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of claims 1 to 6.
CN201910455212.1A 2019-05-29 2019-05-29 Target type frame identification method and device and electronic equipment Pending CN112019852A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910455212.1A CN112019852A (en) 2019-05-29 2019-05-29 Target type frame identification method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910455212.1A CN112019852A (en) 2019-05-29 2019-05-29 Target type frame identification method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN112019852A true CN112019852A (en) 2020-12-01

Family

ID=73501373

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910455212.1A Pending CN112019852A (en) 2019-05-29 2019-05-29 Target type frame identification method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN112019852A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1964250A (en) * 2006-11-23 2007-05-16 华为技术有限公司 Data frame type identification method and device
CN101426137A (en) * 2008-11-25 2009-05-06 上海华为技术有限公司 Video frame type recognizing method and device
CN101854224A (en) * 2009-04-01 2010-10-06 华为技术有限公司 Error correcting coding method, device and system, and forwarding control method and device
US20120174168A1 (en) * 2009-09-10 2012-07-05 Zte Corporation Method and Apparatus for Retrieving I Frame
CN106162235A (en) * 2016-08-17 2016-11-23 北京百度网讯科技有限公司 Method and apparatus for Switch Video stream
CN106303673A (en) * 2015-06-04 2017-01-04 中兴通讯股份有限公司 Code stream alignment, synchronization processing method and transmission, reception terminal and communication system
CN109089126A (en) * 2018-07-09 2018-12-25 武汉斗鱼网络科技有限公司 A kind of video analysis method, apparatus, equipment and medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1964250A (en) * 2006-11-23 2007-05-16 华为技术有限公司 Data frame type identification method and device
CN101426137A (en) * 2008-11-25 2009-05-06 上海华为技术有限公司 Video frame type recognizing method and device
CN101854224A (en) * 2009-04-01 2010-10-06 华为技术有限公司 Error correcting coding method, device and system, and forwarding control method and device
US20120174168A1 (en) * 2009-09-10 2012-07-05 Zte Corporation Method and Apparatus for Retrieving I Frame
CN106303673A (en) * 2015-06-04 2017-01-04 中兴通讯股份有限公司 Code stream alignment, synchronization processing method and transmission, reception terminal and communication system
CN106162235A (en) * 2016-08-17 2016-11-23 北京百度网讯科技有限公司 Method and apparatus for Switch Video stream
CN109089126A (en) * 2018-07-09 2018-12-25 武汉斗鱼网络科技有限公司 A kind of video analysis method, apparatus, equipment and medium

Similar Documents

Publication Publication Date Title
CN108694217B (en) Video label determination method and device
CN108076377B (en) Video storage and playing method and device, electronic equipment and storage medium
CN109391585B (en) Video data processing method, device, terminal and computer readable storage medium
CN109473104B (en) Voice recognition network delay optimization method and device
US11316925B2 (en) Video data storage method and device in cloud storage system
CN113068040A (en) Image compression method and device, electronic equipment and readable storage medium
CN108924574B (en) Packet loss processing method, device, equipment and storage medium in recording and broadcasting system
CN110418138B (en) Video processing method and device, electronic equipment and storage medium
CN109597566B (en) Data reading and storing method and device
CN112565886A (en) Video frame extraction method and device, electronic equipment and readable storage medium
CN112672102B (en) Video generation method and device
CN116193160A (en) Digital watermark embedding method, device, equipment and medium
CN112672154A (en) Live video playing method and device, server and computer readable storage medium
CN112019852A (en) Target type frame identification method and device and electronic equipment
CN112468871B (en) Monitoring video playing method and device and electronic equipment
CN113395523B (en) Image decoding method, device, equipment and storage medium based on parallel threads
WO2018077059A1 (en) Barcode identification method and apparatus
CN105491400B (en) Video stream downloading method and device
CN111083497B (en) Video screenshot method and device
CN114501140A (en) Video character superposition processing method, system and storage medium
CN111050179B (en) Video transcoding method and device
CN110855619B (en) Processing method and device for playing audio and video data, storage medium and terminal equipment
CN111147954A (en) Thumbnail extraction method and device
CN108093258A (en) Coding/decoding method, computer installation and the computer readable storage medium of bit stream data
CN112380550A (en) Energy consumption data acquisition method, device and equipment and readable storage medium

Legal Events

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

Application publication date: 20201201

RJ01 Rejection of invention patent application after publication