Video playing method and device and electronic equipment
By playing the target video in the background video area during video playback and displaying the current video frame of the target video in the main video area, the main element is displayed at least partially outside the main video area, the problem of insufficient visual impact of video playback in the prior art is solved, and the visual impact intensity and traffic increase are achieved.
Patent Information
- Application Number
- CN202311321975.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-12
- Publication Date
- 2025-04-15
AI Technical Summary
In the prior art, video playback has a low visual impact on users, making it difficult to highlight the content presented by the video focus.
By acquiring the target video to be played, the target video is played in the background video area, and the current video frame of the target video is displayed in the main video area with the first border, so that the main element is displayed at least partially outside the main video area.
The visual impact intensity is enhanced, and the visual effect of the main element is out of the frame brings visual impact to the user, and the flow of the pit is increased.
Smart Images

Figure CN119835474A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of video technology, and in particular to a video playback method, device, electronic device and storage medium. Background Art
[0002] As more and more people use electronic devices, more and more applications are running on them. There are more and more applications for people to choose from, which makes the visual effects of application pages particularly important.
[0003] In the prior art, placing videos in applications is a way to enhance the visual effects of the page. However, the common video display format has gradually become difficult to highlight the content that the video focuses on, and the visual impact on users is relatively low.
[0004] Therefore, how to provide a video playback method to enhance the visual impact is a problem that needs to be solved. Summary of the invention
[0005] The video playback method provided in the embodiment of the present application solves the problem in the prior art that video playback has a low visual impact on users.
[0006] An embodiment of the present application provides a video playback method, including: obtaining a target video to be played, and playing the target video in a background video area; when playing the target video, displaying a current video frame of the target video in a main video area having a first border, and the main elements of the current video frame are at least partially displayed outside the main video area; wherein the main video area is located in the background video area.
[0007] Optionally, the displaying of the current video frame of the target video in the main video area having a first border includes: decomposing the current video frame of the target video into first image data and second image data corresponding to the first image data; wherein the first image data includes color information of the current video frame, and the second image data is obtained by cutting out the main elements of the current video frame and includes transparency information of the current video frame; a viewing area range obtained by merging the second image data and the main video area is a first display area for presenting a video picture of the current video frame; and determining whether to present a video picture in which the main elements are at least partially displayed outside the main video area according to the size of the first display area.
[0008] Optionally, the method further includes: acquiring sampled color values of pixels at positions corresponding to the first display area in the first image data, and filling the first display area according to the sampled color values.
[0009] Optionally, it also includes: the area in the background video area other than the first display area is a second display area; the transparency of the pixels in the second display area is set to a specific transparency value representing transparency; or, the second display area is set to a specific background that is different from the main video area.
[0010] Optionally, determining whether to present a video picture in which a main element is at least partially displayed outside a main video area based on the size of the first display area includes: if the first display area is larger than the main video area, presenting a video picture in which a main element is at least partially displayed outside the main video area; otherwise, displaying the current video frame with the first border as the boundary.
[0011] Optionally, if the current playback progress is not greater than a first duration threshold, the current video frame is displayed with the first border as the boundary; if the current playback progress is greater than the first duration threshold and not greater than the second duration threshold, the main elements of the current video frame are at least partially displayed outside the main video area; if the current playback progress is greater than the second duration threshold, the main elements of at least some of the video frames in the subsequent video frames of the current video frame are gradually reduced and displayed; if the current playback progress is greater than the second duration threshold and not greater than the third duration threshold, the main elements of at least some of the video frames in the subsequent video frames are gradually reduced and displayed; if the current playback progress is greater than the third duration threshold, the main video area is controlled to be reduced and shifted, and the displayed video picture is controlled to match the reduction and shift of the main video area until it moves to the target pit position associated with the target video; after moving to the target pit position, the video picture of the target video is controlled to continue to be played at the target pit position.
[0012] Optionally, the first image data is image data of RGB channel; the second image data is image data of Alpha channel; the target video is synthesized frame by frame based on RGB video and Alpha video of the same duration, the same size and corresponding frames; wherein the video frame of the Alpha video is obtained by converting the corresponding RGB frame into a black and white picture and performing cutout processing on the main elements of the video frame.
[0013] Optionally, it also includes: obtaining preset position relationship parameters of the target video; setting the position of the main video area within the background video area according to the position relationship parameters, so that the relative position relationship between the background video area and the main video area includes: the main video area is located in the center position or a special position within the background video area.
[0014] Optionally, it also includes: calculating the rounded pixels of the current video frame according to the rounded parameters of the main video area to obtain a main video area with a rounded effect; when the radius represented by the rounded parameters exceeds the rounded threshold, using a multi-sampling algorithm or a super sampling algorithm to perform rounded processing.
[0015] An embodiment of the present application further provides an electronic device, comprising: a memory, and a processor; the memory is used to store a computer program, and after the computer program is run by the processor, the method provided in the embodiment of the present application is executed.
[0016] Compared with the prior art, this application has the following advantages:
[0017] The embodiments of the present application provide a video playback method, device, electronic device and storage medium, which obtains a target video to be played and plays the target video in a background video area; when playing the target video, the current video frame of the target video is displayed in a main video area with a first border, and the main elements of the current video frame are at least partially displayed outside the main video area; wherein the main video area is located in the background video area. By displaying the main elements outside the main video area, a visual effect of the main elements being out of the frame is brought about, and a visual impact is brought to the user. Furthermore, as the playback process of the target video progresses, a distinct rhythm of the out-of-frame effect is presented, which changes from normal video playback to the main elements being out of the frame and then shrinking to the target pit position, which can highlight the main elements and attract the user's attention, thereby increasing the traffic of the pit position. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 is a processing flow chart of a video playback method provided in the first embodiment of the present application;
[0019] Figure 2 This is a schematic diagram of the rhythm of main elements going out of the frame during video playback provided by the first embodiment of the present application;
[0020] Figure 3 This is one of the schematic diagrams of shrinkage and shifting display during video playback provided by the first embodiment of the present application;
[0021] Figure 4 This is the second schematic diagram of a shrinkage and shifting display during video playback provided by the first embodiment of the present application;
[0022] Figure 5A This is a schematic diagram of a 3D video frame and its out-of-frame processing provided by the first embodiment of the present application;
[0023] 5B is a system block diagram of a player driver provided in the first embodiment of the present application;
[0024] 5C is a system block diagram of a rendering engine provided in the first embodiment of the present application;
[0025] Figure 6 is a processing flow chart of another video playback method provided in the second embodiment of the present application;
[0026] Figure 7 This is a schematic diagram of the relative positions of the background video area and the main video area provided in the second embodiment of the present application;
[0027] Figure 8 is a schematic diagram of a video playback device provided in the third embodiment of the present application;
[0028] Fig. 9 is a schematic diagram of another video playback device provided in the fourth embodiment of the present application;
[0029] Fig.10 It is a schematic diagram of an electronic device provided by this application. DETAILED DESCRIPTION
[0030] Many specific details are described in the following description to facilitate a full understanding of the present application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present application, so the present application is not limited by the specific implementation disclosed below.
[0031] The embodiments of the present application provide a variety of video playback methods, devices, electronic devices, and storage media, which are described one by one in the following embodiments.
[0032] To facilitate understanding, relevant concepts and technologies involved in the embodiments of the present application are first given.
[0033] An application refers to an application program that runs on an electronic product. An application may include one or more pages, and a page may include a page area for displaying information. The information displayed in the page area includes, but is not limited to, videos, static images, dynamic images, text information, etc.
[0034] A scene refers to one or a series of functional scenes corresponding to the information displayed in a page area. It can be embodied in the form of a scene card. The page area corresponding to the scene card is the booth of the scene card, which can display text and / or images.
[0035] A booth is a subdivision of a booth. That is, a scene card can be divided into one or more booths to display different information.
[0036] Out of frame refers to displaying elements in the video beyond the boundaries of the video area, especially by presenting the main elements in multiple consecutive frames of video, breaking through the boundaries of the video area and beyond the scope of the video area, thereby giving the video viewers (hereinafter referred to as viewers) a naked-eye 3D visual effect. Among them, the main element refers to the main object of the video screen and the core of the prominent expression of the video, which can be determined by the clarity meeting certain conditions and / or the size ratio in the video frame meeting certain conditions.
[0037] It should be noted that the above disclosed information is only used to help understand the present application and does not mean to constitute the prior art known to ordinary technicians in the field.
[0038] The video playback method provided in the embodiments of the present application can be applied to electronic devices, including but not limited to: computers, mobile terminals, tablet computers, wearable devices, navigation devices, media players, consumer electronic devices, laptop computers, servers, and distributed computing environments including any of the above systems or devices. On the screen of an electronic device, the video playback method can be implemented through an application page. There can be many specific application scenarios, including but not limited to application page display or computer interface display. The video content involved in the embodiments of the present application can be of various types, including but not limited to commodities, stores, advertisements, news, entertainment, film and television, etc.
[0039] The following combination Figures 1 to 5C The video playback method provided in the first embodiment of the present application is described. Figure 1 The video playback method shown includes:
[0040] Step S101, obtaining a target video to be played, and playing the target video in a background video area;
[0041] Step S102, when playing the target video, display the current video frame of the target video in a main video area with a first border, and the main elements of the current video frame are at least partially displayed outside the main video area; wherein the main video area is located in the background video area.
[0042] The video playback method provided in this embodiment can be applied to a client to implement video playback on the client. The so-called client can be an electronic device or an application running on an electronic device. For example, the client can be a takeaway platform client running on a mobile terminal, can be a video player embedded in an application, or can be a video player installed on a mobile terminal, etc. In the video playback method, two video areas are involved: a background video area and a main video area. The two video areas can be different layers, and preferably the main video area is above the layer of the background video area. The relative position relationship between the two video areas includes: the main video area is located in the background video area. The main video area can be understood as an area divided in the background video area to display the structure of the video picture, including the background, foreground, environment, main elements and other elements of the video picture, which can be understood as an in-frame display area for an out-of-frame video. The background video area can be understood as the actually available video playback area, that is, the range where the video frame can be rendered, which includes the main video area and the display area outside the theme video area that can render out-of-frame elements. The background video area can also be understood as the entire display area for playing out-of-frame videos; the main video area can be understood as the area divided in the background video area to display the video screen structure, including the background, foreground, environment, main elements and other elements of the video screen, and the in-frame display area of the out-of-frame video can be understood. In the method, the target video is played in the background video area; when the target video is played, the current video frame of the target video is displayed in the main video area with a first border, and the main elements of the current video frame are at least partially displayed outside the main video area. Among them, the so-called border refers to the boundary of a video area, which separates or distinguishes the video area to which the border belongs from other page areas. The border can be embodied in a visible form or an invisible border. The frame can be understood as a visual fence. When the video picture of the current video frame is displayed, the main element at least partially exceeds the range of the first frame and is displayed outside the main video area, thus giving the video viewer a visual sense that the main element breaks through the visual fence, thereby achieving an out-of-frame effect. The main element particularly includes elements that can be out of the frame. In practical applications, the video frame before the video frame with an out-of-frame effect may be a video frame in which the main element is in the main video area. As the video frame is displayed continuously, the main element begins to break through the frame from within the first frame to more parts exceeding the frame, thereby achieving a naked eye 3D visual effect. Preferably, the background video area has a second frame, which is at least partially different from the first frame. In a practical application example, the main video area can be set corresponding to the information display area divided for the scene in the application page, and the information display area can be further subdivided into one or more pits for displaying information. The information displayed in the pit includes but is not limited to: product and / or store information, activity information, other pit information, etc.
[0043] As described in step S201, the target video to be played is obtained, and the target video is played in the background video area. The playing of the target video in the background video area includes: when playing, the video frame of the target video is displayed in the main video area in the background video area; when the video frame of the target video is displayed in the main video area, the visual area range of the video picture presenting the current video frame is determined, and the visual area range is the first display area. According to the size of the first display area, it is determined whether to present a video picture in which the main element is at least partially displayed outside the main video area, specifically including: if the first display area is larger than the main video area, then present a video picture in which the main element is at least partially displayed outside the main video area; otherwise, the current video frame is displayed with the first frame as the boundary. When the first display area is larger than the main video area, the area beyond the main video area is the out-of-frame area.
[0044] This embodiment also includes generating the target video according to the original video. The original video includes a first video and a second video of the same length, size and frame-by-frame correspondence, and the first video and the corresponding second video are synthesized frame by frame into a new video for generating naked-eye 3D visual effects as the target video. Each video frame of the first video includes data for recording the color information of the video frame, and each video frame of the second video includes data for recording the transparency information of the video frame. Thus, each video frame of the target video is a synthesized frame, and the synthesized frame includes a first subframe corresponding to the data for recording the color information of the video frame and a second subframe for recording the transparency information of the video frame. The first video is preferably an RGB video composed of RGB frames, and the second video is an Alpha video of the same length, size and frame-by-frame correspondence as the RGB video, and each Alpha frame of the Alpha video is obtained by performing a matting process based on the corresponding RGB frame. The RGB video and the Alpha video are synthesized frame by frame into a new video for generating naked-eye 3D visual effects to obtain the target video, and each video frame of the corresponding target video includes an RGB frame (i.e., a first subframe) and an Alpha frame corresponding to the subframe (i.e., a second subframe). Each video frame of the target video obtained by frame-by-frame synthesis has a size twice that of an RGB frame or an Alpah frame. In this embodiment, the so-called size may be a pixel size. Among them, each video frame of the target video obtained by frame-by-frame synthesis may be a horizontal (i.e., horizontal) splicing synthesis of an RGB frame and a corresponding Alpah frame, or a vertical (i.e., vertical) splicing synthesis. For example, each video frame of the target video obtained by frame-by-frame synthesis is a left RGB frame and a right Alpah frame, or a right RGB frame and a left Alpah frame. For another example, each video frame of the target video obtained by frame-by-frame synthesis is an upper RGB frame and a lower Alpah frame, or a lower RGB frame and an upper Alpah frame. The video frames obtained by frame-by-frame synthesis are encoded according to a certain encoding format such as H.264 or H.265 to form the target video. The target video may be a video file stored locally on the client or stored on the server. When stored on the server, the client obtains the target video from the server in the form of a video stream and plays it. Preferably, the size of the main elements of the video frames before the first target playback progress in the target video is within the size range corresponding to the first frame; the size of the main elements of at least part of the video frames between the first target playback progress and the second target playback progress in the target video exceeds the size corresponding to the first frame in the corresponding size dimension; the size of the main elements of at least part of the video frames after the second target playback progress in the target video is within the size range corresponding to the first frame. Each target playback progress can be reflected by different duration thresholds, and each duration threshold is a threshold set for different video stages within the total video duration.For example, the first target playback progress corresponds to the first duration threshold such as 5S, then when the video is played to 5S, it corresponds to the first target playback progress. In the process of generating the target video, by controlling the video frame features of different video stages, especially the size features, it is helpful to play the generated target video to obtain a better 3D visual effect. For example, when playing to the video frames between the first target playback progress and the second target playback progress, the size features of the main state elements of these video frames in the target video can be used to make these video frames at least partially displayed outside the main video area, thereby presenting a video screen with a three-dimensional effect. Further, it also includes: when the target video is played, as the current playback progress successively matches the first target playback progress and the second target playback progress, it presents a visual out-of-frame rhythm in which the main element is not out of the frame, gradually out of the frame, and then shrinks to not out of the frame. Further, it also includes: if the current playback progress reaches the second target playback progress, the main video area is controlled to shrink and shift, and the displayed video screen is controlled to match the shrinkage and shift of the main video area until it moves to the target pit associated with the target video. Furthermore, it also includes: after moving to the target pit, controlling to continue playing the video screen of the target video at the target pit.
[0045] As described in step S202, when the target video is played, the current video frame of the target video is displayed in the main video area with a first border, and the main elements of the current video frame are at least partially displayed outside the main video area. In practical applications, the visual effect produced after the target video is played depends on the corresponding display logic. And the display logic can also be the processing basis for generating the target video. An example of display logic is as follows: normal display before going out of the frame for n seconds, out of the frame effect for x seconds, the main elements gradually shrink (zoomin) within y seconds, and then, the main video area is reduced and shifted to the target pit associated with the target video within z seconds. Among them, the effect of normal display before going out of the frame is that the video screen is in the entire main video area, that is, ordinary video playback that displays the video screen in a larger area, which can be specifically horizontal screen playback, so as to show a wider field of view.
[0046] In this embodiment, the video screen features of whether the main element of the current video frame is displayed outside the main video area are presented for the current playback progress. Specifically, it includes: if the current playback progress is not greater than the first duration threshold, the current video frame is displayed with the first frame as the boundary, or the current video frame is displayed with the second frame as the boundary. Thus, the main element does not go out of the frame. In a duration threshold example, the first duration threshold is n seconds, and the normal display duration before going out of the frame is n seconds. Further, it also includes: if the current playback progress is greater than the first duration threshold and not greater than the second duration threshold, the main element of the current video frame is at least partially displayed outside the main video area. Thus, the main element out of the frame effect is achieved. Using the above-mentioned duration threshold example, the second duration threshold is (n+x) seconds, then after n seconds of normal playback, x seconds of out-of-frame playback can be achieved. Further, it also includes: if the current playback progress is greater than the second duration threshold, the main elements of at least some video frames in the subsequent video frames of the current video frame are gradually reduced and displayed. Among them, if the current playback progress is greater than the second duration threshold, the main elements of at least some video frames in the subsequent video frames of the current video frame are gradually reduced and displayed, including: if the current playback progress is greater than the second duration threshold and not greater than the third duration threshold, the main elements of at least some video frames in the subsequent video frames are gradually reduced and displayed; if the current playback progress is greater than the third duration threshold, the main video area is controlled to be reduced and shifted, and the displayed video screen is controlled to match the reduction and shift of the main video area until it moves to the target pit position associated with the target video. Continuing with the above duration threshold example, the third duration threshold is (n+x+y) seconds, and the total video playback duration is (n+x+y+z) seconds, then the main element can be gradually shrunk within y seconds, and the main video area can be reduced and shifted to the target pit within z seconds, so that the ordinary video playback that displays the video screen in a larger area is visually associated with the display information of the target pit, so as to realize the user's vision gradually transitioning from ordinary video playback in a larger area to visual guidance that is reduced and shifted to the target pit, and in this process, the main element is highlighted with an out-of-frame visual effect. In a preferred embodiment, after shifting to the target pit, the display information associated with the target pit can be displayed after continuing to play at the target pit for a certain length of time, so as to achieve a better visual guidance effect, wherein continuing to play at the target pit can be understood as small-screen playback. Among them, the display information associated with the target pit is displayed after continuing to play at the target pit for a certain length of time, specifically including: after the target pit continues to play for a certain length of time, the display information associated with the target pit disappears gradually and the display information associated with the target pit is revealed.In this preferred embodiment, the display information associated with the target pit position from the ordinary video playback includes two animation effects from the user's perspective. The first animation is from the ordinary video playback to the zooming out and shifting to the target pit position, and the second animation is played on the small screen of the target pit position until it gradually disappears and the display information associated with the target pit position is revealed. The first animation includes an out-of-frame effect. Of course, in implementation, the playback can also end after shifting to the target pit position.
[0047] In this embodiment, the first animation, i.e., from ordinary video to zooming out and shifting to the target pit position, is preferably implemented as zooming out from right to left, which can be interpolated by a linear or nonlinear interpolator to achieve multiple rhythms of animation process control. It is understandable that zooming out in different modes such as from left to right, from top to bottom, from bottom to top, from all around to the middle, etc., are all within the protection scope of this application.
[0048] Please refer to Figure 2 , the figure schematically shows a rhythm of main elements going out of the frame during video playback, including: playing in the main video frame 201, out-of-frame effect 202, entering the target pit 203, and the effect after entering the pit 204, which are schematic key frames of each stage. In the figure, they are displayed in sequence from 201 to 204 according to the playback time, so as to achieve the three-dimensional animation effect of "start->out of frame->main element shrinking->shrinking to the pit". Shrinking to the pit can be the shrinking of the video screen to the pit or the shrinking and shifting of the video screen to the pit. After moving to the pit, the video or animated image can continue to be displayed in an ordinary way, or other relevant information of the target video can be displayed in the form of text and / or pictures, such as product information, store information, etc. In the figure, the rectangle schematically represents the main video area, and the circle schematically represents the main element.
[0049] Please refer to Figure 3 , the figure shows a display schematic diagram of shrinkage and shifting during video playback, including: out-of-frame effect 301, shrinkage and shift 302, shrinkage and shift to pit position 303. From 301 to 303, the background video area, the main video area and the main elements (the circle in the figure schematically represents the main elements) are all shrunk. The main video area and the main elements shift. Finally, the background video area, the main video area and the main elements shift to the target pit position. In this method, since the geometric shapes of the background video area and the main video area are changed synchronously, for example, the sizes are reduced synchronously, although the out-of-frame area in the background video area needs to be recalculated according to the page size, other pit positions in the display area of the page that share the target video portion can receive operations more quickly. Please refer to Figure 4 , the figure shows another display schematic diagram of shrinkage shift during video playback, including: out-of-frame effect 401, shrinkage shift 402, shrinkage shift to pit position 403, and Figure 3 The difference is, Figure 4 In the implementation method, the background video area is fixed, while the main video area and the main elements shrink and shift, and gradually shrink and shift to the target pit position as the playback progresses. In this implementation method, since only the geometric shape (i.e., size) of the main video area and the main elements need to be adjusted, the size alignment of shrinking to the pit position can be achieved more efficiently.
[0050] In this embodiment, in the first animation corresponding to the normal video playback to the zooming out and shifting to the target pit position, it is iterated with a certain step length, for example, 300ms. Since the geometric shape of the main video area changes over time, the sampled color value obtained from the first image data is also changing, thereby forming an animation effect and the content displayed in the zoomed out state. In one embodiment, since the geometric area changes during the animation process, the color samples outside the main video area after the geometric area changes can be directly discarded to achieve the effect of zooming out and shifting to the target pit position. The amount of calculation is small, but the information of some main elements may be lost. In one embodiment, considering that the main element is generally located at the center of the image corresponding to the first image data (i.e., the RGB frame image), therefore, the main video area after the geometric area changes is controlled to be located at the center of the RGB frame image, which can better retain the information of the main element than the previous embodiment. In another preferred embodiment, the RGB needle image is scaled to retain the information elements to a greater extent, and the information of the main element can be better expressed when the first animation ends at the shift to the target pit position.
[0051] In this embodiment, the display information associated with the target slot is displayed decoupled from the target video, and further, a layout suitable for the display information can be drawn according to the display size of the target slot, thereby avoiding changes in the layout of the display information that lead to poor visual effects as the target video screen is reduced or shifted.
[0052] In this embodiment, pixel-by-pixel processing is performed in the process of displaying the current video frame, especially pixel-by-pixel processing is performed through a graphics rendering pipeline. The rendering layer is processed according to the operating system corresponding to the client, the Android system is based on OpenGLES rendering, and the iOS is based on Metal rendering. The target video can be a video file stored locally on the client or stored on the server. The target video in the form of a locally stored video file or a video stream has a certain encoding format, such as H.264 or H.265 encoding. When the target video is played, the video frame to be rendered to the client screen is decoded according to the encoding format during encoding, and the video frame to be rendered to the client screen is the playback frame. The current video frame refers to the playback frame of the target video being played. Each playback frame obtained by decoding the target video includes first image data representing the first subframe and second image data representing the second subframe. The first image data records the color information of the playback frame. The second image data records transparency information. In practical applications, the target video is obtained by synthesizing RGB video and Alpha video of the same length, size and corresponding frame by frame, which is used to produce naked-eye 3D visual effects. Correspondingly, each playback frame of the target video obtained by decoding includes: an RGB frame based on the RGB channel, i.e., a first subframe, and an Alpha frame corresponding to the Alpha channel, i.e., a second subframe. The size of a playback frame is twice the size of an RGB frame or an Alpha frame. Each playback frame can be a horizontal splicing synthesis of an RGB frame and a corresponding Alpha frame, or a vertical splicing synthesis. For example, the playback frame is a left RGB frame and a right Alpha frame, or a right RGB frame and a left Alpha frame. For another example, the playback frame is an upper RGB frame and a lower Alpha frame, or a lower RGB frame and an upper Alpha frame. Further, the following processing is included: decoding the target video to obtain a video frame (i.e., a playback frame to be rendered to the client screen), and the decoded video frame is decomposed into corresponding first image data and second image data. During implementation, in the process of rendering the current video frame to the client screen, the current video frame is first decomposed into first image data and second image data; the decomposition process includes splitting the source matrix corresponding to the playback frame into two matrices. Take the horizontal format of the left RGB frame and the right Alpha frame as an example. The number of columns of the source matrix of the playback frame is sumColums. Then two matrices are split by column. The data of matrix 1 obtained by taking the columns 0 to 0.5*sumColums-1 of the source matrix is the data of the RGB frame (i.e., the first image data). The data of matrix 2 obtained by taking the columns 0.5*sumColums to sumColums of the source matrix is the data of the Alpha frame (i.e., the second image data). The corresponding decomposition method is adopted according to the splicing method of each subframe of the playback frame.For example, a vertical playback frame with an RGB frame and an Alpha frame below is decomposed into data of the RGB frame and data of the corresponding Alpha frame according to the number of rows.
[0053] Specifically, the current video frame of the target video is displayed in the main video area with a first border, including: decomposing the current video frame of the target video into a first image data and a second image data corresponding to the first image data; wherein the first image data contains the color information of the current video frame, and the second image data is obtained by cutting out the main element of the current video frame and contains the transparency information of the current video frame; the visual area range obtained by merging the second image data and the main video area is the first display area for presenting the video picture of the current video frame; and determining whether to present a video picture in which the main element is at least partially displayed outside the main video area according to the size of the first display area. Specifically, the out-of-frame area corresponding to the main element (i.e., the out-of-frame part of the main element) is determined according to the second image data and the main video area, and the out-of-frame area and the main video area together constitute the first display area. Further, the first display area can be filled with color according to the second image data and the first image data, so as to present a video picture in which the main element is at least partially displayed outside the main video area for the current video frame. Preferably, the target video is a pre-made (or pre-generated) 3D video, especially synthesized frame by frame based on RGB video and Alpha video of the same duration, size and corresponding frames; wherein the video frame of the Alpha video is obtained by converting the corresponding RGB frame into a black and white picture, and performing a cutout process on the main elements of the video frame. Specifically, the 3D video synthesized frame by frame by RGB video and Alpha video of the same duration, size and corresponding frames is used as the target video, or the 3D video is encoded in a certain encoding format such as H.264 or H.265 as the target video. The 3D video includes two groups of corresponding video data, one group is RGB frame data, and the other group is Alpha frame data. The synthesis can be formed by splicing the RGB frame with the corresponding Alpha frame. Of course, other synthesis methods can also be used. Among them, the process of converting the RGB frame into a black and white picture includes: converting it into a grayscale image, and converting it into a black and white picture according to a grayscale threshold. Among them, the first image data is the image data of the RGB channel; the second image data is the image data of the Alpha channel. Specifically, the second image data is compared with the main video area to determine the pixels that need to be retained in the RGB image, thereby obtaining the first display area. Wherein, filling the first display area with color according to the second image data and the first image data includes: obtaining the sampled color values of the pixels at the corresponding positions in the first display area in the first image data, and filling the first display area according to the sampled color values.Furthermore, it also includes: the area other than the first display area in the background video area is a second display area; the second display area is made transparent, specifically, the transparency of the pixels in the second display area is set to a specific transparency value representing transparency; or, the second display area is set to a specific background different from the main video area. The specific transparency value can be 0. Preferably, the specific background is the theme color of the page area corresponding to the scene associated with the target video.
[0054] In actual implementation, the transparency information recorded in the second image data may include two values, A and B. When the value is A, it indicates that the pixel value at the corresponding position needs to be retained, and when the value is B, it indicates that the pixel value at the position does not need to be retained. According to the position where the pixel value needs to be retained in the second image data, the color is taken from the corresponding position of the first image data, and then the color is calculated by taking the union with the first image data corresponding to the main video area to obtain the coloring result of the first display area. For the playback frame that does not go out of the frame, the second image data corresponding to the second subframe is an empty set. In this case, the union calculation means that only the color values sampled from the first image data are used to fill the main video area. If it is determined based on the second image data that the position where the pixel value needs to be retained is located in the main video area, then in this case, the union calculation means that the color values sampled from the first image data are used to fill the main video area.
[0055] Please refer to Figure 5A , the figure shows a schematic diagram of a 3D video frame and its out-of-frame processing, including: a 3D video frame 501a, a first image data 502a, a second image data 503a, a calculated out-of-frame area 504a, and a first display area coloring 505a. Among them, the 3D video frame is a video frame of the target video to be played, and the video frame is generated by processing and splicing the original video frame, for example, it is spliced by corresponding frames in the RGB video and Alpha video of the same length, size and frame-to-frame correspondence. The 3D video frame 501a is segmented (i.e., the video frame is decomposed) to obtain the first image data 502a and the second image data 503a. Among them, the first image data is used for color extraction; the second image data is used to calculate the out-of-frame area with the main video area. In actual processing, the first image data and the second image data are processed pixel by pixel from two dimensions (x and y directions), and the out-of-frame area is calculated according to the second image data and the main video area. The calculation result is shown in the calculated out-of-frame area 504a. The first display area formed by the out-of-frame area and the main video area is filled with color according to the first image data. The coloring result is such as the gray area (top layer of the picture) shown as the first display area filling 505a. The color value of each pixel is determined according to the sampled color value of the pixel at the corresponding position in the first image data.
[0056] In this embodiment, it also includes: obtaining the preset position relationship parameters of the target video, and setting the position of the main video area in the background video area according to the position relationship parameters. Further, the relative position relationship between the background video area and the main video area includes: the main video area is located in the middle position or special position in the background video area. Among them, the special position can be: the main video area is located at the bottom center position in the background video area. The special position can be: the main video area is located at the top center position in the background video area. Of course, it can also be other special positions, without limitation. Further, the preset position relationship parameters also include the position information of the background video area in the page. Thereby, it is convenient to determine the video display position and the out-of-frame area when the client is running, and it has good adaptability to the position, width, height, etc. of the page area where the target video is played, and can adapt to multiple screens better.
[0057] In this embodiment, when the main video area is rounded, it includes: calculating the rounded pixels of the current video frame according to the rounded parameters of the main video area to obtain the main video area with rounded effect. It also includes: when the radius represented by the rounded parameters exceeds the rounded threshold, a multi-sampling algorithm or a super sampling algorithm is used to perform rounded processing. Thereby, the rounded corners are not distorted due to the generation of aliasing in the video screen. The so-called multiple sampling algorithm, namely MSAA (MultiSampling AA), has the following principle: in the rasterization stage, when judging whether a triangle is covered by a pixel, the coverage of the triangle to the sub-pixel is calculated, and the color is calculated once using the pixel center coordinates, and the coloring result is multiplied by the coverage ratio as the final pixel color. The so-called rasterization refers to the process of determining which pixel each vertex is finally located on the screen, and judging whether each pixel is covered by a triangle. The so-called super sampling algorithm refers to SSAA (SuperSampling AA), and its principle is: in the rasterization stage, multiple sub-pixels are sampled and weighted averaged as the color of the final pixel.
[0058] In this embodiment, it also includes: determining the size specification of the target video according to the screen size corresponding to the client. Specifically, it also includes the following processing: judging whether the video frame size of the target video meets the out-of-frame video condition according to the screen size of the terminal on which the application is loaded; if so, executing the step of displaying the current video frame of the target video in the main video area with the first border; otherwise, directly displaying the information corresponding to the target video in the target pit associated with the target video.
[0059] In this embodiment, the naked eye 3D visual effect can be achieved through the playback processing of the target video itself, and it is not necessary to animate the main elements. The target video is especially a video that has been generated and processed according to a certain display logic. Preferably, if the main elements in the screen of each continuous video frame in the target video present an effect from far to near, then combined with the out-of-frame effect, a more shocking naked eye 3D visual experience can be provided. Of course, the main elements in the screen of each continuous video frame in the target video can also be combined with the out-of-frame effect by shifting up and down, providing a better naked eye 3D visual presentation from far to near. The playback processing of the target video itself can be performed on the client, and the pre-generated target video is processed on the server side, or the target video is generated and processed by other clients and then uploaded to the server.
[0060] In this embodiment, the target video is decoded by the client, and the obtained playback frame is decomposed into a first subframe and a second subframe, and then pixel by pixel is merged and rendered to the client screen to achieve the out-of-frame effect, so that the production cost of the target video is low, and it can be well adapted to multiple screens, and there will be no deformation problem during playback. In practical applications, the client device model and screen size may be different, and the resolution is also different. The out-of-frame area is calculated by the client during operation, so it has good adaptability to the position, width, height, etc. of the page area where the target video is played, avoiding deformation during the playback process, and can adapt to different models and screen sizes to ensure that the frame effect can be correctly presented on different screens. If the first subframe and the second subframe are pre-merged into a synthetic frame with an out-of-frame effect on the server, the size of the pre-made synthetic frame is limited. For example, when the synthetic frame is 16:9, the target video is not played in the main video area or the main video area changes according to the model corresponding to the client, it may be necessary to stretch or increase the black edge processing during playback to cause deformation.
[0061] In one implementation, the method further includes: rendering each frame of the target video through a player driver to produce a coherent animation effect. Figure 5B , the figure shows a system block diagram of a player driver, including: the page calls the player 502b through the interface function 501b, and drives the renderer 504b to perform effect rendering 505b and transformation animation 506b for each video frame stored in 503b. Among them, the effect rendering 505b has an effect similar to Figure 2 The out-of-frame effect 202 is shown; wherein the transformation animation refers to the animation effect of geometric shape transformation, such as the shrinking of the main video area, similar to Figure 4 As shown in the contraction shift 402 in .
[0062] In one implementation, it also includes: rendering each frame of the target video through a rendering engine, performing overlay effects on the video frames (i.e., the player of the target video) and the pictures (i.e., the display information associated with the target slot) based on a graphical interface, and being driven by a unified scheduler. Furthermore, it also includes implementing a solution across different clients through an adapter, and providing a rendering engine in the form of a component to implement plug-and-play function calls. Please refer to Figure 5C , the figure shows a system block diagram of a rendering engine, including: a scheduler 501c drives a scene 502c to manage multiple sprites 503c (which are derived classes of nodes), and superimposes effects 505c and animations 506c on nodes 504c to produce a comprehensive effect, wherein the scene 502c can be understood as a screen area that displays a video image of a target video; the content displayed in the screen area is a sprite, and the sprite 503c in the figure includes a video frame displayed in the screen area and display information associated with the target pit that needs to be displayed.
[0063] In this embodiment, it also includes: fatigue control for the playback of the target video, so as to avoid visual fatigue caused to users by frequently displaying videos with 3D visual effects, and improve user experience. In fact, the application page is divided into different page areas according to different scenes for information display, each page area can be understood as a booth, and each booth can include one or more pits. The initial fatigue can be set for different display effects of each booth, such as not more than m times / day, so as to control the display frequency of an effect and avoid frequent display of the same effect. Different scenes can be displayed in the form of cards, which are reflected by different scene cards. Whether different scene cards are displayed on the application page is determined according to at least one of the corresponding scheduling information, display priority, and mutually exclusive logic. In one embodiment, it also includes: obtaining the initial fatigue of the booth corresponding to the scene associated with the target video; recording the display frequency of the booth on the page to which the scene belongs; if the display frequency does not exceed the initial fatigue, then executing the step of displaying the current video frame of the target video in the main video area with the first border; if the display frequency exceeds the initial fatigue, then directly displaying the information corresponding to the target video in the target pit associated with the target video. The information corresponding to the target video includes, but is not limited to: product and / or store information, event information, other pit information, etc. Directly displaying the information corresponding to the target video will jump to the 3D visual effect playback. In one embodiment, it includes: obtaining the motion effect frequency threshold of the booth corresponding to the scene associated with the target video; recording the motion effect frequency of the booth on the page to which the scene belongs; if the motion effect frequency does not exceed the motion effect frequency threshold, then executing the step of displaying the current video frame of the target video in the main video area with a first border; if the motion effect frequency exceeds the motion effect frequency threshold, then directly displaying the information corresponding to the target video in the target pit associated with the target video. In another embodiment, it includes: determining the priority and / or mutual exclusion logic between the scene associated with the target video and other application scenes; determining whether to execute the step of displaying the current video frame of the target video in the main video area with a first border according to the priority and / or mutual exclusion logic. In another embodiment, it includes: determining the scheduling information of the scene and other application scenes associated with the target video, and determining whether to execute the step of displaying the current video frame of the target video in the main video area with a first border according to the scheduling information. In the absence of conflict, the above embodiments may be combined with each other.
[0064] It is understandable that if Figure 2 and Figure 7 The appearance, size, position, style, layout, text, etc. of the interface elements included in or similar interface display diagrams are schematic and do not constitute a limitation on the method.
[0065] It should be noted that, in the absence of conflict, the features given in this embodiment and other embodiments of the present application can be combined with each other, and steps S101 and S102 or similar terms do not limit the steps to be executed sequentially.
[0066] So far, the method provided by this embodiment has been described. The method brings a visual effect of the main element out of the frame by displaying the main element outside the main video area, and brings a visual impact to the user. Furthermore, as the playback process of the target video progresses, a distinct rhythm of the out-of-frame effect is presented, which changes from normal video playback to the main element out of the frame and then shrinks to the target pit position, which can highlight the main element and attract the user's attention, thereby increasing the traffic of the pit position.
[0067] Based on the above embodiment, the second embodiment of the present application provides another video playback method. Figure 6 and Figure 7 The method is described below. For the same parts, please refer to the description of the corresponding parts of the above embodiments and will not be repeated here. Figure 6 The video playback method shown includes:
[0068] Step S601, obtaining a target video to be played, and decomposing a current video frame of the target video into first image data and second image data corresponding to the first image data; wherein the first image data includes color information of the current video frame, and the second image data is obtained by cutting out a main element of the current video frame and includes transparency information of the current video frame;
[0069] Step S602, determining an out-of-frame area corresponding to the main element according to the second image data and the main video area with a first border, wherein the viewing area range formed by the out-of-frame area and the main video area is a first display area for presenting a video picture of a current video frame; wherein the first display area is located within the background video area with a second border;
[0070] Step S603: Fill the first display area with color according to the second image data and the first image data, so that the current video frame presents a video picture with a three-dimensional effect.
[0071] The video playback method provided in this embodiment involves two video areas: a background video area and a main video area. The two video areas can be different layers. Preferably, the main video area is above the layer of the background video area. In the method, the target video is played, and each video frame played is decomposed to obtain the corresponding first image data and second image data. The second image data is used to calculate the frame area, and the first image data is used to fill in the color. Thus, when the first display area exceeds the range of the main video area, the corresponding video picture presents a frame effect. Furthermore, as the video frames are played continuously, the video picture is displayed in the main video area and transitions to the main elements exceeding the first border, providing a naked-eye 3D animation visual effect. Preferably, the background video area has a second border that is at least partially different from the first border.
[0072] Preferably, the first image data is image data of RGB channels; and the second image data is image data of Alpha channel.
[0073] In this embodiment, it also includes: obtaining the preset position relationship parameters of the target video, and setting the position of the main video area in the background video area according to the position relationship parameters. Further, the relative position relationship between the background video area and the main video area includes: the main video area is located in the middle position or a special position in the background video area. Among them, the special position can be: the main video area is located at the bottom center position in the background video area. The special position can be: the main video area is located at the top center position in the background video area. Of course, it can also be other special positions, without limitation. During implementation, the expected visual effect can be determined according to the content characteristics of the target video, and the preset position relationship parameters can be determined according to the expected visual effect. For example, if the main element is expected to be out of the frame from far to near, the preset position relationship parameters can be such that the main video area is centered in the background video area. For another example, if the main element is expected to move out of the frame from far to near from the A side and from the adjacent or opposite B side, the preset position relationship parameters can be such that the main video area is located in the position corresponding to the A side in the background video area. Please refer to Figure 7, the figure schematically shows the relative position of the background video area and the main video area, including: setting the main video area position 701, centering layout 702, special position layout one 703, and special position layout two 704. Among them, setting the main video area position 701 shows setting the coordinates of point A in the upper left corner of the main video area in the background video area, as well as the width and height of the main video area. 702-703 are schematic representations of different relative positions. In the centering layout 702, the center of the main video area coincides with the center of the background video area. In the special position layout one 703, the main video area is located at the bottom position in the background video area. In the special position layout two 704, the main video area is located at the top position in the background video area. Of course, it can also be other relative positions, such as the main video area is located in the top center or top center in the background video area, etc., without limitation.
[0074] As described in step S603, fill the first display area including the out-of-frame area. Wherein, the filling of the first display area according to the second image data and the first image data includes: obtaining the sampled color values of the pixels at the corresponding positions in the first display area in the first image data, and filling the first display area according to the sampled color values. Further, it also includes: the area other than the first display area in the background video area is the second display area; the transparency of the pixels in the second display area is set to a specific transparency value representing transparency; or, the second display area is set to a specific background different from the main video area. The specific transparency value can be 0 or other values representing translucency. Setting the second display area transparent or translucent can make other page information in the lower layer of the background video area visible. Wherein, the specific background is a specific solid color background or a theme color background of the page area corresponding to the scene associated with the target video. The solid color background or the theme color background of the page area can cause visual difference for the video screen, thereby facilitating the presentation of a frame effect.
[0075] In this embodiment, it also includes: calculating the rounded corner pixels of the current video frame according to the rounded corner parameters of the main video area to obtain the main video area with rounded corner effect. It also includes: when the radius represented by the rounded corner parameters exceeds the rounded corner threshold, using a multi-sampling algorithm or a super sampling algorithm to perform rounded corner processing. In this way, the rounded corners in the video screen will not be distorted due to jagged edges.
[0076] In this embodiment, if the size of the target video meets certain specifications, it will be played on the client. Different screen sizes may have different requirements for the size of the target video. Further, it also includes: obtaining the screen size of the terminal that loads the application; judging whether the video frame size of the target video meets the out-of-frame video condition based on the screen size; if not, controlling the terminal to directly display the information corresponding to the target video at the target pit associated with the target video. Further, it also includes: after moving to the target pit, controlling to continue playing the video screen of the target video at the target pit.
[0077] Preferably, the size of the main element of the video frame before the first target playback progress in the target video is within the size range corresponding to the first frame; the size of the main element of at least part of the video in the video frame between the first target playback progress and the second target playback progress in the target video exceeds the size corresponding to the first frame in the corresponding size dimension; the size of the main element of at least part of the video frame after the second target playback progress in the target video is within the size range corresponding to the first frame. Wherein, the current video frame is the video frame between the first target playback progress and the second target playback progress; the making the current video frame present a video screen with a stereoscopic effect includes: making the current video frame at least partially displayed outside the main video area. Further, it also includes: when the target video is played, as the current playback progress successively matches the first target playback progress and the second target playback progress, it presents a visual out-of-frame rhythm of the main element gradually going from out of the frame to out of the frame and then shrinking to not out of the frame. Further, it also includes: if the current playback progress reaches the second target playback progress, the main video area is controlled to shrink and shift, and the displayed video screen is controlled to match the shrinkage and shift of the main video area until it moves to the target pit associated with the target video.
[0078] In this embodiment, it also includes: obtaining the initial fatigue and / or motion effect frequency threshold of the booth corresponding to the scene associated with the target video; recording the display frequency and / or motion effect frequency of the booth on the page belonging to the scene; if the display frequency exceeds the initial fatigue, and / or the motion effect frequency exceeds the motion effect frequency threshold, then controlling the information corresponding to the target video to be displayed directly in the target booth associated with the target video.
[0079] In this embodiment, it also includes: determining at least one of the priority, mutual exclusion logic and scheduling information between the scene associated with the target video and other application scenes; and determining whether to directly display the information corresponding to the target video in the target slot associated with the target video based on at least one of the above-mentioned priority, mutual exclusion logic and scheduling information.
[0080] So far, the method provided in this embodiment has been explained. In the method, the video frame of the target video can be decomposed into first image data and corresponding second image data, and the video frame is rendered by processing each pixel one by one, so as to achieve a visual effect of the main element of a video frame being out of the frame, and a naked-eye 3D visual effect is produced without the assistance of other equipment, thereby highlighting the main element and bringing a visual impact to the user.
[0081] One embodiment of the present application also provides a video display method. The video display method includes: obtaining a target video to be played, and playing the target video in a background video area; when playing the target video, displaying the video frame of the target video according to the display logic, including: displaying the video frame in a main video area with a first border in the background video area, and making at least part of the main elements of the video frame at least partially displayed outside the main video area. Among them, the so-called border refers to the boundary of a video area, which separates or distinguishes the video area to which the border belongs from other page areas. The border can be embodied in a visible form or an invisible boundary. The border can be understood as a visual fence. Since the main element at least partially exceeds the range of the first border when displaying the video picture of the current video frame and is displayed outside the main video area, the video viewer has the visual effect of the main element breaking through the visual fence, thereby achieving an out-of-frame effect. The main element is an element that can be out of the frame. Among them, the main video area can be understood as the main area for displaying the video picture structure divided in the background video area, that is, the area in the frame, including the background, foreground, environment, main elements and other elements of the video picture. The background video area can be understood as also including the out-of-frame display area of the out-of-frame elements rendered by breaking through the first frame in addition to the theme video area. In practical applications, the video frame before the video frame with the out-of-frame effect can be the main element in the main video area. As the video frame is displayed continuously, the main element starts to break through the frame from within the first frame to more parts beyond the frame, thereby realizing the naked eye 3D visual effect. Preferably, the background video area has a second frame, and the second frame is at least partially different from the first frame. The background video area and the main video area can be different layers, and the preferred main video area is above the layer of the background video area. The relative position relationship of the two video areas includes: the main video area is located in the background video area, and the specific relative position relationship includes but is not limited to the center layout, other special position layouts, etc., such as the center layout main video area and the center of the background video area coincide. Other special position layouts include but are not limited to: the main video area is located at the bottom position in the background video area, and the main video area is located at the top position in the background video area. Of course, it can also be other relative positions, such as the main video area is located in the top center or top center of the background video area. In practical applications, the initial position and initial size of the background video area or the main video area on the page may include one or more slots for displaying information. The information displayed in the slots includes, but is not limited to: product and / or store information, activity information, other slot information, etc.
[0082] During implementation, the video frame of the target video is displayed according to the display logic, including: displaying the video screen in the display area of the initial position and initial size in the first stage of the target video playback, displaying at least part of the main elements of the video screen out of the frame in the second stage of the playback, and displaying the main elements in the third stage of the playback. The video screen is reduced and shifted to the target position. Among them, each stage corresponds to a different playback progress or duration. Specifically, the first stage is related to the first playback progress or the first duration threshold; the first stage is related to the second playback progress or the second duration threshold; the third stage is related to the third playback progress or the third duration threshold.
[0083] In one embodiment, displaying the video frame of the target video according to the display logic includes: when the target video starts to play, the video frame is displayed according to the initial position and initial size, and as the playback progresses, the video screen shrinks and shifts to the target pit position associated with the target video.
[0084] In one embodiment, the display of the video frame of the target video according to the display logic includes: when displaying the video frame of the target video in the main video area, determining whether the main element of the current video frame is at least partially displayed outside the main video area according to the combined size of the main video area and the second image data. Further, it specifically includes: if the current playback progress is not greater than the first duration threshold, the current video frame is displayed with the first frame as the boundary, or the current video frame is displayed with the second frame as the boundary. Thus, the main element does not go out of the frame. Further, it also includes: if the current playback progress is greater than the first duration threshold and not greater than the second duration threshold, the main element of the current video frame is at least partially displayed outside the main video area. Thus, the effect of the main element going out of the frame is achieved. Further, it also includes: if the current playback progress is greater than the second duration threshold, the main elements of at least some of the video frames in the subsequent video frames of the current video frame are gradually reduced and displayed. Wherein, if the current playback progress is greater than the second duration threshold, the main elements of at least some of the video frames in the subsequent video frames of the current video frame are gradually reduced and displayed, including: if the current playback progress is greater than the second duration threshold and not greater than the third duration threshold, the main elements of at least some of the video frames in the subsequent video frames are gradually reduced and displayed; if the current playback progress is greater than the third duration threshold, the main video area is controlled to shrink and shift, and the displayed video screen is controlled to match the shrinkage and shift of the main video area until it moves to the target pit associated with the target video. An example of display logic is as follows: normal display before out-of-frame for n seconds, out-of-frame effect for x seconds, the main elements gradually shrink (zoomin) within y seconds, and then the main video area shrinks and shifts to the target pit associated with the target video within z seconds. According to the display logic, the first duration threshold can be set to n seconds, and the normal display duration before out-of-frame is n seconds; the second duration threshold is (n+x) seconds, and x seconds of out-of-frame playback can be achieved after n seconds of normal playback; the third duration threshold is (n+x+y) seconds, and the total video playback duration is (n+x+y+z) seconds, then the main elements can be gradually shrunk within y seconds, and the main video area can be reduced and moved to the target position within z seconds.
[0085] In one embodiment, the size of the main element of the video frame before the first target playback progress in the target video is within the size range corresponding to the first frame; the size of the main element of at least part of the video in the video frame between the first target playback progress and the second target playback progress in the target video exceeds the size corresponding to the first frame in the corresponding size dimension; the size of the main element of at least part of the video frame in the video frame after the second target playback progress in the target video is within the size range corresponding to the first frame. Each target playback progress can be reflected by different duration thresholds, and each duration threshold is a threshold set for different video stages within the total duration of the video. For example, the first target playback progress corresponds to the first duration threshold such as 5S, and when the video is played to 5S, it corresponds to the first target playback progress. In the process of generating the target video, by controlling the video frame features of different video stages, especially the size features, it is helpful to play the generated target video to obtain a better 3D visual effect. For example, when playing to the video frames between the first target playback progress and the second target playback progress, the size features of the main state elements of these video frames in the target video can be used to make these video frames at least partially displayed outside the main video area, thereby presenting a video screen with a three-dimensional effect. Furthermore, it also includes: when the target video is played, as the current playback progress matches the first target playback progress and the second target playback progress in sequence, a visual out-of-frame rhythm is presented in which the main element is not out of the frame, gradually out of the frame, and then shrinks to not out of the frame. Further, it also includes: if the current playback progress reaches the second target playback progress, the main video area is controlled to shrink and shift, and the displayed video picture is controlled to match the shrinkage and shift of the main video area until it moves to the target pit associated with the target video. Thereby, the ordinary video playback that displays the video picture in a larger area is visually associated with the display information of the target pit, so as to realize the user's visual transition from ordinary video playback in a larger area to visual guidance that is reduced and shifted to the target pit, and in this process, the main element is highlighted with an out-of-frame visual effect. In a preferred embodiment, it also includes: after moving to the target pit, the video picture of the target video is controlled to continue to be played at the target pit. Specifically, after the video is shifted to the target position, the video may continue to be played at the target position for a certain period of time before displaying the display information associated with the target position, so as to achieve a better visual guidance effect, wherein the continued playback at the target position can be understood as small-screen playback. The display information associated with the target position may be displayed after the video continues to be played at the target position for a certain period of time, specifically including: after the video continues to be played at the target position for a certain period of time, the video gradually disappears and the display information associated with the target position is revealed.In this preferred embodiment, the display information associated with the target pit position from the ordinary video playback includes two animation effects from the user's perspective. The first animation is from the ordinary video playback to the zooming out and shifting to the target pit position, and the second animation is played on the small screen of the target pit position until it gradually disappears and the display information associated with the target pit position is revealed. The first animation includes an out-of-frame effect. Of course, in implementation, the playback can also end after shifting to the target pit position.
[0086] In this embodiment, the first animation, i.e., from ordinary video to zooming out and shifting to the target pit position, is preferably implemented as zooming out from right to left, which can be interpolated by a linear or nonlinear interpolator to achieve multiple rhythms of animation process control. It is understandable that zooming out in different modes such as from left to right, from top to bottom, from bottom to top, from all around to the middle, etc., are all within the protection scope of this application.
[0087] In this embodiment, in the first animation corresponding to the normal video playback to the zooming out and shifting to the target pit position, since the geometric shape of the main video area changes over time, the sampled color values obtained from the first image data are also changing, thereby forming an animation effect and the content displayed in the zoomed out state. In one embodiment, since the geometric area changes during the animation process, the color samples outside the main video area after the geometric area changes can be directly discarded to achieve the effect of zooming out and shifting to the target pit position. The amount of calculation is small, but some information of the main elements may be lost. In one embodiment, considering that the main element is generally located at the center of the image corresponding to the first image data (i.e., the RGB frame image), therefore, the main video area after the geometric area changes is controlled to be located at the center of the RGB frame image, which can better retain the information of the main element than the previous embodiment. In another preferred embodiment, the RGB needle image is scaled to retain the information elements to a greater extent, and the information of the main element can be better expressed when the first animation ends at the shift to the target pit position.
[0088] In this embodiment, the display information associated with the target slot is displayed decoupled from the target video, and further, a layout suitable for the display information can be drawn according to the display size of the target slot, thereby avoiding changes in the layout of the display information that lead to poor visual effects as the target video screen is reduced or shifted.
[0089] In this embodiment, it also includes: controlling the playback according to at least one of the fatigue of the scene associated with the target video, the priority and / or mutually exclusive logic with other application scenes, and scheduling information, so as to avoid visual fatigue caused to users by frequently displaying videos with 3D visual effects and avoid conflicts between different display effects, thereby improving user experience. In one embodiment, it also includes: obtaining the initial fatigue of the booth corresponding to the scene associated with the target video; recording the display frequency of the booth on the page to which the scene belongs; if the display frequency does not exceed the initial fatigue, executing the step of displaying the current video frame of the target video in the main video area with a first border; if the display frequency exceeds the initial fatigue, directly displaying the information corresponding to the target video in the target pit associated with the target video. The information corresponding to the target video includes, but is not limited to: product and / or store information, activity information, other pit information, etc. Directly displaying the information corresponding to the target video will skip the 3D visual effect playback. In one embodiment, it includes: obtaining the motion effect frequency threshold of the booth corresponding to the scene associated with the target video; recording the motion effect frequency of the booth on the page to which the scene belongs; if the motion effect frequency does not exceed the motion effect frequency threshold, then executing the step of displaying the current video frame of the target video in the main video area with a first border; if the motion effect frequency exceeds the motion effect frequency threshold, then directly displaying the information corresponding to the target video in the target slot associated with the target video. In another embodiment, it includes: determining the priority and / or mutual exclusion logic between the scene associated with the target video and other application scenes; determining whether to execute the step of displaying the current video frame of the target video in the main video area with a first border according to the priority and / or mutual exclusion logic. In yet another embodiment, it includes: determining the scheduling information of the scene associated with the target video and other application scenes, and determining whether to execute the step of displaying the current video frame of the target video in the main video area with a first border according to the scheduling information.
[0090] In the absence of conflict, the above implementation modes can be combined with each other.
[0091] So far, the method provided in this embodiment has been described. In the method, the rendering of the video frame is controlled to produce a naked-eye 3D visual effect without the assistance of other equipment, so as to highlight the main elements and bring a visual impact to the user.
[0092] Corresponding to the first embodiment, the third embodiment of the present application provides a video playback device. For the relevant parts, please refer to the description of the corresponding method embodiment. Figure 8 , the video playback device shown in the figure includes:
[0093] The playing unit 801 is used to obtain a target video to be played and play the target video in the background video area;
[0094] The out-of-frame unit 802 is used to display the current video frame of the target video in a main video area with a first border when playing the target video, and the main elements of the current video frame are at least partially displayed outside the main video area; wherein the main video area is located in the background video area.
[0095] Optionally, the frame-out unit 802 is specifically used to: decompose the current video frame of the target video into first image data and second image data corresponding to the first image data; wherein the first image data includes color information of the current video frame, and the second image data is obtained by cutting out the main elements of the current video frame and includes transparency information of the current video frame; the viewing area range obtained by merging the second image data and the main video area is the first display area for presenting the video picture of the current video frame; and determine whether to present a video picture in which the main elements are at least partially displayed outside the main video area based on the size of the first display area.
[0096] Optionally, the frame output unit 802 is specifically used to: obtain sampled color values of pixels at positions corresponding to the first display area in the first image data, and fill the first display area according to the sampled color values.
[0097] Optionally, the frame unit 802 is specifically used to: set the area in the background video area except the first display area as the second display area; set the transparency of the pixels in the second display area to a specific transparency value representing transparency; or set the second display area to a specific background that is different from the main video area.
[0098] Optionally, the out-of-frame unit 802 is specifically used to: if the first display area is larger than the main video area, present a video picture in which the main element is at least partially displayed outside the main video area; otherwise, display the current video frame with the first frame as the boundary.
[0099] Optionally, the out-of-frame unit 802 is specifically used to: if the current playback progress is not greater than a first duration threshold, display the current video frame with the first border as the boundary; if the current playback progress is greater than the first duration threshold and not greater than a second duration threshold, display at least part of the main elements of the current video frame outside the main video area; if the current playback progress is greater than the second duration threshold, the main elements of at least part of the video frames in the subsequent video frames of the current video frame are gradually reduced and displayed.
[0100] Optionally, the frame-out unit 802 is specifically used to: if the current playback progress is greater than the second duration threshold and not greater than the third duration threshold, the main elements of at least part of the video frames in the subsequent video frames are gradually reduced and displayed; if the current playback progress is greater than the third duration threshold, the main video area is controlled to be reduced and shifted, and the displayed video screen is controlled to match the reduction and shift of the main video area until it moves to the target pit position associated with the target video.
[0101] Optionally, the out-of-frame unit 802 is specifically used to: after moving to the target pit, control the video screen of the target video to continue to be played at the target pit.
[0102] Optionally, the first image data is image data of RGB channels; and the second image data is image data of Alpha channel.
[0103] Optionally, the target video is synthesized frame by frame based on an RGB video and an Alpha video of the same length, the same size and corresponding frames; wherein the video frame of the Alpha video is obtained by converting the corresponding RGB frame into a black and white picture and performing cutout processing on the main elements of the video frame.
[0104] Optionally, the relative position relationship between the background video area and the main video area includes: the main video area is located at a center position or a special position in the background video area.
[0105] Optionally, the control unit is used to: obtain preset position relationship parameters of the target video, and set the position of the main video area within the background video area according to the position relationship parameters.
[0106] Optionally, the frame output unit 802 is specifically used to calculate the rounded corner pixels of the current video frame according to the rounded corner parameters of the main video area to obtain the main video area with a rounded corner effect.
[0107] Optionally, the out-of-frame unit 802 is specifically used to: when the radius represented by the rounded corner parameter exceeds the rounded corner threshold, use a multi-sampling algorithm or a super sampling algorithm to perform rounded corner processing.
[0108] Optionally, the device also includes a control unit, which is used to: determine whether the video frame size of the target video meets the out-of-frame video condition based on the screen size of the terminal on which the application is loaded; if so, execute the step of displaying the current video frame of the target video in the main video area with a first border; otherwise, directly display the information corresponding to the target video in the target pit associated with the target video.
[0109] Corresponding to the second embodiment, the fourth embodiment of the present application provides a video playback device. For the relevant parts, please refer to the description of the corresponding method embodiment. Fig. 9 , the video playback device shown in the figure includes:
[0110] The video frame segmentation unit 901 is used to obtain a target video to be played, and decompose a current video frame of the target video into first image data and second image data corresponding to the first image data; wherein the first image data includes color information of the current video frame, and the second image data is obtained by cutting out a main element of the current video frame and includes transparency information of the current video frame;
[0111] The out-of-frame calculation unit 902 is used to determine the out-of-frame area corresponding to the main element according to the second image data and the main video area with the first frame, and the viewing area range formed by the out-of-frame area and the main video area is the first display area of the video picture presenting the current video frame; wherein the first display area is located in the background video area with the second frame;
[0112] The coloring unit 903 is used to fill the first display area with color according to the second image data and the first image data, so that the current video frame presents a video picture with a three-dimensional effect.
[0113] Optionally, the color filling unit 903 is specifically used to: obtain sampled color values of pixels at positions corresponding to the first display area in the first image data, and fill the first display area according to the sampled color values.
[0114] Optionally, the coloring unit 903 is specifically used to: set the area in the background video area other than the first display area as a second display area; set the transparency of the pixels in the second display area to a specific transparency value representing transparency; or set the second display area to a specific background that is different from the main video area.
[0115] Optionally, the specific background is a specific solid color background or a theme color background of a page area corresponding to a scene associated with the target video.
[0116] Optionally, the background video area has a second border that is at least partially different from the first border.
[0117] Optionally, the size of the main elements of the video frames before the first target playback progress in the target video is within the size range corresponding to the first border; the size of the main elements of at least part of the video frames between the first target playback progress and the second target playback progress in the target video exceeds the size corresponding to the first border in the corresponding size dimension; the size of the main elements of at least part of the video frames after the second target playback progress in the target video is within the size range corresponding to the first border.
[0118] Optionally, the current video frame is a video frame between the first target playback progress and the second target playback progress; the out-of-frame calculation unit 902 is specifically used to: make the current video frame at least partially displayed outside the main video area.
[0119] Optionally, the out-of-frame calculation unit 902 is specifically used for: when the target video is played, as the current playback progress matches the first target playback progress and the second target playback progress in sequence, a visual out-of-frame rhythm is presented in which the main element is out of the frame, gradually becomes out of the frame, and then shrinks to not out of the frame.
[0120] Optionally, the out-of-frame calculation unit 902 is specifically used to: if the current playback progress reaches the second target playback progress, control the main video area to shrink and shift, and control the displayed video screen to match the shrinkage and shift of the main video area until it moves to the target pit position associated with the target video.
[0121] Optionally, the device also includes a control unit, which is used to: obtain the initial fatigue and / or motion effect frequency threshold of the booth corresponding to the scene associated with the target video; record the display frequency and / or motion effect frequency of the booth on the page belonging to the scene; if the display frequency exceeds the initial fatigue, and / or the motion effect frequency exceeds the motion effect frequency threshold, then control the information corresponding to the target video to be displayed directly in the target slot associated with the target video.
[0122] Optionally, the control unit is specifically used to: after moving to the target pit, control the video screen of the target video to continue to be played at the target pit.
[0123] Optionally, the control unit is specifically used to: determine at least one of the priority, mutual exclusion logic and scheduling information between the scene associated with the target video and other application scenes; and determine whether to directly display the information corresponding to the target video in the target slot associated with the target video based on at least one of the above-mentioned priority, mutual exclusion logic and scheduling information.
[0124] Optionally, the first image data is image data of RGB channels; and the second image data is image data of Alpha channel.
[0125] Optionally, the control unit is specifically used to: obtain preset position relationship parameters of the target video, and set the position of the main video area within the background video area according to the position relationship parameters.
[0126] Optionally, the coloring unit 903 is specifically used to calculate the rounded corner pixels of the current video frame according to the rounded corner parameters of the main video area to obtain the main video area with a rounded corner effect.
[0127] Optionally, the control unit is specifically used to: obtain the screen size of the terminal on which the application is loaded; determine whether the video frame size of the target video meets the out-of-frame video condition based on the screen size; if not, control the terminal to directly display the information corresponding to the target video in the target pit associated with the target video.
[0128] Based on the above embodiments, the fifth embodiment of the present application provides an electronic device. For the relevant parts, please refer to the corresponding description of the above embodiments. Fig.10 The electronic device shown in the figure includes: a memory 1001 and a processor 1002; the memory is used to store a computer program, and after the computer program is run by the processor, the method provided in the embodiment of the present application is executed.
[0129] Based on the above embodiments, the sixth embodiment of the present application provides a computer storage medium. For the relevant parts, please refer to the corresponding description of the above embodiments. Fig.10 The memory in the figure can be understood as the storage medium. The computer storage medium stores computer execution instructions, which are used to implement the method provided in the embodiment of the present application when executed by the processor.
[0130] It should be noted that the embodiments of the present application may involve the use of user data. In actual applications, the user's specific personal data should be used in the scheme described in this article within the scope permitted by applicable laws and regulations, in compliance with the applicable laws and regulations of the country where it is located (for example, the user's explicit consent, effective notification to the user, etc.).
[0131] In a typical configuration, an electronic device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory. The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0132] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0133] Although the present application is disclosed as above in the form of a preferred embodiment, it is not intended to limit the present application. Any technical personnel in this field may make possible changes and modifications without departing from the spirit and scope of the present application. Therefore, the scope of protection of the present application shall be based on the scope defined by the claims of the present application.
Claims
1. A video playback method, characterized in that: include: Obtain a target video to be played, and play the target video in the background video area; When playing the target video, the current video frame of the target video is displayed in a main video area having a first border, and the main elements of the current video frame are at least partially displayed outside the main video area; wherein the main video area is located in the background video area.
2. The method according to claim 1, characterized in that The step of displaying the current video frame of the target video in the main video area having the first border comprises: Decomposing the current video frame of the target video into first image data and second image data corresponding to the first image data; wherein the first image data includes color information of the current video frame, and the second image data is obtained by cutting out the main elements of the current video frame and includes transparency information of the current video frame; The viewing area range obtained by combining the second image data and the main video area is a first display area for presenting a video picture of the current video frame; Whether to present a video picture in which a main element is at least partially displayed outside a main video area is determined according to the size of the first display area.
3. The method according to claim 2, characterized in that Also includes: The sampled color values of pixels at positions corresponding to the first display area in the first image data are obtained, and the first display area is filled according to the sampled color values.
4. The method according to claim 2, characterized in that: Also includes: The area in the background video area other than the first display area is a second display area; The transparency of the pixels in the second display area is set to a specific transparency value representing transparency; or the second display area is set to a specific background different from the main video area.
5. The method according to claim 2, characterized in that: The determining, according to the size of the first display area, whether to present a video picture in which a main element is at least partially displayed outside a main video area includes: If the first display area is larger than the main video area, a video picture is presented in which at least part of the main element is displayed outside the main video area; Otherwise, the current video frame is displayed with the first frame as the boundary.
6. The method according to claim 5, characterized in that Also includes: If the current playback progress is not greater than the first duration threshold, displaying the current video frame with the first frame as the boundary; If the current playback progress is greater than the first duration threshold and not greater than the second duration threshold, displaying at least a portion of the main element of the current video frame outside the main video area; If the current playback progress is greater than the second duration threshold and not greater than the third duration threshold, main elements of at least some of the subsequent video frames are gradually reduced and displayed; If the current playback progress is greater than the third duration threshold, the main video area is controlled to shrink and shift, and the displayed video screen is controlled to match the shrinkage and shift of the main video area until it moves to the target pit position associated with the target video; After moving to the target pit position, the control continues to play the video screen of the target video at the target pit position.
7. The method according to claim 2, characterized in that The first image data is image data of RGB channels; the second image data is image data of Alpha channel; The target video is synthesized frame by frame based on an RGB video and an Alpha video of the same duration, size and frame by frame correspondence; wherein the video frame of the Alpha video is obtained by converting the corresponding RGB frame into a black and white picture and performing a cutout process on the main elements of the video frame.
8. The method according to claim 1, characterized in that Also includes: Obtaining preset position relationship parameters of the target video; The position of the main video area within the background video area is set according to the position relationship parameter so that the relative position relationship between the background video area and the main video area includes: the main video area is located in the center or a special position within the background video area.
9. The method according to claim 2, characterized in that: Also includes: Calculating the rounded corner pixels of the current video frame according to the rounded corner parameters of the main video area to obtain the main video area with rounded corner effect; When the radius represented by the rounding parameter exceeds the rounding threshold, a multi-sampling algorithm or a super-sampling algorithm is used to perform rounding processing.
10. An electronic device, characterized in that: include: A memory and a processor; the memory is used to store a computer program, and after the computer program is run by the processor, the method described in any one of claims 1 to 9 is executed.