WO2023016015A1 - Method for displaying video thumbnail, and device and storage medium - Google Patents

Method for displaying video thumbnail, and device and storage medium Download PDF

Info

Publication number
WO2023016015A1
WO2023016015A1 PCT/CN2022/093046 CN2022093046W WO2023016015A1 WO 2023016015 A1 WO2023016015 A1 WO 2023016015A1 CN 2022093046 W CN2022093046 W CN 2022093046W WO 2023016015 A1 WO2023016015 A1 WO 2023016015A1
Authority
WO
WIPO (PCT)
Prior art keywords
video
movie
display
thumbnail
aspect ratio
Prior art date
Application number
PCT/CN2022/093046
Other languages
French (fr)
Chinese (zh)
Other versions
WO2023016015A9 (en
Inventor
暴文莹
马捷
胡雅君
Original Assignee
荣耀终端有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 荣耀终端有限公司 filed Critical 荣耀终端有限公司
Publication of WO2023016015A1 publication Critical patent/WO2023016015A1/en
Publication of WO2023016015A9 publication Critical patent/WO2023016015A9/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/95Computational photography systems, e.g. light-field imaging systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/70Information retrieval; Database structures therefor; File system structures therefor of video data
    • G06F16/73Querying
    • G06F16/738Presentation of query results
    • G06F16/739Presentation of query results in form of a video summary, e.g. the video summary being a video sequence, a composite still image or having synthesized frames
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/63Control of cameras or camera modules by using electronic viewfinders

Abstract

A method for displaying a video thumbnail, and a device and a storage medium, wherein the method is applied to an electronic device. The method comprises: when an electronic device is in a portrait mode, capturing, by means of a camera, a first video having a first aspect ratio; displaying, in an album, a first thumbnail corresponding to the first video, wherein the aspect ratio of the first thumbnail is consistent with the first aspect ratio; when the electronic device is in a landscape mode, capturing, by means of the camera, a second video having a second aspect ratio; and displaying, in the album, a second thumbnail corresponding to the second video, wherein the first thumbnail and the second thumbnail are displayed in the same row, and the aspect ratio of the second thumbnail is inconsistent with the second aspect ratio. By means of the method, a thumbnail, the aspect ratio of which is consistent with the aspect ratio of a video, is displayed, such that it is ensured that the thumbnail can present content in the video in a relatively complete way, thereby improving the usage experience of a user when browsing a video in an album.

Description

视频缩略图的显示方法、设备和存储介质Video thumbnail display method, device and storage medium
本申请要求在2021年8月12日提交中华人民共和国国家知识产权局,申请号为202110925581.X,发明名称为“视频缩略图的显示方法、设备和存储介质”的中国专利申请,以及在2021年9月1日提交中华人民共和国国家知识产权局,申请号为202111022205.6,发明名称为“视频缩略图的显示方法、设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application requires submission to the State Intellectual Property Office of the People's Republic of China on August 12, 2021, with the application number 202110925581. The priority of the Chinese patent application with the application number 202111022205.6 filed on September 1, 2021 with the title of "Video Thumbnail Display Method, Device and Storage Medium", the entire contents of which are incorporated herein by reference In this application.
技术领域technical field
本申请涉及图像显示技术领域,尤其涉及一种视频缩略图的显示方法、设备和存储介质。The present application relates to the technical field of image display, in particular to a method, device and storage medium for displaying video thumbnails.
背景技术Background technique
电子设备可以响应于用户的操作,在显示屏上显示包含视频的缩略图的视频浏览界面。用户通过视频浏览界面查看电子设备上的视频,并通过缩略图预览各个视频的内容。The electronic device may display a video browsing interface including video thumbnails on the display screen in response to the user's operation. The user views videos on the electronic device through the video browsing interface, and previews the content of each video through thumbnails.
目前,视频缩略图的尺寸一般具有固定比例,常见的,视频缩略图的宽度和高度之比固定为1:1。而视频中图像的尺寸则可能有多种比例,如16:9,21:9等等。而视频缩略图的尺寸比例和视频中图像的尺寸比例差距过大,会导致缩略图无法完整呈现视频中图像的内容,用户体验较差。At present, the size of the video thumbnail generally has a fixed ratio, and generally, the ratio of the width to the height of the video thumbnail is fixed at 1:1. The size of the image in the video may have various ratios, such as 16:9, 21:9 and so on. However, if the size ratio of the video thumbnail and the size ratio of the image in the video are too large, the thumbnail cannot fully present the content of the image in the video, and the user experience is poor.
发明内容Contents of the invention
本申请提供了一种视频缩略图的显示方法、设备和存储介质,目的在于使视频浏览界面中电影视频的缩略图能完整的呈现电影视频中图像的内容,改善用户体验。The present application provides a method, device and storage medium for displaying video thumbnails, with the purpose of enabling the thumbnails of movie videos in the video browsing interface to fully present the content of images in the movie and video, and improving user experience.
为了实现上述目的,本申请提供了以下技术方案:In order to achieve the above object, the application provides the following technical solutions:
本申请第一方面提供一种视频缩略图的显示方法,应用于电子设备,显示方法包括:The first aspect of the present application provides a method for displaying video thumbnails, which is applied to electronic devices, and the display method includes:
在电子设备处于竖屏时,通过相机拍摄得到第一视频,第一视频具有第一宽高比;When the electronic device is in a vertical screen, a first video is captured by a camera, and the first video has a first aspect ratio;
在相册中显示第一视频对应的第一缩略图,第一缩略图的宽高比和第一宽高比一致;Display the first thumbnail corresponding to the first video in the album, and the aspect ratio of the first thumbnail is consistent with the first aspect ratio;
在电子设备处于横屏时,通过相机拍摄得到第二视频,第二视频具有第二宽高比;When the electronic device is in a landscape orientation, a second video is captured by a camera, and the second video has a second aspect ratio;
在相册中显示第二视频对应的第二缩略图,第一缩略图和第二缩略图显示在同一行,第二缩略图的宽高比和第二宽高比不一致。The second thumbnail corresponding to the second video is displayed in the album, the first thumbnail and the second thumbnail are displayed on the same row, and the aspect ratio of the second thumbnail is inconsistent with the second aspect ratio.
示例性的,第一视频可以记为电影1,第二视频可以记为电影2,第一宽高比可以是9:21,第二宽高比可以是21:9。Exemplarily, the first video may be recorded as movie 1, the second video may be recorded as movie 2, the first aspect ratio may be 9:21, and the second aspect ratio may be 21:9.
在一些可选的实施例中,在相册中显示第二视频对应的第二缩略图之前,还包括:In some optional embodiments, before displaying the second thumbnail corresponding to the second video in the photo album, further includes:
读取第一视频的视频信息;Read the video information of the first video;
根据第一视频的视频信息确定第一视频的方向为竖屏;Determining the direction of the first video as vertical screen according to the video information of the first video;
读取第二视频的视频信息;Read the video information of the second video;
根据第二视频的视频信息确定第二视频的方向为横屏;According to the video information of the second video, it is determined that the direction of the second video is horizontal;
确定第一缩略图和第二视频对应的第二缩略图在同一行显示。It is determined that the first thumbnail and the second thumbnail corresponding to the second video are displayed on the same row.
示例性的,第一视频的视频信息和第二视频的视频信息可以存储在媒体数据库中,并 由图库从媒体数据库同步至图库自身的数据库中。Exemplarily, the video information of the first video and the video information of the second video can be stored in the media database, and are synchronized by the gallery from the media database to the database of the gallery itself.
在一些可选的实施例中,还包括:In some optional embodiments, also include:
在电子设备处于横屏时,通过相机拍摄得到第三视频,第三视频具有第三宽高比;When the electronic device is in a landscape orientation, a third video is captured by a camera, and the third video has a third aspect ratio;
在相册中显示第三视频对应的第三缩略图,第三缩略图显示在和第二缩略图不同的一行,第三缩略图的宽高比和第三宽高比一致。A third thumbnail corresponding to the third video is displayed in the photo album, the third thumbnail is displayed on a row different from that of the second thumbnail, and an aspect ratio of the third thumbnail is consistent with the third aspect ratio.
示例性的,第三视频可以记为电影5,第三宽高比可以是21:9。Exemplarily, the third video may be recorded as Movie 5, and the third aspect ratio may be 21:9.
在一些可选的实施例中,在相册中显示第三视频对应的第三缩略图之前,还包括:In some optional embodiments, before displaying the third thumbnail corresponding to the third video in the photo album, further includes:
读取第三视频的视频信息;Read the video information of the third video;
根据第三视频的视频信息确定第三视频的方向为横屏;According to the video information of the third video, it is determined that the direction of the third video is a horizontal screen;
确定第三视频对应的第三缩略图显示在和第二缩略图不同的一行。It is determined that the third thumbnail corresponding to the third video is displayed on a row different from the second thumbnail.
在一些可选的实施例中,还包括:In some optional embodiments, also include:
在电子设备处于竖屏时,通过相机拍摄得到第四视频,第四视频具有第四宽高比;When the electronic device is in a vertical screen, a fourth video is obtained by shooting with a camera, and the fourth video has a fourth aspect ratio;
在相册中显示第四视频对应的第四缩略图,第四缩略图显示在和第三缩略图不同的一行,第四缩略图的宽高比和第四宽高比一致。A fourth thumbnail corresponding to the fourth video is displayed in the photo album, the fourth thumbnail is displayed on a row different from that of the third thumbnail, and the aspect ratio of the fourth thumbnail is consistent with the fourth aspect ratio.
在一些可选的实施例中,还包括:In some optional embodiments, also include:
在电子设备处于竖屏时,通过相机拍摄得到第五视频,第五视频具有第五宽高比;When the electronic device is in a vertical screen, a fifth video is obtained by shooting with a camera, and the fifth video has a fifth aspect ratio;
在相册中显示第五视频对应的第五缩略图,第五缩略图和第四缩略图显示在同一行,第五缩略图的宽高比和第五宽高比一致。The fifth thumbnail corresponding to the fifth video is displayed in the photo album, the fifth thumbnail and the fourth thumbnail are displayed in the same row, and the aspect ratio of the fifth thumbnail is consistent with the fifth aspect ratio.
示例性的,在上述实施例中,第四视频可以是电影3,第五视频可以是电影4,第四宽高比和第五宽高比均可以是9:21。Exemplarily, in the foregoing embodiment, the fourth video may be Movie 3, the fifth video may be Movie 4, and both the fourth aspect ratio and the fifth aspect ratio may be 9:21.
在一些可选的实施例中,在相册中显示第五视频对应的第五缩略图之前,还包括:In some optional embodiments, before the fifth thumbnail corresponding to the fifth video is displayed in the photo album, it further includes:
读取第四视频的视频信息;Read the video information of the fourth video;
根据第四视频的视频信息确定第四视频的方向为竖屏;Determining that the direction of the fourth video is a vertical screen according to the video information of the fourth video;
读取第五视频的视频信息;Read the video information of the fifth video;
根据第五视频的视频信息确定第五视频的方向为竖屏;Determining the orientation of the fifth video as a vertical screen according to the video information of the fifth video;
确定第四缩略图和第五视频对应的第五缩略图在同一行显示。It is determined that the fourth thumbnail and the fifth thumbnail corresponding to the fifth video are displayed on the same row.
在一些可选的实施例中,还包括:In some optional embodiments, also include:
在电子设备处于竖屏时,通过相机拍摄得到第六视频,第六视频具有第六宽高比;When the electronic device is in a vertical screen, a sixth video is obtained by shooting with a camera, and the sixth video has a sixth aspect ratio;
在相册中显示第五视频对应的第六缩略图,第六缩略图和第五缩略图显示在同一行,第六缩略图的宽高比和第六宽高比一致。The sixth thumbnail corresponding to the fifth video is displayed in the photo album, the sixth thumbnail and the fifth thumbnail are displayed in the same row, and the aspect ratio of the sixth thumbnail is consistent with the sixth aspect ratio.
示例性的,在上述实施例中,第四视频可以是电影3,第五视频可以是电影4,第四宽高比和第五宽高比均可以是9:21。Exemplarily, in the foregoing embodiment, the fourth video may be Movie 3, the fifth video may be Movie 4, and both the fourth aspect ratio and the fifth aspect ratio may be 9:21.
在一些可选的实施例中,在相册中显示第五视频对应的第六缩略图之前,还包括:In some optional embodiments, before displaying the sixth thumbnail corresponding to the fifth video in the photo album, further includes:
读取第六视频的视频信息;Read the video information of the sixth video;
根据第六视频的视频信息确定第六视频的方向为竖屏;According to the video information of the sixth video, it is determined that the direction of the sixth video is a vertical screen;
确定第四缩略图、第五缩略图和第六视频对应的第六缩略图在同一行显示。It is determined that the fourth thumbnail image, the fifth thumbnail image and the sixth thumbnail image corresponding to the sixth video are displayed in the same row.
示例性的,在上述实施例中,第四视频可以是电影6,第五视频可以是电影7,第六视频可以是电影8,第四宽高比,第五宽高比和第六宽高比均可以是9:21。Exemplarily, in the above embodiment, the fourth video can be movie 6, the fifth video can be movie 7, the sixth video can be movie 8, the fourth aspect ratio, the fifth aspect ratio and the sixth aspect ratio The average ratio can be 9:21.
在一些可选的实施例中,通过相机拍摄得到第一视频之后,还包括:In some optional embodiments, after the first video is captured by the camera, it also includes:
在第一视频中添加电影标签,电影标签用于指示第一视频为在预设的电影模式下拍摄得到的视频。A movie tag is added to the first video, and the movie tag is used to indicate that the first video is a video shot in a preset movie mode.
在一些可选的实施例中,在相册中显示第一视频对应的第一缩略图之前,还包括:In some optional embodiments, before displaying the first thumbnail corresponding to the first video in the photo album, further includes:
根据显示屏上视频显示区域的宽度和预设的参考系数计算得到第一视频的显示高度;Calculate and obtain the display height of the first video according to the width of the video display area on the display screen and the preset reference coefficient;
根据第一视频的显示高度和第一宽高比计算得到第一视频的显示宽度;calculating the display width of the first video according to the display height and the first aspect ratio of the first video;
基于第一视频的显示高度和第一视频的显示宽度,获得第一视频对应的第一缩略图。Based on the display height of the first video and the display width of the first video, a first thumbnail corresponding to the first video is obtained.
在一些可选的实施例中,在相册中显示第二视频对应的第二缩略图之前,还包括:In some optional embodiments, before displaying the second thumbnail corresponding to the second video in the photo album, further includes:
将第一视频的显示高度确定为第二视频的显示高度;Determining the display height of the first video as the display height of the second video;
根据显示屏上视频显示区域的宽度和第一视频的显示宽度,计算得到第二视频的显示宽度;Calculate the display width of the second video according to the width of the video display area on the display screen and the display width of the first video;
基于第二视频的显示高度和第二视频的显示宽度,获得第二视频的缩略图第二视频对应的第二缩略图。Based on the display height of the second video and the display width of the second video, the thumbnail image of the second video and the second thumbnail corresponding to the second video are obtained.
在一些可选的实施例中,在相册中显示第三视频对应的第三缩略图之前,还包括:In some optional embodiments, before displaying the third thumbnail corresponding to the third video in the photo album, further includes:
将显示屏上视频显示区域的宽度确定为第三视频的显示宽度;Determining the width of the video display area on the display screen as the display width of the third video;
根据第三视频的显示宽度和第三宽高比计算得到第三视频的显示高度;calculating the display height of the third video according to the display width of the third video and the third aspect ratio;
基于第三视频的显示宽度和第三视频的显示高度获得第三视频对应的第三缩略图。A third thumbnail corresponding to the third video is obtained based on the display width of the third video and the display height of the third video.
在一些可选的实施例中,在相册中显示第五视频对应的第五缩略图之前,还包括:In some optional embodiments, before the fifth thumbnail corresponding to the fifth video is displayed in the photo album, it further includes:
根据预设的视频布局间隔,显示屏上视频显示区域的宽度和总宽高比计算得到第五视频的显示高度,总宽高比为第四宽高比和第五宽高比之和;According to the preset video layout interval, the width of the video display area on the display screen and the total aspect ratio are calculated to obtain the display height of the fifth video, and the total aspect ratio is the sum of the fourth aspect ratio and the fifth aspect ratio;
根据第五视频的显示高度和第五视频的宽高比计算得到第五视频的显示宽度;Calculate the display width of the fifth video according to the display height of the fifth video and the aspect ratio of the fifth video;
基于第五视频的显示高度和第五视频的显示宽度,获得第五视频对应的第五缩略图。Based on the display height of the fifth video and the display width of the fifth video, a fifth thumbnail corresponding to the fifth video is obtained.
在一些可选的实施例中,基于第一视频的显示高度和第一视频的显示宽度,获得第一视频对应的第一缩略图,包括:In some optional embodiments, based on the display height of the first video and the display width of the first video, obtaining the first thumbnail corresponding to the first video includes:
从第一视频中解析得到一帧图像;Analyzing and obtaining a frame of image from the first video;
将解析得到的图像缩小,获得第一视频对应的第一缩略图,第一缩略图的高度为第一视频的显示高度,第一缩略图的宽度为第一视频的显示宽度。The analyzed image is reduced to obtain a first thumbnail corresponding to the first video, the height of the first thumbnail is the display height of the first video, and the width of the first thumbnail is the display width of the first video.
在一些可选的实施例中,基于第二视频的显示高度和第二视频的显示宽度,获得第二视频对应的第二缩略图,包括:In some optional embodiments, based on the display height of the second video and the display width of the second video, obtaining a second thumbnail corresponding to the second video includes:
从第二视频中解析得到一帧图像;Analyzing and obtaining a frame of image from the second video;
将解析得到的图像缩小,获得缩小后的图像,缩小后的图像的高度和第二视频的显示高度一致;The image obtained by parsing is reduced to obtain the reduced image, and the height of the reduced image is consistent with the display height of the second video;
沿宽度方向对缩小后的图像居中裁剪,获得第二视频对应的第二缩略图,第二缩略图的宽度和第二视频的显示宽度一致。The reduced image is centered and cropped along the width direction to obtain a second thumbnail corresponding to the second video, and the width of the second thumbnail is consistent with the display width of the second video.
本申请第二方面还提供一种电子设备,包括:一个或多个处理器、存储器和摄像头;The second aspect of the present application also provides an electronic device, including: one or more processors, memory and camera;
存储器用于存储一个或多个程序;memory for storing one or more programs;
一个或多个处理器用于执行一个或多个程序,使得电子设备执行本申请第一方面任意一项所提供的视频缩略图的显示方法。One or more processors are used to execute one or more programs, so that the electronic device executes the video thumbnail display method provided in any one of the first aspects of the present application.
本申请第三方面还提供一种计算机存储介质,用于存储计算机程序,计算机程序被执行时,具体用于实现本申请第一方面任意一项所提供的视频缩略图的显示方法。The third aspect of the present application further provides a computer storage medium for storing a computer program. When the computer program is executed, it is specifically used to implement the video thumbnail display method provided in any one of the first aspects of the present application.
本申请提供一种视频缩略图的显示方法、设备和存储介质,应用于电子设备,显示方法包括:在电子设备处于竖屏时,通过相机拍摄得到具有第一宽高比的第一视频;在相册中显示第一视频对应的第一缩略图,第一缩略图的宽高比和第一宽高比一致;在电子设备处于横屏时,通过相机拍摄得到具有第二宽高比的第二视频;在相册中显示第二视频对应的第二缩略图,第一缩略图和第二缩略图显示在同一行,第二缩略图的宽高比和第二宽高比不一致。本方案通过显示宽高比和视频的宽高比一致的缩略图,确保缩略图能较完整的呈现视频中的内容,从而改善用户在相册中浏览视频时的使用体验。The present application provides a video thumbnail display method, device, and storage medium, which are applied to electronic devices. The display method includes: when the electronic device is in a vertical screen, a first video with a first aspect ratio is captured by a camera; The first thumbnail corresponding to the first video is displayed in the photo album, and the aspect ratio of the first thumbnail is consistent with the first aspect ratio; when the electronic device is in landscape orientation, the second video with the second aspect ratio is obtained by shooting with the camera. Video: Display the second thumbnail corresponding to the second video in the album, the first thumbnail and the second thumbnail are displayed on the same line, and the aspect ratio of the second thumbnail is inconsistent with the second aspect ratio. This solution ensures that the thumbnails can fully present the contents of the video by displaying thumbnails with the same aspect ratio as the video, thereby improving the user experience when browsing videos in the photo album.
附图说明Description of drawings
图1为本申请实施例公开的一种电子设备的结构示意图;FIG. 1 is a schematic structural diagram of an electronic device disclosed in an embodiment of the present application;
图2为本申请实施例公开的一种视频浏览界面的示意图;FIG. 2 is a schematic diagram of a video browsing interface disclosed in an embodiment of the present application;
图3为本申请实施例公开的一种电子设备的主界面的示意图;FIG. 3 is a schematic diagram of a main interface of an electronic device disclosed in an embodiment of the present application;
图4至图9为本申请实施例公开的电影视频浏览界面的示意图;4 to 9 are schematic diagrams of movie and video browsing interfaces disclosed in the embodiments of the present application;
图10为本申请实施例公开的一种电子设备的软件架构示意图;FIG. 10 is a schematic diagram of a software architecture of an electronic device disclosed in an embodiment of the present application;
图11为本申请实施例公开的一种视频缩略图的显示方法的流程图;FIG. 11 is a flowchart of a method for displaying video thumbnails disclosed in an embodiment of the present application;
图12为本申请实施例公开的一种按横屏规则将电影视频分行的流程图;Fig. 12 is a flow chart of dividing movie videos into rows according to horizontal screen rules disclosed in the embodiment of the present application;
图13为本申请实施例公开的一种按竖屏规则将电影视频分行的流程图。Fig. 13 is a flow chart of dividing movie videos into lines according to vertical screen rules disclosed in the embodiment of the present application.
具体实施方式Detailed ways
本申请说明书和权利要求书及附图说明中的术语“第一”、“第二”和“第三”等是用于区别不同对象,而不是用于限定特定顺序。The terms "first", "second" and "third" in the specification, claims and description of the drawings of this application are used to distinguish different objects, rather than to limit a specific order.
在本申请实施例中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。In the embodiments of the present application, words such as "exemplary" or "for example" are used as examples, illustrations or illustrations. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of the present application shall not be interpreted as being more preferred or more advantageous than other embodiments or design schemes. Rather, the use of words such as "exemplary" or "such as" is intended to present related concepts in a concrete manner.
为了便于理解,本申请实施例这里介绍本申请实施例涉及的术语:For ease of understanding, the embodiments of this application introduce the terms involved in the embodiments of this application:
1)、电影模式:指的是电子设备录制视频的一种模式。在本申请实施例中,电影模式包括4K高动态范围图像(high-dynamic range,HDR)功能和颜色查找表(look up table,LUT)功能,当用户选择电影模式录制视频时,能够使得录制的视频具有电影的质感,使画面更加立体。为便于区分,将电子设备在电影模式录制的视频称为电影视频,将电子设备在非电影模式录制的视频称为非电影视频。一般的,若录制电影视频时电子设备处于横屏方向,电影视频的宽高比可以是21:9,宽度大于高度的电影视频的方向为横屏,若录制电影视频时电子设备处于竖屏方向,电影视频的宽高比可以是9:21,高度大于宽度的电影视频的方向为竖屏。1) Movie mode: refers to a mode in which electronic equipment records video. In the embodiment of the present application, the movie mode includes a 4K high-dynamic range image (high-dynamic range, HDR) function and a color lookup table (look up table, LUT) function, when the user selects the movie mode to record video, it can make the recorded The video has the texture of a film, making the picture more three-dimensional. For ease of distinction, videos recorded by electronic devices in film mode are called film videos, and videos recorded by electronic devices in non-film modes are called non-film videos. Generally, if the electronic device is in the landscape orientation when recording a movie video, the aspect ratio of the movie video can be 21:9, and the orientation of the movie video whose width is greater than the height is landscape, and if the electronic device is in the portrait orientation when recording the movie video , the aspect ratio of the movie video can be 9:21, and the orientation of the movie video whose height is greater than the width is portrait.
2)、4K HDR:指的是在4K分辨率的基础上增加HDR技术,可以使拍摄的画面呈现更加真实的效果,以及更加接近人眼可见的真实画面。在一些实施例中,采用4K HDR功能拍摄出来的画面亮部不过曝,暗部细节清晰可见。2), 4K HDR: refers to the addition of HDR technology on the basis of 4K resolution, which can make the captured picture more realistic and closer to the real picture visible to the human eye. In some embodiments, the bright part of the picture captured by the 4K HDR function is not exposed, and the details of the dark part are clearly visible.
3)、LUT:也可以称为LUT文件或者LUT参数,是一种颜色转换模板,比如可以是 一种红蓝绿(red green blue,RGB)的映射表。LUT能够将实际采样到的像素灰度值经过一定的变换(如阈值、反转、对比度调整以及线性变换等),变成了另外一个与之对应的灰度值,这样可以起到突出图像的有用信息,增强图像的光对比度的作用。3), LUT: also can be called LUT file or LUT parameter, is a kind of color conversion template, for example can be a kind of mapping table of red green blue (RGB). LUT can transform the actual sampled pixel gray value into another corresponding gray value after a certain transformation (such as threshold, inversion, contrast adjustment and linear transformation, etc.), which can highlight the image. Useful information, the effect of enhancing the light contrast of an image.
本申请实施例提供了一种电子设备100,请参见图1,电子设备100可以包括:处理器110,内部存储器(也称“内存”)120,外部存储器121,传感器模块130,摄像头140,显示屏150等。其中传感器模块130可以包括陀螺仪传感器130A等。An embodiment of the present application provides an electronic device 100. Please refer to FIG. Screen 150 etc. The sensor module 130 may include a gyroscope sensor 130A and the like.
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 110 may include one or more processing units, for example: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural network processor (neural-network processing unit, NPU) wait. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当电子设备100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the energy of the frequency point.
视频编解码器用于对数字视频压缩或解压缩。电子设备100可以支持一种或多种视频编解码器。这样,电子设备100可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 can play or record videos in various encoding formats, for example: moving picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4 and so on.
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备100的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。The NPU is a neural-network (NN) computing processor. By referring to the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and continuously learn by itself. Applications such as intelligent cognition of the electronic device 100 can be realized through the NPU, such as image recognition, face recognition, speech recognition, text understanding, and the like.
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. The memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can be called directly from the memory. Repeated access is avoided, and the waiting time of the processor 110 is reduced, thereby improving the efficiency of the system.
内部存储器120,也可以称为“内存”,可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。内部存储器120可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器120可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。处理器110通过运行存储在内部存储器120的指令,和/或存储在设置于处理器中的存储器的指令,执行电子设备100的各种功能应用以及数据处理。Internal storage 120, which may also be referred to as "memory," may be used to store computer-executable program code, which includes instructions. The internal memory 120 may include an area for storing programs and an area for storing data. Wherein, the stored program area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, etc.) and the like. The storage data area can store data created during the use of the electronic device 100 (such as audio data, phonebook, etc.) and the like. In addition, the internal memory 120 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (universal flash storage, UFS) and the like. The processor 110 executes various functional applications and data processing of the electronic device 100 by executing instructions stored in the internal memory 120 and/or instructions stored in a memory provided in the processor.
外部存储器121一般指外存储器,在本申请实施例中,外部存储器是指除电子设备的内存及处理器的高速缓存以外的储存器,该储存器一般为非易失性存储器。常见的外部存储器有硬盘、软盘、光盘、U盘、Micro SD卡等,用于实现扩展电子设备100的存储能力。外部存储器可以通过外部存储器接口或者总线与处理器110通信,实现数据存储功能。例 如将音乐,视频等文件保存在外部存储器中。The external memory 121 generally refers to an external memory. In the embodiment of the present application, the external memory refers to a storage other than the internal memory of the electronic device and the cache memory of the processor, and the storage is generally a non-volatile memory. Common external storage devices include hard disks, floppy disks, optical disks, U disks, Micro SD cards, etc., which are used to expand the storage capacity of the electronic device 100. The external memory may communicate with the processor 110 through an external memory interface or a bus to implement a data storage function. Such as saving music, video and other files in external storage.
传感器模块130具体可以包括陀螺仪传感器130A。陀螺仪传感器130A可以用于确定电子设备100的运动姿态。在一些实施例中,可以通过陀螺仪传感器130A确定电子设备100围绕三个轴(即,x,y和z轴)的角速度。陀螺仪传感器130A可以用于拍摄防抖。示例性的,当按下快门,陀螺仪传感器130A检测电子设备100抖动的角度,根据角度计算出镜头模组需要补偿的距离,让镜头通过反向运动抵消电子设备100的抖动,实现防抖。陀螺仪传感器130A还可以用于导航,体感游戏场景。The sensor module 130 may specifically include a gyroscope sensor 130A. The gyro sensor 130A can be used to determine the motion posture of the electronic device 100 . In some embodiments, the angular velocity of the electronic device 100 around three axes (ie, x, y and z axes) may be determined by the gyro sensor 130A. The gyro sensor 130A can be used for image stabilization. Exemplarily, when the shutter is pressed, the gyro sensor 130A detects the shaking angle of the electronic device 100, calculates the distance that the lens module needs to compensate according to the angle, and allows the lens to counteract the shaking of the electronic device 100 through reverse movement to achieve anti-shake. The gyroscope sensor 130A can also be used for navigation and somatosensory game scenes.
电子设备100可以通过ISP,摄像头140,视频编解码器,GPU,显示屏150以及应用处理器等实现拍摄功能。The electronic device 100 can realize the shooting function through the ISP, the camera 140 , the video codec, the GPU, the display screen 150 and the application processor.
ISP用于处理摄像头140反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头140中。The ISP is used for processing data fed back by the camera 140 . For example, when taking a picture, open the shutter, the light is transmitted to the photosensitive element of the camera through the lens, and the light signal is converted into an electrical signal, and the photosensitive element of the camera transmits the electrical signal to the ISP for processing, and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on image noise, brightness, and skin color. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP may be located in the camera 140 .
摄像头140用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,电子设备100可以包括1个或N个摄像头140,N为大于1的正整数。Camera 140 is used to capture still images or video. The object generates an optical image through the lens and projects it to the photosensitive element. The photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. DSP converts digital image signals into standard RGB, YUV and other image signals. In some embodiments, the electronic device 100 may include 1 or N cameras 140 , where N is a positive integer greater than 1.
电子设备100通过GPU,显示屏150,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏150和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The electronic device 100 implements a display function through a GPU, a display screen 150 , and an application processor. The GPU is a microprocessor for image processing, and is connected to the display screen 150 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
显示屏150用于显示图像,视频等。显示屏150包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,电子设备100可以包括1个或N个显示屏150,N为大于1的正整数。The display screen 150 is used to display images, videos and the like. The display screen 150 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active matrix organic light emitting diode or an active matrix organic light emitting diode (active-matrix organic light emitting diode, AMOLED), flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light emitting diodes (quantum dot light emitting diodes, QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 150 , where N is a positive integer greater than 1.
以上是以电子设备100为例对本申请实施例作出的具体说明。应该理解的是,本申请实施例示意的结构并不构成对电子设备100的具体限定。电子设备100可以具有比图中所示的更多的或者更少的部件,可以组合两个或多个的部件,或者可以具有不同的部件配置。图中所示出的各种部件可以在包括一个或多个信号处理和/或专用集成电路在内的硬件.软件.或硬件和软件的组合中实现。The above is a specific description of the embodiment of the present application by taking the electronic device 100 as an example. It should be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100 . Electronic device 100 may have more or fewer components than shown in the figures, may combine two or more components, or may have a different configuration of components. The various components shown in the figures may be implemented in hardware. software. or a combination of hardware and software including one or more signal processing and/or application specific integrated circuits.
在一些可能的实施例中,上述内部存储器120可以用于存储一个或多个程序;In some possible embodiments, the above-mentioned internal memory 120 may be used to store one or more programs;
处理器110用于执行内部存储器存储的一个或多个程序,使得电子设备执行本申请任一实施例提供的视频缩略图的显示方法。The processor 110 is configured to execute one or more programs stored in the internal memory, so that the electronic device executes the video thumbnail display method provided by any embodiment of the present application.
在一些可能的实施例中,外部存储器121可以作为一种计算机存储介质,用于存储计 算机程序,存储的计算机程序被执行时,具体用于实现本申请任一实施例所提供的视频缩略图的显示方法。In some possible embodiments, the external memory 121 can be used as a computer storage medium for storing computer programs, and when the stored computer programs are executed, it is specifically used to implement the video thumbnail provided in any embodiment of the present application. Show method.
用户可以使用上述电子设备录制视频,录制得到的视频可以保存在电子设备的存储器中,或者可以由电子设备上传至服务器。进一步的,用户可以在电子设备的显示屏上浏览录制的视频。The user can use the above-mentioned electronic device to record a video, and the recorded video can be stored in the memory of the electronic device, or can be uploaded to the server by the electronic device. Further, the user can browse the recorded video on the display screen of the electronic device.
用户可以通过电子设备上的图库应用浏览视频,请参见图2,电子设备响应于用户浏览视频的操作,显示图2所示的视频浏览界面200,并在该界面中以缩略图的形式显示视频。在视频浏览界面200中,电子设备按特定的宽高比分别显示每一个视频对应的缩略图,视频标识和时长。基于界面200,电子设备可以响应用户对其中任意一个视频对应的缩略图的点击操作,进而开始播放对应的视频。The user can browse videos through the gallery application on the electronic device, see FIG. 2 , the electronic device displays the video browsing interface 200 shown in FIG. 2 in response to the user's operation of browsing videos, and displays videos in the form of thumbnails in this interface . In the video browsing interface 200, the electronic device respectively displays the corresponding thumbnail, video ID and duration of each video according to a specific aspect ratio. Based on the interface 200, the electronic device may respond to the user's click operation on the thumbnail corresponding to any one of the videos, and then start playing the corresponding video.
上述视频的显示方式存在如下的问题:The display method of the above video has the following problems:
每一个视频的缩略图均按固定的宽高比显示,然而电子设备拍摄的视频可能有多种宽高比。录制得到的电影视频的宽高比一般是21:9(当视频为横屏方向的视频时)或者9:21(当视频为竖屏方向的视频时),进一步的,用户也可以编辑录制得到的电影视频,从而获得其他宽高比的电影视频,例如通过编辑获得16:9的电影视频。所以,按固定的宽高比呈现电影视频,会导致浏览电影视频时,图2所示的界面无法完整的显示各个电影视频中的一帧图像,因此用户在浏览电影视频时的观感较差。Each video thumbnail is displayed with a fixed aspect ratio, however videos captured by electronic devices may have multiple aspect ratios. The aspect ratio of the recorded movie video is generally 21:9 (when the video is in landscape orientation) or 9:21 (when the video is in portrait orientation), further, users can also edit and record to obtain , so as to obtain movie videos with other aspect ratios, such as 16:9 movie videos through editing. Therefore, presenting movie videos with a fixed aspect ratio will cause the interface shown in FIG. 2 to be unable to completely display one frame of images in each movie video when browsing movie videos, so the user's viewing experience when browsing movie videos is poor.
针对上述问题,本申请实施例提供了一种视频缩略图的显示方法。本申请实施例提供的视频缩略图的显示方法可以应用于如图1所示的电子设备100,下面以图1所示的电子设备100为手机为例,具体阐述本申请实施例提供的技术方案。In view of the above problems, an embodiment of the present application provides a method for displaying video thumbnails. The video thumbnail display method provided by the embodiment of the present application can be applied to the electronic device 100 shown in FIG. 1 . The following takes the electronic device 100 shown in FIG. 1 as a mobile phone as an example to specifically describe the technical solution provided by the embodiment of the present application. .
请参见图3,手机100响应于用户的亮屏操作,点亮显示屏,并在显示屏上呈现如图3所示的界面300。在界面300中,用户可以点击界面300上呈现的各个应用的图标,手机则响应于用户对图标的点击操作,开启对应的应用。Referring to FIG. 3 , the mobile phone 100 turns on the display screen in response to the user's screen-on operation, and presents an interface 300 as shown in FIG. 3 on the display screen. In the interface 300, the user can click the icons of various applications presented on the interface 300, and the mobile phone responds to the user's click operation on the icons to start the corresponding application.
示例性的,手机可以响应于用户对相机应用的图标301的点击操作,开启相机应用。相机应用开启后,相机应用可以响应用户对相机应用的模式切换控件的操作,切换至电影模式,然后在电影模式下,响应用户开始录制视频的操作,开始录制电影视频。相机应用开始录制电影视频一段时间后,相机应用响应用户停止录制视频的操作,停止录制电影视频,至此,相机应用完成一个电影视频的录制,录制好的电影视频可以按视频文件的形式存储在手机100的内部存储器。Exemplarily, the mobile phone may start the camera application in response to the user's click operation on the icon 301 of the camera application. After the camera application is started, the camera application can switch to the movie mode in response to the user's operation on the mode switching control of the camera application, and then start recording the movie video in response to the user's operation of starting video recording in the movie mode. After the camera app starts recording a movie video for a period of time, the camera app responds to the user's operation to stop recording the video and stops recording the movie video. At this point, the camera app completes the recording of a movie video, and the recorded movie video can be stored on the phone in the form of a video file 100's of internal memory.
进一步的,用户可以点击界面300中图库应用对应的图标302,手机响应于用户对图标302的点击操作,开启图库应用,随后图库应用在手机的显示屏上呈现图3所示的界面303。Furthermore, the user can click the icon 302 corresponding to the gallery application in the interface 300, and the mobile phone responds to the user's click operation on the icon 302 to start the gallery application, and then the gallery application presents the interface 303 shown in FIG. 3 on the display screen of the mobile phone.
界面303中呈现有图库包含的多个相册,例如“相机”,“所有照片”,“视频”,“截屏录屏”和“我的电影”。其中,“我的电影”为电影相册,电影相册包含一个或多个电影视频。 Interface 303 presents a plurality of photo albums contained in the gallery, such as "camera", "all photos", "video", "screen capture" and "my movie". Wherein, "My Movie" is a movie album, and the movie album includes one or more movie videos.
在一些可能的实施例中,电影相册中所包含的电影视频,可以包括手机100拍摄得到的电影视频,以及除手机100以外的其他手机拍摄并通过服务器共享给手机100的电影视频。In some possible embodiments, the movie videos contained in the movie album may include movie videos captured by the mobile phone 100, and movie videos captured by other mobile phones except the mobile phone 100 and shared with the mobile phone 100 through the server.
在一些可能的实施例中,图库应用可以响应于用户新建相册的操作,建立更多的相册。本申请实施例对图库中建立的相册的种类和数量不做限定。In some possible embodiments, the gallery application may create more photo albums in response to the user's operation of creating a new photo album. The embodiment of the present application does not limit the type and quantity of albums created in the gallery.
示例性的,图库应用可以响应于用户新建电影相册的操作,新建一个和“我的电影”相册不同的电影相册“电影相册1”。Exemplarily, the gallery application may create a movie album "Movie Album 1" different from the "My Movies" album in response to the user's operation of creating a new movie album.
图库呈现界面303后,用户可以点击其中的任意一个相册,图库响应用户对任意一个相册的点击操作,在显示屏上显示相册包括的视频或图片。After the gallery presents the interface 303, the user can click any one of the photo albums, and the gallery responds to the user's click operation on any photo album, and displays the videos or pictures included in the photo album on the display screen.
示例性的,图库可以响应用户对“我的电影”相册的点击操作,在显示屏上呈现电影视频浏览界面,在电影视频浏览界面中以电影视频的缩略图的形式,显示“我的电影”包含的电影视频。电影视频浏览界面,是指,用于展示电影视频的视频浏览界面。Exemplarily, the gallery can respond to the user's click operation on the "My Movies" album, presenting a movie and video browsing interface on the display screen, and displaying "My Movies" in the form of movie video thumbnails in the movie and video browsing interface Movie video included. The movie video browsing interface refers to a video browsing interface for displaying movie videos.
电影视频的缩略图,一般可以由电影视频中的一帧图像经过处理得到。处理方式可以包括缩放,裁剪等。在一些可能的实施例中,用于生成缩略图的图像,可以是电影视频中的第一帧图像,即位于电影视频0时刻的一帧图像,也可以是电影视频的前几帧图像中,图像质量最优的一帧图像,图像质量可以基于图像的亮度,清晰度等参数来判断,例如,图像的清晰度越高,则认为图像的质量越好。The thumbnail of the movie video can generally be obtained by processing a frame of image in the movie video. Processing methods can include scaling, cropping, etc. In some possible embodiments, the image used to generate the thumbnail may be the first frame image in the movie video, that is, a frame image at time 0 of the movie video, or the first few frames of the movie video image, A frame of image with the best image quality, the image quality can be judged based on parameters such as image brightness and definition, for example, the higher the image definition is, the better the image quality is.
在呈现电影视频浏览界面之前,图库首先判断手机当前的方向。Before presenting the movie and video browsing interface, the gallery first determines the current orientation of the mobile phone.
若手机当前的方向为竖屏方向,图库按预设的竖屏规则将电影视频划分为若干行,每一行对应1至3个电影视频,同时,每划分出一行,图库根据竖屏规则,以及这一行对应的电影视频的个数、方向和视频尺寸,确定这一行中各个电影视频对应的显示尺寸,然后按各个电影视频对应的显示尺寸,显示这一行对应的每个电影视频对应的缩略图。If the current orientation of the mobile phone is the vertical screen orientation, the gallery divides the movie video into several rows according to the preset vertical screen rules, and each row corresponds to 1 to 3 movie videos. The number, direction and video size of the movie videos corresponding to this row, determine the corresponding display size of each movie video in this row, and then display the thumbnail corresponding to each movie video corresponding to this row according to the display size corresponding to each movie video .
视频尺寸,是指拍摄得到的电影视频中图像帧的尺寸,视频尺寸包括视频宽度和视频长度,视频宽度,即视频中图像帧的宽度,视频高度,即视频中图像帧的高度。一般视频尺寸和拍摄该视频的电子设备的显示屏一致。The video size refers to the size of the image frame in the filmed video. The video size includes the video width and video length. The video width refers to the width of the image frame in the video, and the video height refers to the height of the image frame in the video. Generally, the size of the video is consistent with the display screen of the electronic device that shoots the video.
示例性的,若使用显示屏宽1080像素,高1920像素的电子设备在竖屏方向下拍摄视频,则该视频的视频尺寸可以是宽1080像素,高1920像素。若使用显示屏宽1080像素,高1920像素的电子设备在横屏方向下拍摄视频,则该视频的视频尺寸可以是宽1920像素,高1080像素。Exemplarily, if an electronic device with a display screen width of 1080 pixels and a height of 1920 pixels is used to shoot a video in a portrait orientation, the video size of the video may be 1080 pixels in width and 1920 pixels in height. If an electronic device with a display screen width of 1080 pixels and a height of 1920 pixels is used to shoot a video in landscape orientation, the video size of the video can be 1920 pixels in width and 1080 pixels in height.
显示尺寸,是指在显示屏上以缩略图的形式显示电影视频时,缩略图的尺寸,显示尺寸可以包括显示高度和显示宽度,具体的,显示高度为缩略图在竖直方向的尺寸,显示宽度为缩略图在水平方向的尺寸。显示宽度除以显示高度得到的比值,记为显示宽高比。The display size refers to the size of the thumbnail when the movie video is displayed in the form of a thumbnail on the display screen. The display size may include a display height and a display width. Specifically, the display height is the vertical size of the thumbnail, and the display The width is the horizontal dimension of the thumbnail. The ratio obtained by dividing the display width by the display height is recorded as the display aspect ratio.
在本申请实施例中,位于同一行的各个电影视频的显示高度一致,显示宽度则根据显示高度和各个电影视频的视频宽高比确定。电影视频的视频宽高比,是指,电影视频的视频宽度除以视频高度得到的比值。In the embodiment of the present application, the display heights of the movie videos in the same row are the same, and the display width is determined according to the display height and the video aspect ratio of each movie video. The video aspect ratio of a movie video refers to the ratio obtained by dividing the video width of a movie video by the video height.
图库根据竖屏规则将电影视频分行时,可能产生多种分行结果,每一种分行结果对应的缩略图的显示方式可以参见图4。其中,图4b可以理解为图库响应于用户在图4a上的上滑操作而呈现的界面。When the gallery divides the movie video according to the vertical screen rules, it may produce multiple branch results, and the display mode of the thumbnail corresponding to each branch result can be seen in Figure 4. Wherein, FIG. 4b can be understood as an interface presented by the gallery in response to the user's upward sliding operation on FIG. 4a.
需要说明的是,图4,以及图6至图8中的矩形框表示电影视频对应的缩略图,图4,以及图6至图8中表示电影视频的缩略图的方框内标注的宽高比,为显示屏上显示的缩略图的宽高比,即缩略图的宽度除以缩略图的高度得到的比值。It should be noted that the rectangular boxes in Fig. 4 and Fig. 6 to Fig. 8 represent the thumbnails corresponding to the movie videos, and Fig. 4 and Fig. 6 to Fig. 8 represent the width and height marked in the boxes of the thumbnails of the movie videos Ratio is the aspect ratio of the thumbnail displayed on the display screen, that is, the ratio obtained by dividing the width of the thumbnail by the height of the thumbnail.
在一些可选的实施例中,电子设备在显示电影视频的缩略图时,可以显示图4,图6至图8所示的缩略图的宽高比,也可以不显示缩略图的宽高比。In some optional embodiments, when the electronic device displays the thumbnail of the movie video, it may display the aspect ratio of the thumbnail shown in Figure 4, Figure 6 to Figure 8, or may not display the aspect ratio of the thumbnail .
X1表示将一个竖屏方向电影视频的缩略图和一个横屏方向电影视频的缩略图在同一行显示时的显示方式,这一行的电影视频的缩略图的显示方式可以参见图4a,其中电影1为竖屏方向的电影视频,电影2为横屏方向的电影视频。电影1下方的01:00表示电影1的时长为1分钟,电影1所在的矩形框表示电影1的缩略图,后续的示意图中各元素的含义类似,不再赘述。X1 represents the display mode when displaying a thumbnail of a movie video in a portrait orientation and a thumbnail of a movie video in a landscape orientation on the same line. The display mode of the thumbnails of a movie video in this row can be referred to in Figure 4a, where Movie 1 Movie 2 is a movie video in portrait orientation, and Movie 2 is a movie video in landscape orientation. 01:00 below Movie 1 indicates that the duration of Movie 1 is 1 minute, and the rectangular frame where Movie 1 is located indicates the thumbnail of Movie 1. The meanings of the elements in the subsequent schematic diagrams are similar and will not be repeated here.
显示方式X1中,电影1和电影2的显示高度均为Hx1,Hx1按下述公式计算:In display mode X1, the display heights of Movie 1 and Movie 2 are both Hx1, and Hx1 is calculated according to the following formula:
Hx1=A×AlphaHx1=A×Alpha
本申请实施例涉及的高度和宽度,均可以用像素的数量表示。例如,电影视频的显示高度为100,表示显示出的电影视频的缩略图高度为100个像素。Both the height and the width involved in the embodiment of the present application may be represented by the number of pixels. For example, if the display height of the movie video is 100, it means that the height of the displayed thumbnail of the movie video is 100 pixels.
在一些可选的实施例中,高度和宽度也可以用其他厘米,毫米等单位表示,本申请实施例对尺寸的单位不做限定。In some optional embodiments, the height and width may also be represented by other units such as centimeters and millimeters, and the embodiment of the present application does not limit the units of size.
上述公式中,A为预先设定的视频显示区域的宽度,当图库使用电子设备的整个显示屏来显示电影视频时,A可以等于电子设备的显示屏的宽度,当图库只能在显示屏上一个具有一定尺寸的窗口内显示电影视频时,A可以等于这个窗口的宽度。In the above formula, A is the width of the preset video display area. When the gallery uses the entire display screen of the electronic device to display the movie video, A can be equal to the width of the display screen of the electronic device. When the gallery can only be displayed on the display screen When a movie video is displayed in a window with a certain size, A can be equal to the width of the window.
Alpha为预先设定的参考系数,该参考系数可以由电子设备的厂商或者用户设定。示例性的,Alpha可以设定为9/16。Alpha is a preset reference coefficient, and the reference coefficient can be set by the manufacturer or user of the electronic device. Exemplarily, Alpha can be set to 9/16.
竖屏方向的电影1的显示宽度W1s按下述公式计算:The display width W1s of Movie 1 in portrait orientation is calculated according to the following formula:
W1s=Hx1×(W1÷H1)W1s=Hx1×(W1÷H1)
上述公式中,W1表示电影1的视频宽度,H1表示电影1的视频高度。In the above formula, W1 represents the video width of Movie 1, and H1 represents the video height of Movie 1.
横屏方向的电影2的显示宽度W2s按如下公式计算:The display width W2s of Movie 2 in landscape orientation is calculated according to the following formula:
W2s=min(Wmax,Hx1×(W2÷H2))W2s=min(Wmax, Hx1×(W2÷H2))
其中W2为电影2的视频宽度,H2为电影2的视频高度,Wmax表示电影2的显示宽度上限,Wmax的计算公式如下:Among them, W2 is the video width of movie 2, H2 is the video height of movie 2, and Wmax indicates the upper limit of the display width of movie 2. The calculation formula of Wmax is as follows:
Wmax=A-N-W1sWmax=A-N-W1s
上述公式中,N表示预设的视频布局间隔,在电影视频浏览界面中,上下相邻的两个缩略图之间的垂直间隔,以及左右相邻的两个缩略图之间的水平间隔均可以设定为N。视频布局间隔的单位可以和本申请实施例中宽度和高度的单位一致。In the above formula, N represents the preset video layout interval. In the movie video browsing interface, the vertical interval between the two adjacent thumbnails up and down, and the horizontal interval between the two adjacent thumbnails on the left and right can be Set to N. The unit of the video layout interval may be consistent with the unit of width and height in the embodiment of the present application.
在显示方式X1中,受视频显示区域的宽度的限制,横屏方向的视频(例如图4所示得到电影2)的显示宽高比可能和视频本身的视频宽高比不一致,以图4a为例,电影2的显示宽高比为16:9,而电影2的视频宽高比为21:9。In display mode X1, due to the limitation of the width of the video display area, the display aspect ratio of the video in landscape orientation (for example, Movie 2 as shown in Figure 4) may be inconsistent with the video aspect ratio of the video itself, as shown in Figure 4a For example, Movie 2 has a display aspect ratio of 16:9 and Movie 2 has a video aspect ratio of 21:9.
当电影2的显示高度和电影2的视频宽高比的乘积小于或等于电影2的显示宽度上限时,电影2的显示宽度等于该乘积,此时,电影2的显示宽高比等和电影2的视频宽高比一致。显示宽高比,是指电影视频的显示宽度除以显示高度得到的比值。When the product of the display height of Movie 2 and the video aspect ratio of Movie 2 is less than or equal to the upper limit of the display width of Movie 2, the display width of Movie 2 is equal to the product. At this time, the display aspect ratio of Movie 2 and Movie 2 consistent video aspect ratio. The display aspect ratio refers to the ratio obtained by dividing the display width of the movie video by the display height.
当电影2的显示高度和电影2的视频宽高比的乘积大于电影2的显示宽度上限时,电影2的显示宽度等于显示宽度上限,此时,电影2的显示宽高比小于电影2的视频宽高比。When the product of the display height of Movie 2 and the video aspect ratio of Movie 2 is greater than the upper limit of the display width of Movie 2, the display width of Movie 2 is equal to the upper limit of the display width. At this time, the display aspect ratio of Movie 2 is smaller than the video of Movie 2 aspect ratio.
若电影2的显示宽高比小于电影2的视频宽高比,则图库显示电影2时,首先可以获 取电影2中用于产生缩略图的一帧图像,将这一帧图像按电影2的视频宽高比缩小,从而获得高度和电影2的显示高度一致的缩小后图像,此时,缩小后图像的宽度大于电影2的显示宽度。然后图库沿宽度方向对缩小后图像进行裁剪,获得宽度等于电影2的显示宽度的裁剪图像,这个裁剪图像就是电影2的缩略图。If the display aspect ratio of movie 2 is smaller than the video aspect ratio of movie 2, when movie 2 is displayed in the gallery, a frame of image used to generate a thumbnail in movie 2 can be obtained first, and this frame of image is pressed according to the video of movie 2 The aspect ratio is reduced to obtain a reduced image whose height is consistent with the display height of Movie 2. At this time, the width of the reduced image is greater than the display width of Movie 2. Then the gallery crops the reduced image along the width direction to obtain a cropped image with a width equal to the display width of Movie 2, and this cropped image is the thumbnail of Movie 2.
在一些可能的实施例中,图库可以按居中裁剪的方式对缩小后图像进行裁剪,或者也可以按其他方式进行裁剪,本申请实施例对裁剪的方式不做限定。In some possible embodiments, the gallery may crop the reduced image in a center cropping manner, or in other ways, and the embodiment of the present application does not limit the cropping manner.
X2表示将两个竖屏方向的电影视频的缩略图在同一行显示时的显示方式,请参见界面4a,电影3和电影4均为竖屏方向的电影视频。X2 represents the display mode when displaying the thumbnails of two vertically oriented movie videos in the same row, please refer to interface 4a, where Movie 3 and Movie 4 are both vertically oriented movie videos.
显示方式X2中,电影3和电影4的显示高度均为Hx2,计算Hx2时,根据同一行的两个竖屏方向的视频的视频宽高比选择下述公式(1)和公式(2)中的一个进行计算。In display mode X2, the display heights of Movie 3 and Movie 4 are both Hx2. When calculating Hx2, select the following formula (1) and formula (2) according to the video aspect ratio of the two vertical screen orientation videos in the same row. one of the calculations.
若两个电影视频的视频宽高比均小于前述参考系数Alpha,则按公式(1)计算:If the video aspect ratios of the two movie videos are all less than the aforementioned reference coefficient Alpha, then calculate according to formula (1):
(1)Hx2=(A-N)÷2÷Alpha(1) Hx2=(A-N)÷2÷Alpha
若两个电影视频中,至少一个电影视频的视频宽高比大于或等于前述参考系数Alpha,则按公式(2)计算:If the video aspect ratio of at least one of the two movie videos is greater than or equal to the aforementioned reference coefficient Alpha, then calculate according to formula (2):
(2)Hx2=(A-N)÷(W3÷H3+W4÷H4)(2) Hx2=(A-N)÷(W3÷H3+W4÷H4)
其中,W3表示电影3的视频宽度,H3表示电影3的视频高度,W4表示电影视频4的视频宽度,H4表示电影4的视频高度。Wherein, W3 represents the video width of Movie 3, H3 represents the video height of Movie 3, W4 represents the video width of Movie 4, and H4 represents the video height of Movie 4.
电影3的显示宽度W3s按如下公式计算:The display width W3s of movie 3 is calculated according to the following formula:
W3s=Hx2×(W3÷H3)W3s=Hx2×(W3÷H3)
电影4的显示宽度W4s按如下公式计算:The display width W4s of movie 4 is calculated according to the following formula:
W4s=Hx2×(W3÷H3)W4s=Hx2×(W3÷H3)
X3表示将一个横屏方向的电影视频的缩略图在一行单独显示的显示方式,请参见界面4a,电影5为横屏方向的电影视频。X3 represents a display mode in which thumbnails of a movie video in a landscape orientation are displayed in a single row, please refer to interface 4a, and movie 5 is a movie video in a landscape orientation.
显示方式X3中,电影5的显示高度记为Hx3,Hx3按如下公式计算得到:In display mode X3, the display height of movie 5 is recorded as Hx3, and Hx3 is calculated according to the following formula:
Hx3=A÷(W5÷H5)Hx3=A÷(W5÷H5)
其中W5表示电影5的视频宽度,H5表示电影5的视频高度。Where W5 represents the video width of Movie 5, and H5 represents the video height of Movie 5.
电影5的显示宽度可以和显示区域的宽度A一致。The display width of the movie 5 may be consistent with the width A of the display area.
X4表示将三个竖屏方向的电影视频的缩略图在同一行显示的显示方式,请参见界面4a,电影6,电影7和电影8均为竖屏方向的电影视频。X4 represents the display method of displaying the thumbnails of three vertically oriented movie videos in the same row, please refer to interface 4a, where movie 6, movie 7 and movie 8 are all vertically oriented movie videos.
显示方式X4中,电影6,电影7和电影8的显示高度均为Hx4,Hx4按如下公式计算得到:In display mode X4, the display heights of Movie 6, Movie 7 and Movie 8 are all Hx4, and Hx4 is calculated according to the following formula:
Figure PCTCN2022093046-appb-000001
Figure PCTCN2022093046-appb-000001
电影6的显示宽度W6s按如下公式计算得到:The display width W6s of movie 6 is calculated according to the following formula:
W6s=Hx4×(W6÷H6)W6s=Hx4×(W6÷H6)
和电影6类似,电影7的显示宽度等于电影7的显示高度和电影7的视频宽高比的乘积,电影8的显示宽度,等于电影8的显示高度和电影8的视频宽高比的乘积。Similar to Movie 6, the display width of Movie 7 is equal to the product of the display height of Movie 7 and the video aspect ratio of Movie 7, and the display width of Movie 8 is equal to the product of the display height of Movie 8 and the video aspect ratio of Movie 8.
X5表示将一个竖屏方向的电影视频的缩略图在一行单独显示的显示方式,请参见界面 4b,电影9为竖屏方向的电影视频。X5 represents the display method of displaying the thumbnails of a movie video in a vertical screen orientation in a single line, please refer to interface 4b, and Movie 9 is a movie video in a vertical screen orientation.
显示方式X5中,电影9的显示宽度W9s按如下公式计算:In the display mode X5, the display width W9s of the movie 9 is calculated according to the following formula:
W9s=(A-N)÷2W9s=(A-N)÷2
电影9的显示高度H9s按如下公式计算:The display height H9s of movie 9 is calculated according to the following formula:
H9s=W9s÷(W9÷H9)H9s=W9s÷(W9÷H9)
其中,W9表示电影9的视频宽度,H9表示电影9的视频高度。Among them, W9 represents the video width of Movie 9, and H9 represents the video height of Movie 9.
根据上述显示方式X1至X5中电影视频的显示尺寸的计算公式可以看出,按竖屏规则确定的显示方式中,竖屏方向的电影视频的显示宽高比,与电影视频的视频宽高比一致,因此按竖屏规则确定的显示方式中显示竖屏方向的电影视频时,只需要在电影视频中选取用于产生缩略图的一帧图像,然后将选取的这一帧图像按视频宽高比缩放至对应的显示宽度、显示高度即可,不需要进行裁剪,因此,在按竖屏规则确定的显示方式中,图库可以完整的显示竖屏方向的电影视频中的一帧图像。According to the calculation formulas for the display sizes of movie videos in the above display modes X1 to X5, it can be seen that in the display modes determined according to the vertical screen rules, the display aspect ratio of the movie video in the vertical screen direction is different from the video aspect ratio of the movie video. Therefore, when displaying a movie video in vertical screen orientation in the display mode determined by the vertical screen rules, it is only necessary to select a frame of image used to generate a thumbnail in the movie video, and then select this frame of image according to the width and height of the video It only needs to be zoomed to the corresponding display width and display height without cropping. Therefore, in the display mode determined according to the vertical screen rules, the gallery can completely display a frame of image in the movie video in the vertical screen orientation.
需要说明的是,图4所示的显示方式是本申请一种可选的实施例所提供的例子,在另一些可选的实施例中,电子设备在处于竖屏方向时,还可以采用其他方式显示,而不限于图4所示的几种方式。示例性的,电子设备在处于竖屏方向时,也可以基于其他显示方式,在一行中显示4个或更多个电影视频的缩略图。It should be noted that the display mode shown in FIG. 4 is an example provided by an optional embodiment of the present application. In other optional embodiments, when the electronic device is in a portrait orientation, other Ways to display, not limited to several ways shown in Figure 4. Exemplarily, when the electronic device is in a portrait orientation, it may also display 4 or more movie video thumbnails in a row based on other display manners.
在一些可能的实施例中,图库可以在电影视频浏览界面呈现手机本地存储的电影视频和服务器存储的电影视频,也可以在电影视频浏览界面仅呈现手机本地存储的电影视频,还可以在电影视频浏览界面中仅呈现服务器存储的电影视频。In some possible embodiments, the gallery can display the movie videos stored locally on the mobile phone and the movie videos stored on the server on the movie video browsing interface, or only the movie videos stored locally on the mobile phone can be displayed on the movie video browsing interface, or the Only the movie videos stored on the server are presented in the browsing interface.
请参见图5,图库在打开电影视频浏览界面时,可以默认在电影视频浏览界面以缩略图的形式呈现手机本地存储的电影视频和服务器存储的电影视频,此时的电影视频浏览界面如图5的界面501所示,控件505的选项为“所有”。Please refer to Figure 5. When the library opens the movie and video browsing interface, the movie videos stored locally on the mobile phone and the movie videos stored on the server can be displayed in the form of thumbnails by default on the movie and video browsing interface. The movie and video browsing interface at this time is shown in Figure 5 As shown in the interface 501 of the control 505, the option of the control 505 is "all".
在界面501中,用户可以点击控件505。请参见界面502,用户点击控件505后,电子设备显示菜单506,在菜单506中,用户可以通过点击“所有”,“云端”和“本地”等字样,将控件505切换至对应的选项。In interface 501 , a user may click on control 505 . Please refer to the interface 502. After the user clicks the control 505, the electronic device displays a menu 506. In the menu 506, the user can switch the control 505 to the corresponding option by clicking the words "all", "cloud" and "local".
用户可以通过切换控件505的选项,使得图库在电影视频浏览界面手机本地存储的电影视频或服务器存储的电影视频。The user can switch the option of the control 505 to make the movie video stored locally on the mobile phone or the movie video stored on the server in the movie video browsing interface in the gallery.
示例性的,用户可以将控件505切换为“云端”的选项,此时图库在电影视频浏览界面中,仅呈现存储在服务器的电影视频。请参见图5中界面503,控件505切换为“云端”的选项后,电影视频浏览界面仅显示存储在服务器的电影视频电影2和电影3的缩略图。Exemplarily, the user can switch the control 505 to the "cloud" option, and at this time, the gallery only presents the movie videos stored on the server in the movie video browsing interface. Please refer to the interface 503 in FIG. 5 , after the control 505 is switched to the "cloud" option, the movie video browsing interface only displays the thumbnails of movie 2 and movie 3 stored in the server.
示例性的,用户可以将控件505切换为“本地”的选项,此时图库在电影视频浏览界面中,仅呈现存储在手机本地的电影视频。请参见图5中界面504,控件505切换为“本地”的选项后,电影视频浏览界面仅显示存储在服务器的电影视频电影1,电影4和电影5的缩略图。Exemplarily, the user can switch the control 505 to the "local" option, and at this time, the gallery only presents the movies and videos stored locally on the mobile phone in the movie and video browsing interface. Please refer to the interface 504 in FIG. 5 , after the control 505 is switched to the "local" option, the movie video browsing interface only displays the thumbnails of movie 1, movie 4 and movie 5 stored on the server.
在一些可能的实施例中,手机处于竖屏方向时,每次电影视频浏览界面所要呈现的电影视频发生变更时,图库重新根据竖屏规则将要呈现的电影视频分行,并重新确定每一行对应的电影视频的显示尺寸,然后根据新确定的分行方式和显示尺寸显示每个电影视频的缩略图。In some possible embodiments, when the mobile phone is in a vertical screen orientation, every time the movie video to be presented on the movie video browsing interface changes, the gallery will redefine the movie video branches to be presented according to the vertical screen rules, and re-determine the corresponding row of each row. The display size of the movie video, and then display the thumbnail of each movie video according to the newly determined row mode and display size.
以图5为例,在界面501中,图库要呈现的电影视频包括手机本地和服务器存储的电影1至电影5,此时,电影1的缩略图和电影2的缩略图显示在同一行,电影3和电影4的缩略图显示在同一行,电影5的缩略图单独显示在一行。Taking Figure 5 as an example, in the interface 501, the movie videos to be presented in the gallery include movies 1 to 5 stored locally on the mobile phone and in the server. At this time, the thumbnails of movie 1 and movie 2 are displayed on the same line, and the movies The thumbnails for Movie 3 and Movie 4 are displayed on the same row, and the thumbnails for Movie 5 are displayed on a separate row.
当控件505的选项被切换为云端时,如界面503所示,图库需要呈现的电影视频包括电影2和电影3,此时电影2的缩略图单独显示在一行,电影3的缩略图单独显示在一行,并且电影2和电影3的缩略图的尺寸均相对于界面501中缩略图的尺寸增大。When the option of control 505 is switched to cloud, as shown in interface 503, the movie videos to be presented in the gallery include Movie 2 and Movie 3. At this time, the thumbnails of Movie 2 are displayed on a single row, and the thumbnails of Movie 3 are displayed separately on One line, and the sizes of the thumbnails of Movie 2 and Movie 3 are both increased relative to the size of the thumbnails in interface 501 .
当控件505的选项被切换为本地时,如界面504所示,图库需要呈现的电影视频包括电影1,电影4和电影5,此时电影1和电影4的缩略图显示在同一行,电影5的缩略图单独显示在一行,其中电影1的缩略图的尺寸相对于界面501中缩略图的尺寸增大。When the option of the control 505 is switched to local, as shown in the interface 504, the movie videos to be presented in the gallery include Movie 1, Movie 4 and Movie 5. At this time, the thumbnails of Movie 1 and Movie 4 are displayed on the same row, and Movie 5 The thumbnails of are displayed on a single row, wherein the size of the thumbnail of Movie 1 is increased relative to the size of the thumbnails in the interface 501 .
若手机当前的方向为横屏方向,图库按预设的横屏规则将电影视频划分为若干行,每一行对应1至3个电影视频,同时,每划分出一行,图库根据横屏规则,以及这一行对应的电影视频的个数、方向和视频尺寸,确定这一行中各个电影视频对应的显示尺寸,然后按各个电影视频对应的显示尺寸,显示这一行对应的每个电影视频对应的缩略图。If the current orientation of the mobile phone is landscape orientation, the gallery divides the movie video into several rows according to the preset horizontal screen rules, and each row corresponds to 1 to 3 movie videos. The number, direction and video size of the movie videos corresponding to this row, determine the corresponding display size of each movie video in this row, and then display the thumbnail corresponding to each movie video corresponding to this row according to the display size corresponding to each movie video .
图库根据横屏规则将电影视频分行之后,可能产生多种分行结果,在同一行上显示这一行的电影视频的缩略图,各个分行结果对应的缩略图的显示方式请参见图6至图8。After the gallery divides the movie videos into rows according to the horizontal screen rules, it may generate multiple branch results. The thumbnails of the movie videos in this row are displayed on the same row. For the display methods of the thumbnails corresponding to the results of each branch, please refer to Figure 6 to Figure 8.
需要说明的是,在图6至图8所示的横屏的显示方式中,由于显示屏横向放置,显示区域的宽度A可以等于电子设备的显示屏的高度。It should be noted that, in the horizontal screen display modes shown in FIGS. 6 to 8 , since the display screen is placed horizontally, the width A of the display area may be equal to the height of the display screen of the electronic device.
请参见图6a,Y1表示将三个横屏方向的电影视频的缩略图在同一行显示的显示方式,电影1至电影3均为横屏方向的电影视频。Please refer to FIG. 6 a , Y1 represents a display mode of displaying thumbnails of three movie videos in landscape orientation in the same row, and movies 1 to 3 are movie videos in landscape orientation.
显示方式Y1中,电影1至电影3的显示高度均为Hy1,Hy1按下述公式计算:In display mode Y1, the display heights of movies 1 to 3 are Hy1, and Hy1 is calculated according to the following formula:
Figure PCTCN2022093046-appb-000002
Figure PCTCN2022093046-appb-000002
电影1的显示宽度等于电影1的显示高度Hy1和电影1的视频宽高比的乘积,同理,电影2和电影3的显示宽度分别等于Hy1和对应的视频宽高比的乘积。The display width of Movie 1 is equal to the product of the display height Hy1 of Movie 1 and the video aspect ratio of Movie 1. Similarly, the display widths of Movie 2 and Movie 3 are respectively equal to the product of Hy1 and the corresponding video aspect ratio.
请参见图6a,Y2表示将二个横屏方向的电影视频的缩略图在同一行显示的显示方式,电影4和电影5均为横屏方向的电影视频。Please refer to FIG. 6 a , Y2 represents the display mode of displaying the thumbnails of two movie videos in landscape orientation in the same row, and Movie 4 and Movie 5 are both movie videos in landscape orientation.
显示方式Y2中,电影4和电影5的显示高度均为Hy2,Hy2按下述公式计算:In display mode Y2, the display heights of movie 4 and movie 5 are both Hy2, and Hy2 is calculated according to the following formula:
Figure PCTCN2022093046-appb-000003
Figure PCTCN2022093046-appb-000003
和前述显示方式Y1中电影1的显示宽度相同,电影4和电影5的显示宽度分别等于显示高度Hy2和对应的视频宽高比的乘积。Same as the display width of Movie 1 in the aforementioned display mode Y1, the display widths of Movie 4 and Movie 5 are respectively equal to the product of the display height Hy2 and the corresponding video aspect ratio.
请参见图6b,Y3表示将三个竖屏方向的电影视频的缩略图在同一行显示的显示方式,电影6至电影8均为竖屏方向的电影视频。Please refer to FIG. 6 b , Y3 represents the display mode of displaying the thumbnails of three movie videos in the vertical screen orientation in the same row, and movies 6 to 8 are all movie videos in the vertical screen orientation.
显示方式Y3中,电影6至电影8的显示高度均为Hy3,Hy3按下述公式计算:In the display mode Y3, the display heights of movies 6 to 8 are Hy3, and Hy3 is calculated according to the following formula:
Hy3=(A-2×N)÷3Hy3=(A-2×N)÷3
电影6至电影8的显示宽度,均等于自身的显示高度。The display widths of Movie 6 to Movie 8 are all equal to their own display heights.
图7所示的Y4-1,Y4-2和Y4-3均表示将一个横屏方向的电影视频的缩略图和两个竖 屏方向的电影视频的缩略图在同一行显示的显示方式。Y4-1 shown in Fig. 7, Y4-2 and Y4-3 all represent the display mode that the thumbnail of a movie video in landscape direction and the thumbnail of two movie videos in vertical screen direction are displayed in the same row.
其中,请参见图7a,Y4-1并且横屏方向电影视频的缩略图呈现在这一行的左侧,两个竖屏方向电影视频的缩略图呈现在右侧时的显示方式,电影9为横屏方向的视频,电影10和电影11为竖屏方向的电影视频。Among them, please refer to Figure 7a, Y4-1 and the thumbnail of the movie video in the horizontal screen direction is displayed on the left side of this line, and the thumbnail images of the two vertical screen direction movie videos are displayed on the right side, and the movie 9 is horizontal Screen orientation videos, Movie 10 and Movie 11 are movie videos in portrait orientation.
请参见图7b,Y4-2表示横屏方向电影视频的缩略图呈现在这一行的右侧,两个竖屏方向电影视频的缩略图呈现在左侧时的显示方式,电影14为横屏方向的视频,电影12和电影13为竖屏方向的电影视频。Please refer to Figure 7b, Y4-2 indicates the display mode when the thumbnail of the movie video in landscape orientation is presented on the right side of the row, and the thumbnails of two movie videos in portrait orientation are presented on the left, and Movie 14 is in landscape orientation The videos, Movie 12 and Movie 13 are movie videos in portrait orientation.
请参见图7c,Y4-3表示横屏方向电影视频的缩略图呈现在这一行的中间,两个竖屏方向电影视频的缩略图分别呈现在横屏方向电影视频的缩略图两侧时的显示方式,电影16为横屏方向的视频,电影15和电影17为竖屏方向的电影视频。Please refer to Figure 7c, Y4-3 indicates that the thumbnail of the movie video in the horizontal screen direction is displayed in the middle of the row, and the thumbnails of the two movie videos in the vertical screen direction are displayed on both sides of the thumbnail image of the movie video in the horizontal screen direction. In this way, movie 16 is a video in landscape orientation, and movie 15 and movie 17 are movie videos in vertical orientation.
Y4-1,Y4-2和Y4-3三种显示方式中,电影视频的显示宽度和显示高度的计算方式一致,将Y4-1,Y4-2和Y4-3三种显示方式对应的显示高度记为Hy4。In the three display modes of Y4-1, Y4-2 and Y4-3, the calculation method of the display width and display height of the movie video is the same, and the display height corresponding to the three display modes of Y4-1, Y4-2 and Y4-3 Denote as Hy4.
以显示方式Y4-1为例,Hy4的计算公式如下:Taking the display mode Y4-1 as an example, the calculation formula of Hy4 is as follows:
Figure PCTCN2022093046-appb-000004
Figure PCTCN2022093046-appb-000004
其中,W9和H9分别表示电影9的视频宽度和视频高度,W10和H10分别表示电影10的视频宽度和视频高度,W11和H11分别表示电影11的视频宽度和视频高度。Wherein, W9 and H9 represent the video width and video height of movie 9 respectively, W10 and H10 represent the video width and video height of movie 10 respectively, W11 and H11 represent the video width and video height of movie 11 respectively.
在显示方式Y4-2和Y4-3中,显示高度Hy4可以沿用上述公式计算,只需要将其中的视频宽高比对应的替换为同一行的三个电影视频的视频宽高比即可。In the display modes Y4-2 and Y4-3, the display height Hy4 can be calculated using the above formula, and only need to replace the corresponding video aspect ratios with the video aspect ratios of the three movie videos in the same row.
Y4-1,Y4-2和Y4-3三种显示方式均包括位于同一行的两个竖屏方向的电影视频和一个横屏方向的电影视频。在这三种显示方式中,同一行的三个电影视频的显示宽度计算方式一致,均等于显示高度Hy4和对应的电影视频的视频宽高比的乘积。The three display modes of Y4-1, Y4-2 and Y4-3 all include two movie videos in vertical screen orientation and one movie video in horizontal screen orientation located in the same row. In these three display modes, the display widths of the three movie videos in the same row are calculated in the same manner, which is equal to the product of the display height Hy4 and the video aspect ratio of the corresponding movie video.
以显示方式Y4-1为例,电影9的显示宽度,等于电影9的显示高度Hy4和电影9的视频宽高比的乘积,电影10的显示宽度,等于电影10的显示高度Hy4和电影10的视频宽高比的乘积,电影11的显示宽度,等于电影11的显示高度Hy4和电影11的视频宽高比的乘积。Taking the display mode Y4-1 as an example, the display width of movie 9 is equal to the product of the display height Hy4 of movie 9 and the video aspect ratio of movie 9, and the display width of movie 10 is equal to the display height Hy4 of movie 10 and the video aspect ratio of movie 10 The product of the video aspect ratio, the display width of Movie 11, is equal to the product of the display height Hy4 of Movie 11 and the video aspect ratio of Movie 11.
图6a至图7c中,图6a为图库开启电影相册,且手机处于横屏方向时呈现的界面,6b至图7c可以是电影相册开启后,图库响应于用户的上滑操作而显示的界面。In Fig. 6a to Fig. 7c, Fig. 6a is the interface presented when the movie album is opened in the gallery and the mobile phone is in a landscape orientation, and Fig. 6b to Fig. 7c may be the interface displayed in response to the user's sliding operation after the movie album is opened.
请参见图8a,Y5表示将一个横屏方向电影视频的缩略图单独在一行显示的显示方式,电影18为横屏方向的视频。Please refer to FIG. 8 a , Y5 represents a display mode in which thumbnails of a movie video in landscape orientation are displayed in a single line, and movie 18 is a video in landscape orientation.
显示方式Y5中,电影18的显示高度记为Hy5,Hy5按下述公式计算:In the display mode Y5, the display height of the movie 18 is recorded as Hy5, and Hy5 is calculated according to the following formula:
Figure PCTCN2022093046-appb-000005
Figure PCTCN2022093046-appb-000005
W18和H18分别表示电影18的视频宽度和视频高度。W18 and H18 indicate the video width and video height of Movie 18, respectively.
电影18的显示宽度W18s,等于电影18的显示高度和电影18的视频宽高比的乘积。The display width W18s of the movie 18 is equal to the product of the display height of the movie 18 and the video aspect ratio of the movie 18 .
请参见图8b,Y6表示将一个竖屏方向电影视频的缩略图单独在一行显示的显示方式,电影18为竖屏方向的视频。Please refer to FIG. 8 b , Y6 represents a display mode in which thumbnails of a movie video in a vertical screen orientation are displayed in a single row, and the movie 18 is a video in a vertical screen orientation.
请参见图8c,Y7表示将两个竖屏方向电影视频的缩略图在同一行显示的显示方式,电影18和电影19均为竖屏方向的电影视频。Please refer to FIG. 8 c , Y7 indicates a display mode of displaying thumbnails of two vertically oriented movie videos in the same row, and Movie 18 and Movie 19 are both vertically oriented movie videos.
显示方式Y6和Y7中,电影视频的显示高度和显示方式Y3中电影视频的显示高度一致,电影视频的显示宽度和显示方式Y3中电影视频的显示宽度一致,不再赘述。In the display modes Y6 and Y7, the display height of the movie video is consistent with the display height of the movie video in the display mode Y3, and the display width of the movie video is consistent with the display width of the movie video in the display mode Y3, which will not be repeated here.
图9所示的Y8-1和Y8-2均表示将一个横屏方向的电影视频的缩略图和一个竖屏方向的电影视频的缩略图在同一行显示的显示方式。Y8-1 and Y8-2 shown in FIG. 9 both indicate a display mode in which a thumbnail of a movie video in a landscape orientation and a thumbnail of a movie video in a portrait orientation are displayed in the same row.
其中,请参见图9a,Y8-1表示竖屏方向电影视频的缩略图在左侧显示,横屏方向电影视频的缩略图在右侧显示的显示方式。Wherein, please refer to FIG. 9 a , Y8-1 indicates a display manner in which the thumbnail of the movie video in the portrait orientation is displayed on the left, and the thumbnail of the movie video in the landscape orientation is displayed on the right.
请参见图9b,Y8-2表示横屏方向电影视频的缩略图在左侧显示,竖屏方向电影视频的缩略图在右侧显示的显示方式。Please refer to FIG. 9 b , Y8-2 indicates a display manner in which the thumbnail of the movie video in the landscape orientation is displayed on the left, and the thumbnail of the movie video in the portrait orientation is displayed on the right.
Y8-1和Y8-2两种显示方式中,电影视频的显示宽度和显示高度的计算方式一致,将Y8-1和Y8-2两种显示方式对应的显示高度记为Hy6。In the two display modes of Y8-1 and Y8-2, the display width and height of the movie video are calculated in the same way, and the display height corresponding to the two display modes of Y8-1 and Y8-2 is recorded as Hy6.
以显示方式Y8-1为例,Hy6的计算公式如下:Taking the display mode Y8-1 as an example, the calculation formula of Hy6 is as follows:
Figure PCTCN2022093046-appb-000006
Figure PCTCN2022093046-appb-000006
W19和H19分别表示电影19的视频宽度和视频高度,电影18的显示宽度W18s,等于电影18的显示高度和电影18的视频宽高比的乘积,电影19的显示宽度W19s,等于电影19的显示高度和电影19的视频宽高比的乘积。W19 and H19 represent the video width and video height of Movie 19 respectively, the display width W18s of Movie 18 is equal to the product of the display height of Movie 18 and the video aspect ratio of Movie 18, and the display width W19s of Movie 19 is equal to the display of Movie 19 The product of the height and the video aspect ratio of Movie 19.
图8a至图8c,以及图9a和图9b所示的显示方式可以是电影相册滑动至底部时最后的一个或两个电影视频的缩略图的显示方式,或者,可以是电影相册中仅包含一个或两个电影视频时的缩略图的显示方式。The display methods shown in Figures 8a to 8c, and Figures 9a and 9b can be the display mode of the last one or two movie video thumbnails when the movie album slides to the bottom, or it can be that the movie album only contains one Or the way thumbnails are displayed when two movie videos.
根据上述显示方式Y1至Y7中电影视频的显示尺寸的计算公式可以看出,按横屏规则确定的显示方式中,横屏方向的电影视频的显示宽高比,与电影视频的视频宽高比一致,因此按横屏规则确定的显示方式中显示横屏方向的电影视频时,只需要在电影视频中选取用于产生缩略图的一帧图像,然后将选取的这一帧图像按视频宽高比缩放至对应的显示宽度、显示高度即可,不需要进行裁剪,因此,在按横屏规则确定的显示方式中,图库可以完整的显示横屏方向的电影视频中的一帧图像。According to the calculation formulas for the display sizes of movie videos in the above display modes Y1 to Y7, it can be seen that in the display modes determined according to the horizontal screen rules, the display aspect ratio of the movie video in the horizontal screen direction is different from the video aspect ratio of the movie video. Therefore, when displaying a film video in landscape orientation in the display mode determined by the landscape rules, it is only necessary to select a frame of image used to generate a thumbnail in the film video, and then select this frame of image according to the width and height of the video It only needs to be zoomed to the corresponding display width and display height, and no cropping is required. Therefore, in the display mode determined according to the horizontal screen rules, the gallery can completely display a frame of image in the movie video in the horizontal screen orientation.
图4至图9的每一种显示方式中,若计算显示尺寸的公式的计算结果不为整数,可以对计算结果向上或向下取整得到显示尺寸。In each of the display modes shown in FIGS. 4 to 9 , if the calculation result of the formula for calculating the display size is not an integer, the calculation result can be rounded up or down to obtain the display size.
在一些可能的实施例中,手机处于横屏方向时,每次电影视频浏览界面所要呈现的电影视频发生变更时,图库重新根据横屏规则将要呈现的电影视频分行,并重新确定每一行对应的电影视频的显示尺寸,然后根据新确定的分行方式和显示尺寸显示每个电影视频的缩略图。In some possible embodiments, when the mobile phone is in the landscape orientation, every time the movie video to be presented on the movie video browsing interface changes, the gallery re-displays the movie video branch according to the landscape screen rules, and re-determines the corresponding row of each row. The display size of the movie video, and then display the thumbnail of each movie video according to the newly determined row mode and display size.
需要说明的是,图6至图9所示的显示方式是本申请一种可选的实施例所提供的例子,在另一些可选的实施例中,电子设备在处于横屏方向时,还可以采用除上述显示方式以外的其他方式显示,而不限于图6至图9所示的几种方式。示例性的,电子设备在处于横屏方向时,也可以基于其他显示方式,在一行中显示4个或更多个电影视频的缩略图。It should be noted that the display modes shown in FIGS. 6 to 9 are examples provided by an optional embodiment of the present application. In other optional embodiments, when the electronic device is in a landscape orientation, it also It can be displayed in other ways than the above-mentioned display ways, and is not limited to the several ways shown in FIGS. 6 to 9 . Exemplarily, when the electronic device is in a landscape orientation, it may also display 4 or more movie video thumbnails in a row based on other display manners.
在一些可能的实施例中,图库可以按照各个电影视频的拍摄时间的早晚来确定电影视频浏览界面中电影视频的缩略图的显示顺序。示例性的,电影视频浏览界面中,上方的缩略图对应的电影视频的拍摄时间早于下方的缩略图对应的电影视频的拍摄时间,在同一行 中,左侧的缩略图对应的电影视频的拍摄时间早于右侧的缩略图对应的电影视频的拍摄时间。In some possible embodiments, the gallery may determine the display order of the thumbnails of the movie videos in the movie video browsing interface according to the shooting time of each movie video. Exemplarily, in the movie video browsing interface, the shooting time of the movie video corresponding to the upper thumbnail is earlier than the shooting time of the movie video corresponding to the lower thumbnail, and in the same row, the movie video corresponding to the left thumbnail The shooting time is earlier than the shooting time of the movie video corresponding to the thumbnail on the right.
本申请实施例所提供的视频缩略图的显示方法,具有如下的有益效果:The video thumbnail display method provided by the embodiment of the present application has the following beneficial effects:
在显示电影视频时,图库基于上述横屏规则和竖屏规则动态地确定每个电影视频在视频显示区域内的位置和显示尺寸,使得每个电影视频的显示宽高比和实际的视频宽高比一致,或者接近视频宽高比,避免在产生电影视频的缩略图时对电影视频的图像进行裁剪,使用户在浏览电影视频时,可以看到电影视频中完整的一帧图像,有助于用户通过缩略图预览电影视频的内容,并根据电影视频的缩略图快速的找到特定的电影视频。When displaying movie videos, the gallery dynamically determines the position and display size of each movie video in the video display area based on the above horizontal and vertical screen rules, so that the display aspect ratio of each movie video and the actual video width and height The ratio is the same, or close to the aspect ratio of the video, avoiding cropping the image of the movie video when generating the thumbnail of the movie video, so that the user can see a complete frame of the movie video when browsing the movie video, which is helpful The user previews the content of the movie video through the thumbnail, and quickly finds a specific movie video according to the thumbnail of the movie video.
进一步的,将电影视频的显示宽高比和视频宽高比保持一致,有助于用户直观地区分电影视频浏览界面和非电影视频浏览界面,改善用户浏览电影视频时的体验。Further, keeping the display aspect ratio of the movie video consistent with the video aspect ratio helps the user to intuitively distinguish the movie video browsing interface from the non-movie video browsing interface, and improves the user's experience when browsing movie videos.
需要说明的是,虽然上述实施例以电影视频为例说明本申请提供的视频缩略图的显示方法,但是本申请提供的视频缩略图的显示方法,并不限于显示电影视频的缩略图,而是可以用于显示其他视频的缩略图,以及用于显示其他得到图片。It should be noted that although the above-mentioned embodiment uses movie videos as an example to illustrate the display method of video thumbnails provided by this application, the method of displaying video thumbnails provided by this application is not limited to displaying thumbnails of movie videos, but Can be used to display thumbnails of other videos, and to display other derived images.
本申请实施例所提供的视频缩略图的显示方法,可以由电子设备的相机应用,媒体框架和图库实施。The video thumbnail display method provided by the embodiment of the present application can be implemented by the camera application, media framework and gallery of the electronic device.
请参见图10,电子设备100可以包括硬件层和软件层,其中软件层包括内核层,应用框架层和应用层。硬件层包括摄像头,存储器和显示屏,内核层包括摄像头驱动,应用框架层包括相机应用服务(camera service)和媒体框架,媒体框架包含媒体数据库和媒体编码器(MediaCodec),应用层包括相机应用和图库。存储器可以是只读存储器(Read-Only Memory,ROM)。Referring to FIG. 10 , the electronic device 100 may include a hardware layer and a software layer, wherein the software layer includes a kernel layer, an application framework layer and an application layer. The hardware layer includes camera, memory and display screen, the kernel layer includes camera driver, the application framework layer includes camera service (camera service) and media framework, the media framework includes media database and media encoder (MediaCodec), and the application layer includes camera application and gallery. The memory may be a read-only memory (Read-Only Memory, ROM).
相机应用响应用户的录制电影视频的操作而开启电影模式,在电影模式下向相机应用服务发送控制指令,控制指令通过相机应用服务和摄像头驱动传递至摄像头,使得摄像头开始录制电影视频。在开始录制电影视频时,相机应用在内存中针对本次录制过程创建一个文件流,录制过程中,摄像头拍摄得到的视频流经过摄像头驱动和相机应用服务传输至相机应用,相机应用获得视频流之后,将视频流提供给媒体编码器,媒体编码器对视频流编码得到对应的视频数据,媒体编码器将编码得到的视频数据添加至文件流中。录制一定时间后,相机应用响应用户停止录制的操作,通过相机应用服务和摄像头驱动控制摄像头停止录制视频,然后将前述文件流以视频文件的形式保存在存储器中。The camera application turns on the movie mode in response to the user's operation of recording a movie video, and sends a control command to the camera application service in the movie mode, and the control command is transmitted to the camera through the camera application service and the camera driver, so that the camera starts to record the movie video. When starting to record a movie video, the camera application creates a file stream in memory for this recording process. During the recording process, the video stream captured by the camera is transmitted to the camera application through the camera driver and the camera application service. After the camera application obtains the video stream , providing the video stream to the media encoder, the media encoder encodes the video stream to obtain corresponding video data, and the media encoder adds the encoded video data to the file stream. After recording for a certain period of time, the camera application responds to the user's operation to stop recording, controls the camera to stop recording video through the camera application service and the camera driver, and then saves the aforementioned file stream in the memory in the form of a video file.
相机应用保存视频文件后,媒体框架对内存中的视频文件进行解析,获得这个视频文件的视频信息,并将视频信息更新至媒体数据库中。After the camera application saves the video file, the media framework parses the video file in memory, obtains the video information of the video file, and updates the video information to the media database.
媒体数据库更新后,图库将媒体数据库中记录的媒体信息同步至图库自身的数据库中。之后,当用户通过图库浏览视频时,图库响应用户的操作,基于自身的数据库中存储的视频信息而在显示屏上显示电影视频的缩略图。After the media database is updated, the gallery will synchronize the media information recorded in the media database to its own database. Afterwards, when the user browses videos through the gallery, the gallery responds to the user's operation and displays thumbnails of movie videos on the display screen based on the video information stored in its own database.
请参见图11,下面结合上述电子设备中的相机应用,图库和媒体框架的交互过程对本申请实施例提供的视频缩略图的显示方法的流程进行说明。Referring to FIG. 11 , the flow of the method for displaying video thumbnails provided by the embodiment of the present application will be described below in conjunction with the interaction process of the camera application in the electronic device, the gallery and the media framework.
响应于用户的开启电影模式的操作,相机应用执行步骤S1101,开启电影模式。In response to the user's operation of turning on the movie mode, the camera application executes step S1101 to turn on the movie mode.
电影模式开启后,相机应用响应于用户开始录制的操作,执行步骤S1102,创建文件流,设置多媒体格式并添加电影标签。After the movie mode is turned on, the camera application responds to the user's operation of starting recording, and executes step S1102 to create a file stream, set a multimedia format and add a movie tag.
示例性的,创建的文件流存储在电子设备的运行内存中。Exemplarily, the created file stream is stored in the running memory of the electronic device.
其中,多媒体格式(MediaFormat)具体包括文件流中的若干个字段,这些字段用于说明录制得到的视频的编码格式,采样率等信息,设置多媒体格式,相当于配置上述字段的字段值。一般的,多媒体格式位于文件流的开头部分,即位于文件头中。Among them, the multimedia format (MediaFormat) specifically includes several fields in the file stream. These fields are used to describe the encoding format of the recorded video, sampling rate and other information. Setting the multimedia format is equivalent to configuring the field values of the above fields. Generally, the multimedia format is located at the beginning of the file stream, that is, in the file header.
在一些可能的实施例中,上述电影标签(Tag)可以添加至文件头中。In some possible embodiments, the above movie tag (Tag) can be added to the file header.
在一些可能的实施例中,电影标签也可以在停止录制之后再添加至文件头中。本申请实施例对添加电影标签的时机不做限定。In some possible embodiments, the movie tag can also be added to the file header after the recording is stopped. The embodiment of the present application does not limit the timing of adding movie tags.
示例性的,若媒体编码器基于MP4(Moving Picture Experts Group 4,动态图像专家组4)编码标准编码视频流,则电影标签可以是文件流中Movie header atom层的字段gnre。具体的,若在电影模式下录制视频,则相机应用可以将文件流的Movie header atom层的gnre字段的字段值配置为表示电影视频的值,完成配置后,gnre字段就是这个文件流中的电影标签。Exemplarily, if the media encoder encodes the video stream based on the MP4 (Moving Picture Experts Group 4, Moving Picture Experts Group 4) encoding standard, the movie tag may be the field gnre of the Movie header atom layer in the file stream. Specifically, if the video is recorded in movie mode, the camera application can configure the field value of the gnre field in the Movie header atom layer of the file stream to represent the value of the movie video. After the configuration is completed, the gnre field is the movie in the file stream Label.
执行步骤S1102之后,相机应用执行步骤S1103,录制视频。录制过程中,相机应用实时获得摄像头拍摄得到的视频流,并对视频流执行步骤S1104,编码视频流,和步骤S1105,输出视频数据至文件流。其中步骤S1104由相机利用前述媒体编码器实现。After step S1102 is executed, the camera application executes step S1103 to record a video. During the recording process, the camera application obtains the video stream captured by the camera in real time, and performs step S1104 on the video stream, encoding the video stream, and step S1105, outputting the video data to the file stream. Wherein step S1104 is implemented by the camera using the aforementioned media encoder.
在录制一定时间后,相机应用响应用户停止录制的操作,执行步骤S1106,停止录制视频,和步骤S1107,保存视频文件。After recording for a certain period of time, the camera application responds to the user's operation to stop recording, and executes step S1106 to stop recording the video, and step S1107 to save the video file.
在步骤S1107中,相机应用将包含多媒体格式,电影标签和视频数据的文件流,以文件的形式保存在电子设备的存储器中,从而获得视频文件。In step S1107, the camera application saves the file stream including the multimedia format, the movie tag and the video data in the storage of the electronic device in the form of a file, so as to obtain the video file.
媒体框架运行期间,对电子设备的内存周期性的执行步骤S1108,扫描视频文件。During the running of the media framework, step S1108 is periodically performed on the memory of the electronic device to scan video files.
需要说明的是,步骤S1108中扫描的是内存中已保存的视频文件。It should be noted that the scanned video files in the internal memory are scanned in step S1108.
示例性的,媒体框架可以通过MediaScanner函数执行步骤S1108。Exemplarily, the media framework may execute step S1108 through the MediaScanner function.
通过执行步骤S1108,在相机应用停止录制并保存视频文件中,媒体框架在内存扫描出这个新保存的视频文件,随后,媒体框架对这个视频文件执行步骤S1109,解析视频信息。By executing step S1108, when the camera application stops recording and saves the video file, the media framework scans the memory for the newly saved video file, and then, the media framework executes step S1109 for the video file to analyze the video information.
示例性的,在步骤S1109中,媒体框架可以通过MediaMetaDataRetriever函数对视频文件进行解析,获得被解析的视频文件的视频信息。Exemplarily, in step S1109, the media framework may parse the video file through the MediaMetaDataRetriever function to obtain the video information of the parsed video file.
解析出的视频信息具体可以包括对应的视频文件的旋转角度,视频名称,视频尺寸,视频格式,编码方式,视频文件的存储地址,视频拍摄时间和视频类型等。视频尺寸包括视频宽度width和视频高度height,视频类型包括电影视频和非电影视频。The parsed video information may specifically include the rotation angle of the corresponding video file, video name, video size, video format, encoding method, storage address of the video file, video shooting time, and video type. Video size includes video width width and video height, and video type includes movie video and non-movie video.
续接前述示例,在步骤S1109中,示例性的,媒体框架可以读取视频文件中gnre字段的值,若读取到的值为表示电影视频的值,则确定这个视频文件的视频类型为电影视频,若读取到的值不为表示电影视频的值,或者通过读取发现视频文件中不包含gnre字段,则确定这个视频文件的视频类型为非电影视频。Continuing from the previous example, in step S1109, for example, the media framework can read the value of the gnre field in the video file, and if the read value indicates the value of the movie video, then determine that the video type of the video file is a movie For video, if the read value is not a value representing a movie video, or the video file is found not to contain the gnre field by reading, then it is determined that the video type of the video file is a non-movie video.
解析出视频信息后,媒体框架基于这条媒体信息执行步骤S1110,更新媒体数据库,并通知数据库监听器。After parsing out the video information, the media framework executes step S1110 based on the media information, updates the media database, and notifies the database listener.
媒体数据库用于管理电子设备本地的多媒体文件,一般的,媒体数据库中保存有电子设备本地的每一个多媒体文件对应的媒体信息,其中多媒体文件包括视频文件,图像文件,文档文件和音乐文件等,视频文件对应的媒体信息就是前述视频信息,图像文件对应的媒体信息为图像信息。The media database is used to manage the local multimedia files of the electronic device. Generally, the media database stores the media information corresponding to each local multimedia file of the electronic device, wherein the multimedia files include video files, image files, document files and music files. The media information corresponding to the video file is the aforementioned video information, and the media information corresponding to the image file is image information.
在一些可选的实施例中,媒体数据库具体可以是电子设备的内存和存储器中预先分配给媒体框架的特定存储区域。In some optional embodiments, the media database may specifically be a memory of the electronic device and a specific storage area in the memory that is pre-allocated to the media framework.
其中,步骤S1110中的更新,是指,将解析得到的这条媒体信息添加至媒体数据库中。数据库监听器,是图库创建的一个用于监听媒体数据库的函数,媒体框架每次更新媒体数据库后,通过向数据库监听器发送通知消息的方式通知数据库监听器,随后数据库监听器将通知消息转发给图库。Wherein, the update in step S1110 refers to adding the piece of media information obtained through analysis to the media database. The database listener is a function created by the library to monitor the media database. After the media framework updates the media database each time, it notifies the database listener by sending a notification message to the database listener, and then the database listener forwards the notification message to gallery.
图库收到数据库监听器的通知后,执行步骤S1111,同步媒体数据库。After receiving the notification from the database listener, the library executes step S1111 to synchronize the media database.
图库自身设置有一个用于存储视频和图像信息的数据库,这个数据库可以称为图库数据库,通过执行步骤S1111,图库将媒体框架对媒体数据库的更新同步至图库数据库中。The gallery itself is provided with a database for storing video and image information, and this database may be called a gallery database. By performing step S1111, the gallery synchronizes the update of the media database by the media framework to the gallery database.
图库数据库,具体可以是电子设备的存储器和内存中预先分配给图库的特定存储区域。The gallery database may specifically be a storage area of the electronic device and a specific storage area pre-allocated to the gallery in the internal memory.
示例性的,媒体框架向媒体数据库添加了一条视频信息1之后,通过执行步骤S1111,图库从媒体数据库拷贝视频信息1并将拷贝过来的视频信息1添加在图库数据库中。Exemplarily, after the media framework adds a piece of video information 1 to the media database, by executing step S1111, the gallery copies the video information 1 from the media database and adds the copied video information 1 to the gallery database.
图库数据库除了保存媒体数据库中的图像信息和视频信息之外,还可以服务器的视频信息和图像信息。In addition to saving the image information and video information in the media database, the gallery database can also save video information and image information from the server.
在一些可能的实施例中,图库在电子设备100的云同步功能开启时,周期性的访问服务器,以便从服务器下载服务器存储在服务器的视频的视频信息,以及存储在服务器的图像的图像信息,并将这些从服务器下载的视频信息和图像信息保存在图库数据库中。In some possible embodiments, when the cloud synchronization function of the electronic device 100 is turned on, the gallery periodically accesses the server, so as to download from the server the video information of the video stored in the server by the server, and the image information of the image stored in the server, And save the video information and image information downloaded from the server in the gallery database.
从服务器下载的视频信息和图像信息,可以由服务器对视频和图像解析得到,也可以由终端设备在上传视频和图像时一并上传给服务器。The video information and image information downloaded from the server can be obtained by parsing the video and image information by the server, or can be uploaded to the server together by the terminal device when uploading the video and image information.
图库可以在图库数据库中记录每一条视频信息具体属于哪一个相册,以及记录每一条图像信息具体属于哪一个相册,这样在图库响应于用户的操作而打开特定的相册时,就可以根据上述记录确定需要显示哪些图像和视频。The gallery can record in the gallery database which album each piece of video information belongs to, and which album each piece of image information belongs to, so that when the gallery opens a specific album in response to the user's operation, it can be determined based on the above records Which images and videos need to be displayed.
示例性的,假设图库中只有一个电影相册,记为“我的电影”,则图库可以将图库数据库中每一条视频信息均归属于“我的电影”相册。Exemplarily, assuming that there is only one movie album in the gallery, which is recorded as "My Movies", the gallery can attribute each piece of video information in the gallery database to the "My Movies" album.
任意时刻用户执行了打开图库操作后,图库响应于打开图库操作,执行S1112,显示相册界面。After the user performs the operation of opening the gallery at any time, the gallery executes S1112 in response to the operation of opening the gallery, and displays the photo album interface.
示例性的,显示的相册界面为图3的界面303。Exemplarily, the displayed photo album interface is the interface 303 in FIG. 3 .
显示相册界面后,用户可以通过点击操作打开图库中的任意一个相册,当图库接收到用户打开电影相册的操作时,图库执行步骤S1113,识别设备方向。After the album interface is displayed, the user can click to open any album in the gallery. When the gallery receives the user's operation to open the movie album, the gallery executes step S1113 to identify the orientation of the device.
设备方向,是指电子设备的显示屏当前的方向,具体的,设备方向包括可以是横屏或竖屏。设备方向具体可以通过陀螺仪传感器130A确定。The device orientation refers to the current orientation of the display screen of the electronic device. Specifically, the orientation of the device may include a horizontal screen or a vertical screen. The device orientation may specifically be determined by the gyro sensor 130A.
在识别设备方向后,若图库识别出设备方向为横屏,则执行步骤S1114,按横屏规则确定电影视频的显示方式。After the orientation of the device is identified, if the gallery recognizes that the orientation of the device is landscape, then step S1114 is performed to determine the display mode of the movie and video according to the landscape rules.
步骤S1114中确定出的显示方式包括按图6至图8所示的任意一种或多种显示方式。The display modes determined in step S1114 include any one or more of the display modes shown in FIG. 6 to FIG. 8 .
若图库识别出设备方向为竖屏方向,则执行步骤S1115,按竖屏规则确定电影视频的显示方式。If the gallery recognizes that the orientation of the device is a portrait orientation, step S1115 is performed to determine the display mode of the movie and video according to the portrait orientation rules.
步骤S1115中确定出的显示方式包括按图4和图5所示的任意一种或多种显示方式。The display modes determined in step S1115 include any one or more of the display modes shown in FIG. 4 and FIG. 5 .
执行步骤S1114或步骤S1115之后,图库执行步骤S1116,按确定出的显示方式显示电影视频的缩略图。After step S1114 or step S1115 is executed, the gallery executes step S1116 to display the thumbnails of movie videos in the determined display mode.
在一些可能的实施例中,图库也可以在响应用户的操作而打开电影相册之前,预先确定电影相册中所有电影视频在电子设备横屏时的显示方式,以及确定电影相册中所有电影视频在电子设备竖屏时的显示方式,并将确定的显示方式记录在内存中。在图库打开电影相册时,就可以直接根据电子设备当前的方向,从内存获取对应的显示方式,然后按显示方式显示电影视频。In some possible embodiments, before opening the movie album in response to the user's operation, the gallery can also predetermine the display mode of all the movie videos in the movie album when the electronic device The display mode when the device is in portrait mode, and the determined display mode is recorded in the memory. When the movie album is opened in the gallery, the corresponding display mode can be directly obtained from the memory according to the current orientation of the electronic device, and then the movie video can be displayed according to the display mode.
在一些可能的实施例中,图库在执行步骤S1114或步骤S1115时,可以确定被打开的电影相册所包含的每一个电影视频的缩略图的显示方式。In some possible embodiments, when the gallery executes step S1114 or step S1115, it may determine the display mode of the thumbnail of each movie video included in the opened movie album.
以图6为示例,假设图库数据库中记录有电影1至电影8的视频信息,并且电影1至电影8的拍摄时间递增,其中电影1的拍摄时间最早,电影8的拍摄时间最短。当用户在横屏时打开我的电影相册时,图库按拍摄时间由早至晚逐一确定图库数据库所记录的电影视频的显示方式,并根据确定出的显示方式逐一显示电影视频的缩略图。Taking Fig. 6 as an example, assume that the video information of Movie 1 to Movie 8 is recorded in the gallery database, and the shooting time of Movie 1 to Movie 8 is increasing, wherein the shooting time of Movie 1 is the earliest, and the shooting time of Movie 8 is the shortest. When the user opens the My Movie Album in landscape orientation, the gallery determines the display modes of the movie videos recorded in the gallery database one by one according to the shooting time, and displays the thumbnails of the movie videos one by one according to the determined display mode.
在另一些可能的实施例中,图库在执行步骤S1114或步骤S1115时,也可以只确定电影相册中需要显示的电影视频的显示方式,而不确定后续不需要显示的电影视频的显示方式。In some other possible embodiments, when the gallery executes step S1114 or step S1115, it may also only determine the display mode of the movie video that needs to be displayed in the movie album, but not determine the display mode of the subsequent movie video that does not need to be displayed.
仍以图6为例,图库确定出电影1至电影5的显示方式并按图6a所示界面显示电影1至电影5的缩略图之后,图库判断出显示屏当前无法显示后续的电影视频的缩略图,因此不确定电影6至电影8的显示方式。当图库接收到用户的上滑操作,需要显示电影5之后的电影视频时,再确定后续的电影6至电影8的显示方式,并按图6b所示的界面显示电影6至电影8的缩略图。Still taking Figure 6 as an example, after the gallery determines the display modes of movies 1 to 5 and displays the thumbnails of movies 1 to 5 in the interface shown in Figure 6a, the gallery judges that the display screen cannot currently display the thumbnails of subsequent movie videos thumbnail, so not sure how movies 6 to 8 are shown. When the gallery receives the user's sliding operation and needs to display the movie videos after movie 5, then determine the display mode of the subsequent movie 6 to movie 8, and display the thumbnails of movie 6 to movie 8 according to the interface shown in Figure 6b .
图库可以通过如下方式获得电影视频的缩略图:The gallery can get thumbnails of movie videos as follows:
图库需要获得电影视频的缩略图时,通过媒体框架的解析接口向媒体框架发送解析请求,解析请求中携带有图库确定出的电影视频的显示尺寸。媒体框架响应解析请求,根据媒体数据库中记录的视频信息在存储器中找到需要解析出缩略图的视频文件,从这个视频文件中解析得到用于生成缩略图的一帧图像,然后媒体框架基于图库提供的显示尺寸,将解析出的这一帧图像缩小,获得电影视频的缩略图。获得缩略图后,媒体框架将缩略图写入电子设备的运行内存中,随后图库可以从电子设备的运行内存读取电影视频的缩略图。When the gallery needs to obtain the thumbnail of the movie video, it sends a parsing request to the media framework through the parsing interface of the media framework, and the parsing request carries the display size of the movie video determined by the gallery. The media framework responds to the parsing request, finds the video file that needs to be parsed out of the thumbnail in the memory according to the video information recorded in the media database, parses the video file to obtain a frame of image for thumbnail generation, and then provides the media framework based on the gallery. The display size of the parsed image is reduced to obtain a thumbnail of the movie video. After obtaining the thumbnail, the media framework writes the thumbnail into the running memory of the electronic device, and then the gallery can read the thumbnail of the movie video from the running memory of the electronic device.
在一些可选的实施例中。若这个电影视频为服务器存储的电影视频,则图库向服务器发送携带有电影视频的显示尺寸的解析请求。服务器响应于解析请求,执行上述由媒体框架执行的过程,获得电影视频的缩略图,然后将电影视频的缩略图反馈给位于电子设备的图库。In some optional embodiments. If the movie video is a movie video stored in the server, the gallery sends a parsing request carrying the display size of the movie video to the server. In response to the parsing request, the server executes the above process performed by the media framework to obtain the thumbnail of the movie video, and then feeds back the thumbnail of the movie video to the gallery located on the electronic device.
在一些可选的实施例中,电影视频的显示宽高比和视频宽高比一致,这种情况下,媒体框架或服务器反馈的缩略图的尺寸,就是图库提供的显示尺寸,图库获得缩略图后,可以直接在显示屏上显示该缩略图。In some optional embodiments, the display aspect ratio of the movie video is consistent with the video aspect ratio. In this case, the size of the thumbnail image fed back by the media frame or the server is the display size provided by the gallery, and the gallery obtains the thumbnail After that, the thumbnail can be displayed directly on the display.
在另一些可选的实施例中,电影视频为横屏方向的视频,并且电影视频的显示宽高比和视频宽高比不一致,此时媒体框架或服务器写入运行内存的缩略图的高度和电影视频的显示高度一致,但是缩略图的宽度和电影视频的显示宽度不一致。图库获得缩略图后,若缩略图的宽度小于或等于电影视频的显示宽度,则图库可以直接在显示屏上显示收到的缩略图,若缩略图的宽度大于电影视频的显示宽度,图库就按居中裁剪的方式,沿宽度方向对缩略图进行裁剪,裁剪掉缩略图左右两侧的部分内容,获得宽度和电影视频的显示宽度一致,并且高度和电影视频的显示高度一致的裁剪后缩略图,然后在显示屏上显示这个裁剪后缩略图。In some other optional embodiments, the movie video is a video in a landscape orientation, and the display aspect ratio of the movie video is inconsistent with the video aspect ratio. At this time, the media framework or the server writes the thumbnail height and The display height of the movie video is consistent, but the width of the thumbnail is not consistent with the display width of the movie video. After the gallery obtains the thumbnail, if the width of the thumbnail is less than or equal to the display width of the movie video, the gallery can directly display the received thumbnail on the display screen; if the width of the thumbnail is greater than the display width of the movie video, the gallery will press In the center cropping method, the thumbnail is cropped along the width direction, and part of the content on the left and right sides of the thumbnail is cropped to obtain a cropped thumbnail whose width is consistent with the display width of the movie video and whose height is consistent with the display height of the movie video. This cropped thumbnail is then displayed on the display.
在又一些可选的实施例中,电影视频为竖屏方向的视频,并且电影视频的显示宽高比和视频宽高比不一致,此时媒体框架或服务器反馈的缩略图的宽度和电影视频的显示宽度一致,但是缩略图的高度和电影视频的显示高度不一致。图库收到缩略图后,若缩略图的高度小于或等于电影视频的显示高度,则图库可以直接在显示屏上显示收到的缩略图,若缩略图的高度大于电影视频的显示高度,图库就按居中裁剪的方式,沿高度方向对缩略图进行裁剪,裁剪掉缩略图上下两端的部分内容,获得高度和电影视频的显示高度一致,并且宽度和电影视频的显示宽度一致的裁剪后缩略图,然后在显示屏上显示这个裁剪后缩略图。In still some optional embodiments, the movie video is a video with a vertical screen orientation, and the display aspect ratio of the movie video is inconsistent with the video aspect ratio. At this time, the width of the thumbnail image fed back by the media framework or the server is the same as the width of the movie video. The display width is the same, but the height of the thumbnail and the display height of the movie video are not the same. After the gallery receives the thumbnail, if the height of the thumbnail is less than or equal to the display height of the movie video, the gallery can directly display the received thumbnail on the display screen; if the height of the thumbnail is greater than the display height of the movie video, the gallery will Crop the thumbnail along the height direction in the center cropping method, cut off part of the content at the upper and lower ends of the thumbnail, and obtain a cropped thumbnail whose height is consistent with the display height of the movie video, and whose width is consistent with the display width of the movie video. This cropped thumbnail is then displayed on the display.
在一些可选的实施例中,图库获得媒体框架或服务器反馈的缩略图后,可以在图库数据库中保存缩略图后,可以在图库数据库中保存这一帧图像,此后每次图库需要显示电影视频的缩略图时,直接读取图库数据库中存储的缩略图即可。在图库数据库中保存缩略图的好处在于,当用户打开电影相册时,图库能够更快在电子设备的显示屏上显示电影视频的缩略图,而不必等待媒体框架或服务器反馈缩略图。In some optional embodiments, after the gallery obtains the thumbnail image fed back by the media frame or the server, it can save the thumbnail image in the gallery database, and then save this frame of image in the gallery database, and then every time the gallery needs to display the movie video For thumbnails, just read the thumbnails stored in the gallery database directly. The advantage of saving the thumbnails in the gallery database is that when the user opens the movie album, the gallery can display the thumbnails of the movie videos on the display screen of the electronic device faster without waiting for the media framework or the server to feed back the thumbnails.
在一些可能的实施方式中,图库根据竖屏规则确定出电子设备竖屏时的显示方式之后,可以将竖屏时的显示方式保存在电子设备的内存中,同样的,图库根据竖屏规则确定出电子设备横屏时的显示方式之后,可以将横屏时的显示方式保存在电子设备的内存中。In some possible implementations, after the gallery determines the display mode of the electronic device in vertical screen according to the vertical screen rules, the display mode of the vertical screen can be saved in the memory of the electronic device. Similarly, the gallery is determined according to the vertical screen rules. After displaying the display mode of the electronic device in landscape mode, the display mode in landscape mode can be saved in the memory of the electronic device.
当图库打开电影相册时,可以判断电影相册包括的电影视频是否被更新。若电影相册包括的电影视频被更新,例如电影相册中部分电影视频被删除,或者新增了一些电影视频,则图库根据电子设备的方向,执行前述步骤S1114或S1115来确定相应的显示方式,若电影相册包括的电影视频未被更新,则图库可以根据电子设备的方向,从内存读出之前保存的横屏时的显示方式或者竖屏时的显示方式,根据读取的显示方式直接执行步骤S1116。When the library opens the movie album, it can be determined whether the movie video included in the movie album has been updated. If the movie videos included in the movie album are updated, for example, some movie videos in the movie album are deleted, or some movie videos are added, then the gallery performs the aforementioned steps S1114 or S1115 to determine the corresponding display mode according to the direction of the electronic device, if If the movie video included in the movie album has not been updated, the gallery can read the previously saved display mode in horizontal screen or vertical screen from the memory according to the orientation of the electronic device, and directly execute step S1116 according to the read display mode .
在一些可选的实施例中,完成电影视频的显示之后,图库可以周期性的检测电子设备的方向是否发生变化,若电子设备的方向发生变化,则图库根据变化后的方向重新确定各个电影视频的显示方式,然后按新的显示方式显示电影视频。In some optional embodiments, after the display of the movie video is completed, the gallery can periodically detect whether the orientation of the electronic device changes. If the orientation of the electronic device changes, the gallery will re-determine each movie video according to the changed orientation. display mode, and then display the movie video in the new display mode.
示例性的,电影相册被打开时,电子设备的方向为横屏方向,于是图库按横屏规则确定电影视频的显示方式并显示电影视频,一段时间后,电子设备的方向由横屏方向变更为竖屏方向,此时电影相册仍然处于打开状态,于是图库按竖屏规则重新确定电影视频的显示方式,然后按新确定的显示方式显示电影视频。Exemplarily, when the movie album is opened, the orientation of the electronic device is the landscape orientation, so the gallery determines the display mode of the movie video according to the landscape rules and displays the movie video. After a period of time, the orientation of the electronic device changes from the landscape orientation to In portrait orientation, the movie album is still open at this time, so the gallery re-determines the display method of the movie video according to the vertical screen rules, and then displays the movie video according to the newly determined display method.
进一步的,在电子设备的方向发生变化时,如果电影相册包括的电影视频未被更新,图库可以判断内存中是否有和变化后的方向对应的显示方式,如果内存中有和变化后的方 向对应的显示方式,则图库直接读取该显示方式并基于该显示方式显示电影视频;如果内存中没有和变化后的方向对应的显示方式,图库则根据变化后的方向重新确定各个电影视频的显示方式。Furthermore, when the orientation of the electronic device changes, if the movie video included in the movie album has not been updated, the gallery can determine whether there is a display mode corresponding to the changed orientation in the memory, and if there is a display mode corresponding to the changed orientation in the memory. If there is no display mode corresponding to the changed direction in the memory, the gallery will re-determine the display mode of each movie video according to the changed direction .
示例性的,当电子设备从竖屏变为横屏时,若电影相册中的电影视频未被更新,并且内存中存有电子设备横屏时的显示方式,则图库可以直接按内存中存储的电子设备横屏时的显示方式显示电影视频,如果内存中未存有电子设备横屏时的显示方式,则图库按横屏规则重新确定电影视频的显示方式,然后按新确定的显示方式显示电影视频。Exemplarily, when the electronic device changes from a vertical screen to a horizontal screen, if the movie video in the movie album has not been updated, and the display mode of the electronic device when the electronic device is in a horizontal screen is stored in the memory, the gallery can be directly stored in the memory. The display mode of the electronic device when the screen is horizontal displays the movie video. If the display mode of the electronic device when the screen is not stored in the memory, the gallery will re-determine the display mode of the movie video according to the horizontal screen rules, and then display the movie according to the newly determined display mode. video.
步骤S1115具体包括两个环节,首先图库按图12所示的方法确定显示屏的每一行显示哪些电影视频的缩略图,也就是将各个电影视频分行,在完成分行后,再根据前述显示方式X1至X5对应的尺寸计算公式,计算这一行内各个电影视频的显示尺寸,最后图库就可以在步骤S1116中,基于计算出的显示尺寸逐行显示电影视频的缩略图。Step S1115 specifically includes two links. First, the library determines which thumbnails of movie videos are displayed on each line of the display screen according to the method shown in FIG. The size calculation formula corresponding to X5 calculates the display size of each movie video in this line, and finally the gallery can display the thumbnails of movie videos line by line based on the calculated display size in step S1116.
请参见图12,图库可以通过如下的方法。按竖屏规则将电影视频分行。Please refer to Figure 12, the gallery can be used in the following ways. Divide movies and videos into rows according to vertical screen rules.
S1201,读取第一个电影视频的视频信息。S1201. Read the video information of the first movie video.
步骤S1201中,若图库读取失败,即未读取到第一个电影视频的视频信息,则判断出没有电影视频,本方法结束,若图库读取成功,则执行步骤S1202。In step S1201, if the library reading fails, that is, the video information of the first movie video is not read, it is determined that there is no movie video, and the method ends. If the library reading is successful, step S1202 is executed.
图库中可能有两个或更多的电影相册,本实施例中,读取的视频信息,是指被打开的电影相册所包含的电影视频的视频信息。示例性的,图库中有两个电影相册,分别记为“我的电影1”和“我的电影2”,若用户打开的电影相册是“我的电影1”,“我的电影1”包含10个电影视频,则图库按拍摄时间的先后逐一读取“我的电影1”中10个电影视频的视频信息,并按图12所示的方法将这10个电影视频的缩略图分行。There may be two or more movie albums in the gallery. In this embodiment, the read video information refers to the video information of the movie video contained in the opened movie album. Exemplarily, there are two movie albums in the gallery, respectively recorded as "My Movie 1" and "My Movie 2". If the movie album opened by the user is "My Movie 1", "My Movie 1" contains 10 movie videos, the gallery reads the video information of the 10 movie videos in "My Movie 1" one by one according to the shooting time, and divides the thumbnails of the 10 movie videos into rows according to the method shown in Figure 12.
电影视频的视频信息均存储在图库数据库中。其中,若电影视频是设备本地的存储器中存储的视频,则电影视频的视频信息由图库从媒体数据库中读取并存储在图库数据库中;若电影视频是服务器中存储的视频,则电影视频的视频信息由图库从服务器下载并存储在图库数据库中。The video information of movie videos are all stored in the gallery database. Wherein, if the movie video is a video stored in the local memory of the device, the video information of the movie video is read from the media database by the gallery and stored in the gallery database; if the movie video is a video stored in the server, the video information of the movie video The video information is downloaded from the server by the gallery and stored in the gallery database.
在图12和图13所示的实施例中,图库读取电影视频的视频信息时按电影视频的拍摄时间由早至晚读取,因此,第一个电影视频,是指电影视频中拍摄时间最早的电影视频,第二个电影视频的拍摄时间晚于第一个电影视频的拍摄时间,第三个电影视频的拍摄时间晚于第二个电影视频的拍摄时间,以此类推。In the embodiment shown in Figure 12 and Figure 13, when the library reads the video information of the movie video, it is read from early to late according to the shooting time of the movie video. Therefore, the first movie video refers to the shooting time of the movie video The earliest movie video, the second movie video was shot after the first movie video, the third movie video was shot after the second movie video, and so on.
S1202,识别第一个电影视频的视频方向。S1202. Identify the video direction of the first movie video.
若第一个电影视频的视频方向为横屏,执行步骤S1209,若第一个电影视频的视频方向为竖屏,执行步骤S1203。If the video orientation of the first movie video is landscape, execute step S1209; if the video orientation of the first movie video is portrait, execute step S1203.
电影视频的视频方向,根据电影视频的视频信息中记录的视频高度和视频宽度确定,若电影视频的视频高度大于视频宽度,则识别出电影视频的视频方向为竖屏,若电影视频的视频高度小于视频宽度,则识别出电影视频的视频方向为横屏。The video direction of the movie video is determined according to the video height and video width recorded in the video information of the movie video. If the video height of the movie video is greater than the video width, it is recognized that the video direction of the movie video is vertical. If the video height of the movie video is If it is smaller than the video width, it is recognized that the video orientation of the movie video is landscape.
进一步的,在电影视频的视频信息中记录的旋转角度为90°时,若电影视频的视频高度大于视频宽度,则识别出电影视频的视频方向为横屏,若电影视频的视频高度小于视频宽度,则识别出电影视频的视频方向为竖屏。Further, when the rotation angle recorded in the video information of the movie video is 90°, if the video height of the movie video is greater than the video width, then it is recognized that the video direction of the movie video is horizontal, and if the video height of the movie video is smaller than the video width , then it is recognized that the video orientation of the movie video is vertical.
上述识别电影视频的视频方向的方法适用于后续每一个识别电影视频的视频方向的步骤,后续相关步骤不再赘述。The above-mentioned method for identifying the video direction of a movie video is applicable to each subsequent step of identifying the video direction of a movie video, and the subsequent related steps will not be repeated here.
S1203,读取第二个电影视频的视频信息。S1203. Read the video information of the second movie video.
可选的,执行步骤S1203时,若读取失败,则判断出没有第二个电影视频,则执行步骤S1209,若读取成功,则执行步骤S1204。Optionally, when step S1203 is executed, if the reading fails, it is determined that there is no second movie video, then step S1209 is executed, and if the reading is successful, step S1204 is executed.
S1204,识别第二个电影视频的视频方向。S1204. Identify the video direction of the second movie video.
若第二个电影视频的视频方向为横屏,执行步骤S1208,若第二个电影视频的视频方向为竖屏,执行步骤S1205。If the video orientation of the second movie video is landscape, execute step S1208; if the video orientation of the second movie video is portrait, execute step S1205.
S1205,读取第三个电影视频的视频信息。S1205. Read the video information of the third movie video.
可选的,执行步骤S1205时,若读取失败,则判断出没有第三个电影视频,则执行步骤S1208;若读取成功,则执行步骤S1206。Optionally, when step S1205 is executed, if the reading fails, it is determined that there is no third movie video, and then step S1208 is executed; if the reading is successful, step S1206 is executed.
S1206,识别第三个电影视频的视频方向。S1206. Identify the video direction of the third movie video.
若第三个电影视频的视频方向为横屏,执行步骤S1208,若第三个电影视频的视频方向为竖屏,执行步骤S1207。If the video orientation of the third movie video is landscape, execute step S1208; if the video orientation of the third movie video is portrait orientation, execute step S1207.
S1207,将第一个电影视频,第二个电影视频和第三个电影视频的缩略图在同一行显示。S1207. Display the thumbnails of the first movie video, the second movie video and the third movie video in the same row.
在执行步骤S1208后,第一个电影视频,第二个电影视频和第三个电影视频的缩略图的显示方式如前述X4所示。After step S1208 is executed, the display modes of the thumbnails of the first movie video, the second movie video and the third movie video are as shown in X4 above.
S1208,将第一个电影视频的缩略图和第二个电影视频的缩略图显示在同一行。S1208. Display the thumbnails of the first movie video and the thumbnails of the second movie video in the same row.
在执行步骤S1208后,若第一个电影视频为竖屏方向的视频,第二个电影视频为横屏方向的视频,则第一个电影视频的缩略图和第二个电影视频的缩略图的显示方式如前述X1所示,若第一个电影视频和第二个电影视频均为竖屏方向的视频,则第一个电影视频的缩略图和第二个电影视频的缩略图的显示方式如前述X2所示。After step S1208 is executed, if the first movie video is a video with a vertical screen orientation, and the second movie video is a video with a horizontal screen orientation, the thumbnails of the first movie video and the thumbnails of the second movie video The display mode is as shown in X1 above. If both the first movie video and the second movie video are videos in the vertical orientation, the thumbnails of the first movie video and the thumbnails of the second movie video will be displayed as follows: As shown in X2 above.
S1209,将第一个电影视频的缩略图单独显示一行。S1209. Display the thumbnail of the first movie video in a single line.
在执行步骤S1209后,若第一个电影视频为横屏方向的视频,则这个电影视频的缩略图按前述显示方式X3显示,若第一个电影视频为竖屏方向的视频,则这个电影视频的缩略图按前述显示方式X5显示。After step S1209 is executed, if the first movie video is a video in landscape orientation, the thumbnail of the movie video will be displayed in the aforementioned display mode X3; The thumbnails of are displayed according to the aforementioned display mode X5.
以图4a为例对图12所示的实施例进行说明,假设“我的电影”相册包含电影1至电影8这8个电影视频,电影1至电影8的拍摄时间递增。Taking FIG. 4a as an example to illustrate the embodiment shown in FIG. 12 , it is assumed that the "My Movies" album includes 8 movie videos from Movie 1 to Movie 8, and the shooting time of Movie 1 to Movie 8 is incremented.
图库打开“我的电影”相册时,电影视频包括电影1至电影8,图库读取其中第一个电影视频,即电影1的视频信息,并识别出电影1为竖屏的视频,然后图库读取第二个电影视频,即电影2的视频信息,并识别出电影2为横屏的视频,于是,图库确定将电影1和电影2的缩略图显示在同一行。When the gallery opens the "My Movies" album, the movie videos include movie 1 to movie 8, the gallery reads the video information of the first movie video, that is, movie 1, and recognizes that movie 1 is a vertical screen video, and then the gallery reads Get the video information of the second movie video, that is, movie 2, and recognize that movie 2 is a horizontal video, so the gallery determines to display the thumbnails of movie 1 and movie 2 in the same row.
电影1和电影2的缩略图被划分至同一行后,图库再次执行步骤S1201,此时电影1和2已完成分行,电影视频包括电影3至电影8,图库依次读取此时第一个和第二个电影视频,即电影3和电影4的视频信息,电影3和电影4均为竖屏的视频,于是图库读取第三个电影视频,即电影5的视频信息,并识别出电影5为横屏的视频,根据上述实施例,图库确定将电影3和电影4的缩略图显示在同一行。After the thumbnails of Movie 1 and Movie 2 are divided into the same row, the gallery executes step S1201 again. At this time, Movie 1 and 2 have been divided into rows, and the movie videos include Movie 3 to Movie 8. The gallery reads the first and The second movie video, that is, the video information of Movie 3 and Movie 4, and both Movie 3 and Movie 4 are vertical screen videos, so the gallery reads the third movie video, that is, the video information of Movie 5, and recognizes Movie 5 For videos with a horizontal screen, according to the above embodiment, the gallery determines to display the thumbnails of movie 3 and movie 4 in the same row.
电影3和电影4的缩略图被划分至同一行后,图库返回执行步骤S1201,此时电影视 频包括电影5至电影8,图库读取电影5的视频信息,并识别出电影5为横屏视频,于是图库确定将电影5的缩略图单独显示在一行。After the thumbnails of movie 3 and movie 4 are divided into the same row, the gallery returns to step S1201. At this time, the movie videos include movie 5 to movie 8. The gallery reads the video information of movie 5 and recognizes that movie 5 is a horizontal screen video , so the gallery determines to display the thumbnails of Movie 5 in a single row.
电影5的缩略图被单独划分为一行后,图库返回步骤S1201,通过执行上述实施例,确定将电影6至电影8的缩略图显示在同一行。After the thumbnails of Movie 5 are divided into one row, the gallery returns to step S1201, and by executing the above embodiment, it is determined to display the thumbnails of Movies 6 to 8 in the same row.
电影6至电影8的缩略图被划分至同一行后,图库再次执行步骤S1201,此时由于“我的电影”相册内的电影1至电影8均已完成分行,没有需要读取的电影视频的视频信息,图库读取视频信息失败,本方法结束。After the thumbnails of Movie 6 to Movie 8 are divided into the same row, the library executes step S1201 again. At this time, since Movie 1 to Movie 8 in the "My Movies" album have all been divided into rows, there is no movie video that needs to be read. Video information, the library failed to read the video information, and this method ends.
步骤S1114具体包括两个环节,首先图库按图13所示的方法确定显示屏的每一行显示哪些电影视频的缩略图,也就是将各个电影视频分行,在完成分行后,再根据前述显示方式Y1至Y7对应的尺寸计算公式,计算这一行内各个电影视频的显示尺寸,最后图库就可以在步骤S1116中,基于计算出的显示尺寸逐行显示电影视频的缩略图。Step S1114 specifically includes two steps. First, the library determines which thumbnails of movie videos are displayed on each line of the display screen according to the method shown in FIG. The size calculation formula corresponding to Y7 calculates the display size of each movie video in this line, and finally the gallery can display the thumbnails of movie videos line by line based on the calculated display size in step S1116.
请参见图13,图库可以通过如下的方法。按横屏规则将电影视频分行。Please refer to Figure 13, the gallery can be used in the following ways. Divide movies and videos into rows according to horizontal screen rules.
S1301、读取第一个电影视频的视频信息。S1301. Read the video information of the first movie video.
步骤S1301中,若图库读取失败,即未读取到第一个电影视频的视频信息,则判断出没有电影视频,本方法结束,若图库读取成功,则执行步骤S1302。In step S1301, if the library reading fails, that is, the video information of the first movie video is not read, it is determined that there is no movie video, and the method ends. If the library reading is successful, step S1302 is executed.
图库中可能有两个或更多的电影相册,本实施例中,读取的视频信息,是指被打开的电影相册所包含的电影视频的视频信息。There may be two or more movie albums in the gallery. In this embodiment, the read video information refers to the video information of the movie video contained in the opened movie album.
S1302、识别第一个电影视频的视频方向。S1302. Identify the video direction of the first movie video.
若第一个电影视频的视频方向为竖屏,执行步骤S1303,若第一个电影视频的视频方向为横屏,执行步骤S1307。If the video direction of the first movie video is portrait, execute step S1303; if the video orientation of the first movie video is landscape, execute step S1307.
S1303、读取第二个电影视频的视频信息。S1303. Read the video information of the second movie video.
S1304、识别第二个电影视频的视频方向。S1304. Identify the video direction of the second movie video.
若第二个电影视频的视频方向为竖屏,执行步骤S1305,若第二个电影视频的视频方向为横屏,执行步骤S1309。If the video orientation of the second movie video is portrait, execute step S1305; if the video orientation of the second movie video is landscape, execute step S1309.
S1305、读取第三个电影视频的视频信息。S1305. Read the video information of the third movie video.
S1306、将第一个电影视频,第二个电影视频和第三个电影视频的缩略图显示在同一行。S1306. Display the thumbnails of the first movie video, the second movie video and the third movie video in the same row.
步骤S1306执行之后,返回执行步骤S1301。After step S1306 is executed, return to step S1301.
在执行步骤S1306后,若第一个电影视频至第三个电影视频均为横屏方向的视频,则第一个电影视频至第三个电影视频的缩略图的显示方式如前述显示方式Y1所示;若第一个电影视频至第三个电影视频均为竖屏方向的视频,则第一个电影视频至第三个电影视频的缩略图的显示方式如前述显示方式Y3所示;若第一个电影视频至第三个电影视频中,一个电影视频为横屏方向的视频,另外两个电影视频为竖屏方向的视频,则第一个电影视频至第三个电影视频的缩略图的显示方式如前述显示方式Y4-1至Y4-3所示。After step S1306 is executed, if the first movie video to the third movie video are videos in landscape orientation, the thumbnails of the first movie video to the third movie video will be displayed in the same way as the aforementioned display method Y1 display; if the first movie video to the third movie video are videos in vertical screen orientation, then the display modes of the thumbnails from the first movie video to the third movie video are as shown in the aforementioned display mode Y3; if the second movie video From one movie video to the third movie video, one movie video is a video in landscape orientation, and the other two movie videos are videos in portrait orientation, then the thumbnails of the first movie video to the third movie video The display modes are as shown in the aforementioned display modes Y4-1 to Y4-3.
其中,若第一个电影视频为横屏方向的视频,另外两个电影视频为竖屏方向的视频,则显示方式为Y4-1;若第三个电影视频为横屏方向的视频,另外两个电影视频为竖屏方向的视频,则显示方式为Y4-2;若第二个电影视频为横屏方向的视频,另外两个电影视频为竖屏方向的视频,则显示方式为Y4-3。Among them, if the first movie video is a video with a landscape orientation, and the other two movie videos are videos with a portrait orientation, the display mode is Y4-1; if the third movie video is a video with a landscape orientation, the other two If the first movie video is in portrait orientation, the display method is Y4-2; if the second movie video is in landscape orientation, and the other two movie videos are in portrait orientation, the display method is Y4-3 .
S1307、读取第二个电影视频的视频信息。S1307. Read the video information of the second movie video.
S1308、识别第二个电影视频的视频方向。S1308. Identify the video direction of the second movie video.
若第二个电影视频的视频方向为竖屏,执行步骤S1309,若第二个电影视频的视频方向为横屏,执行步骤S1312。If the video orientation of the second movie video is portrait, execute step S1309; if the video orientation of the second movie video is landscape, execute step S1312.
S1309、读取第三个电影视频的视频信息。S1309. Read the video information of the third movie video.
S1310、识别第三个电影视频的视频方向。S1310. Identify the video direction of the third movie video.
若第三个电影视频的视频方向为竖屏,执行步骤S1306,若第三个电影视频的视频方向为横屏,执行步骤S1311。If the video orientation of the third movie video is portrait, execute step S1306; if the video orientation of the third movie video is landscape orientation, execute step S1311.
S1311、将第一个电影视频和第二个电影视频的缩略图显示在同一行。S1311. Display the thumbnails of the first movie video and the second movie video on the same row.
步骤S1311执行之后,返回执行步骤S1301。After step S1311 is executed, return to step S1301.
在执行步骤S1311后,若第一个电影视频和第二个电影视频均为横屏方向的视频,则第一个电影视频和第二个电影视频的缩略图的显示方式如前述显示方式Y2所示;若第一个电影视频和第二个电影视频均为竖屏方向的视频,则第一个电影视频和第二个电影视频的缩略图的显示方式如前述显示方式Y7所示;若第一个电影视频为竖屏方向的视频,第二个电影视频为横屏方向的视频,则缩略图的显示方式如前述显示方式Y8-1所示,若第一个电影视频为横屏方向的视频,第二个电影视频为竖屏方向的视频,则缩略图的显示方式如前述显示方式Y8-2所示。After step S1311 is executed, if both the first movie video and the second movie video are videos in landscape orientation, the thumbnail images of the first movie video and the second movie video will be displayed in the same way as the aforementioned display method Y2. display; if the first movie video and the second movie video are videos in vertical screen orientation, then the display modes of the thumbnails of the first movie video and the second movie video are as shown in the aforementioned display mode Y7; One movie video is a video with a vertical orientation, and the second movie video is a video with a horizontal orientation. video, the second movie video is a video with a vertical screen orientation, and the display mode of the thumbnail is as shown in the aforementioned display mode Y8-2.
S1312、读取第三个电影视频的视频信息。S1312. Read the video information of the third movie video.
S1313、识别第三个电影视频的视频方向。S1313. Identify the video direction of the third movie video.
若第三个电影视频的视频方向为竖屏,执行步骤S1311,若第三个电影视频的视频方向为横屏,执行步骤S1306。If the video orientation of the third movie video is portrait, execute step S1311 ; if the video orientation of the third movie video is landscape orientation, execute step S1306 .
在上述流程中,若任意一个读取视频信息的步骤读取失败,则判断出没有下一个电影视频,将当前已读取到视频信息的电影视频的缩略图在同一行显示,然后返回步骤S1301。In the above process, if any step of reading the video information fails to read, it is judged that there is no next movie video, and the thumbnails of the movie videos whose video information has been read are displayed on the same line, and then return to step S1301 .
例如,当任意一个读取第二个电影视频的视频信息失败时,判断出没有第二个电影视频,将第一个电影视频的缩略图单独在一行显示,然后返回步骤S1301。当任意一个读取第三个电影视频的视频信息失败时,判断出没有第三个电影视频,将第一个电影视频和第二个电影视频的缩略图在同一行显示,然后返回步骤S1301。For example, when any one fails to read the video information of the second movie video, it is judged that there is no second movie video, and the thumbnail of the first movie video is displayed in a single line, and then returns to step S1301. When any one fails to read the video information of the third movie video, it is judged that there is no third movie video, and the thumbnails of the first movie video and the second movie video are displayed on the same row, and then return to step S1301.
在将一个电影视频的缩略图单独在一行显示时,若这个电影视频是横屏方向的视频,则这个电影视频的缩略图按前述显示方式Y5显示,若这个电影视频是竖屏方向的视频,则这个电影视频的缩略图按前述显示方式Y6显示。When displaying the thumbnail of a movie video in a single row, if the movie video is a video in a horizontal orientation, then the thumbnail of the movie video is displayed in the aforementioned display mode Y5; if the movie video is a video in a vertical orientation, Then the thumbnail of the movie video is displayed in the aforementioned display mode Y6.
图13所示的实施例中各步骤的具体实施方式可以参见图12中的对应步骤,不再赘述。For the specific implementation manner of each step in the embodiment shown in FIG. 13 , reference may be made to the corresponding steps in FIG. 12 , which will not be repeated here.
本申请实施例还提供一种计算机存储介质,用于存储计算机程序,计算机程序被执行时,具体用于实现本申请任一实施例提供的视频缩略图的显示方法。An embodiment of the present application further provides a computer storage medium for storing a computer program. When the computer program is executed, it is specifically used to implement the method for displaying video thumbnails provided in any embodiment of the present application.
本申请实施例还提供一种计算机程序产品,包括多条可执行的计算机命令,该产品的计算机命令被执行时,具体用于实现本申请任一实施例提供的视频缩略图的显示方法。The embodiment of the present application also provides a computer program product, including a plurality of executable computer commands. When the computer commands of the product are executed, it is specifically used to implement the video thumbnail display method provided in any embodiment of the present application.

Claims (18)

  1. 一种视频缩略图的显示方法,其特征在于,应用于电子设备,所述显示方法包括:A method for displaying video thumbnails, characterized in that it is applied to electronic equipment, and the display method includes:
    在所述电子设备处于竖屏时,通过相机拍摄得到第一视频,所述第一视频具有第一宽高比;When the electronic device is in a vertical screen, a first video is captured by a camera, and the first video has a first aspect ratio;
    在相册中显示所述第一视频对应的第一缩略图,所述第一缩略图的宽高比和所述第一宽高比一致;Displaying a first thumbnail corresponding to the first video in the photo album, the aspect ratio of the first thumbnail is consistent with the first aspect ratio;
    在所述电子设备处于横屏时,通过相机拍摄得到第二视频,所述第二视频具有第二宽高比;When the electronic device is in a landscape orientation, a second video is captured by a camera, and the second video has a second aspect ratio;
    在相册中显示所述第二视频对应的第二缩略图,所述第一缩略图和所述第二缩略图显示在同一行,所述第二缩略图的宽高比和所述第二宽高比不一致。Display the second thumbnail corresponding to the second video in the photo album, the first thumbnail and the second thumbnail are displayed on the same row, and the aspect ratio of the second thumbnail and the second width The height ratio is inconsistent.
  2. 根据权利要求1所述的显示方法,其特征在于,所述在相册中显示所述第二视频对应的第二缩略图之前,还包括:The display method according to claim 1, wherein before displaying the second thumbnail corresponding to the second video in the photo album, further comprising:
    读取所述第一视频的视频信息;Read the video information of the first video;
    根据所述第一视频的视频信息确定所述第一视频的方向为竖屏;determining the direction of the first video to be a vertical screen according to the video information of the first video;
    读取所述第二视频的视频信息;read the video information of the second video;
    根据所述第二视频的视频信息确定所述第二视频的方向为横屏;determining that the direction of the second video is horizontal according to the video information of the second video;
    确定所述第一缩略图和所述第二视频对应的第二缩略图在同一行显示。It is determined that the first thumbnail and the second thumbnail corresponding to the second video are displayed in the same row.
  3. 根据权利要求1或2所述的显示方法,其特征在于,还包括:The display method according to claim 1 or 2, further comprising:
    在所述电子设备处于横屏时,通过相机拍摄得到第三视频,所述第三视频具有第三宽高比;When the electronic device is in a landscape orientation, a third video is captured by a camera, and the third video has a third aspect ratio;
    在相册中显示所述第三视频对应的第三缩略图,所述第三缩略图显示在和所述第二缩略图不同的一行,所述第三缩略图的宽高比和所述第三宽高比一致。A third thumbnail corresponding to the third video is displayed in the photo album, the third thumbnail is displayed on a row different from that of the second thumbnail, and the aspect ratio of the third thumbnail is the same as that of the third thumbnail. Consistent aspect ratio.
  4. 根据权利要求3所述的显示方法,其特征在于,所述在相册中显示所述第三视频对应的第三缩略图之前,还包括:The display method according to claim 3, wherein before displaying the third thumbnail corresponding to the third video in the photo album, further comprising:
    读取所述第三视频的视频信息;Read the video information of the third video;
    根据所述第三视频的视频信息确定所述第三视频的方向为横屏;determining that the direction of the third video is horizontal according to the video information of the third video;
    确定所述第三视频对应的第三缩略图显示在和所述第二缩略图不同的一行。It is determined that the third thumbnail corresponding to the third video is displayed on a row different from that of the second thumbnail.
  5. 根据权利要求1至4任意一项所述的显示方法,其特征在于,还包括:The display method according to any one of claims 1 to 4, further comprising:
    在所述电子设备处于竖屏时,通过相机拍摄得到第四视频,所述第四视频具有第四宽高比;When the electronic device is in a vertical screen, a fourth video is captured by a camera, and the fourth video has a fourth aspect ratio;
    在相册中显示所述第四视频对应的第四缩略图,所述第四缩略图显示在和所述第三缩略图不同的一行,所述第四缩略图的宽高比和所述第四宽高比一致。A fourth thumbnail corresponding to the fourth video is displayed in the photo album, the fourth thumbnail is displayed on a row different from that of the third thumbnail, and the aspect ratio of the fourth thumbnail is the same as that of the fourth thumbnail. Consistent aspect ratio.
  6. 根据权利要求5所述的显示方法,其特征在于,还包括:The display method according to claim 5, further comprising:
    在所述电子设备处于竖屏时,通过相机拍摄得到第五视频,所述第五视频具有第五宽高比;When the electronic device is in a vertical screen, a fifth video is captured by a camera, and the fifth video has a fifth aspect ratio;
    在相册中显示所述第五视频对应的第五缩略图,所述第五缩略图和所述第四缩略图显示在同一行,所述第五缩略图的宽高比和所述第五宽高比一致。The fifth thumbnail corresponding to the fifth video is displayed in the photo album, the fifth thumbnail and the fourth thumbnail are displayed on the same row, and the aspect ratio of the fifth thumbnail is the same as the fifth width. The high ratio is consistent.
  7. 根据权利要求6所述的显示方法,其特征在于,所述在相册中显示所述第五视频对 应的第五缩略图之前,还包括:The display method according to claim 6, wherein, before displaying the fifth thumbnail corresponding to the fifth video in the photo album, further comprising:
    读取所述第四视频的视频信息;Read the video information of the fourth video;
    根据所述第四视频的视频信息确定所述第四视频的方向为竖屏;determining that the direction of the fourth video is a vertical screen according to the video information of the fourth video;
    读取所述第五视频的视频信息;Read the video information of the fifth video;
    根据所述第五视频的视频信息确定所述第五视频的方向为竖屏;determining that the orientation of the fifth video is vertical according to the video information of the fifth video;
    确定所述第四缩略图和所述第五视频对应的第五缩略图在同一行显示。It is determined that the fourth thumbnail and the fifth thumbnail corresponding to the fifth video are displayed on the same row.
  8. 根据权利要求7所述的显示方法,其特征在于,还包括:The display method according to claim 7, further comprising:
    在所述电子设备处于竖屏时,通过相机拍摄得到第六视频,所述第六视频具有第六宽高比;When the electronic device is in a vertical screen, a sixth video is captured by a camera, and the sixth video has a sixth aspect ratio;
    在相册中显示所述第五视频对应的第六缩略图,所述第六缩略图和所述第五缩略图显示在同一行,所述第六缩略图的宽高比和所述第六宽高比一致。Display the sixth thumbnail corresponding to the fifth video in the photo album, the sixth thumbnail and the fifth thumbnail are displayed in the same row, and the aspect ratio of the sixth thumbnail is the same as the sixth width The high ratio is consistent.
  9. 根据权利要求8所述的显示方法,其特征在于,所述在相册中显示所述第五视频对应的第六缩略图之前,还包括:The display method according to claim 8, characterized in that before displaying the sixth thumbnail corresponding to the fifth video in the photo album, further comprising:
    读取所述第六视频的视频信息;Read the video information of the sixth video;
    根据所述第六视频的视频信息确定所述第六视频的方向为竖屏;determining that the orientation of the sixth video is a vertical screen according to the video information of the sixth video;
    确定所述第四缩略图、所述第五缩略图和所述第六视频对应的第六缩略图在同一行显示。It is determined that the fourth thumbnail image, the fifth thumbnail image, and the sixth thumbnail image corresponding to the sixth video are displayed in the same row.
  10. 根据权利要求1至9任意一项所述的显示方法,其特征在于,所述通过相机拍摄得到第一视频之后,还包括:The display method according to any one of claims 1 to 9, characterized in that, after the first video is captured by the camera, further comprising:
    在所述第一视频中添加电影标签,所述电影标签用于指示所述第一视频为在预设的电影模式下拍摄得到的视频。A movie tag is added to the first video, and the movie tag is used to indicate that the first video is a video shot in a preset movie mode.
  11. 根据权利要求1至10任意一项所述的显示方法,其特征在于,所述在相册中显示所述第一视频对应的第一缩略图之前,还包括:The display method according to any one of claims 1 to 10, characterized in that before displaying the first thumbnail corresponding to the first video in the photo album, further comprising:
    根据显示屏上视频显示区域的宽度和预设的参考系数计算得到所述第一视频的显示高度;calculating the display height of the first video according to the width of the video display area on the display screen and a preset reference coefficient;
    根据所述第一视频的显示高度和所述第一宽高比计算得到所述第一视频的显示宽度;calculating the display width of the first video according to the display height of the first video and the first aspect ratio;
    基于所述第一视频的显示高度和所述第一视频的显示宽度,获得所述第一视频对应的第一缩略图。Based on the display height of the first video and the display width of the first video, a first thumbnail corresponding to the first video is obtained.
  12. 根据权利要求11所述的显示方法,其特征在于,所述在相册中显示所述第二视频对应的第二缩略图之前,还包括:The display method according to claim 11, wherein before displaying the second thumbnail corresponding to the second video in the photo album, further comprising:
    将所述第一视频的显示高度确定为所述第二视频的显示高度;determining the display height of the first video as the display height of the second video;
    根据显示屏上视频显示区域的宽度和所述第一视频的显示宽度,计算得到所述第二视频的显示宽度;calculating the display width of the second video according to the width of the video display area on the display screen and the display width of the first video;
    基于所述第二视频的显示高度和所述第二视频的显示宽度,获得所述第二视频的缩略图所述第二视频对应的第二缩略图。A thumbnail of the second video and a second thumbnail corresponding to the second video are obtained based on the display height of the second video and the display width of the second video.
  13. 根据权利要求3至10任意一项所述的方法,其特征在于,所述在相册中显示所述第三视频对应的第三缩略图之前,还包括:The method according to any one of claims 3 to 10, wherein before displaying the third thumbnail corresponding to the third video in the photo album, further comprising:
    将显示屏上视频显示区域的宽度确定为所述第三视频的显示宽度;Determining the width of the video display area on the display screen as the display width of the third video;
    根据所述第三视频的显示宽度和所述第三宽高比计算得到所述第三视频的显示高度;calculating the display height of the third video according to the display width of the third video and the third aspect ratio;
    基于所述第三视频的显示宽度和所述第三视频的显示高度获得所述第三视频对应的第三缩略图。A third thumbnail corresponding to the third video is obtained based on the display width of the third video and the display height of the third video.
  14. 根据权利要求6至10任意一项所述的显示方法,其特征在于,所述在相册中显示所述第五视频对应的第五缩略图之前,还包括:The display method according to any one of claims 6 to 10, characterized in that before displaying the fifth thumbnail corresponding to the fifth video in the photo album, further comprising:
    根据预设的视频布局间隔,显示屏上视频显示区域的宽度和总宽高比计算得到所述第五视频的显示高度,所述总宽高比为所述第四宽高比和所述第五宽高比之和;According to the preset video layout interval, the width of the video display area on the display screen and the total aspect ratio are calculated to obtain the display height of the fifth video, and the total aspect ratio is the fourth aspect ratio and the first aspect ratio. sum of five aspect ratios;
    根据所述第五视频的显示高度和所述第五视频的宽高比计算得到所述第五视频的显示宽度;calculating the display width of the fifth video according to the display height of the fifth video and the aspect ratio of the fifth video;
    基于所述第五视频的显示高度和所述第五视频的显示宽度,获得所述第五视频对应的第五缩略图。A fifth thumbnail corresponding to the fifth video is obtained based on the display height of the fifth video and the display width of the fifth video.
  15. 根据权利要求11所述的显示方法,其特征在于,所述基于所述第一视频的显示高度和所述第一视频的显示宽度,获得所述第一视频对应的第一缩略图,包括:The display method according to claim 11, wherein the obtaining the first thumbnail corresponding to the first video based on the display height of the first video and the display width of the first video comprises:
    从所述第一视频中解析得到一帧图像;Analyzing and obtaining a frame of image from the first video;
    将解析得到的图像缩小,获得所述第一视频对应的第一缩略图,所述第一缩略图的高度为所述第一视频的显示高度,所述第一缩略图的宽度为所述第一视频的显示宽度。The image obtained by parsing is reduced to obtain a first thumbnail corresponding to the first video, the height of the first thumbnail is the display height of the first video, and the width of the first thumbnail is the width of the first video. The display width of a video.
  16. 根据权利要求12所述的显示方法,其特征在于,所述基于所述第二视频的显示高度和所述第二视频的显示宽度,获得所述第二视频对应的第二缩略图,包括:The display method according to claim 12, wherein the obtaining the second thumbnail corresponding to the second video based on the display height of the second video and the display width of the second video comprises:
    从所述第二视频中解析得到一帧图像;Analyzing and obtaining a frame of image from the second video;
    将解析得到的图像缩小,获得缩小后的图像,所述缩小后的图像的高度和所述第二视频的显示高度一致;shrinking the image obtained by parsing to obtain a reduced image, the height of the reduced image is consistent with the display height of the second video;
    沿宽度方向对所述缩小后的图像居中裁剪,获得所述第二视频对应的第二缩略图,所述第二缩略图的宽度和所述第二视频的显示宽度一致。Centering and cropping the reduced image along the width direction to obtain a second thumbnail corresponding to the second video, where the width of the second thumbnail is consistent with the display width of the second video.
  17. 一种电子设备,其特征在于,所述电子设备包括:一个或多个处理器、存储器和摄像头;An electronic device, characterized in that the electronic device includes: one or more processors, memory and camera;
    所述存储器用于存储一个或多个程序;The memory is used to store one or more programs;
    所述一个或多个处理器用于执行所述一个或多个程序,使得电子设备执行如权利要求1至16任意一项所述的视频缩略图的显示方法。The one or more processors are configured to execute the one or more programs, so that the electronic device executes the video thumbnail display method according to any one of claims 1 to 16.
  18. 一种计算机存储介质,其特征在于,用于存储计算机程序,所述计算机程序被执行时,具体用于实现如权利要求1至16任意一项所述的视频缩略图的显示方法。A computer storage medium, which is characterized in that it is used to store a computer program, and when the computer program is executed, it is specifically used to implement the video thumbnail display method according to any one of claims 1 to 16.
PCT/CN2022/093046 2021-08-12 2022-05-16 Method for displaying video thumbnail, and device and storage medium WO2023016015A1 (en)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN202110925581.X 2021-08-12
CN202110925581 2021-08-12
CN202111022205.6 2021-09-01
CN202111022205.6A CN113918766B (en) 2021-08-12 2021-09-01 Video thumbnail display method, apparatus and storage medium

Publications (2)

Publication Number Publication Date
WO2023016015A1 true WO2023016015A1 (en) 2023-02-16
WO2023016015A9 WO2023016015A9 (en) 2023-11-23

Family

ID=79233739

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/093046 WO2023016015A1 (en) 2021-08-12 2022-05-16 Method for displaying video thumbnail, and device and storage medium

Country Status (2)

Country Link
CN (2) CN113918766B (en)
WO (1) WO2023016015A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113918766B (en) * 2021-08-12 2023-10-13 荣耀终端有限公司 Video thumbnail display method, apparatus and storage medium
CN116048744B (en) * 2022-08-19 2023-09-12 荣耀终端有限公司 Image acquisition method and related electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108737882A (en) * 2018-05-09 2018-11-02 腾讯科技(深圳)有限公司 Display methods, device, storage medium and the electronic device of image
CN112804445A (en) * 2020-12-30 2021-05-14 维沃移动通信有限公司 Display method and device and electronic equipment
CN113055585A (en) * 2019-12-27 2021-06-29 青岛海信移动通信技术股份有限公司 Thumbnail display method of shooting interface and mobile terminal
CN113918766A (en) * 2021-08-12 2022-01-11 荣耀终端有限公司 Video thumbnail display method, device and storage medium

Family Cites Families (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7711193B2 (en) * 2006-11-07 2010-05-04 Aol Inc. Recognizing blank and nearly blank images
CN104007947A (en) * 2014-05-19 2014-08-27 广州金山网络科技有限公司 Thumbnail display method and device
CN105447034A (en) * 2014-08-29 2016-03-30 富泰华工业(深圳)有限公司 Method and system for generating picture thumbnail
CN104754223A (en) * 2015-03-12 2015-07-01 广东欧珀移动通信有限公司 Method for generating thumbnail and shooting terminal
US10198147B2 (en) * 2016-03-17 2019-02-05 Samsung Electronics Co., Ltd. Object management and visualization using a computing device
CN106792272A (en) * 2016-11-28 2017-05-31 维沃移动通信有限公司 The generation method and mobile terminal of a kind of video thumbnails
CN108089788B (en) * 2017-12-19 2019-12-06 维沃移动通信有限公司 Thumbnail display control method and mobile terminal
CN109120997A (en) * 2018-09-30 2019-01-01 北京微播视界科技有限公司 Method for processing video frequency, device, terminal and medium
CN111050062B (en) * 2018-10-15 2022-01-14 华为技术有限公司 Shooting method and electronic equipment
CN113475092B (en) * 2019-02-27 2022-10-04 华为技术有限公司 Video processing method and mobile device
CN110691259B (en) * 2019-11-08 2022-04-22 北京奇艺世纪科技有限公司 Video playing method, system, device, electronic equipment and storage medium
CN111669462B (en) * 2020-05-30 2022-09-02 华为技术有限公司 Method and related device for displaying image
CN111694533A (en) * 2020-06-12 2020-09-22 深圳新智联软件有限公司 Screen projection display method and device applied to horizontal and vertical screens, computer equipment and storage medium
CN111880711B (en) * 2020-07-31 2022-02-01 Oppo广东移动通信有限公司 Display control method, display control device, electronic equipment and storage medium
CN111918131A (en) * 2020-08-18 2020-11-10 北京达佳互联信息技术有限公司 Video generation method and device
CN112822394B (en) * 2020-12-30 2024-03-26 维沃移动通信(杭州)有限公司 Display control method, display control device, electronic equipment and readable storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108737882A (en) * 2018-05-09 2018-11-02 腾讯科技(深圳)有限公司 Display methods, device, storage medium and the electronic device of image
CN113055585A (en) * 2019-12-27 2021-06-29 青岛海信移动通信技术股份有限公司 Thumbnail display method of shooting interface and mobile terminal
CN112804445A (en) * 2020-12-30 2021-05-14 维沃移动通信有限公司 Display method and device and electronic equipment
CN113918766A (en) * 2021-08-12 2022-01-11 荣耀终端有限公司 Video thumbnail display method, device and storage medium

Also Published As

Publication number Publication date
CN113918766A (en) 2022-01-11
CN113918766B (en) 2023-10-13
WO2023016015A9 (en) 2023-11-23
CN117609547A (en) 2024-02-27

Similar Documents

Publication Publication Date Title
CN105190511B (en) Image processing method, image processing apparatus and image processing program
US20220366219A1 (en) Systems and Methods for Providing Feedback for Artificial Intelligence-Based Image Capture Devices
JP7139515B2 (en) Video imaging method, video imaging device, electronic device, and computer-readable storage medium
WO2023016015A1 (en) Method for displaying video thumbnail, and device and storage medium
KR102045957B1 (en) Method and apparatus for photographing of a portable terminal
KR102090624B1 (en) Apparatus and method for processing a image in device
US9373187B2 (en) Method and apparatus for producing a cinemagraph
US20080253685A1 (en) Image and video stitching and viewing method and system
US20170134654A1 (en) Video recording method and device
WO2022252660A1 (en) Video capturing method and electronic device
CN113099146B (en) Video generation method and device and related equipment
CN113064684B (en) Virtual reality equipment and VR scene screen capturing method
BR112014002827B1 (en) METHOD AND SYSTEM FOR SELECTIVE CAPTURE AND PRESENTATION OF PORTIONS OF NATIVE DIFFUSION IMAGES IN A MULTIPLE DIFFUSION CAMERA SYSTEM; AND METHOD AND SYSTEM FOR SELECTIVE CAPTURE AND DISPLAY PORTIONS OF NATIVE IMAGE DIFFUSION IN A MULTIPLE DIFFUSION CAMERA SYSTEM
US20150332091A1 (en) Device and method of processing image
JP2016537918A (en) Method and apparatus for parallax of captions on images when scrolling
EP4171046A1 (en) Video processing method, and device, storage medium and program product
WO2023160241A1 (en) Video processing method and related device
WO2023134583A1 (en) Video recording method and apparatus, and electronic device
US20240144971A1 (en) System and Method for Performing a Rewind Operation with a Mobile Image Capture Device
US10785415B2 (en) Display control device and display control method
WO2023226634A1 (en) Photographing method and electronic device
WO2023231696A1 (en) Photographing method and related device
WO2023231616A1 (en) Photographing method and electronic device
WO2023160143A1 (en) Method and apparatus for viewing multimedia content
CN112995539B (en) Mobile terminal and image processing method

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22855002

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE