CN114697758B - Video processing method and device and electronic equipment - Google Patents
Video processing method and device and electronic equipment Download PDFInfo
- Publication number
- CN114697758B CN114697758B CN202011614555.7A CN202011614555A CN114697758B CN 114697758 B CN114697758 B CN 114697758B CN 202011614555 A CN202011614555 A CN 202011614555A CN 114697758 B CN114697758 B CN 114697758B
- Authority
- CN
- China
- Prior art keywords
- video
- video frame
- target
- frames
- sequence
- 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
Links
- 238000003672 processing method Methods 0.000 title abstract description 16
- 238000000034 method Methods 0.000 claims abstract description 38
- 238000012545 processing Methods 0.000 claims abstract description 21
- 230000000295 complement effect Effects 0.000 claims abstract description 10
- 238000004422 calculation algorithm Methods 0.000 claims description 21
- 238000005516 engineering process Methods 0.000 claims description 8
- 238000004806 packaging method and process Methods 0.000 claims description 7
- 230000006837 decompression Effects 0.000 claims description 5
- 238000009877 rendering Methods 0.000 claims 1
- 230000000694 effects Effects 0.000 abstract description 18
- 230000000007 visual effect Effects 0.000 abstract description 5
- 210000004556 brain Anatomy 0.000 description 5
- 238000004891 communication Methods 0.000 description 4
- 238000010586 diagram Methods 0.000 description 4
- 239000011521 glass Substances 0.000 description 3
- 238000010187 selection method Methods 0.000 description 3
- 230000004438 eyesight Effects 0.000 description 2
- 230000006978 adaptation Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000005538 encapsulation Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000014509 gene expression Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000008447 perception Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
- 230000001131 transforming effect Effects 0.000 description 1
- 230000016776 visual perception Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/80—Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
- H04N21/81—Monomedia components thereof
- H04N21/816—Monomedia components thereof involving special video data, e.g 3D video
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N13/00—Stereoscopic video systems; Multi-view video systems; Details thereof
- H04N13/10—Processing, recording or transmission of stereoscopic or multi-view image signals
- H04N13/106—Processing image signals
- H04N13/161—Encoding, multiplexing or demultiplexing different image signal components
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N13/00—Stereoscopic video systems; Multi-view video systems; Details thereof
- H04N13/30—Image reproducers
- H04N13/302—Image reproducers for viewing without the aid of special glasses, i.e. using autostereoscopic displays
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/50—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
- H04N19/597—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding specially adapted for multi-view video sequence encoding
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
- H04N21/44—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
- H04N21/44—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
- H04N21/44016—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving splicing one content stream with another content stream, e.g. for substituting a video clip
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/80—Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
- H04N21/81—Monomedia components thereof
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Testing, Inspecting, Measuring Of Stereoscopic Televisions And Televisions (AREA)
Abstract
The application provides a video processing method, a video processing device and electronic equipment, wherein the method comprises the following steps: acquiring a first video frame sequence and a second video frame sequence respectively corresponding to two paths of original video sources for 3D presentation; respectively and alternately selecting target video frames with complementary identification information from the first video frame sequence and the second video frame sequence according to the identification information of the video frames to obtain a first target video frame set and a second target video frame set; and according to the sequence of the identification information of the target video frames, performing cross combination on the target video frames in the two sets to obtain a target video frame sequence. According to the method and the device, the video frame sequence with the naked eye 3D visual effect can be obtained through the cross combination processing of the video frames of the two video sources, and then the naked eye 3D video file can be generated, so that a user can watch the video with the 3D effect by naked eyes without relying on special equipment.
Description
Technical Field
The present application relates to the technical field of software algorithm development, and in particular, to a video processing method and apparatus, and an electronic device.
Background
In the prior art, there are two ways to achieve a 3D effect: one way is for the user to wear 3D glasses or VR glasses directly, relying on a dedicated device; the other mode is that a player is modified to play a video with a 3D effect, and the video can be directly watched by human eyes, but the mode cannot use a common video player, and the fast switching of the two videos can consume a large amount of equipment computing resources, so that the 3D effect of the high-definition high-image-quality video is seriously affected.
Disclosure of Invention
The application aims to provide a video processing method, a video processing device and electronic equipment, wherein a video frame sequence with a naked eye 3D visual effect can be obtained through cross merging processing of video frames of two paths of video sources, so that a 3D naked eye video file capable of being played by a common player can be generated, and a user can watch a video with a 3D effect by naked eyes without depending on special equipment.
In a first aspect, an embodiment of the present application provides a video processing method, where the method includes: acquiring two paths of original video sources for 3D presentation; respectively decoding the two paths of original video sources to obtain a first video frame sequence and a second video frame sequence which respectively correspond to the two paths of original video sources; respectively and alternately selecting target video frames from the first video frame sequence and the second video frame sequence according to the identification information of the video frames, so that the identification information of the target video frames in the obtained first target video frame set and the second target video frame set is complementary; and carrying out cross combination on the target video frames in the first target video frame set and the second target video frame set according to the sequence of the identification information of the target video frames to obtain a target video frame sequence.
Further, after the target video frame set is obtained, the method further includes: and encapsulating the audio frames in the original video sources and the target video frames in the target video frame sequence to obtain the naked eye 3D video files corresponding to the two original video sources.
Further, the identification information includes a decompression time stamp of the video frame or a sequence number corresponding to the video frame.
Further, the step of acquiring two original video sources for 3D presentation includes: collecting two paths of original video sources for 3D presentation through parallel binocular camera equipment; or, calculating the target video source by an image recognition technology to obtain two paths of original video sources with parallax.
Further, the step of alternately selecting the target video frame from the first video frame sequence and the second video frame sequence according to the identification information of the video frame includes: according to the sequence of the identification information of the video frames in the first video frame sequence, sequentially spacing a specified number of video frames, selecting a specified number of first target video frames from the first video frame sequence, and adding the first target video frames into a first target video frame set; and sequentially adding second target video frames, which have the same identification information as the unselected video frames in the first video frame sequence, in the second video frame sequence to a second target video frame set according to the sequence of the identification information.
Further, the step of alternately selecting the target video frame from the first video frame sequence and the second video frame sequence according to the identification information of the video frame includes: according to the identification information of the video frames, odd frames are selected from the first video frame sequence and added to the first target video frame set, and even frames are selected from the second video frame sequence and added to the second target video frame set.
Further, before the step of alternately selecting the target video frame from the first video frame sequence and the second video frame sequence according to the identification information of the video frame, the method further includes: if the identification information of the video frames in the first video frame sequence and the second video frame sequence is inconsistent, the identification information of the video frames is adjusted to be consistent under the premise of not changing the sequence.
Further, the step of encapsulating the audio frames in the original video sources and the target video frames in the target video frame sequence to obtain the naked eye 3D video files corresponding to the two original video sources includes: taking an audio frame in any one path of original video source as a target audio frame; and packaging the target audio frame and the target video frame in the target video frame sequence through a preset coding algorithm to obtain naked eye 3D video files corresponding to the two paths of original video sources.
Further, the preset encoding algorithm includes one of the following: h264 coding algorithm, H265 coding algorithm and AV1 coding algorithm.
In a second aspect, an embodiment of the present application further provides a video processing apparatus, including: the video source acquisition module is used for acquiring two paths of original video sources for 3D presentation; the video decoding module is used for respectively decoding the two paths of original video sources to obtain a first video frame sequence and a second video frame sequence which respectively correspond to the two paths of original video sources; the target frame selection module is used for alternately selecting target video frames from the first video frame sequence and the second video frame sequence respectively according to the identification information of the video frames so as to make the identification information of the target video frames in the obtained first target video frame set and the second target video frame set complementary; and the frame combination module is used for performing cross combination on the target video frames in the first target video frame set and the second target video frame set according to the sequence of the identification information of the target video frames to obtain a target video frame sequence.
In a third aspect, an embodiment of the present application further provides an electronic device, which includes a processor and a memory, where the memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement the method of the first aspect.
In a fourth aspect, embodiments of the present application further provide a computer-readable storage medium storing computer-executable instructions that, when invoked and executed by a processor, cause the processor to implement the method of the first aspect.
In the video processing method provided by the embodiment of the application, first, two paths of original video sources for 3D presentation are decoded respectively to obtain a first video frame sequence and a second video frame sequence corresponding to the two paths of original video sources respectively; then, according to the identification information of the video frames, respectively and alternately selecting target video frames with complementary identification information from the first video frame sequence and the second video frame sequence to obtain a first target video frame set and a second target video frame set; and then, carrying out cross combination on the target video frames in the two sets according to the sequence of the identification information of the target video frames to obtain a target video frame sequence. According to the embodiment of the application, the video frame sequence with the naked eye 3D visual effect can be obtained through the cross combination processing of the video frames of the two video sources, and then a 3D naked eye video file capable of being played by a common player can be generated, so that a user can watch the video with the 3D effect by naked eyes without relying on special equipment.
Drawings
In order to more clearly illustrate the detailed description of the present application or the technical solutions in the prior art, the drawings used in the detailed description or the prior art description will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a flowchart of a video processing method according to an embodiment of the present application;
fig. 2 is a flowchart of a video frame selection method according to an embodiment of the present disclosure;
fig. 3 is a schematic diagram of a video cross-assembly according to an embodiment of the present application;
fig. 4 is a block diagram of a video processing apparatus according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions of the present application will be described clearly and completely with reference to the following embodiments, and it should be understood that the described embodiments are some, but not all embodiments of the present application. 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.
Currently, there are three ways to view video with 3D stereoscopic effect:
the first method comprises the following steps: the three-dimensional video technology mainly adopted by the 3D film is that an image with binocular parallax is directly synthesized through parallel shooting during shooting, and fine adjustment processing is carried out at the later stage. When the parallax images are played, the two parallax images exist on a picture at the same time, corresponding videos are obtained by the left eye and the right eye of a person at the same time through special equipment (such as polarized glasses), and the parallax images are perceived as stereoscopic images after being processed by the brain of the person.
And the second method comprises the following steps: the VR stereo video is characterized in that two videos with parallax, which are generated by two parallel cameras, are simultaneously and respectively played, the left eye and the right eye of a person respectively receive the corresponding videos by utilizing VR equipment (head-mounted equipment), and the parallax caused by the parallax is processed by the brain of the person to feel the effect of the stereo video.
And the third is that: the conventional naked eye 3D technology is used for transforming a player, two paths of videos with parallax errors generated by parallel shooting are played on a player terminal device in a rapid and alternate mode, when human eyes watch the videos, the videos switched rapidly generate the parallax errors, and after the human brain processes the parallax errors, the effect of a stereoscopic image is perceived.
In the above manner, the biggest problem of 3D movies and VR 3D technologies is that they are dependent on special equipment and cannot be viewed directly by human eyes. Conventional bore hole 3D technique, player need special transformation, can not use ordinary video player, and the fast switch-over of two videos can a large amount of consumer computational resources moreover, have serious influence to the high-definition video 3D effect.
Based on this, embodiments of the present application provide a video processing method, an apparatus, and an electronic device, which can obtain a video frame sequence with a naked-eye 3D visual effect by performing cross-merge processing on video frames of two video sources, and can further generate a 3D naked-eye video file that can be played by using a common player, so that a user can watch a video with a 3D effect by naked eyes without relying on a special device.
Fig. 1 is a flowchart of a video processing method according to an embodiment of the present application, where the video processing method specifically includes the following steps:
and S102, acquiring two paths of original video sources for 3D presentation.
The two original video sources for 3D presentation in the embodiment of the application may be two video sources with parallax acquired by hardware equipment, for example, two video sources generated by parallel shooting through parallel binocular shooting equipment; or, the two original video sources with parallax may be obtained by performing video parallax calculation through a software technique, for example, calculating a target video source through an image recognition technique. The binocular camera shooting equipment comprises two cameras or binocular cameras for shooting in parallel.
And step S104, respectively decoding the two paths of original video sources to obtain a first video frame sequence and a second video frame sequence respectively corresponding to the two paths of original video sources.
The video source decoding process can be realized by a hardware decoder or by a software decoding technology, and a first video frame sequence and a second video frame sequence can be obtained after two paths of original video sources are respectively decoded, wherein the first video frame sequence and the second video frame sequence are arranged according to the sequence of the identification information of the video frames.
Step S106, according to the identification information of the video frames, respectively and alternately selecting target video frames from the first video frame sequence and the second video frame sequence, so that the identification information of the target video frames in the obtained first target video frame set and the second target video frame set are complementary.
In this step, the identification information may be a decompression timestamp of the video frame, or may also be a sequence number corresponding to the video frame. The target video frames are alternately selected from the first video frame sequence and the second video frame sequence, which may be non-uniform and may be uniformly alternately selected, for example, the first video frame sequence includes video frames A1, A2, A3 \8230 \ 8230 \ a20, the second video frame sequence includes video frames B1, B2, B3 \8230 \ 8230, B20, the target video frames A1, A2 may be selected from the first video frame sequence, the target video frames B3, B4, B5 may be selected from the second video frame sequence, the target video frame A6 may be selected from the first video frame sequence, the target video frames B7, B8 may be selected from the second video frame sequence, and so on, until the last frame, which is non-uniform and alternate selection, as long as the identification information of the target video frames in the first target video frame sequence and the second target video frame sequence is complementary.
Yet another way is to alternate the selection evenly, e.g. selecting target video frame A1 from the first video frame sequence, target video frame B2 from the second video frame sequence, target video frame A3 from the first video frame sequence, target video frame B4 from the second video frame sequence, and so on until the last frame.
Forming a first target video frame set by selected target video frames in the first video frame sequence; forming a second target video frame set by the selected target video frames in the second video frame sequence; the target video frames in the first set of target video frames and the second set of target video frames are complementary.
And step S108, according to the sequence of the identification information of the target video frames, performing cross combination on the target video frames in the first target video frame set and the second target video frame set to obtain a target video frame sequence.
And after the first target video frame set and the second target video frame set are determined, performing cross combination on the target video frames according to the sequence of the identification information of the target video frames in the two sets to obtain a target video frame sequence.
According to the video processing method provided by the embodiment of the application, two paths of video sources generated by parallel shooting are decoded and then target video frames are alternately selected according to the sequence of the decompression timestamps of the video frames, the target video frames are combined in a cross mode to obtain a video frame sequence with a naked eye 3D visual effect, and then the video frames can be combined into a complete naked eye 3D video through a video coding algorithm.
After the target video frame sequence is obtained, the following method steps may be further included: and encapsulating the audio frames in the original video sources and the target video frames in the target video frame sequence to obtain the naked eye 3D video files corresponding to the two original video sources.
In the embodiment of the application, only the video frames are subjected to cross merging processing, and the audio is not subjected to special processing, so that during final encoding, the audio frames corresponding to any path of original video source can be adopted for packaging, namely, after the audio frames in the original video source and the target video frames in the target video frame sequence are packaged, naked eye 3D video files corresponding to two paths of original video sources can be generated.
In practical application, two original video sources used for 3D presentation are available in various acquiring modes, and the video sources used in the embodiment of the application are two video files generated by two-way parallel camera equipment for simulating binocular vision, which are also used in the production of most 3D stereo videos. Two parallel cameras simulate binocular vision to acquire videos, two video sources always require to unify targets, synchronize audio start and stop time and unify two video frame rates (not less than 60 frames/second: 60 complete pictures are generated in each second). In addition, a target video source can be calculated through an image recognition technology to obtain two paths of original video sources with parallax, namely, the video sources are obtained through a software mode.
In order to improve the final viewing effect of the naked eye 3D video file, the embodiment of the present application provides a preferred target video frame selection method, that is, the step S106 is a step of respectively and alternately selecting a target video frame from a first video frame sequence and a second video frame sequence according to identification information of the video frame, and may be specifically implemented by referring to a flowchart of a video frame selection method shown in fig. 2:
step S202, according to the sequence of the identification information of the video frames in the first video frame sequence, sequentially spacing a specified number of video frames, and selecting a specified number of first target video frames from the first video frame sequence to add to the first target video frame set.
The specified number can be one or more, the number of the video frames in the interval is the same as the number of the target frame selections, namely, the target video frames are alternately and uniformly selected from the two video frame sequences, and the mode can realize better 3D video effect. For example, the first sequence of video frames comprises video frames A1, A2, A3 \8230; a20, and the second sequence of video frames comprises video frames B1, B2, B3 \8230 \ 8230; B20, then two video frames may be separated, the first target video frame A3, A4 is selected from the first sequence of video frames, two more video frames are separated, the first target video frame A7, A8 is selected from the first sequence of video frames, and so on until the last frame. The selected first target video frames A3, A4, A7 and A8 \8230 \ 8230:are sequentially added into the first target video frame set.
Step S204, adding second target video frames which have the same identification information with the unselected video frames in the first video frame sequence in the second video frame sequence to a second target video frame set in sequence according to the sequence of the identification information.
The second video frame sequence comprises video frames B1, B2 and B3 \8230, wherein \8230isused in B20, generally speaking, identification information of two paths of video frames respectively corresponding to two paths of decoded original video sources acquired by binocular camera equipment is consistent, namely, identification information of the video frame A1 is consistent with that of the video frame B1, identification information of the video frame A2 is consistent with that of the video frame B2 \82308230, if the identification information of two paths of video sources respectively corresponding to two paths of decoded video frames obtained by software calculation may have certain difference, and at this time, the identification information of the two paths of video frames needs to be adjusted to be consistent on the premise of keeping the sequence unchanged.
In this way, after the first target video frame in the first video frame sequence is selected, the second target video frame in the second video frame sequence may be directly determined, that is, the second target video frames in the second video frame sequence, which have the same identification information as the unselected video frames in the first video frame sequence, are sequentially added to the second target video frame set according to the sequence of the identification information.
Further, as described in the above example, after determining that the first target video frames in the first target video frame set are A3, A4, A7, and A8 \8230, respectively, the unselected video frames in the first video frame sequence are A1, A2, A5, and A6 \8230, the video frames with the same identification information are B1, B2, B5, and B6 \8230, and therefore, the video frames B1, B2, B5, and B6 \8230, and the unselected video frames are added to the second target video frame set as the second target video frames.
In a preferred embodiment, the step of alternately selecting the target video frames from the first video frame sequence and the second video frame sequence according to the identification information of the video frames can be implemented by selecting odd frames from the first video frame sequence, such as a first video frame A1, a first video frame A3 \8230, and \8230, from the first video frame sequence, adding to the first target video frame set, and selecting even frames from the second video frame sequence, such as a second video frame B2, a second video frame B4 \8230, and \8230, from the second target video frame set, according to the identification information of the video frames, as shown in fig. 3. According to the identification information of the odd frame and the even frame, the odd frame and the even frame are crossed and merged to obtain a target video frame sequence: a first video frame A1, a second video frame B2, a first video frame A3, a second video frame B4 \8230;. This way, that is, in the above embodiment, when the specified number is one, that is, one video frame is selected every other video frame, this way of selecting video frames can better achieve the 3D effect of video.
After the first target video frame set and the second target video frame set are determined through the process, the target video frames in the two sets are further subjected to cross merging according to identification information of the target video frames to generate a target video frame sequence, and then audio frames in the original video source and the target video frames in the target video frame sequence are packaged to obtain naked eye 3D video files corresponding to the two original video sources. Specifically, an audio frame in any one path of original video source can be used as a target audio frame; and packaging the target audio frame and the target video frame in the target video frame sequence through a preset coding algorithm to obtain naked eye 3D video files corresponding to the two paths of original video sources. The preset encoding algorithm may include one of: h264 coding algorithm, H265 coding algorithm, and AV1 coding algorithm.
By re-encoding, the newly generated video file has the same frame rate as the original video source, but since the two video files are combined, the frame rate of each monocular video (acting on one eye) is half of the frame rate of the original video source. Therefore, after combining the video files, in order to reduce the frustration caused by the monocular perception of the human eyes, the original video source is required to be recorded at a higher frame rate as much as possible. And the newly generated naked eye 3D video file can be played on a common video player. If a person is looking with only one eye, the effect is a video with ghosts. If a person watches the three-dimensional images with two eyes, the brain can automatically correspond the double-image images to the single-side eyes to receive information through short adaptation, and finally, the illusion of watching the three-dimensional images is generated through the processing of the human brain visual perception area, namely, the effect of naked eye 3D videos is realized.
The video processing method provided by the embodiment of the application is realized through a pure software algorithm, does not depend on a special viewing device or a special video player, the video file can also use a common coding format in the market, all playing conditions are not limited, and a viewer can experience a 3D (three-dimensional) video effect by naked eyes.
Based on the foregoing method embodiment, an embodiment of the present application further provides a video processing apparatus, as shown in fig. 4, the apparatus includes: a video source obtaining module 402, configured to obtain two paths of original video sources for 3D presentation; the video decoding module 404 is configured to decode two paths of original video sources respectively to obtain a first video frame sequence and a second video frame sequence corresponding to the two paths of original video sources respectively; a target frame selection module 406, configured to alternately select a target video frame from the first video frame sequence and the second video frame sequence according to the identification information of the video frame, so that the obtained identification information of the target video frames in the first target video frame set and the second target video frame set are complementary; and the frame combination module 408 is configured to perform cross combination on the target video frames in the first target video frame set and the second target video frame set according to the sequence of the identification information of the target video frames to obtain a target video frame sequence.
In another possible implementation, the video processing apparatus further includes: and the audio and video packaging module is used for packaging the audio frames in the original video sources and the target video frames in the target video frame sequence to obtain naked eye 3D video files corresponding to the two original video sources.
In another possible embodiment, the identification information includes a decompression timestamp of the video frame or a sequence number corresponding to the video frame.
In another possible implementation, the video source obtaining module 402 is further configured to: acquiring two paths of original video sources for 3D presentation through binocular camera equipment; or, calculating the target video source by an image recognition technology to obtain two paths of original video sources with parallax.
In another possible implementation, the target frame selecting module 406 is further configured to: according to the sequence of the identification information of the video frames in the first video frame sequence, sequentially spacing a specified number of video frames, selecting a specified number of first target video frames from the first video frame sequence, and adding the first target video frames to the first target video frame set; and sequentially adding second target video frames which have the same identification information as the unselected video frames in the first video frame sequence to a second target video frame set according to the sequence of the identification information in the second video frame sequence.
In another possible implementation, the target frame selecting module 406 is further configured to: according to the identification information of the video frames, odd frames are selected from the first video frame sequence and added to the first target video frame set, and even frames are selected from the second video frame sequence and added to the second target video frame set.
In another possible embodiment, the above apparatus further comprises: and the timestamp adjusting module is used for adjusting the identification information of the video frames to be consistent on the premise of keeping the sequence unchanged if the identification information of the video frames is inconsistent in the first video frame sequence and the second video frame sequence.
In another possible implementation, the audio/video encapsulation module is further configured to: taking an audio frame in any original video source as a target audio file; and packaging the target audio frame and the target video frame in the target video frame sequence through a preset coding algorithm to obtain naked eye 3D video files corresponding to the two paths of original video sources.
In another possible embodiment, the preset encoding algorithm includes one of the following: h264 coding algorithm, H265 coding algorithm and AV1 coding algorithm.
The video processing apparatus provided in the embodiment of the present application has the same implementation principle and technical effect as those of the foregoing video processing method embodiment, and for brief description, reference may be made to corresponding contents in the foregoing video processing method embodiment for the portions of the embodiment of the video processing apparatus that are not mentioned.
An electronic device is further provided in the embodiments of the present application, as shown in fig. 5, which is a schematic structural diagram of the electronic device, where the electronic device includes a processor 51 and a memory 50, the memory 50 stores computer-executable instructions capable of being executed by the processor 51, and the processor 51 executes the computer-executable instructions to implement the method.
In the embodiment shown in fig. 5, the electronic device further comprises a bus 52 and a communication interface 53, wherein the processor 51, the communication interface 53 and the memory 50 are connected by the bus 52.
The Memory 50 may include a high-speed Random Access Memory (RAM) and may also include a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. The communication connection between the network element of the system and at least one other network element is realized through at least one communication interface 53 (which may be wired or wireless), and the internet, a wide area network, a local network, a metropolitan area network, and the like may be used. The bus 52 may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus 52 may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 5, but this does not indicate only one bus or one type of bus.
The processor 51 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 51. The Processor 51 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the device can 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. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in a memory, and the processor 51 reads information in the memory and performs the steps of the method of the previous embodiment in combination with hardware thereof.
Embodiments of the present application further provide a computer-readable storage medium, where the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are called and executed by a processor, the computer-executable instructions cause the processor to implement the foregoing method, and specific implementation may refer to the foregoing method embodiments, which are not described herein again.
The video processing method, the video processing apparatus, and the computer program product of the electronic device provided in the embodiments of the present application include a computer-readable storage medium storing a program code, where instructions included in the program code may be used to execute the method described in the foregoing method embodiments, and specific implementations may refer to the method embodiments and are not described herein again.
Unless specifically stated otherwise, the relative steps, numerical expressions, and numerical values of the components and steps set forth in these embodiments do not limit the scope of the present application.
The functions, if implemented in software functional units and sold or used as a stand-alone product, may be stored in a non-transitory computer-readable storage medium executable by a processor. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including 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 steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk, and various media capable of storing program codes.
In the description of the present application, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the drawings, and are only for convenience of description and simplicity of description, and do not indicate or imply that the device or element being referred to must have a particular orientation, be constructed and operated in a particular orientation, and thus, should not be construed as limiting the present application. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present application, and are used to illustrate the technical solutions of the present application, but not to limit the technical solutions, and the scope of the present application is not limited to the above-mentioned embodiments, although the present application is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope disclosed in the present application; such modifications, changes or substitutions do not depart from the spirit and scope of the exemplary embodiments of the present application, and are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims (11)
1. A method of video processing, the method comprising:
acquiring two paths of original video sources for 3D presentation;
decoding the two paths of original video sources respectively to obtain a first video frame sequence and a second video frame sequence corresponding to the two paths of original video sources respectively;
respectively and alternately selecting target video frames from the first video frame sequence and the second video frame sequence according to the identification information of the video frames, so that the identification information of the target video frames in the first target video frame set and the second target video frame set are complementary;
according to the sequence of the identification information of the target video frames, performing cross combination on the target video frames in the first target video frame set and the second target video frame set to obtain a target video frame sequence;
and encapsulating the audio frames in the original video source and the target video frames in the target video frame sequence to obtain two paths of naked eye 3D video files corresponding to the original video source.
2. The method of claim 1, wherein the identification information comprises a decompression timestamp of a video frame or a corresponding sequence number of the video frame.
3. The method of claim 1, wherein the step of obtaining two original video sources for 3D rendering comprises:
acquiring two paths of original video sources for 3D presentation through parallel binocular camera equipment;
or,
and calculating the target video source by an image recognition technology to obtain two paths of original video sources with parallax.
4. The method according to claim 1, wherein the step of alternately selecting the target video frame from the first video frame sequence and the second video frame sequence according to the identification information of the video frame comprises:
according to the sequence of the identification information of the video frames in the first video frame sequence, sequentially spacing a specified number of video frames, selecting a first target video frame with the specified number from the first video frame sequence, and adding the first target video frame into a first target video frame set;
and sequentially adding second target video frames, which have the same identification information as the unselected video frames in the first video frame sequence, in the second video frame sequence to a second target video frame set according to the sequence of the identification information.
5. The method according to claim 1, wherein the step of alternately selecting the target video frame from the first video frame sequence and the second video frame sequence according to the identification information of the video frame comprises:
according to the identification information of the video frames, odd frames are selected from the first video frame sequence and added to a first target video frame set, and even frames are selected from the second video frame sequence and added to a second target video frame set.
6. The method of claim 1, wherein prior to the step of alternately selecting the target video frame from the first video frame sequence and the second video frame sequence, respectively, according to identification information of the video frame, the method further comprises:
if the identification information of the video frames in the first video frame sequence and the second video frame sequence is inconsistent, the identification information of the video frames is adjusted to be consistent on the premise of keeping the sequence.
7. The method according to claim 1, wherein the step of encapsulating the audio frames in the original video source and the target video frames in the target video frame sequence to obtain two paths of naked eye 3D video files corresponding to the original video source comprises:
taking an audio frame in any one path of the original video source as a target audio frame;
and packaging the target audio frame and the target video frame in the target video frame sequence through a preset coding algorithm to obtain two paths of naked eye 3D video files corresponding to the original video sources.
8. The method of claim 7, wherein the predetermined encoding algorithm comprises one of: h264 coding algorithm, H265 coding algorithm and AV1 coding algorithm.
9. A video processing apparatus, characterized in that the apparatus comprises:
the video source acquisition module is used for acquiring two paths of original video sources for 3D presentation;
the video decoding module is used for respectively decoding the two paths of original video sources to obtain a first video frame sequence and a second video frame sequence which respectively correspond to the two paths of original video sources;
a target frame selection module, configured to alternately select a target video frame from the first video frame sequence and the second video frame sequence according to identification information of the video frames, so that identification information of target video frames in the obtained first target video frame set and second target video frame set are complementary;
the frame combination module is used for performing cross combination on the target video frames in the first target video frame set and the second target video frame set according to the sequence of the identification information of the target video frames to obtain a target video frame sequence;
and the video file generation module is used for encapsulating the audio frames in the original video source and the target video frames in the target video frame sequence to obtain two paths of naked eye 3D video files corresponding to the original video source.
10. An electronic device comprising a processor and a memory, the memory storing computer-executable instructions executable by the processor, the processor executing the computer-executable instructions to implement the method of any of claims 1 to 8.
11. A computer-readable storage medium having computer-executable instructions stored thereon which, when invoked and executed by a processor, cause the processor to implement the method of any of claims 1 to 8.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011614555.7A CN114697758B (en) | 2020-12-30 | 2020-12-30 | Video processing method and device and electronic equipment |
PCT/CN2021/129870 WO2022142757A1 (en) | 2020-12-30 | 2021-11-10 | Video processing method and apparatus, electronic device, and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011614555.7A CN114697758B (en) | 2020-12-30 | 2020-12-30 | Video processing method and device and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114697758A CN114697758A (en) | 2022-07-01 |
CN114697758B true CN114697758B (en) | 2023-03-31 |
Family
ID=82132974
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011614555.7A Active CN114697758B (en) | 2020-12-30 | 2020-12-30 | Video processing method and device and electronic equipment |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN114697758B (en) |
WO (1) | WO2022142757A1 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116567353B (en) * | 2023-07-10 | 2023-09-12 | 湖南快乐阳光互动娱乐传媒有限公司 | Video delivery method and device, storage medium and electronic equipment |
Family Cites Families (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20080059937A (en) * | 2006-12-26 | 2008-07-01 | 삼성전자주식회사 | Display apparatus and processing method for 3d image and processing system for 3d image |
KR100943950B1 (en) * | 2008-07-14 | 2010-03-03 | 삼성에스디아이 주식회사 | Stereoscopic image display device and driving method thereof |
CN103081478A (en) * | 2010-06-24 | 2013-05-01 | 电子部品研究院 | Method for configuring stereoscopic moving picture file |
WO2012061549A2 (en) * | 2010-11-03 | 2012-05-10 | 3Dmedia Corporation | Methods, systems, and computer program products for creating three-dimensional video sequences |
CN102547313A (en) * | 2010-12-21 | 2012-07-04 | 北京睿为视讯技术有限公司 | Three-dimensional video play system and method thereof |
CN103024449B (en) * | 2011-09-28 | 2015-08-19 | 中国移动通信集团公司 | Stream of video frames processing method, video server and terminal equipment |
US20130215239A1 (en) * | 2012-02-21 | 2013-08-22 | Sen Wang | 3d scene model from video |
CN104363437A (en) * | 2014-11-28 | 2015-02-18 | 广东欧珀移动通信有限公司 | Method and apparatus for recording stereo video |
CN106303495B (en) * | 2015-06-30 | 2018-01-16 | 深圳创锐思科技有限公司 | Synthetic method, device and its mobile terminal of panoramic stereo image |
CN108111833A (en) * | 2016-11-24 | 2018-06-01 | 阿里巴巴集团控股有限公司 | For the method, apparatus and system of stereo video coding-decoding |
CN107872670A (en) * | 2017-11-17 | 2018-04-03 | 暴风集团股份有限公司 | A kind of 3D video coding-decoding methods, device, server, client and system |
CN110868560B (en) * | 2018-08-27 | 2022-04-15 | 青岛海信移动通信技术股份有限公司 | Video recording method based on binocular camera and terminal equipment |
CN111447504B (en) * | 2020-03-27 | 2022-05-03 | 北京字节跳动网络技术有限公司 | Three-dimensional video processing method and device, readable storage medium and electronic equipment |
-
2020
- 2020-12-30 CN CN202011614555.7A patent/CN114697758B/en active Active
-
2021
- 2021-11-10 WO PCT/CN2021/129870 patent/WO2022142757A1/en active Application Filing
Also Published As
Publication number | Publication date |
---|---|
WO2022142757A1 (en) | 2022-07-07 |
CN114697758A (en) | 2022-07-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106303573B (en) | 3D video image processing method, server and client | |
US8218855B2 (en) | Method and apparatus for receiving multiview camera parameters for stereoscopic image, and method and apparatus for transmitting multiview camera parameters for stereoscopic image | |
CN102918847B (en) | The method and apparatus of display image | |
US20130169543A1 (en) | Rendering Apparatuses, Display System and Methods for Rendering Multimedia Data Objects with a Function to Avoid Eye Fatigue | |
JP2009207136A (en) | Method for processing multiple video streams, and systems for encoding and decoding video streams | |
TWI539790B (en) | Apparatus, method and software product for generating and rebuilding a video stream | |
US20150304640A1 (en) | Managing 3D Edge Effects On Autostereoscopic Displays | |
US20110157163A1 (en) | Image processing device and image processing method | |
Battisti et al. | Toward the assessment of quality of experience for asymmetric encoding in immersive media | |
US8941718B2 (en) | 3D video processing apparatus and 3D video processing method | |
US9491435B2 (en) | Image synchronization method and associated apparatus | |
CN114697758B (en) | Video processing method and device and electronic equipment | |
US10553029B1 (en) | Using reference-only decoding of non-viewed sections of a projected video | |
CN103209335A (en) | Stereoscopic film playing method and system supporting high screen refresh rate | |
TW201340686A (en) | Method and device for generating three-dimensional image | |
CN110198457B (en) | Video playing method and device, system, storage medium, terminal and server thereof | |
US10593122B1 (en) | Mirroring edge pixels | |
WO2012165218A1 (en) | Recording device, recording method, playback device, playback method, program, and recording/playback device | |
CN114040184A (en) | Image display method, system, storage medium and computer program product | |
Kalva et al. | Design and evaluation of a 3D video system based on H. 264 view coding | |
KR20200143287A (en) | Method and apparatus for encoding/decoding image and recording medium for storing bitstream | |
US10609356B1 (en) | Using a temporal enhancement layer to encode and decode stereoscopic video content | |
JP5700998B2 (en) | 3D image display apparatus and control method thereof | |
KR101433082B1 (en) | Video conversing and reproducing method to provide medium feeling of two-dimensional video and three-dimensional video | |
CN104185005A (en) | Image processing apparatus and image processing method |
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 |