CN109068166B - Video synthesis method, device, equipment and storage medium - Google Patents
Video synthesis method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN109068166B CN109068166B CN201810943403.8A CN201810943403A CN109068166B CN 109068166 B CN109068166 B CN 109068166B CN 201810943403 A CN201810943403 A CN 201810943403A CN 109068166 B CN109068166 B CN 109068166B
- Authority
- CN
- China
- Prior art keywords
- video
- preset
- pictures
- picture
- regions
- 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
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/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/431—Generation of visual interfaces for content selection or interaction; Content or additional data rendering
- H04N21/4312—Generation of visual interfaces for content selection or interaction; Content or additional data rendering involving specific graphical features, e.g. screen layout, special fonts or colors, blinking icons, highlights or animations
-
- 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/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/21—Server components or server architectures
- H04N21/218—Source of audio or video content, e.g. local disk arrays
- H04N21/21805—Source of audio or video content, e.g. local disk arrays enabling multiple viewpoints, e.g. using a plurality of cameras
-
- 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/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/234—Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
- H04N21/23424—Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving splicing one content stream with another content stream, e.g. for inserting or substituting an advertisement
-
- 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/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/47—End-user applications
- H04N21/485—End-user interface for client configuration
- H04N21/4858—End-user interface for client configuration for modifying screen layout parameters, e.g. fonts, size of the windows
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Business, Economics & Management (AREA)
- Marketing (AREA)
- Databases & Information Systems (AREA)
- Human Computer Interaction (AREA)
- Controls And Circuits For Display Device (AREA)
- Processing Or Creating Images (AREA)
Abstract
Description
技术领域technical field
本申请涉及视频处理领域,尤其涉及一种视频合成方法、装置、设备及存储介质。The present application relates to the field of video processing, and in particular, to a video synthesis method, apparatus, device, and storage medium.
背景技术Background technique
随着互联网时代的不断发展,人们针对信息的传播已不局限于文字、图片,通过视频传播也作为如今主流传播方式之一,视频的传播类型各式各样,以时间长短的不同可以来区别视频类型,比如,10秒,15秒的短视频;1分钟到5分钟的长视频;以及在线直播视频等等。With the continuous development of the Internet era, people's dissemination of information is no longer limited to text and pictures. Video dissemination is also one of the mainstream dissemination methods today. There are various types of video dissemination, which can be distinguished by the length of time. Video types, for example, short videos of 10 seconds and 15 seconds; long videos of 1 minute to 5 minutes; and live online videos, etc.
目前,视频的传播可以通过视频网站、社交应用程序等平台进行传播,而针对社交应用程序中,大部分是用户进行录制来生成的视频,用户通过视频来展示或者分享自己想要表达的内容,直接而准确。At present, the dissemination of videos can be disseminated through video websites, social applications and other platforms. For social applications, most of the videos are recorded and generated by users. Users display or share the content they want to express through videos. Direct and accurate.
然而,随着视频的数量不断增加,视频中展现的内容需要通过加大时间来准确以及完整的表达,对于视频制造者需要花费较多时间来逐一处理视频(比如剪辑、特效等);而对于视频观看者可能需要花费较多时间来观看每个视频的完整内容,从而导致用户针对视频处理或者视频观看来说,花费时间较多。However, with the increasing number of videos, the content displayed in the video needs to be expressed accurately and completely by increasing the time, and it takes more time for video producers to process the videos one by one (such as editing, special effects, etc.); Video viewers may need to spend more time watching the complete content of each video, which causes users to spend more time on video processing or video viewing.
发明内容SUMMARY OF THE INVENTION
为克服相关技术中存在的问题,本申请提供一种视频合成方法、装置、设备及存储介质。In order to overcome the problems existing in the related art, the present application provides a video synthesis method, apparatus, device and storage medium.
根据本申请实施例的第一方面,提供一种视频合成方法,包括:According to a first aspect of the embodiments of the present application, a video synthesis method is provided, including:
获取预设的画面布局的配置信息,其中,所述配置信息包括每个区域在所述显示容器中的显示尺寸和显示位置;Obtaining configuration information of a preset screen layout, wherein the configuration information includes the display size and display position of each area in the display container;
根据所述配置信息将M个预设的本地视频画面加载至M个区域中,并将实时采集的N个拍摄视频画面加载至N个区域中,其中,所述L为大于1的正整数,所述M、所述N均为正整数,并且所述M与所述N之和等于所述L;Load M preset local video images into M areas according to the configuration information, and load N shooting video images collected in real time into N areas, where L is a positive integer greater than 1, The M and the N are both positive integers, and the sum of the M and the N is equal to the L;
将所述M个区域的画面与所述N个区域的画面进行渲染后生成第一播放文件。A first play file is generated after rendering the pictures of the M regions and the pictures of the N regions.
可选地,在所述获取预设的画面布局的配置信息,其中,所述配置信息包括每个区域在所述显示容器中的显示尺寸和显示位置之前,还包括:Optionally, before acquiring the configuration information of the preset screen layout, wherein the configuration information includes the display size and display position of each area in the display container, it further includes:
获取所述显示容器的分辨率;obtain the resolution of the display container;
根据所述显示容器的分辨率计算所述显示容器的宽高比;calculating the aspect ratio of the display container according to the resolution of the display container;
当所述宽高比大于预设的第一阈值时,确认预设的第一布局格式为所述画面布局的配置信息,其中,所述第一布局格式为使所述L个区域在所述显示容器的宽度方向上依次叠放。When the aspect ratio is greater than a preset first threshold, confirm that the preset first layout format is the configuration information of the screen layout, wherein the first layout format is to make the L areas in the The display containers are stacked one after the other in the width direction.
可选地,在所述根据所述显示容器的分辨率计算所述显示容器的宽高比之后,还包括:Optionally, after calculating the aspect ratio of the display container according to the resolution of the display container, the method further includes:
当所述宽高比小于或等于所述预设的第一阈值时,确认预设的第二布局格式为所述画面布局的配置信息,其中,所述第二布局格式为使所述L个区域在所述显示容器的高度方向上依次叠放。When the aspect ratio is less than or equal to the preset first threshold, confirm that the preset second layout format is the configuration information of the screen layout, wherein the second layout format is to make the L The regions are stacked one after another in the height direction of the display container.
可选地,在当所述M和所述N都为1时,所述本地视频画面加载在第一区域,所述拍摄视频画面加载第二区域,在所述获取预设的画面布局的配置信息之前,所述配置信息包括每个区域在所述显示容器中的显示尺寸和显示位置还包括:Optionally, when both the M and the N are 1, the local video picture is loaded in the first area, the shot video picture is loaded in the second area, and the configuration of obtaining a preset picture layout is performed in the Before the information, the configuration information includes the display size and display position of each area in the display container and also includes:
获取所述本地视频画面和所述拍摄视频画面的分辨率;obtaining the resolution of the local video picture and the captured video picture;
根据所述本地视频画面和所述拍摄视频画面的分辨率,计算所述本地视频画面与所述拍摄视频画面的宽度比或者高度比;According to the resolution of the local video picture and the captured video picture, calculate the width ratio or height ratio of the local video picture and the captured video picture;
当所述宽度比或者高度比小于预设的第二阈值时,确定预设的第三布局格式为所述画面布局的配置信息,其中,所述第三布局格式为使所述第一区域嵌套在所述第二区域内。When the width ratio or the height ratio is smaller than the preset second threshold, determine that the preset third layout format is the configuration information of the screen layout, wherein the third layout format is to make the first area embedded within the second area.
可选地,在所述根据所述配置信息将M个预设的本地视频画面加载至M个区域中,并将实时采集的N个拍摄视频画面加载至N个区域中,其中,所述L为大于1的正整数,所述M、所述N均为正整数,并且所述M与所述N之和等于所述L中,还包括:Optionally, in the loading of M preset local video images into M areas according to the configuration information, and loading N shooting video images collected in real time into N areas, wherein the L is a positive integer greater than 1, the M and the N are both positive integers, and the sum of the M and the N is equal to the L, and also includes:
获取所述本地视频画面分辨率;obtaining the local video picture resolution;
根据所述M个区域在所述显示容器中的显示尺寸将所述本地视频画面进行等比例缩放,以使所述本地视频画面在所述M个区域完整显示;scaling the local video image in equal proportions according to the display size of the M areas in the display container, so that the local video image is completely displayed in the M areas;
根据所述N个区域在所述显示容器中的显示尺寸,确定所述拍摄视频画面的分辨率。可选地,在所述将所述M个区域的画面与所述N个区域的画面进行渲染后生成第一播放文件中,还包括:The resolution of the captured video picture is determined according to the display size of the N regions in the display container. Optionally, in the generating of the first playback file after rendering the pictures of the M regions and the pictures of the N regions, it further includes:
对所述M个区域的画面与所述N个区域的画面进行解码,分别生成L个纹理信息对所述M个区域的画面与所述N个区域的画面进行解码,分别生成L个纹理信息;Decoding the pictures of the M regions and the pictures of the N regions, and generating L pieces of texture information respectively Decoding the pictures of the M regions and the pictures of the N regions, and generating L pieces of texture information respectively ;
根据所述预设的画面布局的配置信息,分别计算所述L个纹理信息的纹理坐标和顶点坐标;According to the configuration information of the preset screen layout, respectively calculate the texture coordinates and vertex coordinates of the L pieces of texture information;
根据所述纹理坐标和所述顶点坐标生成所述第一播放文件。The first play file is generated according to the texture coordinates and the vertex coordinates.
可选地,在所述根据所述配置信息将M个预设的本地视频画面加载至M个区域中,并将实时采集的N个拍摄视频画面加载至N个区域中,其中,所述L为大于1的正整数,所述M、所述N均为正整数,并且所述M与所述N之和等于所述L之后,还包括:Optionally, in the loading of M preset local video images into M areas according to the configuration information, and loading N shooting video images collected in real time into N areas, wherein the L is a positive integer greater than 1, the M and the N are both positive integers, and after the sum of the M and the N is equal to the L, it also includes:
获取预设的拍摄视频特效画面;Obtain the preset special effect screen for shooting video;
将所述拍摄视频特效画面加载至所述N个区域。Loading the special effect pictures of the shooting video into the N regions.
可选地,在所述将所述M个区域的画面与所述N个区域的画面进行渲染后生成第一播放文件,还包括:Optionally, generating a first playback file after rendering the pictures of the M regions and the pictures of the N regions, further comprising:
将所述M个区域的画面与所述N个区域的画面进行叠加渲染,得到渲染后的所述第一播放文件。The images of the M areas and the images of the N areas are superimposed and rendered to obtain the rendered first playback file.
根据本申请实施例的第二方面,提供一种视频合成的装置,用于同一显示容器中L个区域的画面合成,包括:According to a second aspect of the embodiments of the present application, a device for video synthesis is provided, which is used for picture synthesis of L regions in the same display container, including:
获取单元,被配置为获取预设的画面布局的配置信息,其中,所述配置信息包括每个区域在所述显示容器中的显示尺寸和显示位置;an obtaining unit, configured to obtain configuration information of a preset screen layout, wherein the configuration information includes the display size and display position of each area in the display container;
处理单元,被配置为根据所述配置信息将M个预设的本地视频画面加载至M个区域中,并将实时采集的N个拍摄视频画面加载至N个区域中,其中,所述L为大于1的正整数,所述M、所述N均为正整数,并且所述M与所述N之和等于所述L;The processing unit is configured to load the M preset local video images into the M areas according to the configuration information, and load the N shooting video images collected in real time into the N areas, wherein the L is a positive integer greater than 1, the M and the N are both positive integers, and the sum of the M and the N is equal to the L;
执行单元,被配置为将所述M个区域的画面与所述N个区域的画面进行渲染后生成第一播放文件。The execution unit is configured to generate a first play file after rendering the pictures of the M regions and the pictures of the N regions.
可选地,所述视频合成装置还包括:Optionally, the video synthesis apparatus further includes:
第一获取子单元,被配置为获取所述显示容器的分辨率;a first acquiring subunit, configured to acquire the resolution of the display container;
第一处理子单元,被配置为根据所述显示容器的分辨率计算所述显示容器的宽高比;a first processing subunit configured to calculate the aspect ratio of the display container according to the resolution of the display container;
第一执行子单元,被配置为当所述宽高比大于预设的第一阈值时,确认预设的第一布局格式为所述画面布局的配置信息,其中,所述第一布局格式为使所述L个区域在所述显示容器的宽度方向上依次叠放。The first execution subunit is configured to confirm that the preset first layout format is the configuration information of the screen layout when the aspect ratio is greater than a preset first threshold, wherein the first layout format is The L regions are sequentially stacked in the width direction of the display container.
可选地,所述视频合成装置还包括:Optionally, the video synthesis apparatus further includes:
第二执行子单元,被配置为当所述宽高比小于或等于所述预设的第一阈值时,确认预设的第二布局格式为所述画面布局的配置信息,其中,所述第二布局格式为使所述L个区域在所述显示容器的高度方向上依次叠放。The second execution subunit is configured to confirm that the preset second layout format is the configuration information of the screen layout when the aspect ratio is less than or equal to the preset first threshold, wherein the first The second layout format is that the L regions are stacked in sequence in the height direction of the display container.
可选地,所述视频合成装置还包括:Optionally, the video synthesis apparatus further includes:
第二获取子单元,被配置为获取所述本地视频画面和所述拍摄视频画面的分辨率;a second obtaining subunit, configured to obtain the resolution of the local video picture and the captured video picture;
第二处理子单元,被配置为根据所述本地视频画面和所述拍摄视频画面的分辨率,计算所述本地视频画面与所述拍摄视频画面的宽度比或者高度比;a second processing subunit, configured to calculate a width ratio or a height ratio of the local video frame and the captured video frame according to the resolution of the local video frame and the captured video frame;
第三执行子单元,被配置为当所述宽度比或者高度比小于预设的第二阈值时,确定预设的第三布局格式为所述画面布局的配置信息,其中,所述第三布局格式为使所述第一区域嵌套在所述第二区域内。The third execution subunit is configured to, when the width ratio or the height ratio is smaller than a preset second threshold, determine that the preset third layout format is the configuration information of the screen layout, wherein the third layout The format is such that the first area is nested within the second area.
可选地,所述视频合成装置还包括:Optionally, the video synthesis apparatus further includes:
第三获取子单元,被配置为获取所述本地视频画面分辨率;a third obtaining subunit, configured to obtain the local video picture resolution;
第三处理子单元,被配置为根据所述M个区域在所述显示容器中的显示尺寸将所述本地视频画面进行等比例缩放,以使所述本地视频画面在所述M个区域完整显示;The third processing subunit is configured to scale the local video picture in equal proportion according to the display size of the M regions in the display container, so that the local video picture is completely displayed in the M regions ;
第四执行子单元,被配置根据所述N个区域在所述显示容器中的显示尺寸,确定所述拍摄视频画面的分辨率。The fourth execution subunit is configured to determine the resolution of the captured video picture according to the display size of the N regions in the display container.
可选地,所述视频合成装置还包括:Optionally, the video synthesis apparatus further includes:
第一解码子单元,被配置为对所述M个区域的画面与所述N个区域的画面进行解码,分别生成L个纹理信息对所述M个区域的画面与所述N个区域的画面进行解码,分别生成L个纹理信息;a first decoding subunit, configured to decode the pictures of the M regions and the pictures of the N regions, and respectively generate L pieces of texture information for the pictures of the M regions and the pictures of the N regions Perform decoding to generate L texture information respectively;
第四处理子单元,被配置为根据所述预设的画面布局的配置信息,分别计算所述L个纹理信息的纹理坐标和顶点坐标;a fourth processing subunit, configured to calculate the texture coordinates and vertex coordinates of the L pieces of texture information according to the preset configuration information of the screen layout;
第五执行子单元,被配置为根据所述纹理坐标和所述顶点坐标生成所述第一播放文件。A fifth execution subunit is configured to generate the first play file according to the texture coordinates and the vertex coordinates.
可选地,所述视频合成装置还包括:Optionally, the video synthesis apparatus further includes:
第四获取子单元,被配置为获取预设的拍摄视频特效画面;a fourth obtaining subunit, configured to obtain a preset special effect picture for shooting video;
第五处理子单元,被配置为将所述拍摄视频特效画面加载至所述N个区域。The fifth processing subunit is configured to load the special effect picture of the shot video into the N regions.
可选地,所述视频合成装置还包括:Optionally, the video synthesis apparatus further includes:
第六执行子单元,被配置为将所述M个区域的画面与所述N个区域的画面进行叠加渲染,得到渲染后的所述第一播放文件。The sixth execution subunit is configured to superimpose and render the pictures of the M regions and the pictures of the N regions to obtain the rendered first play file.
根据本申请实施例的第三方面,提供一种视频合成设备,包括处理器,用于存储处理器可执行指令的存储器,所述处理器被配置为上述视频合成方法的步骤。According to a third aspect of the embodiments of the present application, there is provided a video synthesis device, comprising a processor and a memory for storing instructions executable by the processor, where the processor is configured to perform the steps of the above video synthesis method.
根据本申请实施例的第四方面,提供一种非临时性计算机可读存储介质,当所述存储介质中的指令由移动终端的处理器执行时,使得移动终端能够执行上述视频合成方法的步骤。According to a fourth aspect of the embodiments of the present application, a non-transitory computer-readable storage medium is provided, when instructions in the storage medium are executed by a processor of a mobile terminal, the mobile terminal can perform the steps of the above video synthesis method .
根据本申请实施例的第五方面,提供计算机程序产品,包括计算机程序代码,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行上述视频合成方法的步骤。According to a fifth aspect of the embodiments of the present application, a computer program product is provided, including computer program code, the computer program includes program instructions, and when the program instructions are executed by a computer, the computer is caused to perform the steps of the above video synthesis method.
本申请的实施例提供的技术方案可以包括以下有益效果:通过获取预设的画面布局的配置信息,其中,所述配置信息包括每个区域在所述显示容器中的显示尺寸和显示位置;根据所述配置信息将M个预设的本地视频画面加载至M个区域中,并将实时采集的N个拍摄视频画面加载至N个区域中,其中,所述L为大于1的正整数,所述M、所述N均为正整数,并且所述M与所述N之和等于所述L;将所述M个区域的画面与所述N个区域的画面进行渲染后生成第一播放文件。将多个实时拍摄视频和多个本地视频进行渲染,生成视频合成画面,视频制造者不需要专业技能,即可实现同一显示容器多画面显示的特效剪辑,同一显示容器显示多个画面,使视频观看者可在同一时间内观看多个视频,节省信息摄取的时间。The technical solutions provided by the embodiments of the present application may include the following beneficial effects: by acquiring configuration information of a preset screen layout, wherein the configuration information includes the display size and display position of each area in the display container; The configuration information loads M preset local video images into M areas, and loads N shooting video images collected in real time into N areas, where L is a positive integer greater than 1, so The M and the N are both positive integers, and the sum of the M and the N is equal to the L; the first playback file is generated after rendering the pictures of the M regions and the pictures of the N regions . Render multiple real-time shooting videos and multiple local videos to generate video composite images. Video producers do not need professional skills to realize special effects clips for multi-screen display in the same display container. Display multiple images in the same display container, making the video Viewers can watch multiple videos at the same time, saving time in information ingestion.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本申请。It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not limiting of the present application.
附图说明Description of drawings
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本申请的实施例,并与说明书一起用于解释本申请的原理。The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description serve to explain the principles of the application.
图1是根据一示例性实施例示出的一种视频合成方法的流程图。FIG. 1 is a flow chart of a video synthesis method according to an exemplary embodiment.
图2是根据一示例性实施例示出的确认第一布局格式的流程图。FIG. 2 is a flowchart illustrating a confirmation of a first layout format according to an exemplary embodiment.
图3是根据一示例性实施例示出的确认第三布局格式的流程图。FIG. 3 is a flowchart illustrating a third layout format confirmation according to an exemplary embodiment.
图4是根据一示例性实施例示出的第三布局格式示意图。FIG. 4 is a schematic diagram of a third layout format according to an exemplary embodiment.
图5是根据一示例性实施例示出的对视频进行裁剪的流程图。Fig. 5 is a flow chart of cropping a video according to an exemplary embodiment.
图6是根据一示例性实施例示出的生成第一播放文件的流程图。FIG. 6 is a flow chart of generating a first play file according to an exemplary embodiment.
图7是根据一示例性实施例示出的拍摄视频特效画面加载的流程图。FIG. 7 is a flow chart of loading a special effect screen of a shooting video according to an exemplary embodiment.
图8是根据一示例性实施例示出的一种视频合成装置的框图。Fig. 8 is a block diagram of a video synthesis apparatus according to an exemplary embodiment.
图9是根据一示例性实施例示出的一种视频合成设备的结构框图。Fig. 9 is a structural block diagram of a video synthesis device according to an exemplary embodiment.
具体实施方式Detailed ways
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本申请相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本申请的一些方面相一致的装置和方法的例子。Exemplary embodiments will be described in detail herein, examples of which are illustrated in the accompanying drawings. Where the following description refers to the drawings, the same numerals in different drawings refer to the same or similar elements unless otherwise indicated. The implementations described in the illustrative examples below are not intended to represent all implementations consistent with this application. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present application as recited in the appended claims.
图1是根据一示例性实施例示出的一种视频合成方法的流程图,如图1所示,视频合成方法用于终端中,包括以下步骤:FIG. 1 is a flow chart of a video synthesis method according to an exemplary embodiment. As shown in FIG. 1 , the video synthesis method is used in a terminal and includes the following steps:
S1100、获取预设的画面布局的配置信息,其中,所述配置信息包括每个区域在所述显示容器中的显示尺寸和显示位置;S1100. Acquire configuration information of a preset screen layout, wherein the configuration information includes the display size and display position of each area in the display container;
本申请实施例中,将同一显示容器分为两个区域,通过配置信息确定两个区域在显示容器中的显示尺寸和显示位置。这里,配置信息决定了两个视频数据源在同一画面输出时,各个视频画面在显示屏幕上占的位置和空间。举例说明:显示容器为一块分辨率为1440*900的显示屏,获取到的配置信息表示第一区域为屏幕左半部占720*900的部分,第二区域为屏幕右半部占720*900的部分。可以理解的,数据源可以为多个,包括M个本地视频画面和N个实时拍摄画面,对应的显示容器分成L个区域,L为M与N之和,配置信息确定了每个区域在显示容器中的显示尺寸和显示位置。In the embodiment of the present application, the same display container is divided into two areas, and the display size and display position of the two areas in the display container are determined by the configuration information. Here, the configuration information determines the position and space occupied by each video image on the display screen when the two video data sources are output in the same image. For example: the display container is a display screen with a resolution of 1440*900. The obtained configuration information indicates that the first area is the left half of the screen which occupies 720*900, and the second area is the right half of the screen which occupies 720*900 part. It can be understood that there can be multiple data sources, including M local video images and N real-time shooting images. The corresponding display container is divided into L areas, where L is the sum of M and N. The configuration information determines that each area is displayed in the display. Display size and display position in the container.
S1200、根据所述配置信息将M个预设的本地视频画面加载至M个区域中,并将实时采集的N个拍摄视频画面加载至N个区域中,其中,所述L为大于1的正整数,所述M、所述N均为正整数,并且所述M与所述N之和等于所述L;S1200. Load M preset local video images into M areas according to the configuration information, and load N shooting video images collected in real time into N areas, where L is a positive value greater than 1 an integer, the M and the N are both positive integers, and the sum of the M and the N is equal to the L;
在步骤S1100中,通过配置信息确定了每个区域在显示屏上的尺寸和位置。具体加载的过程为,每一个区域对应一个媒体缓冲器,循环读取视频的原始数据放到对应的媒体缓冲器当中,用于下一个步骤的显示。In step S1100, the size and position of each area on the display screen are determined through the configuration information. The specific loading process is that each area corresponds to a media buffer, and the original data of the cyclically read video is put into the corresponding media buffer for display in the next step.
S1300、将所述M个区域的画面与所述N个区域的画面进行渲染后生成第一播放文件。S1300. Generate a first play file after rendering the pictures of the M regions and the pictures of the N regions.
通过步骤S1200,显示容器的每个区域的媒体缓冲器分别加载了本地视频数据和实时拍摄数据,在此步骤中,通过将L路数据进行叠加渲染,得到第一播放文件。该播放文件一路用于实时播放,一路写入文件用于保存。Through step S1200, the media buffer of each area of the display container is loaded with local video data and real-time shooting data respectively. In this step, the first playback file is obtained by superimposing and rendering the L data. The playback file is used for real-time playback all the way, and the file is written all the way for saving.
渲染是将图像绘制到屏幕上,可以实现3D物体在屏幕上的绘制。渲染通过渲染器来完成。渲染器读取媒体缓冲器中的视频数据,完成视频画面在屏幕上的显示。本申请实施例中,渲染器同时读取每个区域媒体缓冲器中的视频数据,并将各路数据叠加,完成合成视频画面在同一显示容器上的绘制。Rendering is to draw images to the screen, which can realize the drawing of 3D objects on the screen. Rendering is done through renderers. The renderer reads the video data in the media buffer and completes the display of the video picture on the screen. In the embodiment of the present application, the renderer simultaneously reads the video data in the media buffer of each region, and superimposes the data of each channel to complete the drawing of the composite video picture on the same display container.
本申请实施例中,同一显示容器中的画面布局配置信息根据显示容器的分辨率自动调整,具体过程请参阅图2,图2为本实施例示出的一种根据显示容器分辨率确定画面布局的一种实施方式流程图。In this embodiment of the present application, the screen layout configuration information in the same display container is automatically adjusted according to the resolution of the display container. Please refer to FIG. 2 for the specific process. An implementation flow chart.
如图2所示,在步骤S1100之前,还包括下述步骤:As shown in Figure 2, before step S1100, the following steps are also included:
S1101、获取所述显示容器的分辨率;S1101. Obtain the resolution of the display container;
本申请实施例中的显示容器为终端的屏幕或者终端屏幕的一部分。读取显示容器的分辨率,可以通过以下方式获取显示容器的分辨率:获取终端设备的型号,根据终端设备的型号查找数据库,获取的终端设备的屏幕分辩率,屏幕的分辨率指屏幕上显示的像素个数,分辨率1920X1080,意思是水平方向上显示的像素个数是1920px(pixel),垂直方向上像素个数是1080px。或者,直接读取该终端设备所使用的显示屏的规格参数,获取该终端屏幕的分辨率。在一些实施方式中,显示容器也可以是显示屏上预设的部分区域。The display container in the embodiment of the present application is the screen of the terminal or a part of the screen of the terminal. To read the resolution of the display container, you can obtain the resolution of the display container in the following ways: Obtain the model of the terminal device, search the database according to the model of the terminal device, and obtain the screen resolution of the terminal device. The resolution of the screen refers to the display on the screen. The number of pixels, the resolution is 1920X1080, which means that the number of pixels displayed in the horizontal direction is 1920px (pixel), and the number of pixels in the vertical direction is 1080px. Or, directly read the specification parameters of the display screen used by the terminal device to obtain the resolution of the terminal screen. In some embodiments, the display container may also be a preset partial area on the display screen.
S1102、根据所述显示容器的分辨率计算所述显示容器的宽高比;S1102. Calculate the aspect ratio of the display container according to the resolution of the display container;
根据显示容器的分辨率,获取显示容器的宽度和高度。宽高比即宽度与高度的比值,宽度对应水平方向上的尺寸,高度对应垂直方向上的尺寸。值得注意的是,移动终端的宽度和高度跟放置的状态有关,在计算宽高比时需要先判断移动终端放置状态,确定水平方向和垂直方向的尺寸。移动终端的宽度和高度会根据放置状态发生改变。在计算宽高比时,始终将处于水平方向的尺寸看作屏幕的宽度,处于垂直方向的尺寸看作屏幕的高度。Get the width and height of the display container according to the resolution of the display container. Aspect ratio is the ratio of width to height, the width corresponds to the size in the horizontal direction, and the height corresponds to the size in the vertical direction. It is worth noting that the width and height of the mobile terminal are related to the placement state. When calculating the aspect ratio, it is necessary to first judge the placement state of the mobile terminal and determine the dimensions in the horizontal and vertical directions. The width and height of the mobile terminal will change according to the placement state. When calculating the aspect ratio, always consider the size in the horizontal direction as the width of the screen, and the size in the vertical direction as the height of the screen.
S1103、当所述宽高比大于预设的第一阈值时,确认预设的第一布局格式为所述画面布局的配置信息,其中,所述第一布局格式为使所述L个区域在所述显示容器的宽度方向上依次叠放。S1103. When the aspect ratio is greater than a preset first threshold, confirm that the preset first layout format is the configuration information of the screen layout, wherein the first layout format is to make the L areas in the The display containers are stacked in sequence in the width direction.
本申请实施例中,宽高比不同,画面布局的自动转换,对应的配置信息也不同。当宽高比大于设定的阈值时,例如设定的阈值为1,对应的第一布局格式为左右布局,即当宽比高的比值大于1时,各区域的划分按左右方式划分。本申请实施例中,采用平均划分的方式。举例说明,例如显示容器的分辨率为1440*960,水平方向即宽度为1440,垂直方向即高度为960,宽高比为1440/960,宽高比大于1,M和N都为1时,将显示容器按左右方式平均划分,即本地视频画面显示在屏幕左部720*960的区域,实时拍摄视频画面显示在屏幕右部720*960的区域。可以方便的理解,左右可以互换。In the embodiment of the present application, the aspect ratio is different, and the configuration information corresponding to the automatic conversion of the screen layout is also different. When the aspect ratio is greater than the set threshold, for example, the set threshold is 1, the corresponding first layout format is left-right layout, that is, when the aspect ratio is greater than 1, each area is divided in a left-right manner. In the embodiment of the present application, an average division method is adopted. For example, if the resolution of the display container is 1440*960, the width in the horizontal direction is 1440, the height in the vertical direction is 960, the aspect ratio is 1440/960, the aspect ratio is greater than 1, and both M and N are 1, The display container is evenly divided on the left and right, that is, the local video image is displayed in the area of 720*960 on the left of the screen, and the real-time video image is displayed in the area of 720*960 on the right of the screen. It is easy to understand that left and right can be interchanged.
在本申请实施例中,如果宽高比小于或者等于1,布局方式与前面所述不同,采用第二布局方式,第二布局方式为上下布局。接着前述的例子,如果移动终端进行了旋转,分辨率仍然为1440*960,但是水平方向宽度为960,垂直方向的高度为1440,此时,宽高比为960/1440,比值小于1,将显示容器按上下方式凭据划分,即实时拍摄视频画面显示在屏幕上部960*720的区域,实时拍摄视频画面显示在屏幕下部960*720的区域。可以方便的理解,上下可以互换。In the embodiment of the present application, if the aspect ratio is less than or equal to 1, the layout mode is different from that described above, and the second layout mode is adopted, and the second layout mode is the top-bottom layout. Following the previous example, if the mobile terminal is rotated, the resolution is still 1440*960, but the width in the horizontal direction is 960 and the height in the vertical direction is 1440. At this time, the aspect ratio is 960/1440, and the ratio is less than 1. The display container is divided according to the upper and lower way, that is, the real-time shooting video image is displayed in the area of 960*720 in the upper part of the screen, and the real-time shooting video image is displayed in the area of 960*720 in the lower part of the screen. It can be easily understood that up and down can be interchanged.
在一些实施方式中,不但会根据显示容器的分辨率自动选择画面布局格式,而且会根据本地视频画面和拍摄视频画面分辨率来确定画面布局格式。具体请参阅图3。图3为本申请实施例示出当M和N都为1,本地视频画面加载在第一区域,拍摄视频画面加载第二区域时,根据本地视频和拍摄视频分辨率确定画面布局格式的一种实施方式的流程图。In some embodiments, not only the screen layout format is automatically selected according to the resolution of the display container, but also the screen layout format is determined according to the resolution of the local video picture and the captured video picture. Please refer to Figure 3 for details. 3 shows an implementation of determining the screen layout format according to the resolution of the local video and the captured video when M and N are both 1, the local video image is loaded in the first area, and the captured video image is loaded into the second area, according to an embodiment of the present application. flow chart of the way.
如图3所示,在步骤S1100之前,还包括下述步骤:As shown in Figure 3, before step S1100, the following steps are also included:
S1111、获取所述本地视频画面和所述拍摄视频画面的分辨率;S1111, acquiring the resolution of the local video picture and the captured video picture;
视频分辨率指的是视频画面宽度和高度上的像素值,常见的视频分辨率包括,4:3的,分辨率为320*240或者640*480,16:9的,分辨率为640*360,720*480,1024*600,1280*720。视频的分辨率通常作为属性参数写入视频文件中,通过读取视频文件中分辨率参数获取已有视频的分辨率。由于另外一路视频是视频录制设备实时采集的,录制的视频的分辨率取决于视频录制设备上对分辨率的设置,所以实时拍摄视频的分辨率通过读取视频录制设备上录制分辨率的设定来获取。Video resolution refers to the pixel value on the width and height of the video screen. Common video resolutions include, 4:3, the resolution is 320*240 or 640*480, 16:9, the resolution is 640*360 , 720*480, 1024*600, 1280*720. The resolution of the video is usually written into the video file as an attribute parameter, and the resolution of the existing video is obtained by reading the resolution parameter in the video file. Since the other video is captured in real time by the video recording device, the resolution of the recorded video depends on the resolution setting on the video recording device, so the resolution of the real-time video is obtained by reading the recording resolution setting on the video recording device. to obtain.
S1112、根据所述本地视频画面和所述拍摄视频画面的分辨率,计算所述本地视频画面与所述拍摄视频画面的宽度比或者高度比;S1112, calculating a width ratio or a height ratio of the local video frame and the captured video frame according to the resolution of the local video frame and the captured video frame;
在一些场景中,本地视频的分辨率比实时拍摄视频的分辨率小得多,如果在同一画面显示时,让两者占用相同面积的屏幕空间,会导致一些显示空间的浪费,而且显示效果也不好。所以,通过获取本地视频画面和拍摄视频画面的分辨率,比较本地视频画面和拍摄视频画面的宽度比,或者高度比,根据比值,设定与简单的左右布局或上下布局不同的布局方式。In some scenarios, the resolution of the local video is much smaller than the resolution of the real-time shooting video. If the two occupy the same area of screen space when the same screen is displayed, it will cause some waste of display space, and the display effect will also be poor. not good. Therefore, by obtaining the resolution of the local video image and the captured video image, compare the width ratio or height ratio of the local video image and the captured video image, and set a different layout from the simple left-right layout or the top-bottom layout according to the ratio.
S1113、当所述宽度比或者高度比小于预设的第二阈值时,确定预设的第三布局格式为所述画面布局的配置信息,其中,所述第三布局格式为使所述第一区域嵌套在第二区域内。S1113. When the width ratio or the height ratio is smaller than a preset second threshold, determine that a preset third layout format is the configuration information of the screen layout, wherein the third layout format is to make the first layout format Regions are nested within a second region.
当本地视频画面宽度比拍摄视频画面宽度小得多时,或本地视频画面高度比拍摄视频画面高度小得多,设定第三布局格式为画面布局的方式。第三布局格式可以称之为画中画布局格式,具体如图4所示,即实时拍摄视频占显示容器的全部空间,本地视频显示在显示容器的一角。如果本地视频画面尺寸过大,按照第三布局格式显示,实时拍摄视频画面大部分被本地视频画面遮盖,显示效果不佳,为了达到最佳的显示效果,将本地视频画面与拍摄视频画面的宽度比或者高度比设定阈值,小于阈值时,采用第三布局格式,本申请实施例中,阈值设置为1/3,即本地视频画面的宽度小于拍摄视频画面的宽度的1/3时,采用第三布局格式。When the width of the local video frame is much smaller than the width of the captured video frame, or the height of the local video frame is much smaller than the height of the captured video frame, the third layout format is set as a frame layout method. The third layout format may be called a picture-in-picture layout format, as shown in Figure 4, that is, the real-time captured video occupies the entire space of the display container, and the local video is displayed in a corner of the display container. If the size of the local video image is too large, it will be displayed in the third layout format. Most of the real-time video image is covered by the local video image, and the display effect is not good. In order to achieve the best display effect, the width of the local video image and the captured video image is The ratio or height ratio is set to a threshold. When it is less than the threshold, the third layout format is adopted. In the embodiment of the present application, the threshold is set to 1/3, that is, when the width of the local video picture is less than 1/3 of the width of the captured video picture, the third layout format is adopted. The third layout format.
对显示容器进行划分后,本地视频分辨率或者拍摄视频分辨率通常与划分后的显示区域的分辨率不同,如果视频画面的尺寸超过了显示区域的尺寸,要对视频画面进行处理,使之可以在显示区域较好的显示。具体请参阅图5,图5为本申请实施例示出的根据显示尺寸对本地视频画面和实时拍摄的视频画面处理的一种实施方式的流程图。After the display container is divided, the resolution of the local video or the captured video is usually different from the resolution of the divided display area. If the size of the video image exceeds the size of the display area, the video image must be processed so that it can be Better display in the display area. Please refer to FIG. 5 for details. FIG. 5 is a flowchart of an implementation manner of processing a local video image and a video image captured in real time according to a display size according to an embodiment of the present application.
如图5所示,在步骤S1200中,还包括下述步骤:As shown in Figure 5, in step S1200, the following steps are also included:
S1201、获取所述本地视频画面分辨率;S1201, obtaining the local video picture resolution;
如前所述,视频分辨率指的是视频画面宽度和高度上的像素值,常见的视频分辨率包括:4:3的,分辨率为320*240或者640*480;16:9的,分辨率为640*360,720*480,1024*600,1280*720。视频的分辨率通常作为属性参数写入视频文件中,通过读取视频文件中分辨率参数获取已有视频的分辨率。As mentioned above, video resolution refers to the pixel value of the width and height of the video screen. Common video resolutions include: 4:3, with a resolution of 320*240 or 640*480; 16:9, resolution The rate is 640*360, 720*480, 1024*600, 1280*720. The resolution of the video is usually written into the video file as an attribute parameter, and the resolution of the existing video is obtained by reading the resolution parameter in the video file.
S1202、根据所述M个区域在所述显示容器中的显示尺寸将所述本地视频画面进行等比例缩放,以使所述本地视频画面在所述M个区域完整显示;S1202, scaling the local video picture in equal proportions according to the display size of the M regions in the display container, so that the local video picture is completely displayed in the M regions;
获取本地视频的分辨率后,匹配显示尺寸,保持原始宽高比进行等比例的缩放。例如本地视频的分辨率为600*600,显示尺寸为720*720,则将原始视频宽度和高度都放大1.2倍。After obtaining the resolution of the local video, match the display size, keep the original aspect ratio, and perform equal scaling. For example, if the resolution of the local video is 600*600 and the display size is 720*720, the width and height of the original video will be enlarged by 1.2 times.
S1203、根据所述N个区域在所述显示容器中的显示尺寸,确定所述拍摄视频画面的分辨率。S1203. Determine the resolution of the captured video image according to the display size of the N regions in the display container.
当视频图像时实时拍摄的,在拍摄时限制拍摄画面的尺寸,使拍摄的视频画面加载到显示区域可以在显示容器上很好的显示。When the video image is captured in real time, the size of the captured image is limited during capturing, so that the captured video image can be well displayed on the display container when loaded into the display area.
如图6所示,在步骤S1300中,还包括下述步骤:As shown in Figure 6, in step S1300, the following steps are also included:
S1301、对所述M个区域的画面与所述N个区域的画面进行解码,分别生成L个纹理信息对所述M个区域的画面与所述N个区域的画面进行解码,分别生成L个纹理信息;S1301. Decode the pictures of the M regions and the pictures of the N regions, respectively generate L pieces of texture information, decode the pictures of the M regions and the pictures of the N regions, and generate L pieces of texture information respectively texture information;
对缓存在每个区域对应的媒体缓冲器的视频数据进行解码,生成纹理信息。纹理是GPU用来绘制图像的输入信息。在计算机图形学中,纹理指的是一张表示物体表面细节的位图。因为Direct3D中所有纹理都是位图,所以可以把任何位图贴到Direct3D图元的表面。例如,应用程序可以创建物体并使它们的表面看起来有木纹的样式。可以把草、泥土和岩石等纹理贴在构成山的图元的表面,这样就能得到看起来很真实的山坡。应用程序也可以用纹理创建其它的效果。Decode the video data buffered in the media buffer corresponding to each region to generate texture information. Textures are the input information that the GPU uses to draw images. In computer graphics, a texture refers to a bitmap that represents details on the surface of an object. Because all textures in Direct3D are bitmaps, you can map any bitmap to the surface of a Direct3D primitive. For example, an application can create objects and make their surfaces appear wood-grained. Textures such as grass, dirt, and rocks can be affixed to the surface of the primitives that make up the mountain, so that you can get a real-looking hillside. Applications can also use textures to create other effects.
S1302、根据所述预设的画面布局的配置信息,分别计算所述L个纹理信息的纹理坐标和顶点坐标;S1302, according to the configuration information of the preset screen layout, respectively calculate the texture coordinates and vertex coordinates of the L pieces of texture information;
在绘制图像时,不仅要给每个顶点定义几何坐标,而且也要定义纹理坐标。几何坐标决定顶点在屏幕上绘制的位置,而纹理坐标决定纹理图像中的哪一个纹素赋予该顶点。通过前述步骤中获取的画面布局的配置信息确定每一路纹理的纹理坐标和顶点坐标。When drawing an image, not only geometry coordinates but also texture coordinates must be defined for each vertex. Geometry coordinates determine where a vertex is drawn on the screen, while texture coordinates determine which texel in the texture image is assigned to that vertex. The texture coordinates and vertex coordinates of each texture are determined according to the configuration information of the screen layout obtained in the preceding steps.
S1303、根据所述纹理坐标和所述顶点坐标生成所述第一播放文件。S1303. Generate the first play file according to the texture coordinates and the vertex coordinates.
获取纹理坐标和顶点坐标,通过顶点着色器绘制图像,为每个顶点提供顶点坐标和纹理坐标。顶点坐标决定了应该在屏幕上的哪个地点渲染特定的顶点。纹理坐标决定了纹理图像中的哪个纹理单元将分配给这个顶点。绘制的结果一路用户实时显示,一路写入文件用于保存。Get texture coordinates and vertex coordinates, draw the image through a vertex shader, and provide vertex coordinates and texture coordinates for each vertex. Vertex coordinates determine where on the screen a particular vertex should be rendered. Texture coordinates determine which texture unit in the texture image will be assigned to this vertex. The drawing results are displayed all the way to the user in real time, and all the way to the file for saving.
在一些实施方式中,对实时拍摄的视频加入一些视频特效,具体请参阅图7,图7为本申请实施例示出的加入视频特效的一种实施方式的流程图。In some embodiments, some video special effects are added to the video shot in real time. For details, please refer to FIG. 7 , which is a flowchart of an implementation manner of adding video special effects according to an embodiment of the present application.
如图7所示,在步骤S1200之后,还包括下述步骤:As shown in Figure 7, after step S1200, the following steps are also included:
S1211、获取预设的拍摄视频特效画面;S1211. Acquire a preset special effect picture for shooting a video;
对实时拍摄的视频加入视频特效,视频特效文件保存在本地,视频特效有多种,对应多个本地文件。用户可以在启动视频录制之前,选择想要添加的视频特效。Add video special effects to the video shot in real time. The video special effect files are saved locally. There are many kinds of video special effects, corresponding to multiple local files. Users can select the video effects they want to add before starting video recording.
S1212、将所述拍摄视频特效画面加载至所述N个区域。S1212. Load the special effect picture of the shooting video into the N regions.
将选择的视频特效文件加载到N个区域,显示时,叠加到实时采集的拍摄视频图像上,实现预设的效果。Load the selected video effect file into N areas, and when displayed, superimpose it on the captured video image captured in real time to achieve the preset effect.
图8是根据一示例性实施例示出的一种视频合成装置框图。参照图8,该装置包括获取单元2100、处理单元2200、执行单元2300。Fig. 8 is a block diagram of a video synthesis apparatus according to an exemplary embodiment. Referring to FIG. 8 , the apparatus includes an
获取单元2100,被配置为获取预设的画面布局的配置信息,其中,所述配置信息包括每个区域在所述显示容器中的显示尺寸和显示位置;The obtaining
处理单元2200,被配置为根据所述配置信息将M个预设的本地视频画面加载至M个区域中,并将实时采集的N个拍摄视频画面加载至N个区域中,其中,所述L为大于1的正整数,所述M、所述N均为正整数,并且所述M与所述N之和等于所述L;The
执行单元2300,被配置为将所述M个区域的画面与所述N个区域的画面进行渲染后生成第一播放文件。The
在一些实施方式当中,视频合成装置还包括:第一获取子单元、第一处理子单元和第一执行子单元,其中,第一获取子单元,被配置为获取所述显示容器的分辨率;第一处理子单元,被配置为根据所述显示容器的分辨率计算所述显示容器的宽高比;第一执行子单元,被配置为当所述宽高比大于预设的第一阈值时,确认预设的第一布局格式为所述画面布局的配置信息,其中,所述第一布局格式为使所述L个区域在所述显示容器的宽度方向上依次叠放。In some embodiments, the video synthesis apparatus further includes: a first acquisition subunit, a first processing subunit, and a first execution subunit, wherein the first acquisition subunit is configured to acquire the resolution of the display container; a first processing subunit, configured to calculate the aspect ratio of the display container according to the resolution of the display container; a first execution subunit, configured to calculate the aspect ratio when the aspect ratio is greater than a preset first threshold , confirming that the preset first layout format is the configuration information of the screen layout, wherein the first layout format is that the L regions are sequentially stacked in the width direction of the display container.
在一些实施方式当中,视频合成装置还包括:第二执行子单元,被配置为当所述宽高比小于或等于所述预设的第一阈值时,确认预设的第二布局格式为所述画面布局的配置信息,其中,所述第二布局格式为使所述L个区域在所述显示容器的高度方向上依次叠放。In some embodiments, the video synthesis apparatus further includes: a second execution subunit, configured to confirm that the preset second layout format is the preset second layout format when the aspect ratio is less than or equal to the preset first threshold. The configuration information of the screen layout, wherein the second layout format is that the L regions are stacked in sequence in the height direction of the display container.
在一些实施方式当中,视频合成装置还包括:第二获取子单元、第二处理子单元和第三执行子单元,其中,第二获取子单元,被配置为获取所述本地视频画面和所述拍摄视频画面的分辨率;第二处理子单元,被配置为根据所述本地视频画面和所述拍摄视频画面的分辨率,计算所述本地视频画面与所述拍摄视频画面的宽度比或者高度比;第三执行子单元,被配置为当所述宽度比或者高度比小于预设的第二阈值时,确定预设的第三布局格式为所述画面布局的配置信息,其中,所述第三布局格式为使所述第一区域嵌套在所述第二区域内。In some embodiments, the video synthesis apparatus further includes: a second acquisition subunit, a second processing subunit, and a third execution subunit, wherein the second acquisition subunit is configured to acquire the local video picture and the The resolution of the captured video picture; the second processing subunit is configured to calculate the width ratio or height ratio of the local video picture and the captured video picture according to the local video picture and the resolution of the captured video picture The third execution subunit is configured to, when the width ratio or the height ratio is smaller than the preset second threshold, determine that the preset third layout format is the configuration information of the screen layout, wherein the third The layout format is such that the first area is nested within the second area.
在一些实施方式当中,视频合成装置还包括:第三获取子单元、第三处理子单元和第四执行子单元,其中,第三获取子单元,被配置为获取所述本地视频画面分辨率;第三处理子单元,被配置为根据所述M个区域在所述显示容器中的显示尺寸将所述本地视频画面进行等比例缩放,以使所述本地视频画面在所述M个区域完整显示;第四执行子单元,被配置根据所述N个区域在所述显示容器中的显示尺寸,确定所述拍摄视频画面的分辨率。In some embodiments, the video synthesis apparatus further includes: a third acquisition subunit, a third processing subunit, and a fourth execution subunit, wherein the third acquisition subunit is configured to acquire the local video picture resolution; The third processing subunit is configured to scale the local video picture in equal proportion according to the display size of the M regions in the display container, so that the local video picture is completely displayed in the M regions ; a fourth execution subunit, configured to determine the resolution of the captured video picture according to the display size of the N regions in the display container.
在一些实施方式当中,视频合成装置还包括:第一解码子单元、第四处理子单元和第五执行子单元,其中,第一解码子单元,被配置为对所述M个区域的画面与所述N个区域的画面进行解码,分别生成L个纹理信息对所述M个区域的画面与所述N个区域的画面进行解码,分别生成L个纹理信息;第四处理子单元,被配置为根据所述预设的画面布局的配置信息,分别计算所述L个纹理信息的纹理坐标和顶点坐标;第五执行子单元,被配置为根据所述纹理坐标和所述顶点坐标生成所述第一播放文件。In some embodiments, the video synthesis apparatus further includes: a first decoding subunit, a fourth processing subunit, and a fifth execution subunit, wherein the first decoding subunit is configured to compare the pictures of the M regions with The pictures of the N regions are decoded to generate L pieces of texture information respectively, and the pictures of the M regions and the pictures of the N regions are decoded to respectively generate L pieces of texture information; the fourth processing subunit is configured To calculate the texture coordinates and vertex coordinates of the L pieces of texture information respectively according to the configuration information of the preset screen layout; a fifth execution subunit is configured to generate the texture coordinates and the vertex coordinates according to the texture coordinates and the vertex coordinates First play file.
在一些实施方式当中,视频合成装置还包括:第四获取子单元和第五处理子单元,其中,第四获取子单元,被配置为获取预设的拍摄视频特效画面;第五处理子单元,被配置为将所述拍摄视频特效画面加载至所述N个区域。In some embodiments, the video synthesis apparatus further includes: a fourth acquisition subunit and a fifth processing subunit, wherein the fourth acquisition subunit is configured to acquire a preset special effect picture for shooting video; and a fifth processing subunit, is configured to load the shooting video special effect picture to the N regions.
在一些实施方式当中,视频合成装置还包括:第六执行子单元,被配置将所述M个区域的画面与所述N个区域的画面进行叠加渲染,得到渲染后的所述第一播放文件。In some embodiments, the video synthesizing apparatus further includes: a sixth execution subunit, configured to superimpose and render the pictures of the M regions and the pictures of the N regions, to obtain the rendered first playback file .
关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。Regarding the apparatus in the above-mentioned embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be described in detail here.
图9是根据一示例性实施例示出的一种视频合成设备900的结构框图,该视频合成设备900为用于视频合成的移动终端。例如,视频合成设备900可以是移动电话,计算机,数字广播终端,消息收发设备,游戏控制台,平板设备,医疗设备,健身设备,个人数字助理等。FIG. 9 is a structural block diagram of a
参照图9,视频合成设备900可以包括以下一个或多个组件:处理组件902,存储器904,电源组件906,多媒体组件908,音频组件910,输入/输出(I/O)的接口912,传感器组件914,以及通信组件916。9, a
处理组件902通常控制视频合成设备900的整体操作,诸如与显示,电话呼叫,数据通信,相机操作和记录操作相关联的操作。处理组件902可以包括一个或多个处理器920来执行指令,以完成上述的方法的全部或部分步骤。此外,处理组件902可以包括一个或多个模块,便于处理组件902和其他组件之间的交互。例如,处理组件902可以包括多媒体模块,以方便多媒体组件908和处理组件902之间的交互。The
存储器904被配置为存储各种类型的数据以支持在视频合成设备900的操作。这些数据的示例包括用于在视频合成设备900上操作的任何应用程序或方法的指令,联系人数据,电话簿数据,消息,图片,视频等。存储器904可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。
电源组件906为视频合成设备900的各种组件提供电力。电源组件906可以包括电源管理系统,一个或多个电源,及其他与为视频合成设备900生成、管理和分配电力相关联的组件。
多媒体组件908包括在所述视频合成设备900和用户之间的提供一个输出接口的屏幕。在一些实施例中,屏幕可以包括液晶显示器(LCD)和触摸面板(TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。所述触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与所述触摸或滑动操作相关的持续时间和压力。在一些实施例中,多媒体组件908包括一个前置摄像头和/或后置摄像头。当视频合成设备900处于操作模式,如拍摄模式或视频模式时,前置摄像头和/或后置摄像头可以接收外部的多媒体数据。每个前置摄像头和后置摄像头可以是一个固定的光学透镜系统或具有焦距和光学变焦能力。
音频组件910被配置为输出和/或输入音频信号。例如,音频组件910包括一个麦克风(MIC),当视频合成设备900处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器904或经由通信组件916发送。在一些实施例中,音频组件910还包括一个扬声器,用于输出音频信号。
I/O接口912为处理组件902和外围接口模块之间提供接口,上述外围接口模块可以是键盘,点击轮,按钮等。这些按钮可包括但不限于:主页按钮、音量按钮、启动按钮和锁定按钮。The I/
传感器组件914包括一个或多个传感器,用于为视频合成设备900提供各个方面的状态评估。例如,传感器组件914可以检测到视频合成设备900的打开/关闭状态,组件的相对定位,例如所述组件为视频合成设备900的显示器和小键盘,传感器组件914还可以检测视频合成设备900或视频合成设备900一个组件的位置改变,用户与视频合成设备900接触的存在或不存在,视频合成设备900方位或加速/减速和视频合成设备900的温度变化。传感器组件914可以包括接近传感器,被配置用来在没有任何的物理接触时检测附近物体的存在。传感器组件914还可以包括光传感器,如CMOS或CCD图像传感器,用于在成像应用中使用。在一些实施例中,该传感器组件914还可以包括加速度传感器,陀螺仪传感器,磁传感器,压力传感器或温度传感器。
通信组件916被配置为便于视频合成设备900和其他设备之间有线或无线方式的通信。视频合成设备900可以接入基于通信标准的无线网络,如WiFi,运营商网络(如2G、3G、4G或5G),或它们的组合。在一个示例性实施例中,通信组件916经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,所述通信组件916还包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT)技术和其他技术来实现。
在示例性实施例中,视频合成设备900可以被一个或多个应用专用集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理设备(DSPD)、可编程逻辑器件(PLD)、现场可编程门阵列(FPGA)、控制器、微控制器、微处理器或其他电子元件实现,用于执行上述方法。In an exemplary embodiment,
在示例性实施例中,还提供了一种包括指令的非临时性计算机可读存储介质,例如包括指令的存储器904,上述指令可由视频合成设备900的处理器920执行以完成上述方法。例如,所述非临时性计算机可读存储介质可以是ROM、随机存取存储器(RAM)、CD-ROM、磁带、软盘和光数据存储设备等。In an exemplary embodiment, there is also provided a non-transitory computer-readable storage medium including instructions, such as a
在一些实施方式中,提供计算机程序产品,包括计算机程序代码,计算机程序包括程序指令,当程序指令被计算机执行时,使计算机执行上述视频合成方法的步骤。In some embodiments, a computer program product is provided, comprising computer program code, the computer program comprising program instructions that, when executed by a computer, cause the computer to perform the steps of the above-described video synthesis method.
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本申请的其它实施方案。本申请旨在涵盖本申请的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本申请的一般性原理并包括本申请未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本申请的真正范围和精神由下面的权利要求指出。Other embodiments of the present application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses or adaptations of this application that follow the general principles of this application and include common knowledge or conventional techniques in the technical field not disclosed in this application . The specification and examples are to be regarded as exemplary only, with the true scope and spirit of the application being indicated by the following claims.
应当理解的是,本申请并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本申请的范围仅由所附的权利要求来限制。It is to be understood that the present application is not limited to the precise structures described above and illustrated in the accompanying drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.
Claims (16)
Priority Applications (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010182771.2A CN111356000A (en) | 2018-08-17 | 2018-08-17 | Video synthesis method, device, equipment and storage medium |
| CN201810943403.8A CN109068166B (en) | 2018-08-17 | 2018-08-17 | Video synthesis method, device, equipment and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201810943403.8A CN109068166B (en) | 2018-08-17 | 2018-08-17 | Video synthesis method, device, equipment and storage medium |
Related Child Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202010182771.2A Division CN111356000A (en) | 2018-08-17 | 2018-08-17 | Video synthesis method, device, equipment and storage medium |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN109068166A CN109068166A (en) | 2018-12-21 |
| CN109068166B true CN109068166B (en) | 2020-02-14 |
Family
ID=64687399
Family Applications (2)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201810943403.8A Active CN109068166B (en) | 2018-08-17 | 2018-08-17 | Video synthesis method, device, equipment and storage medium |
| CN202010182771.2A Pending CN111356000A (en) | 2018-08-17 | 2018-08-17 | Video synthesis method, device, equipment and storage medium |
Family Applications After (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202010182771.2A Pending CN111356000A (en) | 2018-08-17 | 2018-08-17 | Video synthesis method, device, equipment and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (2) | CN109068166B (en) |
Families Citing this family (22)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110121094A (en) * | 2019-06-20 | 2019-08-13 | 广州酷狗计算机科技有限公司 | Video is in step with display methods, device, equipment and the storage medium of template |
| CN110401820A (en) * | 2019-08-15 | 2019-11-01 | 北京迈格威科技有限公司 | Multipath video processing method, device, medium and electronic equipment |
| CN110572411A (en) * | 2019-09-18 | 2019-12-13 | 北京云中融信网络科技有限公司 | Method and device for testing video transmission quality |
| CN110781440A (en) * | 2019-10-31 | 2020-02-11 | 北京东软望海科技有限公司 | Container height adjusting method and device, computer equipment and storage medium |
| CN110996150A (en) * | 2019-11-18 | 2020-04-10 | 咪咕动漫有限公司 | Video fusion method, electronic device and storage medium |
| CN113497963B (en) * | 2020-03-18 | 2023-04-18 | 阿里巴巴集团控股有限公司 | Video processing method, device and equipment |
| CN111541868A (en) * | 2020-03-31 | 2020-08-14 | 北京辰森世纪科技股份有限公司 | Cooking state monitoring method, device and system |
| CN111901572B (en) * | 2020-08-14 | 2022-03-18 | 广州盈可视电子科技有限公司 | Multi-channel video stream synthesis method, device, equipment and storage medium |
| CN112004032B (en) * | 2020-09-04 | 2022-02-18 | 北京字节跳动网络技术有限公司 | Video processing method, terminal device and storage medium |
| CN112235626B (en) * | 2020-10-15 | 2023-06-13 | Oppo广东移动通信有限公司 | Video rendering method and device, electronic equipment and storage medium |
| CN115515005B (en) * | 2021-06-07 | 2024-11-26 | 京东方科技集团股份有限公司 | A method, device and display device for obtaining cover of program switching |
| CN113727047A (en) * | 2021-08-18 | 2021-11-30 | 深圳传音控股股份有限公司 | Video processing method, mobile terminal and readable storage medium |
| CN113760211A (en) * | 2021-08-31 | 2021-12-07 | 联想(北京)有限公司 | Control method and control device |
| CN113923351B (en) * | 2021-09-09 | 2022-09-27 | 荣耀终端有限公司 | Method, device and storage medium for exiting multi-channel video shooting |
| CN115809957A (en) * | 2021-09-13 | 2023-03-17 | 北京字跳网络技术有限公司 | Image processing method and device |
| CN115996277A (en) * | 2021-10-19 | 2023-04-21 | 上海赛连信息科技有限公司 | A method and device for simultaneously recording multiple video files with different frames |
| CN114286115B (en) * | 2021-11-24 | 2024-04-16 | 杭州星犀科技有限公司 | Control method and system for picture display of multi-channel video |
| CN114286177A (en) * | 2021-12-28 | 2022-04-05 | 北京快来文化传播集团有限公司 | Video splicing method and device and electronic equipment |
| CN114710643A (en) * | 2022-03-23 | 2022-07-05 | 广州方硅信息技术有限公司 | Video rendering method, device and equipment in video conference and readable storage medium |
| CN114429611B (en) * | 2022-04-06 | 2022-07-08 | 北京达佳互联信息技术有限公司 | Video synthesis method and device, electronic equipment and storage medium |
| CN115695685B (en) * | 2022-10-28 | 2025-08-19 | 北京字跳网络技术有限公司 | Special effect processing method and device, electronic equipment and storage medium |
| CN119603548A (en) * | 2023-09-08 | 2025-03-11 | 中兴通讯股份有限公司 | Photographing method, electronic device, and computer readable medium |
Family Cites Families (12)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8319814B2 (en) * | 2007-06-22 | 2012-11-27 | Lifesize Communications, Inc. | Video conferencing system which allows endpoints to perform continuous presence layout selection |
| AU2009257627B2 (en) * | 2008-06-09 | 2014-05-01 | Vidyo, Inc. | Improved view layout management in scalable video and audio communication systems |
| CN101692693B (en) * | 2009-09-29 | 2011-09-28 | 北京中科大洋科技发展股份有限公司 | Multifunctional integrated studio system and a method |
| CN101860715A (en) * | 2010-05-14 | 2010-10-13 | 中兴通讯股份有限公司 | Multi-picture composition method, system and media processing device |
| CN103530096B (en) * | 2012-07-03 | 2018-11-16 | 索尼公司 | Long-range control method, remote control equipment and display equipment |
| CN105704424A (en) * | 2014-11-27 | 2016-06-22 | 中兴通讯股份有限公司 | Multi-image processing method, multi-point control unit, and video system |
| CN105898133A (en) * | 2015-08-19 | 2016-08-24 | 乐视网信息技术(北京)股份有限公司 | Video shooting method and device |
| CN106165430B (en) * | 2016-06-29 | 2019-11-08 | 北京小米移动软件有限公司 | Live video method and device |
| JP6727989B2 (en) * | 2016-08-31 | 2020-07-22 | キヤノン株式会社 | Image processing apparatus and control method thereof |
| CN106604047A (en) * | 2016-12-13 | 2017-04-26 | 天脉聚源(北京)传媒科技有限公司 | Multi-video-stream video direct broadcasting method and device |
| CN107257506A (en) * | 2017-06-29 | 2017-10-17 | 徐文波 | Many picture special efficacy loading methods and device |
| CN108156520B (en) * | 2017-12-29 | 2020-08-25 | 珠海市君天电子科技有限公司 | Video playing method and device, electronic equipment and storage medium |
-
2018
- 2018-08-17 CN CN201810943403.8A patent/CN109068166B/en active Active
- 2018-08-17 CN CN202010182771.2A patent/CN111356000A/en active Pending
Also Published As
| Publication number | Publication date |
|---|---|
| CN109068166A (en) | 2018-12-21 |
| CN111356000A (en) | 2020-06-30 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN109068166B (en) | Video synthesis method, device, equipment and storage medium | |
| CN109168034B (en) | Commodity information display method and device, electronic equipment and readable storage medium | |
| US10437545B2 (en) | Apparatus, system, and method for controlling display, and recording medium | |
| CN104052922B (en) | Image processing method and the electronic equipment for supporting image processing method | |
| US9509907B2 (en) | Information processing device, storage medium having moving image data stored thereon, information processing system, storage medium having moving image reproduction program stored thereon, and moving image reproduction method | |
| CN108510597A (en) | Edit methods, device and the non-transitorycomputer readable storage medium of virtual scene | |
| WO2017181556A1 (en) | Video game live streaming method and device | |
| WO2020063084A1 (en) | Image processing method and apparatus, electronic device, and storage medium | |
| KR20230049691A (en) | Video processing method, terminal and storage medium | |
| US9137461B2 (en) | Real-time camera view through drawn region for image capture | |
| WO2016192325A1 (en) | Method and device for processing logo on video file | |
| CN103209312B (en) | A kind of method of video player, mobile terminal and mobile terminal playing video | |
| CN111862936A (en) | Methods, apparatus, electronic devices and storage media for generating and distributing works | |
| CN111988672A (en) | Video processing method and device, electronic equipment and storage medium | |
| CN105100870A (en) | Screen capture method and terminal device | |
| CN112614228A (en) | Method and device for simplifying three-dimensional grid, electronic equipment and storage medium | |
| CN108965711A (en) | Method for processing video frequency and device | |
| CN111754607A (en) | Image processing method and apparatus, electronic device, and computer-readable storage medium | |
| KR102189189B1 (en) | Gamut mapping method and device | |
| CN107396166A (en) | The method and device of live middle display video | |
| CN107566878B (en) | Method and device for displaying pictures in live broadcast | |
| CN106954093B (en) | Panoramic video processing method, device and system | |
| EP3799415A2 (en) | Method and device for processing videos, and medium | |
| CN106375833A (en) | VR-based video display method, device and terminal equipment | |
| CN113286073A (en) | Imaging method, imaging device, and storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |