CN109246434B - Video encoding method, video decoding method and electronic equipment - Google Patents

Video encoding method, video decoding method and electronic equipment Download PDF

Info

Publication number
CN109246434B
CN109246434B CN201811366190.3A CN201811366190A CN109246434B CN 109246434 B CN109246434 B CN 109246434B CN 201811366190 A CN201811366190 A CN 201811366190A CN 109246434 B CN109246434 B CN 109246434B
Authority
CN
China
Prior art keywords
video
area
encoding
data
metadata
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811366190.3A
Other languages
Chinese (zh)
Other versions
CN109246434A (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.)
Lenovo Beijing Ltd
Original Assignee
Lenovo Beijing 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 Lenovo Beijing Ltd filed Critical Lenovo Beijing Ltd
Priority to CN201811366190.3A priority Critical patent/CN109246434B/en
Publication of CN109246434A publication Critical patent/CN109246434A/en
Application granted granted Critical
Publication of CN109246434B publication Critical patent/CN109246434B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • 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/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/70Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by syntax aspects related to video coding, e.g. related to compression standards

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The application provides a video encoding method, a video decoding method and electronic equipment, wherein a first video area and a second video area are determined in a video to be processed in the video encoding method, and then the first video area and the second video area are encoded in different encoding modes, so that the target area determined by a user is encoded in an encoding mode meeting requirements. Distortion of a video of a target area determined by a user in a decoding process can be reduced, so that the user can obtain high-definition demand information, the demand of the user for obtaining effective information through the video is met, and the experience effect of the user is improved.

Description

Video encoding method, video decoding method and electronic equipment
Technical Field
The present application relates to the field of video technologies, and in particular, to a video encoding method, a video decoding method, and an electronic device.
Background
With the development of information technology, video signals become the most important way for people to acquire information in daily life with the advantages of intuition, high efficiency and the like. Since the video signal contains a large amount of data, it needs to occupy a large amount of transmission bandwidth and storage space. For efficient transmission and storage of video signals, compression encoding of the video signals is required.
However, these existing video coding methods are usually lossy, that is, when decoding and restoring the coded video picture, the restored picture has a certain distortion relative to the original picture, and for a video signal with special use, such as a surveillance video, the picture is not clear due to the distortion of the picture, so that the requirement of using the video signal to acquire information cannot be realized.
Disclosure of Invention
In view of this, the present application provides the following technical solutions:
a video encoding method, comprising:
determining a first video area and a second video area corresponding to a video to be processed;
executing first encoding processing on a video picture corresponding to the first video area to obtain first video data;
executing second encoding processing on the video picture corresponding to the second video area to obtain second video data, wherein the second encoding processing is different from the encoding parameter of the first encoding processing;
and packaging the first video data and the second video data to obtain a target video file.
Optionally, the determining a first video area and a second video area corresponding to a video to be processed includes:
responding to the received operation instruction, and determining a first video area corresponding to the video to be processed;
and determining a video area corresponding to the video to be processed out of the first video area as a second video area.
Optionally, the determining a first video area and a second video area corresponding to a video to be processed includes:
performing video picture recognition on the video to be processed in response to the received recognition condition, and determining a video area meeting the recognition condition as a first video area;
and determining a video area corresponding to the video to be processed out of the first video area as a second video area.
Optionally, the operation instruction includes coordinate positioning information;
wherein, the determining a first video area corresponding to the video to be processed in response to the received operation instruction includes:
and calculating to obtain a first video area corresponding to the video to be processed based on the coordinate positioning information.
Optionally, the method further comprises:
in response to the first video area being at least two video areas;
determining a target area corresponding to the first video area based on the received selection instruction;
and determining a video area corresponding to the video to be processed outside the target area as a second video area.
Optionally, the method further comprises:
determining a coding parameter of a first coding process according to the transmission condition of the video to be processed;
and determining the encoding parameters of the second encoding process based on the resolution of the video acquisition device of the video to be processed.
Optionally, the encapsulating the first video data and the second video data to obtain a target video file includes:
analyzing the first video data to obtain first coded data and first metadata;
analyzing the second video data to obtain second coded data and second metadata;
splicing the first coded data and the second coded data to obtain coded data;
splicing the first metadata and the second metadata to obtain metadata;
and carrying out video frame packaging on the coded data and the metadata to obtain a target video file.
A video decoding method, comprising:
obtaining a target video file;
analyzing the target video file to obtain video coding data;
determining a video area and an encoding mode corresponding to the video area based on the video encoding data;
determining a decoding mode matched with the coding mode;
decoding a video area corresponding to the decoding mode based on the decoding mode to obtain a video picture corresponding to the video area;
and carrying out video encapsulation on the video picture to obtain a target video.
Optionally, the method further comprises:
in response to the video area comprising a first video area and a second video area;
if the encoding mode corresponding to the first video area is an unencoded mode, performing video encapsulation on a video picture corresponding to the first video area and a video picture obtained by decoding the second video area to obtain a target video.
An electronic device comprising a memory, a first processor and a second processor, wherein,
the first processor is used for determining a first video area and a second video area corresponding to a video to be processed; executing first encoding processing on a video picture corresponding to the first video area to obtain first video data; executing second encoding processing on the video picture corresponding to the second video area to obtain second video data, wherein the second encoding processing is different from the encoding parameter of the first encoding processing; packaging the first video data and the second video data to obtain a target video file;
the second processor is used for obtaining a target video file; analyzing the target video file to obtain video coding data; determining a video area and an encoding mode corresponding to the video area based on the video encoding data; determining a decoding mode matched with the coding mode; decoding a video area corresponding to the decoding mode based on the decoding mode to obtain a video picture corresponding to the video area; and carrying out video encapsulation on the video picture to obtain a target video.
Therefore, compared with the prior art, the video encoding method and the video decoding method and the electronic equipment are provided, the first video area and the second video area are determined in the video to be processed, and then the first video area and the second video area are encoded in different encoding modes, so that the target area determined by a user is encoded in a mode meeting requirements, meanwhile, the video decoding method can decode videos in different encoding modes, and different video extraction requirements can be met. Distortion of a video of a target area determined by a user in a decoding process can be reduced, so that the user can obtain high-definition demand information, the demand of the user for obtaining effective information through the video is met, and the experience effect of the user is improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a schematic flowchart illustrating a video encoding method according to an embodiment of the present application;
fig. 2 is a schematic flow chart illustrating a video data encapsulation method according to an embodiment of the present application;
fig. 3 is a schematic flowchart illustrating a video decoding method according to an embodiment of the present application;
fig. 4 is a schematic diagram illustrating a video area provided by an embodiment of the present application;
fig. 5 is a schematic structural diagram illustrating a video encoding apparatus according to an embodiment of the present application;
fig. 6 is a schematic structural diagram illustrating a video decoding apparatus according to an embodiment of the present application;
fig. 7 shows a schematic structural diagram of an electronic device provided in an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, 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 application.
Referring to fig. 1, which shows a schematic flowchart of an embodiment of a video encoding method according to the present application, the method of the present embodiment may include:
s101, determining a first video area and a second video area corresponding to a video to be processed.
In the video transmission process, in order to meet the transmission amount of video data and the bandwidth requirement of a transmission network, an original video is generally processed before transmission, and the original video to be processed is recorded as a video to be processed. In the embodiment of the application, the video to be processed is divided to obtain the first video area and the second video area. The standard of video division needs to be set according to the relevant characteristics of the video to be processed, for example, the video may be divided according to specific information in a picture, or may be divided according to picture resolution precision, or may be divided according to video frame data amount, and the like.
It should be noted that, in this embodiment, only the first video area and the second video area are used as the partition ranges for dividing the video to be processed, but the first video area does not only include one video area, the corresponding first video area may include a plurality of video areas, the video areas may satisfy the same parameter condition, for example, the compression accuracies of the video areas are all the first accuracy, and the video areas may also satisfy the same parameter range, for example, both the video areas include a character a. Also, the second video area may be a plurality of video areas except that the division condition of the second video area is different from the division condition of the first video area.
S102, performing first encoding processing on a video picture corresponding to a first video area to obtain first video data;
s103, second encoding processing is carried out on the video picture corresponding to the second video area, and second video data are obtained.
After the first video area and the second video area of the video to be processed are determined, different encoding processes need to be performed on different video areas to ensure that the processed video can meet the requirements of users. The video encoding method is a method of converting a file in a certain video format into a file in another video format by a specific compression technique. The most important codec standards for video streaming include h.261, h.263, and h.264 by the international telecommunications union, M-JPEG by the moving still experts group, and MPEG series standards by the moving picture experts group of the international organization for standardization, and codec schemes widely used on the internet.
In this embodiment of the present application, different encoding methods can be simultaneously compatible to perform encoding processing on different regions of the same video, where encoding parameters of a first encoding process and a second encoding process are different, the encoding parameters refer to main parameter information capable of characterizing the two encoding methods, such as a compression ratio, a video size, and the like, the parameter information is determined by user requirements, for example, if a user needs to obtain a relatively clear video picture of a first video region by taking the compression ratio as an example, the first encoding process may be an unencoding process, that is, after a video picture of the first video region is not encoded, first video data is obtained, and a corresponding second encoding process is h.264 encoding, that is, 100: a compression ratio of 1, resulting in second video data. The compression ratio of the first encoding process is 1:1, the compression ratio of the second encoding process is 100:1. other differences in encoding parameters may also be used to determine the first encoding process and the second encoding process. Note that, if the first encoding process is an unencoded process, it merely means that no encoding method is applied to the video picture in the first video region, but it does not mean that no processing is applied to the video picture in the first video region, and for example, picture extraction processing may be performed according to a user's request.
After different coding processes are carried out on the video pictures in different video areas, different video data are obtained and stored, and the subsequent processing or transmission is convenient to use.
And S104, packaging the first video data and the second video data to obtain a target video file.
In order to ensure the integrity of video transmission, video data after different video processing needs to be encapsulated, that is, first video data corresponding to a first video area and second video data corresponding to a second video area are spliced to obtain a complete video to be transmitted, so as to perform video transmission. Or storing the packaged video for subsequent requirements.
The embodiment of the application provides a video coding method, a first video area and a second video area are determined in a video to be processed, then the first video area and the second video area are coded in different coding modes, and it is guaranteed that a target area determined by a user is coded in a coding mode meeting requirements, so that distortion of the video of the target area determined by the user in a decoding process can be reduced, the user can obtain high-definition required information, the requirement of the user for obtaining effective information through the video is met, and the experience effect of the user is improved.
In order to ensure that the video region division of the video to be processed completely meets the requirement of a user on extracting specific video information, in another embodiment of the present application, two methods for performing region division on the video to be processed are further included, where the first method for performing region division on the video may include:
s201, responding to a received operation instruction, and determining a first video area corresponding to a video to be processed;
s202, determining a video area corresponding to the video to be processed out of the first video area as a second video area.
In this embodiment, the operation instruction is a video region division condition proposed by a user according to the video picture content of the video to be processed, and the operation instruction may include coordinate information, video frame information, video position information, or the like of a specific video region, that is, according to the operation instruction, a video region required by the user may be accurately extracted from the video to be processed, a video region meeting the operation instruction of the user is determined as a first video region, and other video regions corresponding to the video to be processed other than the first video region are determined as a second video region. That is, the first video area is a video area containing user demand information, and the second video area is a normal video area.
For example, if the operation instruction includes coordinate positioning information, the corresponding method when determining the first video area is as follows: and calculating to obtain a first video area corresponding to the video to be processed based on the coordinate positioning information. That is, according to the video coordinate positioning information provided by the user, the position information set of the picture area of the to-be-processed video corresponding to the coordinate is calculated, and each area can be numbered uniformly, so that the video areas can be distinguished conveniently, and thus the areas are determined as the first video area.
The above-mentioned video area division is video division based on a clear and definite video division condition provided by a user, and in this embodiment, the video division may also be performed according to a video extraction condition provided by the user, that is, the second video area division method may include the following steps:
s301, responding to the received identification condition, identifying a video picture of a video to be processed, and determining a video area meeting the identification condition as a first video area;
s302, determining a video area corresponding to the video to be processed out of the first video area as a second video area.
The identification condition is a screening condition proposed for a specific video picture or video information according to information such as the use of the video to be processed, and the identification condition includes one or more of an identification condition for a specific person, an identification condition for a specific place, and/or an identification condition for a video picture at a specific time. For example, the identification condition is that video pictures including the person a are screened out, at this time, the video pictures including the person a are obtained by picture identification technology, and the video areas corresponding to the video pictures are recorded as the first video areas. Therefore, the first encoding processing can be carried out on the video area including the character A in the subsequent video encoding process, and a high-definition picture is obtained, so that a user can analyze specific information conveniently.
In another embodiment of the present application, the video encoding method further includes:
s401, responding to the first video area as at least two video areas;
s402, determining a target area corresponding to the first video area based on the received selection instruction;
and S403, determining a video area corresponding to the video to be processed outside the target area as a second video area.
Whether the first video area determined according to the operation instruction or the recognition condition may include at least two video areas, at this time, a final target area needs to be determined according to the requirement of the user, and if the video areas are all the video areas desired by the user, all the video areas are determined as the target area; and if a part of the video areas are the video areas required by the user, determining the part of the video areas as target areas. When the first video area is obtained and the first video area is a plurality of video areas, the information corresponding to each video area can be assigned with the corresponding identification information, and the identification information is sent to the user for the user to determine the target area.
Then, the video area other than the target area is determined as the second video area again, so that if the target area is a part of the video area of the first video area, the second video area includes the remaining video area of the first video area and includes a video area which does not satisfy the operation instruction or the identification condition.
Correspondingly, an external adding instruction can be received, that is, the currently selected first video area cannot completely meet the requirement of the user, and the first video area is added according to the adding instruction of the user.
There is also provided in another embodiment of the present application a method of a first encoding process and a second encoding process, the method comprising:
s501, determining a coding parameter of first coding processing according to a transmission condition of a video to be processed;
s502, determining the encoding parameters of the second encoding process based on the resolution of the video acquisition device of the video to be processed.
The transmission conditions of the video to be processed represent some conditions of a sending end, a receiving end and a video transmission medium in the video transmission process, and can include conditions such as bandwidth limitation conditions of a transmission network, video transmission size conditions of the sending end, conditions of the receiving end for allowing the maximum video receiving amount, definition requirements of a user on the video after transmission and the like, so as to determine encoding parameters of the first encoding process, and then select an encoding mode meeting the requirements according to the encoding parameters or process the encoding mode in a non-encoding mode.
The resolution of the video acquisition device mainly refers to conditions such as the resolution of a camera at a video acquisition end and the bandwidth of a corresponding video transmission medium, and can be determined according to the requirements of a user, and in order to determine encoding parameters intelligently and automatically, the resolution of the acquisition device is preferably used to determine encoding parameters of the second encoding in the embodiment, so that the video acquisition device can better adapt to the video characteristics of the current video to be processed, and the encoding workload is reduced.
In another embodiment of the present application, there is also provided a method of video data encapsulation, referring to fig. 2, the method including:
s601, analyzing the first video data to obtain first coded data and first metadata;
s602, analyzing the second video data to obtain second coded data and second metadata;
s603, splicing the first coded data and the second coded data to obtain coded data;
s604, splicing the first metadata and the second metadata to obtain metadata;
s605, carrying out video frame encapsulation on the coded data and the metadata to obtain a target video file.
After different video areas are coded in different coding processing modes, first video data corresponding to the first video area are obtained, and second video data corresponding to the second video area are obtained. Then, video analysis is performed on the video data to obtain encoded data and metadata, respectively, where the encoded data may represent information such as an encoding mode and a number of bytes occupied by the video area, and the metadata may represent information such as encoding of the encoding area, a position of the video area in the current photographic image picture, and a number of bytes occupied by the video area. Then, the entire video frame encapsulation is performed based on the encoded data and the metadata. If the corresponding first encoding processing is an uncoded processing mode, the corresponding first encoded data can be represented as uncoded data. For example, the corresponding first encoded data of each first video region is sequentially added to the end of the second encoded data corresponding to the second video region, corresponding first metadata and second metadata are sequentially added to the data corresponding to the metadata of the video frame, and the whole video frame encapsulation is performed based on the newly generated image encoded data and metadata, so as to obtain the target video file. Therefore, data splicing of different coding modes can be carried out based on the video data after coding processing, a complete video file is obtained, and compatibility and processing of different coding modes are realized.
Corresponding to the video encoding method provided in the present application, there is also provided in another embodiment of the present application a video decoding method, see fig. 3, the video decoding method comprising:
s701, obtaining a target video file;
for example, the target video file after being encoded and compressed is transmitted to a receiving end through a transmission network, and the video file received by the receiving end is the video file to be decoded.
S702, analyzing the target video file to obtain video coding data;
after the target video file is obtained, the target video file needs to be parsed to obtain video encoding data capable of representing a video compression mode and video region division. The parsing may be performed by identification information of a video file, file type information, and the like, where the video encoded data may include encoding mode information, video region number information, video region byte number information, and the like.
And S703, determining a video area and an encoding mode corresponding to the video area based on the video encoding data.
Since the encoded video data includes the main information of the video that has been encoded, the encoding method corresponding to each video area can be determined based on the information.
And S704, determining a decoding mode matched with the coding mode.
Each coding mode has a decoding mode corresponding to the coding mode, so that the decoding mode can be determined according to the coding mode, and the process of decoding the file is more accurate and efficient.
S705, decoding the video region corresponding to the decoding method based on the decoding method, and obtaining a video picture corresponding to the video region.
If the target video file adopts processing modes of different video areas corresponding to different encoding modes, different decoding modes are adopted for different video areas to obtain corresponding video pictures, and compatibility and processing of different decoding modes are realized.
And S706, performing video packaging on the video picture to obtain a target video.
In the decoding process, each video area is respectively and correspondingly decoded, and in order to meet the requirement of a user for obtaining a complete video, the decoded videos need to be spliced and then presented to the user.
The embodiment of the application provides a video decoding method, which can obtain video coded data based on target video file analysis, then determine a decoding mode matched with an encoding mode in the video coded data, and decode different video areas corresponding to the video coded data based on different decoding modes to obtain a target video, so that the decoding processing of the video areas with different encoding modes is realized, the decoding requirements of users on the different video areas after the encoding processing are met, and the requirements of the users on the high definition of specific video information are realized.
In another embodiment of the present application, the video decoding method further includes:
s801, responding to that the video area comprises a first video area and a second video area;
s802, if the encoding mode corresponding to the first video area is the non-encoding mode, decoding the video picture corresponding to the first video area and the second video area to obtain the video picture, and performing video encapsulation to obtain the target video.
In the process of video encoding processing, a video can be divided into different video areas according to encoding requirements, for example, a first video area of a video area requiring high definition, and at this time, in order to ensure higher picture definition, the first video area can be subjected to non-encoding processing, so that in the process of decoding, the first video area can be directly obtained without processing, and video frames obtained by decoding with other areas are subjected to video frame encapsulation to obtain a target video.
The embodiment of the application also provides a specific application scene of video coding and decoding, in which information extraction is performed on some important events in video pictures, which requires that the video pictures for the important events can have higher definition and reduce the generation of distortion phenomenon in the current video coding and decoding transmission process. If the video to be processed is the monitoring video, the important event is a traffic accident picture in the video.
And receiving a set of coordinate positioning information input by an external user, wherein the coordinate positioning information represents the position information of the car accident picture in the video. And calculating a position information set of the coordinate positioning information corresponding to the monitoring picture area by combining information such as camera resolution, monitoring setting and the like, and uniformly labeling each area. Referring to fig. 4, a schematic diagram of a video area provided in an embodiment of the present application is shown. The whole monitoring video comprises three specific areas, namely a first video area, and the video set of the specific areas is as follows: { (r 1, x1, y1, m1, k 1), (r 2, x2, y2, m2, k 2), (r 3, x3, y3, m3, k 3) }, where r represents the region number, x and y represent the coordinates of the lower left corner of the region, and m and k represent the coordinates of the lower right corner of the region. The coordinate form is only an implementation manner provided in this embodiment, and an upper right corner coordinate and a lower left corner coordinate may also be defined, or a diagonal coordinate may also be defined, which is not limited in this application. Meanwhile, if a plurality of specific video areas are included, an area adding or deleting instruction input from the outside can be received, and the corresponding specific video area is selected according to the instruction.
According to the determined information of the specific video area (such as area 1, area 2 and area 3 in fig. 4), cutting out the video area part corresponding to the current surveillance video, and encoding the remaining part of the picture according to the encoding format (including but not limited to encoding modes such as h.263 and h.264) set by the camera, wherein the encoded data is represented as OD and the metadata is represented as OM (encode _ type, size). For each selected area, its uncoded data is represented as RD, and the metadata is represented as RM = (ID, P, size), where ID represents the number of the video area, P represents the position of the area in the current camera shooting picture, and Size represents the number of bytes occupied by the video area. And adding RD of each selected area to the end of OM data once, and sequentially adding corresponding RM data and OM data to the metadata of the frame, and performing whole video frame packaging based on newly generated image coding data and metadata.
And after receiving the video frame data subjected to the video coding processing, analyzing the metadata information of the video frame to obtain an uncoded area list. For each uncoded region, the number of bytes occupied by the region picture is checked according to the serial number of the uncoded region, and corresponding uncoded image data is extracted according to the sequence of the region in the coded data. And for the region which is subjected to coding compression in the picture, analyzing an 'encode _ type' field in the corresponding metadata to obtain an adopted coding mode, and calling a corresponding decoding algorithm to decode. And splicing the image data after decoding each part according to the position information occupied by each part in the video picture to be used as a target video for outputting.
The application also provides a video coding device corresponding to the video coding method. Referring to fig. 5, which shows a corresponding schematic structural diagram of an embodiment of a video encoding apparatus according to the present application, the apparatus of the present embodiment may include:
the area determining unit 10 is configured to determine a first video area and a second video area corresponding to a video to be processed;
a first encoding unit 11, configured to perform a first encoding process on a video picture corresponding to the first video area, so as to obtain first video data;
a second encoding unit 12, configured to perform a second encoding process on the video picture corresponding to the second video region, so as to obtain second video data, where the second encoding process is different from an encoding parameter of the first encoding process;
a packaging unit 13, configured to package the first video data and the second video data to obtain a target video file.
In another embodiment of the video encoding apparatus of the present application, the region determining unit 10 may include:
the first response subunit is used for responding to the received operation instruction and determining a first video area corresponding to the video to be processed;
correspondingly, if the operation instruction received in the first response subunit includes coordinate positioning information, the first response subunit is specifically configured to: and calculating to obtain a first video area corresponding to the video to be processed based on the coordinate positioning information.
The first determining subunit is configured to determine, as the second video area, a video area corresponding to the video to be processed, which is outside the first video area.
In another embodiment of the video encoding apparatus of the present application, the region determining unit 10 may further include:
the second response subunit is used for responding to the received identification condition, performing video picture identification on the video to be processed, and determining a video area meeting the identification condition as a first video area;
and the second determining subunit is configured to determine, as the second video area, a video area corresponding to the video to be processed, which is outside the first video area.
On the basis of the above-described embodiment of the video encoding apparatus, the apparatus in another embodiment of the present application further includes:
a region response unit for responding that the first video region is at least two video regions;
the instruction receiving unit is used for determining a target area corresponding to the first video area based on the received selection instruction;
and the second video area determining unit is used for determining a video area corresponding to the video to be processed, which is not the target area, as a second video area.
In another embodiment of the present invention, the video coding apparatus further includes a coding mode determining unit, where the coding mode determining unit is specifically configured to: determining a coding parameter of a first coding process according to the transmission condition of the video to be processed;
and determining the encoding parameters of the second encoding process based on the resolution of the video acquisition device of the video to be processed.
In another embodiment of the video encoding apparatus of the present application, the encapsulation unit 13 of the apparatus includes:
a first parsing subunit, configured to parse the first video data to obtain first encoded data and first metadata;
the second analysis subunit is used for analyzing the second video data to obtain second coded data and second metadata;
the first splicing subunit is used for splicing the first coded data and the second coded data to obtain coded data;
the second splicing subunit is used for splicing the first metadata and the second metadata to obtain metadata;
and the packaging subunit is used for packaging the video frames of the coded data and the metadata to obtain a target video file.
The application also provides a video decoding device corresponding to the video decoding method. Referring to fig. 6, which shows a schematic structural diagram of an embodiment of a video decoding apparatus according to the present application, the video decoding apparatus of the present embodiment may include:
an obtaining unit 20, configured to obtain a target video file;
the analysis unit 21 is configured to analyze the target video file to obtain video encoded data;
an encoding determining unit 22 configured to determine a video region and an encoding method corresponding to the video region based on the encoded video data;
a decoding determining unit 23 configured to determine a decoding scheme matching the encoding scheme;
a decoding processing unit 24, configured to perform decoding processing on a video region corresponding to the decoding method based on the decoding method, and obtain a video picture corresponding to the video region;
and the video packaging unit 25 is configured to perform video packaging on the video picture to obtain a target video.
In another embodiment of the video decoding apparatus of the present application, the apparatus further comprises:
a response unit for responding to the video area including a first video area and a second video area;
and the target video acquisition unit is used for performing video encapsulation on the video picture corresponding to the first video area and the video picture obtained by decoding the second video area to obtain a target video if the coding mode corresponding to the first video area is a non-coding mode.
By the video encoding device and the video decoding device provided by the embodiment of the application, a specific encoding and decoding processing mode can be adopted for a specific video area, lossless transmission of pictures in the specific area can be realized, the video definition is ensured, and compared with a mode that distortion is reduced by adopting an uncoded mode for transmission of all videos, the data volume of transmission of the whole video picture can be reduced.
An electronic device is also provided in the embodiments of the present application, referring to fig. 7, the electronic device includes a memory 30, a first processor 31 and a second processor 32, where the memory 30 is used to store an executable program, and the first processor 31 is used to execute the program stored in the memory 30, that is, the first processor 31 is specifically used to execute the following program steps:
s311, determining a first video area and a second video area corresponding to the video to be processed;
s312, performing first coding processing on the video picture corresponding to the first video area to obtain first video data;
s313, performing second encoding processing on the video picture corresponding to the second video area to obtain second video data, wherein the second encoding processing has different encoding parameters from the first encoding processing;
s314, packaging the first video data and the second video data to obtain a target video file;
in another embodiment, the first processor 31 may also be implemented by executing the executable program stored in the memory 30:
responding to the received operation instruction, and determining a first video area corresponding to the video to be processed;
and determining a video area corresponding to the video to be processed out of the first video area as a second video area.
Or realize that:
performing video picture recognition on the video to be processed in response to the received recognition condition, and determining a video area meeting the recognition condition as a first video area;
and determining a video area corresponding to the video to be processed out of the first video area as a second video area.
In another embodiment, the first processor 31 may also be implemented by executing an executable program stored in the memory 30:
and responding to the operation instruction including coordinate positioning information, and calculating to obtain a first video area corresponding to the video to be processed based on the coordinate positioning information.
In another embodiment, the first processor 31 may also be implemented by executing an executable program stored in the memory 30:
in response to the first video area being at least two video areas;
determining a target area corresponding to the first video area based on the received selection instruction;
and determining a video area corresponding to the video to be processed outside the target area as a second video area.
In another embodiment, the first processor 31 may also be implemented by executing an executable program stored in the memory 30:
determining a coding parameter of a first coding process according to the transmission condition of the video to be processed;
and determining the encoding parameters of the second encoding process based on the resolution of the video acquisition device of the video to be processed.
In another embodiment, the first processor 31 may also be implemented by executing an executable program stored in the memory 30:
analyzing the first video data to obtain first coded data and first metadata;
analyzing the second video data to obtain second coded data and second metadata;
splicing the first coded data and the second coded data to obtain coded data;
splicing the first metadata and the second metadata to obtain metadata;
and carrying out video frame packaging on the coded data and the metadata to obtain a target video file.
In another embodiment, the second processor 32 may also be implemented by executing an executable program stored in the memory 30:
s321, obtaining a target video file;
s322, analyzing the target video file to obtain video coding data;
s323, determining a video area and an encoding mode corresponding to the video area based on the video encoding data;
s324, determining a decoding mode matched with the coding mode;
s325, decoding the video area corresponding to the decoding mode based on the decoding mode to obtain a video picture corresponding to the video area;
and carrying out video encapsulation on the video picture to obtain a target video.
In another embodiment, the second processor 32 may also be implemented by executing an executable program stored in the memory 30:
in response to the video area comprising a first video area and a second video area;
if the encoding mode corresponding to the first video area is an unencoded mode, performing video encapsulation on a video picture corresponding to the first video area and a video picture obtained by decoding the second video area to obtain a target video.
Through the electronic equipment provided by the application, different encoding processing of different regions can be performed on the video based on the first processor, and decoding processing of different video regions is performed through the second processor, so that the picture after video encoding and decoding meets the user requirements, and the user experience is improved.
Those of ordinary skill in the art will understand that: all or part of the steps for implementing the method embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer readable storage medium, and when executed, the program performs the steps including the method embodiments; and the aforementioned storage medium includes: a mobile storage device, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Alternatively, the integrated unit described above may be stored in a computer-readable storage medium if it is implemented in the form of a software functional module and sold or used as a separate product. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially implemented or portions thereof contributing to the prior art may be embodied in the form of a software product stored in a storage medium, and including several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a removable storage device, a ROM, a RAM, a magnetic or optical disk, or various other media that can store program code.
It should be noted that, in the present specification, the embodiments are all described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. For the device-like embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
In addition, it should be further noted that, in the embodiments described above, relational terms such as first, second and the like are only used for distinguishing one operation, unit or module from another operation, unit or module, and do not necessarily require or imply any actual relation or order between the units, the units or modules. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, or system 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, or system. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of additional like elements in a process, method, or system comprising the element.
The foregoing is only a preferred embodiment of the present application and it should be noted that those skilled in the art can make several improvements and modifications without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.

Claims (7)

1. A video encoding method, comprising:
determining a first video area and a second video area corresponding to a video to be processed; the first video area is a video area containing user requirement information;
executing first encoding processing on a video picture corresponding to the first video area to obtain first video data; the first encoding process is an uncoding process;
executing second encoding processing on the video picture corresponding to the second video area to obtain second video data, wherein the second encoding processing is different from the encoding parameter of the first encoding processing; the encoding parameter comprises a compression ratio or a video size;
packaging the first video data and the second video data to obtain a target video file;
determining a coding parameter of a first coding process according to the transmission condition of the video to be processed;
determining encoding parameters of a second encoding process based on the resolution of the video acquisition device of the video to be processed;
wherein the encapsulating the first video data and the second video data to obtain a target video file includes:
analyzing the first video data to obtain first coded data and first metadata;
analyzing the second video data to obtain second coded data and second metadata;
splicing the first encoding data and the second encoding data corresponding to each first video area to obtain encoding data;
splicing the first metadata and the second metadata corresponding to each first video area to obtain metadata;
performing video frame packaging on the coded data and the metadata to obtain a target video file; the coded data represents a coding mode and the number of bytes occupied by a video area, and the metadata represents the coding of the coding area, the position of the video area in the current picture and the number of bytes occupied by the video area.
2. The method according to claim 1, wherein the determining a first video region and a second video region corresponding to the video to be processed comprises:
responding to the received operation instruction, and determining a first video area corresponding to the video to be processed;
and determining a video area corresponding to the video to be processed out of the first video area as a second video area.
3. The method of claim 1, wherein determining the first video region and the second video region corresponding to the video to be processed comprises:
performing video picture recognition on the video to be processed in response to the received recognition condition, and determining a video area meeting the recognition condition as a first video area;
and determining a video area corresponding to the video to be processed out of the first video area as a second video area.
4. The method of claim 2, the operational instructions comprising coordinate positioning information;
wherein, the determining a first video area corresponding to the video to be processed in response to the received operation instruction comprises:
and calculating to obtain a first video area corresponding to the video to be processed based on the coordinate positioning information.
5. The method of claim 3 or 4, further comprising:
in response to the first video area being at least two video areas;
determining a target area corresponding to the first video area based on the received selection instruction;
and determining a video area corresponding to the video to be processed outside the target area as a second video area.
6. A video decoding method, comprising:
obtaining a target video file;
analyzing the target video file to obtain video coding data;
determining a video region and an encoding mode corresponding to the video region based on the video encoding data, wherein encoding parameters of different encoding modes are different, and the encoding parameters comprise compression ratio or video size;
determining a decoding mode matched with the coding mode;
decoding a video area corresponding to the decoding mode based on the decoding mode to obtain a video picture corresponding to the video area;
performing video encapsulation on the video picture to obtain a target video;
the method further comprises the following steps:
in response to the video area comprising a first video area and a second video area; the first video area is a video area containing user requirement information;
if the encoding mode corresponding to the first video area is an unencoded mode, performing video encapsulation on a video picture corresponding to the first video area and a video picture obtained by decoding the second video area to obtain a target video;
the target video file is obtained by encapsulating first video data and second video data; the first video data is obtained by performing first encoding processing on a video picture corresponding to the first video area; the second video data is obtained by performing second encoding processing on a video picture corresponding to the second video area; wherein encapsulating the first video data and the second video data comprises: analyzing the first video data to obtain first coded data and first metadata; analyzing the second video data to obtain second coded data and second metadata; splicing the first encoding data and the second encoding data corresponding to each first video area to obtain encoding data; splicing the first metadata and the second metadata corresponding to each first video area to obtain metadata; performing video frame encapsulation on the coded data and the metadata to obtain a target video file; the coded data represents a coding mode and the number of bytes occupied by a video area, and the metadata represents the coding of the coding area, the position of the video area in the current picture and the number of bytes occupied by the video area.
7. An electronic device comprising a memory, a first processor and a second processor, wherein,
the first processor is used for determining a first video area and a second video area corresponding to a video to be processed; the first video area is a video area containing user requirement information; executing first encoding processing on a video picture corresponding to the first video area to obtain first video data; the first encoding process is an uncoding process; executing second encoding processing on the video picture corresponding to the second video area to obtain second video data, wherein the second encoding processing is different from the encoding parameter of the first encoding processing; packaging the first video data and the second video data to obtain a target video file; determining a coding parameter of a first coding process according to the transmission condition of the video to be processed; determining encoding parameters of a second encoding process based on the resolution of the video acquisition device of the video to be processed;
wherein the encapsulating the first video data and the second video data to obtain a target video file includes: analyzing the first video data to obtain first coded data and first metadata; analyzing the second video data to obtain second coded data and second metadata; splicing the first encoding data and the second encoding data corresponding to each first video area to obtain encoding data; splicing the first metadata and the second metadata corresponding to each first video area to obtain metadata; performing video frame packaging on the coded data and the metadata to obtain a target video file; the metadata is used for representing the encoding mode of the encoding area, the number of bytes occupied by the video area, the encoding of the encoding area, the position of the video area in the current picture and the number of bytes occupied by the video area;
the second processor is used for obtaining a target video file; analyzing the target video file to obtain video coding data; determining a video region and an encoding mode corresponding to the video region based on the video encoding data, wherein encoding parameters of different encoding modes are different, and the encoding parameters comprise compression ratio or video size; determining a decoding mode matched with the coding mode; decoding a video area corresponding to the decoding mode based on the decoding mode to obtain a video picture corresponding to the video area; and carrying out video encapsulation on the video picture to obtain a target video.
CN201811366190.3A 2018-11-16 2018-11-16 Video encoding method, video decoding method and electronic equipment Active CN109246434B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811366190.3A CN109246434B (en) 2018-11-16 2018-11-16 Video encoding method, video decoding method and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811366190.3A CN109246434B (en) 2018-11-16 2018-11-16 Video encoding method, video decoding method and electronic equipment

Publications (2)

Publication Number Publication Date
CN109246434A CN109246434A (en) 2019-01-18
CN109246434B true CN109246434B (en) 2023-03-21

Family

ID=65074922

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811366190.3A Active CN109246434B (en) 2018-11-16 2018-11-16 Video encoding method, video decoding method and electronic equipment

Country Status (1)

Country Link
CN (1) CN109246434B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106572350A (en) * 2015-10-08 2017-04-19 三星电子株式会社 Electronic device configured to non-uniformly encode/decode image data according to display shape

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101945275B (en) * 2010-08-18 2012-10-24 镇江唐桥微电子有限公司 Video coding method based on region of interest (ROI)
CN103974071A (en) * 2013-01-29 2014-08-06 富士通株式会社 Video coding method and equipment on basis of regions of interest
KR102088801B1 (en) * 2013-03-07 2020-03-13 삼성전자주식회사 Method and apparatus for ROI coding using variable block size coding information
CN104378635B (en) * 2014-10-28 2017-12-05 西交利物浦大学 The coding method of video interested region based on microphone array auxiliary
WO2018093182A1 (en) * 2016-11-16 2018-05-24 Samsung Electronics Co., Ltd. Image management method and apparatus thereof
CN108429921B (en) * 2017-02-14 2020-12-18 北京金山云网络技术有限公司 Video coding and decoding method and device
CN108513119A (en) * 2017-02-27 2018-09-07 阿里巴巴集团控股有限公司 Mapping, processing method, device and the machine readable media of image

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106572350A (en) * 2015-10-08 2017-04-19 三星电子株式会社 Electronic device configured to non-uniformly encode/decode image data according to display shape

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
基于提升小波变换的视频图像编码技术研究;陈文静等;《微型机与应用》;20140425;第33卷(第8期);第42-44、48页 *
陈文静等.基于提升小波变换的视频图像编码技术研究.《微型机与应用》.2014,第33卷(第8期), *

Also Published As

Publication number Publication date
CN109246434A (en) 2019-01-18

Similar Documents

Publication Publication Date Title
CN103188522B (en) Method and system for providing and delivering a composite condensed stream
EP3209018A1 (en) Encoding or decoding method and apparatus
CN110784718B (en) Video data encoding method, apparatus, device and storage medium
US8300959B2 (en) Transport stream structure of image data having additional information inserted, and method and apparatus for transmission and reception thereof
US20110058613A1 (en) Method and apparatus for generating bitstream based on syntax element
CN111818295A (en) Image acquisition method and device
CN113343895B (en) Target detection method, target detection device, storage medium and electronic equipment
CN111385576B (en) Video coding method and device, mobile terminal and storage medium
CN113395523B (en) Image decoding method, device, equipment and storage medium based on parallel threads
CN109246434B (en) Video encoding method, video decoding method and electronic equipment
CN110636334B (en) Data transmission method and system
TW202406355A (en) Method and image-capturing device for encoding image frames of an image stream and transmitting encoded image frames on a communications network
CN107734278B (en) Video playback method and related device
CN113099270B (en) File storage method, decoding method, device, storage medium and electronic device
CN113840160B (en) Event data transmission method, system, electronic device and readable storage medium
US20240070924A1 (en) Compression of temporal data by using geometry-based point cloud compression
CN102047662A (en) Encoder
EP4231644A1 (en) Video frame compression method and apparatus, and video frame decompression method and apparatus
CN112437289B (en) Switching time delay obtaining method
CN112822188A (en) Method and device for monitoring transcoding task state in distributed transcoding system
CN114650439A (en) Information monitoring method, terminal, server and computer readable storage medium
CN106534137B (en) Media stream transmission method and device
US12003743B2 (en) Video stream decoding method and apparatus, terminal device, and storage medium
US20220038724A1 (en) Video stream decoding method and apparatus, terminal device, and storage medium
CN106341589B (en) Digital image processing method, device and system

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