Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the foregoing drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below do not represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
Before describing the video display method, the video display apparatus, the electronic device, the server, and the storage medium provided by the embodiments of the present disclosure in detail, related technologies and implementation environments related to the embodiments of the present disclosure will be briefly described here.
First, a brief description will be given of a related art to which an embodiment of the present disclosure relates.
The video playing client can run in the electronic device, and the electronic device can display a video playing interface and a content display interface in the process of running the video playing client. The video playing interface is used for displaying videos, and the content displaying interface is used for displaying content related to the videos.
Exemplary content related to a video may include: one or more of user comment content for a video, an episode list for the video, links to other videos related to the video, and comment content for other videos related to the video.
The video playing client mentioned in the embodiments of the present disclosure may be an application client, or a web page version client.
The video playing client (hereinafter referred to as a client) has a video scalable playing function, and the video scalable playing function enables the video playing client to display the video and simultaneously display the content related to the video. At present, in the video zooming process, the situation that the key content contained in the video is lost can occur.
This will be described below by way of example.
Fig. 1a to 1b are schematic views illustrating a related art to which an embodiment of the present disclosure relates according to an exemplary embodiment.
Fig. 1a to fig. 1b are described by taking a video displayed on the video playing interface as a first video, and a content display interface displays user comment content for the first video as an example.
In fig. 1a, a display screen of the electronic device displays a video playing interface in a full screen mode, and since a first video is displayed on the video playing interface, the display screen of the electronic device displays the first video in the full screen mode, where the first video includes abackground content area 11 and akey content area 12.
Illustratively, thebackground content area 11 in the first video may be an image filled with black, or a gaussian-blurred image. In fig. 1a, thebackground content area 11 is illustrated as an image filled in black.
Illustratively, thekey content area 12 in the first video is an area of the first video where picture content is actually available.
Since the display screen of the electronic device in fig. 1a shows the video playing interface in a full screen manner, the content display interface is not displayed. If the user needs to see the content display interface, for example, the user needs to view the user comment content, the user may perform a zoom-out operation with respect to the video playing interface. As shown in fig. 1b, a video zoom-out operation of sliding up is performed.
And the client terminal can reduce the first video after detecting the reduction operation, and the corresponding video playing interface can be correspondingly reduced after the first video is reduced.
Fig. 1b is a schematic diagram of thevideo playing interface 10 after being reduced. After the video playing interface and the first video are reduced, the electronic device displays acontent display interface 13.
Illustratively, the first video is reduced in size, and the length of the first video in the vertical direction and the length of the first video in the horizontal direction are reduced at the same time. In the process of zooming out the first video, the key content area is also zoomed out.
For example, assuming that the reduced first video is referred to as a second video, aregion 14 shown in fig. 1b and outlined by a white dashed line is a region where the second video is located, and a black image located outside the second video is abackground image 10 added by the client.
As shown in fig. 1a, assume that the length of the first video in the vertical direction is A1 and the length in the horizontal direction is B1; the length of the key content area in the first video in the vertical direction is A2, and the length in the horizontal direction is B2. As shown in fig. 1B, the second video has a length A3 in the vertical direction (A3 is smaller than A1) and a length B3 in the horizontal direction (B3 is smaller than B1); the key content area in the second video has a length A4 in the vertical direction (A4 is smaller than A2) and a length B4 in the horizontal direction (B4 is smaller than B2).
In the process of zooming out the first video, limited by the display space of the video playing interface, a situation may occur that the second video contains missing key content as shown in fig. 1 b.
Next, a brief description is given of an implementation environment related to the embodiments of the present disclosure.
FIG. 2 is an architectural diagram illustrating one implementation environment in accordance with an exemplary embodiment. The following video presentation methods may be applied in the implementation environment, which includes: aserver 21 and at least oneelectronic device 22.
Illustratively, theelectronic device 22 and theserver 21 may establish a connection and communicate via a wireless network.
For example, theelectronic device 22 may be any electronic product capable of interacting with a user through one or more of a keyboard, a touch pad, a touch screen, a remote controller, a voice interaction device, a handwriting device, and the like, for example, a mobile phone, a tablet computer, a palm computer, a personal computer, a wearable device, a smart television, and the like.
For example, there is a client in theelectronic device 22, and if the client is an application client, theelectronic device 22 may install the client; if the client is a web page version client, the electronic device 32 may display the web page version client through a browser.
For example, the video display device applied to the electronic device provided by the embodiment of the present disclosure may be an insert of the client.
Theserver 21 may be, for example, one server, a server cluster composed of a plurality of servers, or a cloud computing service center. Theserver 21 may include a processor, memory, and a network interface, among others.
Illustratively, theserver 21 stores one or more videos uploaded by the user, and theserver 21 may transmit the one or more videos to theelectronic device 22. Theelectronic device 22 may display one or more videos.
Fig. 2 is only an example, and fig. 2 shows 3electronic devices 22, the number of theelectronic devices 22 in practical application may be set according to practical requirements, and the number of theelectronic devices 22 is not limited in the embodiment of the present disclosure.
The present implementation environment relates to two application scenarios.
In a first application scenario, theelectronic device 22 is configured to run a video-class client, and the electronic device may obtain a video from theserver 21, obtain video information of the video by itself, and execute the video presentation method provided by the embodiment of the present disclosure. Theserver 21 is used for sending video to theelectronic device 22 running the video-class client.
In a second application scenario, theelectronic device 22 is configured to run a video-class client, and the electronic device may obtain the video and video information of the video from theserver 21 and perform the video presentation method provided by the embodiment of the present disclosure. Theserver 21 is used for sending videos and video information of the videos to theelectronic device 22 running the video type client.
It will be understood by those skilled in the art that the foregoing electronic devices and servers are merely exemplary and that other existing or future electronic devices or servers, which may be suitable for use with the present disclosure, are also encompassed within the scope of the present disclosure and are hereby incorporated by reference.
The technical scheme provided by the disclosure is described below with reference to the accompanying drawings.
Fig. 3 is a flowchart illustrating a video presentation method applied to an electronic device according to an exemplary embodiment, and the method includes the following steps S31 to S34 in implementation.
In step S31, a video scaling operation implemented on the video playing interface is received, and operation information of the video scaling operation is acquired.
In step S32, video information of the first video displayed in the video playing interface is obtained.
Wherein the video information includes at least a presentation size of the first video and a key content area.
In step S33, according to the operation information and the video information of the first video, scaling the first video to obtain a second video.
Wherein the second video includes the key content region.
In step S34, in response to the video zooming operation, the second video is displayed in the video playing interface.
The clients operated by theelectronic device 22 include at least a video playback interface and a content display interface. Illustratively, the video playing interface and the content displaying interface belong to the same window; illustratively, the video playback interface and the content display interface belong to different windows.
Illustratively, the first video includes at least akey content area 12.
For example, the video playing interface is located on the left side of the content display interface, or the video playing interface is located on the right side of the content display interface, or the video playing interface is located above the content display interface, or the video playing interface is located below the content display interface.
The following describes a video scaling operation, a first video, a display size of the first video, and a key content area provided by an embodiment of the present disclosure.
Illustratively, the operation manner of the video zooming operation implemented on the video playing interface in step S31 is various.
The disclosed embodiments provide, but are not limited to, the following three.
In the first mode, the operation mode of the video zooming operation is a key operation.
Illustratively, the video zoom key may be a physical key in the electronic device, such as one or more keys in a keyboard.
Illustratively, the video zoom key may be a virtual key in a display interface (the display interface includes at least one of a video playing interface and a content display interface), such as the display interface displays the video zoom key. Fig. 4 is a schematic diagram illustrating a display manner of a video zoom key in a display interface according to an exemplary embodiment. As shown in fig. 4, the video zoom-out button 41 and the video zoom-inbutton 43 are displayed at fixed positions on the display interface.
Illustratively, the video zoom-out button 41 and the video zoom-inbutton 43 may also be displayed in adisplay menu 42 suspended in the display interface. Thedisplay menu 42 has movable and concealable features therein.
For example, if a first preset operation for the display interface is detected, thedisplay menu 42 in the previous hidden state is displayed, and if a second preset operation for the display interface is detected, thedisplay menu 42 in the previous display state is hidden.
For example, the first preset operation and the second preset operation may be the same or different.
For example, if a "touch and press" operation for the display interface is detected, thedisplay menu 42 in the hidden state before display is determined; if a "touch and press" operation is again detected for the display interface, themenu 42 is hidden.
For example, if a "drag" operation is detected for thedisplay menu 42, thedisplay menu 42 may be suspended at a different position on the display interface to avoid thedisplay menu 42 blocking the key content area of the first video.
The display mode of the video zoom key on the display interface may include multiple modes, and fig. 4 of the embodiment of the present disclosure provides two display modes located above the display interface, but the embodiment of the present disclosure is not limited to the display mode shown in fig. 4, and any one display mode is within the protection scope of the embodiment of the present disclosure.
In the second mode, the operation mode of the video scaling operation is a sliding operation.
For example, the sliding operation is "slide up" or "slide down". It is understood that the disclosed embodiment provides two sliding operations of "sliding up" and "sliding down", but the disclosed embodiment is not limited to the above sliding operation, and any sliding operation is within the scope of the disclosed embodiment, for example, the sliding operation may be "drawing a circle" or "drawing a hook".
In the third mode, the operation mode of the video zooming operation is a voice operation.
Illustratively, the voice operation may be an operation of zooming the first video displayed by the video playing interface, such as "zooming out the video", or an operation of adding a large content display interface, such as "displaying more user comment content".
For example, the voice instruction in the voice operation may carry a length that the first video needs to be scaled, for example, the voice instruction is: "video is shortened by 5cm".
Illustratively, in step S31, the first video is an original video that has not undergone scaling processing or a video that has undergone scaling processing one or more times.
For example, if the first video is an original video that has not been subjected to scaling processing, the first video may be a video uploaded to theserver 21 by the user, or the first video is a video obtained by processing the video after theserver 21 receives the video uploaded by the user.
For example, if the first video is an original video that is not scaled, the video playing interface is the entire area of the display screen, that is, the electronic device displays the first video in a full screen, as shown in fig. 1 a.
For example, if the first video is a video that has not been subjected to scaling processing, the video playing interface is a local area of the display screen.
Illustratively, in step S32, the presentation size of the first video includes at least a length of the first video in a vertical direction and a length of the first video in a horizontal direction. The key content area of the first video is an area of the first video where picture content is actually present.
Illustratively, the key content area of the first video refers to a location area of the first video where the key content area is located.
For example, in step S33, the size of the key content area included in the second video may be the same as the size of the key content area included in the first video, or the second video may be composed of the key content areas in the vertical direction.
Illustratively, the dimensions of the key content area include a length of the key content area in a vertical direction and a length of the key content area in a horizontal direction.
The above-mentioned size of the key content area included in the second video may be the same as the size of the key content area included in the first video, which means that the length of the key content area in the second video in the horizontal direction is the same as the length of the key content area in the first video in the horizontal direction, and the length of the key content area in the second video in the vertical direction is the same as the length of the key content area in the first video in the vertical direction.
Illustratively, in the process of reducing the first video, the region of the first video except the key content region is reduced, and the size of the key content region is kept unchanged, so that the obtained key content in the key content region of the second video is not lost, and the video display effect in the process of video scaling is improved.
For example, if the second video is composed of the key content areas in the vertical direction, the length of the key content areas in the vertical direction in the second video is the same as the length of the key content areas in the vertical direction in the first video, or the length of the key content areas in the vertical direction in the second video is smaller than the length of the key content areas in the vertical direction in the first video. The second video may or may not include a background content area in the horizontal direction.
In the video display method provided by the embodiment of the disclosure, the video is zoomed by acquiring the operation information of the video zooming operation and the video information of the first video displayed in the video playing interface under the condition of receiving the video zooming operation implemented in the video playing interface, and the zoomed second video comprises the key content area through the video information comprising the key content area information, so that the loss of the key content in the video zooming process caused by the display space limited by the video playing interface is avoided, and the video display effect in the video zooming process is improved.
In an alternative embodiment, step S33 includes steps A1 to A2 in the specific implementation process.
In step A1, a scaling mode and a scaling parameter of the first video are determined according to the operation information and the video information of the first video.
In step A2, scaling the first video according to the scaling mode and the scaling parameter to obtain the second video.
Illustratively, the scaling manner of the first video is global scaling or preset direction scaling.
The preset direction can be a horizontal direction or a vertical direction, and if the preset direction is the horizontal direction, the preset direction is zoomed to be the length in the zooming horizontal direction; if the predetermined direction is the vertical direction, the predetermined direction is scaled to scale the length in the vertical direction. Global scaling refers to scaling the length in the vertical direction as well as the length in the horizontal direction.
Correspondingly, if the scaling mode of the first video is global scaling, the scaling parameter includes a scaling length in the preset direction and a scaling ratio, and if the scaling mode of the first video is scaling in the preset direction, the scaling parameter includes a scaling length in the preset direction.
The scaling ratio is a ratio of a length in a preset direction to a length in a direction perpendicular to the preset direction.
It can be understood that, if the first video includes the background content area and the key content area, and if the background content area and the key content area are reduced as a whole, it may happen that if the first video is reduced to a smaller size, the key content area of the first video is too small in size, and the user may not clearly see the key content, thereby affecting the video display effect in the video scaling process.
Fig. 5a to 5d are schematic diagrams illustrating a video zooming-out process according to an exemplary embodiment, in which a first video is displayed on a full screen on a display interface of the electronic device in fig. 5 a. If the user needs to see thecontent display interface 13, for example, the user needs to view the user comment content, the user may perform a zoom-out operation with respect to the video playing interface. As shown in fig. 5b, a slide operation of sliding upward is performed.
Fig. 5b is a schematic diagram of the first video after first zooming out. After the first video is reduced, the electronic device displays thecontent display interface 13.
As can be seen from fig. 5B, when the first video is zoomed out, the background content area and the key content area are zoomed out as a whole, assuming that when the first video is zoomed out to the second video, the length in the vertical direction is zoomed out from the length B1 to the length A2, assuming that the length of the first video in the vertical direction is the length B1, and the length in the horizontal direction is the length B2; then, when the first video is reduced to the second video, the length in the horizontal direction is reduced from B2 to B2 × A2/B1.
For example, thearea 14 outlined by a white dashed line in fig. 5b is an area where the second video is located after the first video is reduced, and a black image displayed outside thearea 14 outlined by a white dashed line in thevideo playing interface 10 is a background image supplemented by the client.
If the user needs to continue to reduce the video displayed on the video playing interface, the reducing operation may be executed again, as shown in fig. 5c, which is a schematic diagram of thevideo playing interface 10 and thecontent displaying interface 13 displayed on the electronic device after the reducing operation is executed for the second time. The video displayed on the video playing interface in fig. 5c continues to shrink, and thecontent display interface 13 continues to increase. It is understood that, as thecontent display interface 13 is enlarged, thecontent display interface 13 may display more content, for example, the content displayed in the second display area may not be updated, and the existing content displayed in the second display area may be enlarged.
Assuming that the first video has been scaled down to the minimum in fig. 5c, if the scaling-down operation is detected again, only the content in the display content display interface is updated, as shown in fig. 5 d. The content displayed by the content display interface in fig. 5d has been updated relative to the content displayed by the content display interface in fig. 5 c.
In summary, when the first video is zoomed, the background content area and the key content area are zoomed as a whole, and if the background content area and the key content area are zoomed as a whole, the size of the key content area in the first video is too small, so that the user cannot watch the key content displayed in the key content area clearly, and the video display effect in the video zooming process is affected.
In order to prevent the situation that the size of the key content area in the second video obtained by reducing is too small to make the key content unclear, because the background content area and the key content area are scaled as a whole when the first video is reduced, the background content area and the key content area are respectively reduced as two independent individuals in the process of reducing the first video.
The above-described technical means will be explained below. In an optional embodiment, the operation information of the video zooming operation implemented on the video playing interface at least includes an operation type and an operation distance.
In an alternative implementation manner, there are multiple manners for determining the operation distance, and the embodiments of the present disclosure provide, but are not limited to, the following two manners.
The first implementation mode comprises the following steps: the fixed length corresponding to one-time video zooming operation is preset, and the fixed length is the operation distance.
Illustratively, the video scaling operation may be: any one of a key operation, a slide operation, and a voice operation without carrying a zoom length.
If the fixed length corresponding to one video scaling operation is preset to be 1cm, the fixed length of the first video in the preset direction is fixedly scaled, for example, 1cm, after each video scaling operation is executed.
Illustratively, the fixed length may be determined based on actual situations, and the embodiments of the present disclosure do not limit specific values of the fixed length.
The second implementation mode comprises the following steps: based on the video scaling operation, an operating distance is determined.
For example, if the video scaling operation is a sliding operation, the operation distance may be calculated based on the length of the sliding track; if the zooming operation is voice operation, the operation distance is the length carried by the voice command, and if the voice command is 'video 5cm is reduced', the operation distance is 5cm; if the zooming operation is key operation, the operation distance is calculated based on the duration and/or the strength of the touch of the video zooming key.
Illustratively, the operation distance = a projection distance of the sliding track in the preset direction, or the operation distance = a length of the sliding track, or the operation distance = a projection distance of the sliding track in the preset direction × a first preset proportion, or the operation distance = a length of the sliding track × a first preset proportion.
Illustratively, the first predetermined ratio may be any value less than 1, or, alternatively, greater than 1.
For example, when the user performs zooming-out on the video, the background content area in the preset direction can be zoomed out by performing zooming-out operations for a plurality of times frequently, which indicates that the user has conservative actions, for example, the sliding length is small, or the force and/or duration of touching and pressing the zoom-out button of the video is small, then theelectronic device 22 may set the first preset ratio to be greater than 1, and the specific value of the first preset ratio may be determined by statistics for a plurality of times.
For example, if the user performs a zoom-out operation frequently when zooming out the video, and the video is zoomed out to a minimum size, which indicates that the user action is large, for example, the sliding length is large, or the force and/or duration of pressing the video zoom-out key is large, theelectronic device 22 may set the first preset ratio to be less than 1. For example, the specific value of the first preset ratio may be determined statistically a plurality of times.
Illustratively, the operation type may be a zoom-out operation or a zoom-in operation.
Illustratively, the specific implementation process of step A1 includes step a11 and step a12.
In step a11, when it is determined that the operation type is a zoom-out operation, determining a zoom-out mode and a zoom-out parameter of the first video according to the operation distance and the video information of the first video; the reduction mode at least comprises whether the key content area is reduced or not and a reduction type; the reduction type comprises reduction in a preset direction or integral reduction; the reduction parameter at least comprises a reduction length in the preset direction.
For example, in the process of reducing the first video, the key content area may not be reduced, so that after the first video is reduced to the second video, the situation that the key content is unclear during viewing due to the fact that the size of the key content area in the second video is too small does not occur, and the video display effect in the process of video scaling is affected.
In step a12, when it is determined that the operation type is an enlargement operation, an enlargement manner and an enlargement parameter of the first video are determined according to the operation distance and the video information of the first video; the amplification mode at least comprises whether the key content area is amplified and the amplification type; the amplification type comprises amplification in a preset direction or integral amplification; the magnification parameter includes at least a magnification length in the preset direction.
In an optional embodiment, when determining the zoom-out mode and the zoom-out parameter of the first video, the operation distance of the zoom operation on the first video and the video information of the first video need to be considered comprehensively, so that the operation feeling of a user can be improved.
The following describes a specific implementation process of step a11, and step a11 may involve three cases, which are described below.
The first case of step a11 includes step B1 to step B4.
In step B1, a background content area of the first video outside the key content area is determined according to the video information.
Illustratively, determining that the first video is in a background content area outside the key content area comprises: determining at least one of a length of the background content area in a preset direction, a length of the background content area in a direction perpendicular to the preset direction, and position information of the background content area in the first video.
In step B2, when the operation distance is not greater than the length of the background content area in the preset direction, it is determined that the reduction manner includes not reducing the key content area, reducing the background content area, and setting the reduction type of the background content area to be reduction in the preset direction or reduction as a whole.
In step B3, in a case where the reduction type of the background content area is reduction in a preset direction, a reduction length in the preset direction is determined based on the operation distance.
Illustratively, the reduction length of the background content area in the preset direction is equal to the operation distance.
In step B4, when the reduction type of the background content area is the overall reduction, a first reduction ratio and a reduction length in the preset direction are determined based on the operation distance and the size of the background content area, where the first reduction ratio is a ratio of a length of the background content area in the preset direction to a length of the background content area in a direction perpendicular to the preset direction.
The background content area is described below.
Illustratively, the representation form of the background content area is various, and the embodiment of the disclosure provides but is not limited to the following two:
the first method comprises the following steps: the background content contained in the background content area is a black background image or a color image.
Illustratively, the first video contains background content that is added by the user prior to uploading the first video to the server; or the server adds the first video after receiving the first video.
And the second method comprises the following steps: the background content contained in the background content region is an image after the gaussian blur processing.
Illustratively, the background content in the background content area may further include video content corresponding to the first video, such as a video title, or a subtitle or caption corresponding to the first video.
The locations of the background content area and the key content area are described below.
Exemplary, the relative positions of the background content area and the key content area include various, and the embodiments of the present disclosure provide but are not limited to: the background content area is located above the key content area and/or the background content area is located below the key content area and/or the background content area is located to the left of the key content area and/or the background content area is located to the right of the key content area.
Illustratively, as shown in fig. 1a, thebackground content area 11 includes a first sub-background content area and a second sub-background content area, one sub-background content area being located above thekey content area 12 and one sub-background content area being located below thekey content area 12.
The following describes a relationship between a background content area and a key content area of a first video according to an embodiment of the present disclosure.
The first video includes a background content area and a key content area. That is, in the vertical direction, the length of the first video is equal to the sum of the length of the background content area and the length of the key content area; in the horizontal direction, the length of the first video is equal to the sum of the length of the background content area and the length of the key content area.
Since the first video includes the background content area and the key content area, it may be determined whether the first video includes the background content area based on a presentation size of the first video and a presentation size of the key content area in the first video; if the first video includes the background content area, the position area of the background content area in the first video may be determined based on the position area of the key content area in the first video and the display size of the first video.
For example, it may be determined whether a background content area exists in the first video in the preset direction based on the length of the first video in the preset direction and the length of the key content area in the preset direction. And if the background content area exists, the length of the background content area in the preset direction can be calculated.
If the length of the first video in the preset direction is larger than the length of the key content area in the preset direction, it is determined that a background content area exists in the first video in the preset direction. The length of the background content area in the preset direction is equal to the length of the first video in the preset direction minus the length of the key content area in the preset direction. If the length of the first video in the preset direction is equal to the length of the key content area in the preset direction, it is determined that the first video does not have a background content area in the preset direction.
The length of the first video in the preset direction and the length of the key content area in the preset direction are described below with specific examples.
If the video zoom operation is a sliding operation on the video playing interface in a preset direction, it is assumed that the preset direction is a vertical direction as shown in fig. 1 b. Then, after detecting the upward sliding operation on the video playing interface, if the length of the first video in the vertical direction is 10cm, and the length of the key content area in the vertical direction is 6cm, determining that a background content area exists in the first video in the vertical direction, and the length of the background content area in the vertical direction is: 10cm-6cm =4cm.
If the length of the first video in the vertical direction is 10cm, and the length of the key content area in the vertical direction is 10cm, it is determined that the first video does not have the background content area in the vertical direction.
The "preset direction" mentioned in the embodiments of the present disclosure may be a vertical direction or a horizontal direction.
The following describes how to reduce the background content area in the embodiments of the present disclosure in conjunction with the position relationship between the background content area and the key content area, and the way to reduce the background content area includes, but is not limited to, the following two cases.
In the first case: the background content area is entirely located at one side of the key content area, for example, the background content area is entirely located above the key content area, or the background content area is entirely located below the key content area, or the background content area is entirely located at the left side of the key content area, or the background content area is entirely located at the right side of the key content area. The way of reducing the background content area is to reduce the background content area as a whole.
Fig. 6 is a schematic diagram illustrating a positional relationship of a background content area and a key content area according to an exemplary embodiment. Fig. 6 illustrates an example in which the entirebackground content area 11 is located below thekey content area 12.
In the left diagram of fig. 6 theelectronic device 22 displays the first video full screen.
Assuming that the reduced length of the background content area in the vertical direction is smaller than the length of the background content area in the vertical direction, the right side of fig. 6 illustrates a second video obtained after reducing the background content area in a preset direction.
As can be seen from the comparison between the left and right images in fig. 6, the sizes of the key content areas of the first and second videos are the same, and the size of the background content area of the second video is smaller than that of the background content area of the first video.
In the second case: the background content area is located on both sides of the key content area. It is assumed that the background content area comprises a first sub-background content area and a second sub-background content area. In a preset direction, the content display device sequentially comprises a first sub-background content area, a key content area and a second sub-background content area.
Illustratively, in the second case, two ways of narrowing down the background content area are involved.
The first mode is as follows: determining the reduction length of a first sub-background content area at one side of a key content area, reducing, after the first sub-background content area is reduced, if the first video still needs to be reduced, determining the reduction length of a second sub-background content area at the other side of the key content area, and reducing.
Fig. 7a to 7d are schematic diagrams illustrating a manner of determining a reduced length of a background content area according to an exemplary embodiment. Fig. 7a to 7d illustrate the background content areas above and below the key content area as an example, for example, the first sub background content area below the key content area may be reduced first, and after the first sub background content area is reduced, if the first video still needs to be reduced, the second sub background content area above the key content area may be reduced. Or, the second sub-background content area is reduced first, and after the second sub-background content area is reduced, if the first video still needs to be reduced, the first sub-background content area is reduced.
The first video is shown full screen in fig. 7 a; if the zoom-out operation is detected, determining a zoom-out length of the first sub-background content area located on the lower side of the key content area, and zooming out the first sub-background content area based on the zoom-out length, as shown in fig. 7b, which is a schematic diagram after the zoom-out is completed in the first sub-background content area; if the firstsub-background content area 11 on the lower side of thekey content area 12 is reduced, and if the first video still needs to be reduced, the reduced length of the second sub-background content area on the upper side of the key content area is determined, and the second sub-background content area is reduced based on the reduced length, as shown in fig. 7c, which is a schematic diagram after the first sub-background content area is reduced.
In fig. 7d, as the second sub-background content area located on the upper side of the key content area is reduced, the position of the key content area in the display interface is also raised, and the height of the raised position of the key content area in the display interface is equal to the reduced length of the second sub-background content area on the upper side of the key content area.
The second mode is as follows: determining the reduction lengths corresponding to the background content areas on the two sides of the key content area respectively, and reducing the background content areas on the two sides of the key content area simultaneously.
In an alternative implementation, the manner of determining the reduced length of the first sub-background content area and determining the reduced length of the second sub-background content area includes, but is not limited to, the following two.
In a first implementation manner, a reduction ratio of the first sub-background content area in the preset direction is determined. And determining the reduction ratio of the second sub-background content area in the preset direction.
The reduction ratio is a ratio of a length of the self in the preset direction to a length of the background content area in the preset direction.
Wherein the length of the background content area in the preset direction = the length of the first sub-background content area in the preset direction + the length of the second sub-background content area in the preset direction.
Exemplary, further comprising the steps of: and determining the reduction length of the first sub-background content area in the preset direction and the reduction length of the second sub-background content area in the preset direction based on the reduction length of the background content area in the preset direction, the reduction ratio of the first sub-background content area in the preset direction and the reduction ratio of the second sub-background content area in the preset direction.
For example, the calculation formula may be: the reduced length of the first sub-background region in the preset direction = the reduced scale of the first sub-background region — the reduced length of the background content region in the preset direction.
The reduced length of the background content area in the preset direction is the sum of the reduced length of the first sub-background area in the preset direction and the reduced length of the second sub-background area in the preset direction.
For example, in the left image of fig. 8, the reduction length of the background content area in the preset direction = the reduction length of the first sub-background area in the preset direction + the reduction length of the second sub-background area in the preset direction =2cm +3cm =5cm.
A process of determining a reduced length of the first sub-background content area in the preset direction and a reduced length of the second sub-background content area in the preset direction will be described below with a specific example.
Assuming that the length of the first sub-background content area in the preset direction is 3cm, and the length of the second sub-background content area in the preset direction is 6m, the reduction ratio of the first sub-background content area is equal to 3 cm/(6+3) cm =1/3, and the reduction ratio of the second sub-background content area is equal to 6 cm/(6+3) cm =2/3.
Assuming that the reduced length of the background content area in the preset direction is 3cm in total, the reduced length of the first sub-background content area in the preset direction is 3*1/3=1cm, and the reduced length of the second sub-background content area in the preset direction is 3*2/3=2cm.
In the embodiment of the present disclosure, the first sub-background content area and the second sub-background content area of the background content area are scaled down in the preset direction, so that the video display effect in the video scaling process is improved, the video display effect better conforms to the watching habit of the user, and the user experience is improved.
In a second implementation, it is determined that the reduced length of the first sub-background content area is the same as the reduced length of the second sub-background content area.
A process of simultaneously reducing the first sub-background content area and the second sub-background content area is described below with a specific example.
Fig. 8 is a schematic diagram illustrating another way of determining a reduced length of a background content area according to an exemplary embodiment. Fig. 8 illustrates an example in which the first sub-background content area is located below the key content area, and the second sub-background content area is located above the key content area.
The first video is shown full screen in the left diagram of fig. 8; if the zoom-out operation is detected, the zoom-out length of the first sub-background content area and the zoom-out length of the second sub-background content area are determined, and the video with the first sub-background content area and the second sub-background content area both zoomed out is shown in the right side of fig. 8.
The reducing type of the background content area in step B3 may be reducing in a preset direction, that is, reducing the background content area in the preset direction, and keeping the size of the background content area unchanged in a direction perpendicular to the preset direction.
The implementation of step B3 is described below with a specific example. Fig. 9a to 9b are schematic diagrams illustrating a reduction manner of a first video according to an exemplary embodiment. As shown in fig. 9a, it is assumed that the length of the background content area in the preset direction is 7.5cm (0.5 +7= 7.5), the reduced length of the background content area in the preset direction is 5cm, and the length of the key content area in the preset direction is 4cm. Fig. 9b shows the second video after the background content area is reduced by 5cm in the predetermined direction, and the background content area is not reduced in the direction perpendicular to the predetermined direction. The length of the key content area in the preset direction in fig. 9b is 4cm.
The type of reduction of the background content area in step B4 is a global reduction, i.e. reducing the background content area in a preset direction and reducing the background content area in a direction perpendicular to the preset direction.
Illustratively, the first reduction ratio = a length of the background content area in a preset direction/a length of the background content area in a direction perpendicular to the preset direction.
Exemplary, also include: and determining the reduction length of the background content area in the direction vertical to the preset direction based on the first reduction proportion and the reduction length of the background content area in the preset direction.
Illustratively, this may be based on the formula: the reduction length of the background content region in the direction perpendicular to the preset direction = the reduction length of the background content region in the preset direction/the first reduction ratio.
The implementation of step B4 is described below with a specific example. Fig. 10a to 10b are schematic diagrams illustrating another reduction manner of the first video according to an exemplary embodiment.
As shown in fig. 10a, assuming that the length of the background content area in the preset direction (assumed to be the vertical direction) is 7cm, the length of the background content area in the direction perpendicular to the preset manner (assumed to be the horizontal direction) is 6cm, the first reduction ratio =7/6, and the reduction length of the background content area in the vertical direction is 5cm, then the reduction length of the background content area in the horizontal direction = 5/(7/6).
Fig. 10b is a display interface in which the background content area is reduced by 5cm in the preset direction and reduced by 5/(7/6) in the horizontal direction, the dotted frame area in fig. 10b is the area where the background content area is reduced as a whole, and the gray area outside the dotted frame is the background image added by the client after the background content area is reduced as a whole. As can be seen from a comparison between fig. 10a and fig. 10b, in this embodiment, after the reduction processing, the size of the key content area of the video remains unchanged, and the background content area is reduced as a whole.
The second case referred to in step a11 includes steps C1 to C3.
In step C1, a background content area of the first video outside the key content area is determined according to the video information.
In step C2, when the operation distance is greater than the length of the background content area in the preset direction, determining that the reduction manner includes not reducing the key content area and reducing the background content area.
In step C3, based on the size of the background content area, a reduced length of the background content area in the preset direction and a reduced length in a direction perpendicular to the preset direction are determined.
For example, the length of the background content area in the preset direction is determined as a reduced length of the background content area in the preset direction, and the length of the background content area in the direction perpendicular to the preset direction is determined as a reduced length of the background content area in the direction perpendicular to the preset direction.
For example, since the background content areas are all removed, the zoom-out type of the background content areas may be zoom-out in a preset direction or zoom-out as a whole.
Assuming that the reduction type of the background content area is reduction in the preset direction and the preset direction is a vertical direction, the implementation process of step C3 will be described below by using a specific example. Fig. 11 is a schematic diagram illustrating another way of downscaling a first video according to an example embodiment. As shown in the left diagram of fig. 11, assuming that the operation distance is 5cm, the length of the background content area in the preset direction is 3cm, and the length of the key content area in the preset direction is 4cm. The right side of fig. 11 is a schematic diagram of the second video after the background content area is reduced by 3cm in the preset direction. The length of the key content area in the preset direction shown in the right diagram of fig. 11 is constant at 4cm.
In the embodiment of the present disclosure, since the operation distance is greater than the length of the background content area in the preset direction, exemplarily, the size of the key content area is kept unchanged, and the background content area is completely reduced.
In the two implementation manners, only the background content area is reduced, and the key content area is not reduced, that is, the first video is reduced in a manner of keeping the size of the key content area unchanged. In the process of video zooming out, the size of the key content area is ensured to be unchanged, the condition that the key content is lost in the process of video zooming due to the fact that the display space of the video playing interface is limited is avoided, the condition that the size of the key content area is too small is also avoided, and therefore the video display effect in the process of video zooming is improved.
The third case referred to in step a11 includes steps D1 to D5.
In step D1, a background content area of the first video outside the key content area is determined according to the video information.
In step D2, when the operation distance is greater than the length of the background content area in the preset direction, determining that the reduction manner includes reducing the key content area, reducing the key content area in the preset direction or reducing the key content area as a whole, and reducing the background content area.
In step D3, based on the size of the background content area, a reduced length of the background content area in the preset direction and a reduced length in a direction perpendicular to the preset direction are determined.
In step D4, when the zoom-out type of the key content area is zoom-out in a preset direction, based on the length of the background content area in the preset direction and the operation distance, the zoom-out length of the key content area in the preset direction is determined.
In step D5, when the zoom-out type of the key content area is a whole zoom-out, based on the length of the background content area in the preset direction, the operation distance, and the size of the key content area, a zoom-out length of the key content area in the preset direction and a second zoom-out ratio are determined, where the second zoom-out ratio is a ratio of the length of the key content area in the preset direction to the length of the key content area in a direction perpendicular to the preset direction.
For the description of step D3, refer to the description of step C3 in the second case related to step a11, and are not described herein again.
Implementations of determining a reduced length of a key content area in a preset direction provided by embodiments of the present disclosure include, but are not limited to, two cases.
In the first case: the minimum length of the key content area in the preset direction is set in advance.
In order to avoid the size of the key content area being too small, the key content area is provided with a minimum length in the preset direction, that is, if the length of the key content area in the preset direction is the minimum length, the key content area is not reduced even if a reduction operation is received.
For example, if the length of the key content area in the preset direction is the minimum length and the zoom-out operation is received again, the content in the content display area may be updated while the size of the key content area is maintained.
If the operation distance is greater than or equal to the length + of the background content area in the first video in the preset direction (the length of the key content area in the preset direction-the minimum length), then the reduced length of the key content area in the preset direction = the length of the key content area in the preset direction-the minimum length.
If the operation distance is less than the length of the background content area in the first video in the preset direction + (the length of the key content area in the preset direction-the minimum length), then the reduction length of the key content area in the preset direction = the operation distance-the length of the background content area in the first video in the preset direction.
In the second case: the minimum length of the key content area in the preset direction is not preset, and then the reduced length of the key content area in the preset direction = operating distance — length of the background content area in the first video in the preset direction.
The implementation of step D3 and step D4 is described below with specific examples.
Fig. 12 is a schematic diagram illustrating yet another way of downscaling a first video according to an example embodiment.
As shown in the left diagram of fig. 12, assuming that the operation distance is 5cm, the length of the background content area in the preset direction (assumed to be the vertical direction) is 3cm, and the length of the key content area in the vertical direction is 4cm. The right diagram of fig. 12 is a schematic diagram corresponding to the second video after the background content area is reduced by 3cm in the vertical direction and the key content area is reduced by 2cm (i.e., 4cm-2 cm) in the vertical direction.
In this embodiment, the length of the key content area in the preset direction (e.g., the vertical direction) is shortened, and the length in the direction perpendicular to the preset direction (e.g., the horizontal direction) remains unchanged, so that a situation of "flattening" of a picture displayed by the key content area may occur, and a video display effect in the video scaling process may be affected.
For this purpose, in step D5, the key content area is reduced in its entirety.
Illustratively, the second reduction ratio = a length of the key content area in a preset direction/a length of the key content area in a direction perpendicular to the preset direction.
Exemplary, also include: and determining the reduction length of the key content area in the direction vertical to the preset direction based on the second reduction proportion and the reduction length of the key content area in the preset direction.
Illustratively, the formula is as follows: the reduction length of the key content area in the direction perpendicular to the preset direction = the reduction length of the key content area in the preset direction/the second reduction ratio.
The following describes steps D3 and D5 with specific examples.
Fig. 13 is a schematic diagram illustrating yet another way of downscaling a first video according to an exemplary embodiment. The predetermined direction is assumed to be a vertical direction.
As shown in the left diagram of fig. 13, it is assumed that the operation distance is 9cm, the length of the background content area in the vertical direction is 7cm, the length of the key content area in the vertical direction is 4cm, and the length in the horizontal direction is 8cm. That is, the second reduction ratio is 4cm/8cm =1/2. If the key content area is reduced by 2cm in the preset direction (assuming the vertical direction), that is, 9-7=2cm, then the zoom length of the key content area in the horizontal direction = the reduction length of the key content area in the preset direction/the second reduction ratio = 2/(1/2) =4cm.
The right diagram of fig. 13 is a schematic diagram corresponding to the second video after the background content area is reduced by 7cm in the vertical direction, the key content area is reduced by 2cm in the vertical direction, and the key content area is reduced by 4cm in the horizontal direction.
Since the display scale of the key content area subjected to the reduction processing is 2cm/4cm =1/2, it is the same as the display scale when the key content area is not zoomed. Therefore, the same display scale of the key content area before and after the key content area is reduced is ensured, the situation that the key content area is flat is avoided, and the video display effect in the video scaling process is improved.
In the video display method provided by the foregoing disclosure, after detecting, for a first video composed of a background content area and a key content area, a reduction operation for a video playing interface, if the first video has the background content area, the first video may be reduced in a manner of reducing a length of the background content area in a preset direction or in a manner of reducing the background content area as a whole, so as to obtain a second video. When the first video is zoomed, the first video is zoomed in a mode of zooming out the background content area, at the moment, the display size of the key content area is possibly kept unchanged, and the situation that the key content is lost in the video zooming process due to the limitation of the display space of a video playing interface is avoided; alternatively, if the background content area needs to be reduced after being reduced, the key content area may be reduced. The key content area in the embodiment of the present disclosure may not be reduced, or the reduction degree is relatively small, so that the video display effect in the video scaling process is improved.
In an optional implementation manner, if the narrowing-down manner of the key content area is overall narrowing-down, the narrowing-down parameters of the key content area include: the method includes the steps of reducing the length of the key content area in a preset direction, and reducing the length of the key content area in a direction perpendicular to the preset direction, wherein the reduced length of the key content area in the preset direction = the reduced length of the key content area in the direction perpendicular to the preset direction.
In an alternative embodiment, step a12 involves the following three cases. It is to be understood that the first video involved in step a12 may be a video reduced by the above step a 11.
Illustratively, the first video involved in step a12 may be composed of key content areas in a preset direction, and assuming that the preset direction is a vertical direction, the first video involved in step a12 may be as shown in the right side diagram of fig. 11, or as shown in the right side diagram of fig. 12, or as shown in the right side diagram of fig. 13; illustratively, the first video involved in step a12 may be composed of a key content area and a background content area, as shown in the right side view of fig. 6, as shown in the right side view of fig. 8, as shown in fig. 9b, or as shown in fig. 10 b.
The first case referred to in step a12 includes steps F1 to F4. In the first case, the first video is composed of a key content area and a background content area, and the key content area is not reduced; alternatively, the first video is composed of a key content area, and the key content area is not reduced.
In step F1, when the length of the key content area in the preset direction is equal to the original length of the key content area, determining an original size corresponding to a background content area of a first video outside the key content area according to video information of the first video.
For example, the original length of the key content area in the preset direction mentioned in the embodiments of the present disclosure is the length of the key content area in the preset direction without scaling. That is, after the client receives the video from the server, when the video is not scaled, the length of the key content area in the video in the preset direction is set.
If the length of the key content area in the preset direction is equal to the original length of the key content area, it is indicated that the key content area is not subjected to the reduction operation, and therefore the key content area does not need to be enlarged.
For example, the original size of the background content area of the video refers to the size of the background content area in the video that is not subjected to the scaling processing, that is, the size of the background content area in the video when the electronic device receives the video from the server and does not perform any scaling processing on the video.
The original size of the background content area of the video comprises the original length of the background content area in the preset direction and the original length of the background content area in the direction perpendicular to the preset direction.
For example, if the first video is composed of a key content area and a background content area, and the key content area is not narrowed, step F1 may determine a display size corresponding to the background content area of the first video outside the key content area, that is, a size of the background content area currently displayed by the first video.
For example, if the first video is composed of a key content area and the key content area is not narrowed, the display sizes of the first video outside the key content area corresponding to the background content areas determined in step F1 are all 0, so that the original sizes corresponding to the background content areas need to be determined.
In step F2, determining that the amplification mode includes not amplifying the key content area, amplifying the background content area, and whether the amplification type of the background content area is amplification in a preset direction or amplification in whole.
In step F3, in a case where the type of enlargement of the background content area is enlargement in a preset direction, an enlargement length of the background content area in the preset direction is determined based on the operation distance.
Illustratively, the enlargement length of the background content area in the preset direction is equal to the operation distance.
The preset direction may be a vertical direction or a horizontal direction, and if the preset direction is the vertical direction, the amplification in the preset direction is the vertical direction, and if the preset direction is the horizontal direction, the amplification in the preset direction is the horizontal direction.
Wherein, the vertical direction enlargement means enlarging the length in the vertical direction; the horizontal direction enlargement refers to enlargement of the length in the horizontal direction.
For example, referring to the description of step B3, the "reduction type" in this section is changed to the "enlargement type", and the "reduction length" is changed to the "enlargement length", which is the description of the process of enlarging the background content area in the preset direction.
In step F4, when the amplification type of the background content area is the integral amplification, based on the operation distance and the original size of the background content area, an amplification length of the background content area in the preset direction and a first amplification ratio are determined, where the first amplification ratio is a ratio of the original length of the background content area in the preset direction to the original length of the background content area in a direction perpendicular to the preset direction.
For example, determining the enlargement length and the first enlargement ratio of the background content area in the preset direction based on the operation distance and the original size of the background content area includes: determining an amplification length of the background content area in the preset direction based on the operation distance; determining a first magnification ratio based on a ratio of an original length of the background content area in the preset direction to an original length in a direction perpendicular to the preset direction.
Illustratively, the first magnification ratio = original length of the background content area in a preset direction/original length of the background content area in a direction perpendicular to the preset direction.
Exemplary, also include: and determining the amplification length of the background content area in the direction perpendicular to the preset direction based on the first amplification scale and the amplification length of the background content area in the preset direction.
Illustratively, the formula is: the enlargement length of the background content area in the direction perpendicular to the preset direction = enlargement length of the background content area in the preset direction/first enlargement ratio.
For example, referring to the description of step B4, changing the "zoom-out type" in this section to the "zoom-in type" and changing the "zoom-out length" to the "zoom-in length" are descriptions of the process of zooming out the entire background content area.
The second case referred to in step a12 includes steps G1 to G3. In the second case, the first video is composed of key content regions, which have been reduced at this time.
In step G1, when the length of the key content area in the preset direction is less than or equal to the difference between the original length of the key content area and the operation distance, determining that the amplification manner includes not amplifying the background content area, amplifying the key content area, and whether the amplification type of the key content area is preset direction amplification or whole amplification.
It can be understood that, since the operation distance may be a condition that the length of the key content area in the preset direction is enlarged to be less than or equal to the original length, the enlarged first video does not include the background content area in the preset direction.
If the length of the key content area of the first video in the preset direction is 3cm, the original length of the key content area in the preset direction is 7cm, and the operating distance is 2cm. That is, the operating distance 2cm is less than (original length of the key content area in the preset direction is 7cm — length of the key content area in the preset direction is 3 cm). It can be known that the operation distance is not enough to enlarge the length of the key content area of the first video in the preset direction to the original length of the key content area in the preset direction. At this time, the key content area is enlarged first, and the background content area is not enlarged.
In step G2, when the amplification type of the key content area is a preset direction amplification, an amplification length of the key content area in the preset direction is determined based on the operation distance.
Illustratively, the enlargement length of the key content area in the preset direction is equal to the operation distance.
In step G3, when the amplification type of the key content area is the whole amplification, based on the operation distance and the size of the key content area, an amplification length of the key content area in the preset direction and a second amplification ratio are determined, where the second amplification ratio is a ratio of the length of the key content area in the preset direction to the length of the key content area in a direction perpendicular to the preset direction.
Illustratively, the enlargement length of the key content area in the preset direction is equal to the operation distance.
Illustratively, the second magnification ratio = length of the key content area in the preset direction/length of the key content area in a direction perpendicular to the preset direction.
Exemplary, also include: and determining the method length of the key content area in the direction perpendicular to the preset direction based on the second amplification scale and the amplification length of the key content area in the preset direction.
Illustratively, the formula is: the enlargement length of the key content area in the preset direction = enlargement length of the key content area in the preset direction/second enlargement ratio.
The third case to which step a12 relates includes steps H1 to H6. In a third case, the first video consists of a key content area, which has been reduced.
In step H1, when the length of the key content area in the preset direction is greater than the difference between the original length of the key content area and the operation distance, according to the video information, an original size corresponding to a background content area of the first video outside the key content area is determined.
The original size of the background content area of the video comprises the original length of the background content area in the preset direction and the original length of the background content area in the direction perpendicular to the preset direction.
Illustratively, determining a background content region of the first video outside the key content region includes determining a positional relationship of the key content region and the background content region.
For example, the background content area includes a first sub-background content area and a second sub-background content area in the preset direction, and the first sub-background content area and the second sub-background content area are located on two sides of the background content area, or the background content area is located on the upper side of the key content area in the preset direction, or the background content area is located below the key content area in the preset direction.
It will be appreciated that since the first video is composed of key content regions, the first video does not include background content regions, and therefore the background content regions are presented here with a size of 0, i.e., no background content regions. The subsequent process of enlarging the background content area is a process from scratch.
In step H2, determining the amplification manner includes amplifying the key content area, where the amplification type of the key content area is amplification in a preset direction or amplification in a whole, amplifying the background content area, and where the amplification type of the background content area is amplification in a preset direction or amplification in a whole.
In step H3, when the amplification type of the key content area is amplification in a preset direction, based on the length of the key content area in the preset direction and the original length, determining an amplification length of the key content area in the preset direction.
Illustratively, the formula is: the enlargement length of the key content area in the preset direction = the original length of the key content area in the preset direction — the length of the key content area in the preset direction.
For example, if the original length of the key content area in the preset direction is 10cm, and the length of the key content area in the preset direction (i.e., the presentation length) is 7cm, the enlargement length of the key content area in the preset direction is 10cm-7cm =3cm.
In step H4, when the type of enlargement of the key content area is the whole enlargement, an enlargement length of the key content area in the preset direction and a third enlargement ratio, which is a ratio of a length of the key content area in the preset direction to a length in a direction perpendicular to the preset direction, are determined based on the size of the key content area and the original length.
Illustratively, the enlargement length of the key content area in the preset direction is determined based on the original length of the key content area in the preset direction and the length of the key content area in the preset direction.
Illustratively, the formula is: the zoom-in length of the key content area in the preset direction = original length of the key content area in the preset direction — length of the key content area in the preset direction.
Illustratively, the third magnification scale is determined based on a size of the key content area.
Illustratively, the third magnification ratio = length of the key content area in the preset direction/length of the key content area in a direction perpendicular to the preset direction.
For example, the original length of the key content area in the preset direction is 10cm, the length of the key content area in the preset direction is 4cm, and the length of the key content area in the direction perpendicular to the preset direction is 2cm, then the enlargement length of the key content area in the preset direction = (10 cm-4 cm) =6cm, and the third enlargement ratio =4cm/2cm =2.
Illustratively, the enlargement length of the key content area in a direction perpendicular to the preset direction is determined based on the enlargement length of the key content area in the preset direction and the third enlargement ratio.
Illustratively, the formula is: the enlargement length of the key content area in the direction perpendicular to the preset direction = enlargement length of the key content area in the preset direction/third enlargement ratio.
Still taking the original length of the key content area in the preset direction as 10cm, the length of the key content area in the preset direction as 4cm, and the length of the key content area in the direction perpendicular to the preset direction as 2cm as an example, the amplification length of the key content area in the direction perpendicular to the preset direction =6cm/2=3cm.
In step H5, in a case that the amplification type of the background content area is a preset direction amplification, an amplification length of the background content area in the preset direction is determined based on the operation distance.
Illustratively, the enlargement length of the background content area in the preset direction is determined based on the operation distance and the enlargement length of the key content area in the preset direction.
Illustratively, the formula is: the zoom-in length of the background content area in the preset direction = operating distance — zoom-in length of the key content area in the preset direction.
For example, the operation distance is 10cm, the enlargement length of the key content area in the preset direction is 4cm, and the enlargement length of the background content area in the preset direction is 10cm-4cm =6cm.
In step H6, when the amplification type of the background content area is the integral amplification, based on the operation distance and the original size of the background content area, an amplification length of the background content area in the preset direction and a fourth amplification ratio are determined, where the fourth amplification ratio is a ratio of the original length of the background content area in the preset direction to the original length of the background content area in a direction perpendicular to the preset direction.
Wherein the original size of the background content area of the video comprises an original length of the background content area in a vertical direction and an original length of the background content area in a horizontal direction.
Wherein the original size of the background content area of the video comprises an original length of the background content area in a vertical direction and an original length of the background content area in a horizontal direction.
Illustratively, the enlargement length of the background content area in the preset direction is determined based on the operation distance and the enlargement length of the key content area in the preset direction.
Illustratively, the formula is: the zoom-in length of the background content area in the preset direction = operating distance — zoom-in length of the key content area in the preset direction.
Illustratively, the fourth magnification ratio is determined based on an original length of the background content area in the preset direction and an original length of the background content area in a direction perpendicular to the preset direction. Illustratively, the formula is: the fourth magnification ratio = based on an original length of the background content area in the preset direction/an original length of the background content area in a direction perpendicular to the preset direction.
For example, based on the original length of the background content area in the preset direction being 10cm and the original length of the background content area in the direction perpendicular to the preset direction being 5cm, the fourth magnification ratio is 2.
Illustratively, the enlargement length of the background content area in the direction perpendicular to the preset direction is determined based on the enlargement length of the background content area in the preset direction and the fourth enlargement ratio.
Illustratively, the formula is: the enlargement length of the background content area in the direction perpendicular to the preset direction = based on the enlargement length/fourth enlargement ratio of the background content area in the preset direction.
Still taking the original length of the background content area in the preset direction as 10cm and the original length of the background content area in the direction perpendicular to the preset direction as 5cm as an example, if the amplification length of the background content area in the preset direction is 4cm, the amplification length of the background content area in the preset direction is 4cm/2=2cm.
In an alternative embodiment, if the background content areas are located on both sides of the key content area (as shown in fig. 7), it is assumed that the background content area includes a first sub-background content area and a second sub-background content area.
The magnification parameters of the first video in the magnification process further include the magnification ratio of the first sub-background content area in the preset direction, and the magnification ratio of the second sub-background content area in the preset direction.
The magnification ratio is a ratio of an original length of the user in the preset direction to an original length of the background content area in the preset direction.
For example, the original length of the first sub-background content area in the preset direction refers to the original length of the first sub-background content area in the video that is not subjected to the scaling processing in the preset direction, that is, the original length of the first sub-background content area in the video that is not subjected to any scaling processing after the electronic device receives the video from the server.
Likewise, the original length of the second sub-background content area in the preset direction refers to the original length of the second sub-background content area in the video that is not subjected to the scaling processing in the preset direction.
Assuming that the length of the first sub-background content area in the vertical direction is 3cm, and the length of the second sub-background content area in the vertical direction is 6m, the amplification ratio of the first sub-background content area is equal to 3 cm/(6+3) cm =1/3, and the amplification ratio of the second sub-background content area is equal to 2/3.
Setting the enlargement length of the background content area in the vertical direction to be 3cm in total, the enlargement length of the first sub background content area in the vertical direction is 3 × (1/3) =1cm, and the enlargement length of the second sub background content area in the vertical direction is 3 × (2/3) =2cm.
In the embodiment of the present disclosure, the first background content area and the second background content area of the background content area are enlarged in proportion in the vertical direction, and the obtained video display effect better conforms to the watching habit of the user, thereby improving the user experience.
In an alternative embodiment, for the purpose of fast zooming the first video, an operation of zooming the first video by one key may be performed, and the implementation manner of step S33 may include steps E1 to E3.
In step E1, an operation type corresponding to the operation information is determined. In step E2, if the operation type is a one-key zoom-out operation, removing a background content area in the first video other than the key content area to obtain the second video.
In step E3, if the operation type is a one-key zoom-in operation, the key content area is zoomed in to the original size of the key content area, and the background content area is zoomed in to the original size of the background content area, so as to obtain the second video.
For example, there are various modes of the one-key zoom-out operation or the one-key zoom-in operation.
The embodiments of the present disclosure provide, but are not limited to, the following three.
In the first mode, the operation mode of the one-key zoom-out operation or the one-key zoom-in operation is a key operation.
In the second mode, the operation mode of the one-key zoom-out operation or the one-key zoom-in operation is a slide operation.
In the third mode, the operation mode of one-key zooming-out operation or one-key zooming-in operation is voice operation.
The three operation modes of the one-key zoom-out operation or the one-key zoom-in operation may refer to the operation mode of the video zoom-out operation implemented on the video playing interface in step S31, and are not repeated herein.
In an optional embodiment, in the process of shrinking the video playing interface in the preset direction, the content display interface is growing, and the method for growing the content display interface includes step I11 and step I12.
In step I11, controlling a content display interface in the display interfaces to at least increase a reduced length of a video playing interface in a preset direction in the preset direction.
Illustratively, the length of the video playing interface is reduced in the preset direction, and the length of the content displaying interface is increased in the preset direction. Illustratively, the reduced length of the video playing interface in the preset direction is equal to the reduced length of the first video in the preset direction.
And in step I12, controlling the content display interface to display the updated content related to the second video.
In an alternative embodiment, steps I21 to I22 are further included.
In step I21, a plurality of frames of video images are acquired from the first video.
In step I22, based on a plurality of frames of the video images, the key content area included in the first video is determined.
For example, the steps I21 to I22 may be a specific implementation manner of the step S32, or the steps I21 to I22 may be executed before the step S31.
There are various implementations of step I22 provided in the embodiments of the present disclosure, and the embodiments of the present disclosure provide, but are not limited to, the following three.
The first implementation of step I22 includes: step J1 to step J3.
In step J1, for two adjacent frames of video images at any position in a plurality of frames of video images, a difference image of the two frames of video images is obtained to obtain at least one frame of difference image.
Illustratively, multiple frames of video images may be extracted from the video. The disclosed embodiments do not limit the number of video images obtained from a video.
Illustratively, the longer the total duration of the video, the greater the number of video images extracted from the video.
For example, in practical applications, in order to ensure accuracy of video information of subsequently obtained videos, the number of video images obtained from the videos is greater than or equal to a preset number of frames, for example, the preset number of frames is 20. Illustratively, the number of frames of the extracted video image can be set based on actual conditions, so as to not only ensure the accuracy of the obtained video information of the video, but also improve the data processing speed.
For example, a plurality of frames of video images may be extracted from the video uniformly, for example, one frame of video image is extracted every 10 frames, or one frame of video image is extracted every preset time length. Illustratively, multiple frames of video images may be randomly extracted from the video.
For example, the sequence of the multiple frames of video images extracted from the video may be scrambled, and the two adjacent frames of video images may be two adjacent frames of video images in time, or may not be two adjacent frames of video images in time.
For example, after extracting multiple frames of video images from the video, the sequencing may be performed based on the time of the multiple frames of video images in the video, where the two "adjacent" frames of video images are two adjacent frames of video images in terms of time.
Illustratively, the difference image can be obtained by calculating an adaptive mixed Gaussian backgroundmodeling method MOG 2.
Illustratively, the difference image may be a difference mask FrameMask between two frames of video images.
Illustratively, in order to increase the data processing speed, the step J1 specifically includes: reducing the target multiple of the multi-frame video image; and aiming at two adjacent frames of video images at any position in the multi-frame video image with the reduced target multiple, obtaining a difference image representing the difference of the two frames of video images so as to obtain a multi-frame difference image.
The target multiple is less than 1, and for example, the target multiple may be any value less than 1, such as 0.4, 0.5, 0.6, etc.
Fig. 14a to 14b are schematic views of a plurality of frames of difference images shown according to an exemplary embodiment.
If 20 frames of video images are acquired, and for two adjacent frames of video images at any position in the 20 frames of video images, a self-adaptive mixed Gaussian background modeling method is adopted to calculate a difference mask of the two adjacent frames so as to obtain a multi-frame difference image. Fig. 14a is a difference image based on the difference between the 1 st frame video image and the 2 nd frame video image, and fig. 14b is a difference image based on the difference between the 12 th frame video image and the 13 th frame image.
In step J2, based on the at least one frame of difference image, a target image is obtained, where a pixel value at each position in the target image is an average value of pixel values corresponding to the position in the at least one frame of difference image.
In an alternative implementation manner, the specific implementation procedure of step J2 includes steps J21 to J23.
In step J21, the at least one frame of difference image is processed respectively to obtain a first image corresponding to each frame of difference image, where one frame of first image includes multiple image regions that are not connected to each other, and at least one of the multiple image regions is a multiply-connected region.
Illustratively, the morphological opening operation processing is performed on at least one frame of the difference image respectively to obtain multiple frames of the first image.
The operation of performing erosion prior to dilation on the difference image is referred to as a morphological opening operation. The morphological opening operation can eliminate fine objects in the difference image, separating objects at fine lines and smoothing the larger object boundaries.
Illustratively, the background content area may include content corresponding to the key content area, such as a title corresponding to the actual content displayed by the key content area, or, an onwhite, or, a caption; the content contained in the background content area may be close to the key content area, and the morphological opening operation processing is performed on the difference image, so that the content contained in the background content area and adjacent to the key content area can be separated from the key content area, and the boundary of the key content area can be determined more accurately.
In order to make those skilled in the art understand the process of processing the difference image to obtain the first image provided by the embodiment of the present disclosure, the following examples are given.
Fig. 15a to 15d are schematic diagrams illustrating processing of a difference image to obtain a first image according to an exemplary embodiment. In which a region 151 (indicated by a dotted line frame) shown in fig. 15a is a key content region, a region 152 (indicated by a dashed line frame) is content related to the key content region, such as subtitles, contained in the background content region, and these two regions in the difference image are connected, as shown by three cells in fig. 15 a. Fig. 15b shows a structure for processing the difference image.
Illustratively, the process of processing the difference image based on the structure shown in fig. 15b is as follows: if the central cell of the structure (for example, the cell marked with a thick black line in fig. 15 b) is a moving cell, and the central cell of the structure is moved among the cells included in the difference image shown in fig. 15a, and if the central cell of the structure is moved to one cell in the difference image shown in fig. 15a, the intersection of the structure and the difference image shown in fig. 15a is completely equal to the structure, it is determined that the cell meets the requirement, and the cell in the difference image shown in fig. 15a is saved. All cells in the difference image shown in fig. 15a that satisfy the above requirements are determined, the above-described all cells that satisfy the requirements constitute an image composed of dark black cells as shown in fig. 15c, and the light black cells in fig. 15c are cells in the difference image shown in fig. 15a that do not satisfy the above requirements.
Illustratively, if the central cell of the structure shown in fig. 15b is taken as a moving cell, and the central cell of the moving structure in the peripheral cells of the dark black shown in fig. 15c is moved to any cell located at the peripheral position of the image composed of the dark black cells shown in fig. 15c, and the structure shown in fig. 15b intersects the image composed of the dark black cells shown in fig. 15c, it is determined that the cell meets the requirement, and the cell is retained. All cells satisfying the above requirements and the dark black cells shown in fig. 15c together constitute the first image shown in fig. 15 d.
It can be seen from 15d thatregion 151 is not already connected toregion 152.
In step J22, based on at least one frame of the first image, a second image is obtained, the pixel at each position in the second image being the average of the pixel values at that position in the at least one frame of the first image.
In an alternative implementation manner, the implementation process of step J22 specifically includes steps J221 to J222.
In step J221, for each frame of the first image, the (pixel point position, pixel value) corresponding to each pixel included in the first image is determined, so as to obtain that each first image includes (pixel point position, pixel value) corresponding to each pixel.
In step J222, for each pixel position, an average value of the pixel values having the pixel position is obtained to obtain a pixel average value corresponding to the pixel position, that is, (pixel position, pixel average value).
And the pixel value corresponding to any pixel in the second image is the pixel average value corresponding to the pixel point position of the pixel.
It can be understood that, in the step "acquiring multiple frames of video images from the video", two frames of video images can be obtained from the video, and in the step J1, one frame of difference image can be obtained, and the one frame of difference image is processed, so that one frame of first image can be obtained, and if there is only one frame of first image, if the pixel values of one or more pixels in the first image are wrong (this embodiment of the present disclosure is referred to as an abnormal pixel), the accuracy of determining the key content area is affected.
In order to solve the above problem, for example, the step "acquiring a plurality of frames of video images from the video" may obtain N frames of video images from the video, where N is a positive integer greater than 2. Therefore, at least two frames of difference images can be obtained in step J1, at least two frames of first images can be obtained in step J21, and in step J22, the pixel value corresponding to each pixel point position in the multiple frames of first images is taken as the corresponding pixel average value, so that the influence caused by abnormal pixel points can be eliminated.
It can be understood that the pixel corresponding to thepixel position 1 in the first image of one frame may be an abnormal pixel, and the pixel corresponding to thepixel position 1 in the first image of another frame may be a non-abnormal pixel; and the probability that the pixels of different first images at the same pixel point position are all abnormal pixel points is very small, so the influence of the abnormal pixel points on data processing can be eliminated by calculating the average value, and the obtained second image can more clearly show the boundary of the key content area.
In step J23, the second image is processed to obtain a target image, where at least one image region included in the target image is a single connected region.
Illustratively, the second map is subjected to morphological closing operation processing and binarization processing to obtain a target image.
The operation of expanding the second image first and then corroding the second image is called morphological closing operation. The morphological closing operation can fill small spaces in the object, connecting the effects of an adjacent object and a smooth boundary.
The purpose of performing the morphological closing operation processing on the second image will be described below by way of example.
Fig. 16a to 16b are schematic diagrams illustrating the purpose of processing the second image according to an exemplary embodiment. Fig. 16a is a second image, and it can be seen from fig. 16a that there are many independent small spaces in the key content area (outlined by white solid line) 1601 that needs to be obtained, such as the blacksmall hole 1602, the blacksmall hole 1603 and so on encircled by the circle in fig. 16 a. These fine spaces reduce the accuracy of obtaining the key content region later, and therefore, it is necessary to connect the fine spaces (for example, the black pinholes and the black pinhole edge region) in thekey content region 1601, and the pixels in the key content region can be connected by performing the morphological closing operation processing on the second image. Fig. 16b can be obtained by performing morphological closing processing on fig. 16 a.
It can be seen from fig. 16b that the key content area does not include an independent fine space, and the key content area is a large single connected area as a whole.
In an optional implementation manner, the second image may be used as a target image, or the second image is binarized to obtain the target image, so that the target image presents a black-and-white effect, and the contour of the key content area can be obtained more accurately.
In step J3, a target image region having a largest area among at least one image region included in the target image is determined as the key content region.
For example, the target image may include a plurality of image regions, and the target image region having the largest area is determined as the key content region.
Illustratively, the position coordinates corresponding to each image area are obtained, and the image area position coordinates are (top, left, bottom, right), where top is the position coordinates of the upper boundary line forming the image area, left is the position coordinates of the left boundary line forming the image area, bottom is the position coordinates of the lower boundary line forming the image area, and right is the position coordinates of the right boundary line forming the image area. And calculating the area of each image area based on the corresponding position coordinates of each image area to obtain the target image area with the largest area.
In an alternative embodiment, the present disclosure further provides a method for determining a probability that a target image region is a key content region.
The significance of determining the probability that the target image region is the key content region will be described below with reference to fig. 17a to 17 c. Fig. 17a to 17c are schematic diagrams illustrating relative positions of a target contour region and a true key content region according to an exemplary embodiment.
If the probability that the target image region is a key content region is low, as shown in fig. 17a, it is illustrated that the target image region 1701 (outlined by a black dashed line) may include a background content region 1703 (fig. 17a to 17c represent a background content region by a black image) in addition to the key content region 1702 (outlined by a black solid line).
If the target image region has a low probability of being a key content region, as shown in fig. 17b, the target image region 1701 (outlined with a black dotted-and-dashed line) includes a partial key content region 1702 (outlined with a black solid line) and a partialbackground content region 1703.
If the background content area is reduced based on the video information corresponding to fig. 17b, the key content area may be missing, as shown in fig. 17 c.
In view of this, the present disclosure provides a method for determining a probability that a target image region is a key content region, which includes the following steps K1 to K3 in implementation.
In step K1, the image located in the target image area is converted into a grayscale map.
Illustratively, the "grayscale map" mentioned in the embodiments of the present disclosure includes only the image inside the target image region, and does not include the image except the target image region in the image.
In step K2, a first number of pixels in the gray scale map having pixel values greater than or equal to a first threshold is obtained.
In step K3, a ratio of the first number to a second number of pixels included in the gray map is determined as a first probability.
For example, if the target image is subjected to binarization processing, the pixel values of the pixels included in the key content region should be all 255, if the pixel value of one pixel in the grayscale image is greater than the first threshold, it is indicated that the pixel is a "white point", and if the pixel value of one pixel in the grayscale image is less than or equal to the first threshold, it is indicated that the pixel is a "black point". Therefore, the proportion of pixels capable of serving as "white points" in the target image area can be determined based on the first probability.
For example, if the first probability is greater than or equal to the second threshold, which indicates that the accuracy of the determined key content area is high, the zooming out operation on the first video based on the position of the key content area will not cause the problems as shown in fig. 17a to 17c, and therefore step S33 may be executed.
Illustratively, the first threshold may be determined based on actual conditions, for example, in order to ensure that the electronic device has a reduction accuracy greater than or equal to 95% in the process of reducing the background content area based on the video information, the second threshold is determined to be 0.9.
For example, after the electronic device detects a zoom-out operation, if a key content is missing during the process of zooming out the key content area, that is, the situation shown in fig. 17c occurs, or if the background content area is not completely zoomed out, the electronic device starts to zoom out the entire video, and if either of the two situations indicates that a zoom-out error occurs, the electronic device may feed back information representing that a zoom-out error occurs to the server.
The reduction accuracy rate at which the electronic device reduces the background content area based on the video information means that the server may determine the reduction accuracy rate based on the total number a of video information of one or more videos transmitted to the one or more electronic devices and the number B of information characterizing a reduction error received as feedback.
Illustratively, the reduction accuracy = number B/total number a.
In an optional embodiment, to expand the recall rate, for a corresponding first video having a first probability less than a second threshold, the video presentation method further comprises: step L1 to step L4.
In the step L1, the vertical coordinates of horizontal straight line segments respectively included in the multiple frames of video images are acquired, so as to obtain a straight line segment position set.
In step L2, a first ordinate and a second ordinate are determined from the plurality of ordinates included in the set of straight-line segment positions.
In step L3, a region surrounded by a first horizontal straight line whose ordinate is the first ordinate, a second horizontal straight line whose ordinate is the second ordinate, and a boundary in the vertical direction of the video image is determined as a candidate key content region.
In step L4, if the candidate key content area is the same as the target image area, step S33 is performed.
In an alternative implementation, the implementation procedure of step L1 includes steps L11 to L13.
In step L11, edge detection is performed on a plurality of frames of the video images, respectively, to obtain a plurality of frames of third images.
Wherein one video image corresponds to one third image.
For example, when the video image is subjected to edge detection, points where brightness changes are obvious can be identified, for example, the boundaries of the background content area and the key content area in the video image. Illustratively, the edge detection may be a Canny edge algorithm.
FIG. 18 is a diagram illustrating a three frame third image resulting from edge detection according to an example embodiment. The borders of the frames in the third image of the three frames in fig. 18 are clearly evident, making it easier to obtain the borders of the background content area and the key content area in the video image.
In step L12, for each third image, the curves and vertical lines in the third image are removed, and the horizontal lines are retained to obtain a fourth image.
For example, if the key content area is a rectangular area, and the boundary of the key content area in the vertical direction is the boundary of the video in the vertical direction, the key content area may be obtained by determining the boundary of the key content area in the horizontal direction according to the embodiment of the present disclosure, so step L12 may only keep horizontal straight lines.
For example, if the key content area is a rectangular area, and the boundary of the key content area in the vertical direction is not the boundary of the video in the vertical direction, the embodiment of the present disclosure needs to determine the boundary of the key content area in the horizontal direction and the boundary of the key content area in the vertical direction. That is, the vertical straight line and the horizontal straight line need to be retained in step L12.
For example, the step L12 is described by taking the horizontal straight line as an example, and the vertical straight line is the same, which is not described herein again.
Illustratively, it may be said that "removing curves, vertical lines, and retaining horizontal lines" in the third image is a line detection process. Illustratively, the line detection process may be hough transform line detection.
FIG. 19 is a diagram illustrating a fourth image resulting from a straight line detection process, according to an exemplary embodiment.
The fourth image of the 3 frames in fig. 19 corresponds to the third image of the 3 frames in fig. 18 one by one. Comparing fig. 19 with fig. 18, the fourth image of 3 frames in fig. 19 retains the straight line in the horizontal direction.
Wherein, the left diagram of fig. 19 retains 2 horizontal straight lines, and the middle diagram of fig. 19 retains 1 horizontal straight line; the right side of figure 19 retains 2 horizontal lines.
In summary, although at least 2 horizontal straight lines should be retained in the fourth image of each frame, in practical applications, the boundary of the key content area in some third images may be very similar to the background content area, resulting in only one or 0 horizontal straight line being retained; alternatively, there may be 2 or more horizontal line segments left in the third image.
In step L13, vertical coordinates of horizontal straight lines respectively included in the fourth images of the multiple frames are obtained to obtain a set of straight line segment positions.
For example, assuming that the fourth image of the plurality of frames includes n horizontal straight lines in total, the vertical coordinates of the n horizontal straight lines in the third image are: y1, y2, y3, …, yn, then the set of straight segment positions may be (y 1, y2, y3, …, yn).
There are various implementation manners of the step L2, and the embodiment of the present disclosure provides, but is not limited to, the following clustering manner, which includes the step L21 to the step L24.
Illustratively, fig. 20a to 20c are schematic diagrams illustrating a clustering process according to an exemplary embodiment.
As shown in fig. 20 a-20 c, each black circle represents a yi, i being any positive integer greater than or equal to 1 and less than or equal to n. In fig. 20a to 20c, the black circles are arranged from left to right according to their corresponding yi from small to large.
In fig. 20a to 20c, n =10 is taken as an example for explanation.
Illustratively, the number of clusters is set to be 2, the iteration number of the clusters is set to be L, and L is any positive integer greater than 1, and illustratively, L =10.
In step L21, two cluster center positions, i.e.,cluster center position 201 andcluster center position 202, are initialized at random based on the respective vertical coordinates included in the linear segment position set.
For example, it is assumed that the maximum ordinate of the respective ordinates included in the set of straight-line segment positions isordinate 1, the minimum ordinate isordinate 2, and the position of each cluster center is greater than or equal toordinate 1 and less than or equal toordinate 2.
Thecluster center locations 201 and 202 are characterized by circles filled in with a grid as shown in fig. 20 a.
For example, the cluster center position may be any ordinate included in the set of straight line segment positions, or may not be any ordinate included in the set of straight line segment positions, such as thecluster center position 202 shown in fig. 20 a.
In step L22, d (yi, c 1) and d (yi, c 2) are calculated, and if d (yi, c 1) < = d (yi, c 2), it is determined that the ordinate yi belongs to the first set corresponding to thecluster center position 201; if d (yi, c 1) > d (yi, c 2), it is determined that the ordinate yi belongs to the second set corresponding to clustercenter position 202, i =1, …, n.
Where d (yi, c 1) is the distance between the ordinate yi and thecluster center position 201, and d (yi, c 2) is the distance between the ordinate yi and thecluster center position 202.
In step L23, thecluster center position 201 is updated based on each ordinate included in the first set;cluster center position 202 is updated based on the ordinates contained in the second set.
Suppose it is determined that y1, y2, y3 belong to the first set, y4, y5, y6, y7, y8, y9, …, yn belong to the second set. Illustratively,cluster center position 201= (y 1+ y2+ y 3)/3;cluster center position 202= (y 4+ y5+ y6+ y7+ y8+ y9+, …, + yn)/(n-3).
After the first iteration,cluster center locations 201 and 202 are located as shown in FIG. 20 b.
In step L24, return to step L21 until the number of iterations reaches L end.
Illustratively, thecluster center position 201 and thecluster center position 202 obtained after L iterations are a first ordinate and a second ordinate.
There are various ways to determine whether the candidate key content area is the same as the target image area in the embodiments of the present disclosure, and the embodiments of the present disclosure provide, but are not limited to, the following two implementation manners.
The first implementation mode comprises the following steps: if the position coordinates (top 1, left1, bottom1, right 1) of the candidate key content area are the same as the position coordinates (top 2, left2, bottom2, right 2) of the target image area, determining that the candidate key content area is the same as the target image area, otherwise, determining that the candidate key content area is different from the target image area.
Wherein top1 and bottom1 are vertical coordinates of the horizontal boundary of the key content area; left1 and right1 are horizontal coordinates of the vertical boundary of the key content area, and top2 and bottom2 are vertical coordinates of the horizontal boundary of the target image area; left2 and right2 are the abscissa of the vertical boundary of the target image area.
The second implementation mode comprises the following steps: if the absolute value of the difference between top2 of the target image area and top1 of the candidate key content area is smaller than or equal to a third threshold, and the absolute value of the difference between bottom2 of the target image area and bottom1 of the candidate key content area is smaller than or equal to a fourth threshold, and theratio 1 is greater than or equal to a fifth threshold, and theratio 2 is greater than or equal to a sixth threshold, determining that the candidate key content area is the same as the target image area, otherwise, determining that the candidate key content area is different from the target image area.
Wherein the ratio of 1= the set of straight-line segment positions contains half of the number of positions in each ordinate whose absolute value of the difference from top1 is less than or equal to the seventh threshold/the number of multi-frame video images obtained in step I21.
Theratio 2= half of the number of positions in each vertical coordinate included in the set of straight-line segment positions whose absolute value of the difference from bottom1 is less than or equal to the eighth threshold/the number of multi-frame video images obtained in step I21.
For example, values of the third threshold, the fourth threshold, the fifth threshold, the sixth threshold, the seventh threshold, and the eighth threshold may be determined based on an actual situation, and are not described herein again.
Assume that the third threshold is 2 pixels and the fourth threshold is 0.4; the fifth threshold is 2 pixels and the sixth threshold is 0.4. Theratio 1 is expressed as uplinerob and theratio 2 is expressed as downlinerob.
Illustratively, uplinepcb = numUpCount/0.5 × n, where, for each yi, if abs (yi-top 1) < =2, numUpCount =numUpCount +1, the initial value of numUpCount is 0.
Exemplarily, downlinepcb = numbottmcount/0.5 × n, wherein, for each yi, if abs (yi-bottmo 1) < =2, numbottmcount = numbottmcount +1, numbottmcount has an initial value of 0.
If abs (top 2-top 1) < =3 and uplinepcb > =0.4 and abs (bottom 2-bottom 1) < =3 and downlinepcb > =0.4, it is determined that the target image region is the same as the candidate key content region.
And if any one of the 4 conditions is not met, determining that the target image area is different from the candidate key content area.
The second implementation of step I22 includes step J1, step J2, step J4, step L1, step L2, step L3, and step L5.
In step J4, a target image region having the largest area is determined from at least one image region included in the target image.
In step L5, if the candidate key content area is the same as the target image area, the target image area is determined to be the key content area.
The third implementation of step I22 includes step L1, step L2, and step L6.
In step L6, a first horizontal straight line whose ordinate is the first ordinate, a second horizontal straight line whose ordinate is the second ordinate, and a region surrounded by a boundary in the vertical direction of the video image are determined as the key content region.
In an alternative embodiment, the video presentation method includes the following steps M1 to M2.
In step M1, an instruction to acquire video information of the first video is sent to a server.
In step M2, video information of the first video sent by a server is received.
For example, the steps M1 and M2 may be a specific implementation manner of the step S32, and for example, the steps M1 and M2 may be performed before the step S31.
In the video display method provided by the embodiment of the present disclosure, the video information of one video has various expression forms, for example, any one of a table, a structure, a number, a queue, a linked list, and a function.
The following is an example of the presentation of video information as a function of video. Illustratively, the video information of a video includes the original information of the video. The original information refers to data before the video is not scaled, and includes at least one of the following contents, for example.
Wherein, height refers to the original length of the video in the vertical direction, and width refers to the original length of the video in the horizontal direction.
The leftRatio refers to the sum of the length of the sub background content area located on the left side of the key content area in the horizontal direction/the length of the sub background content areas located on both sides of the key content area in the horizontal direction.
For example, it is assumed that the background image padded in the horizontal direction in fig. 5b is a sub-background content area. The length of the sub background content area located to the left of the key content area in the horizontal direction may be a length of the sub background content area located to the left of the key content area in the horizontal direction as shown in fig. 5 b.
For example, the sum of the lengths of the sub background content areas located on both sides of the key content area in the horizontal direction may be, as shown in fig. 5b, the sum of the length of the sub background content area located on the left side of the key content area in the horizontal direction and the length of the sub background content area located on the right side of the key content area in the horizontal direction.
toprating refers to the sum of the length in the vertical direction of the sub background content area located above the key content area in the vertical direction/the length in the vertical direction of the sub background content areas located on both sides of the key content area.
For example, the length of the sub background content area above the key content area in the vertical direction may be the length of the sub background content area above the key content area in the vertical direction as shown in fig. 5 a.
Illustratively, the sum of the lengths in the vertical direction of the sub background content areas located on both sides of the key content area in the vertical direction = the length in the vertical direction of the sub background content area located above the key content area as shown in fig. 5a + the length in the vertical direction of the sub background content area located below the key content area as shown in fig. 5 a.
The width ratio refers to the ratio of the original length of the key content area in the horizontal direction to the original length of the video in the horizontal direction; the height ratio refers to the ratio of the original length of the key content area in the vertical direction to the original length of the video in the vertical direction.
Illustratively, the right black side duty =1 — the left black side duty. The ratio of the right black side = the length of the sub-background content area located on the right side of the key content area in the horizontal direction/the sum of the lengths of the sub-background content areas located on both sides of the key content area in the horizontal direction.
Exemplarily, based on the width ratio of the key content region, the original length of the key content region in the horizontal direction can be obtained; based on the height ratio of the key content region, the original length of the key content region in the vertical direction can be obtained. Based on the width, which is the original length of the key content area in the horizontal direction, the sum of the lengths of the sub-background content areas located on both sides of the key content area in the horizontal direction can be obtained. Based on height — height of the key content region ratio, the sum of the lengths in the vertical direction of the sub-background content regions located on both sides of the key content region in the vertical direction can be obtained.
For example, if the key content area is located in the middle of the video, the length of the sub background content area located on the left side of the key content area in the horizontal direction = the length of the sub background content area located on the right side of the key content area in the horizontal direction, and the length of the sub background content area located above the key content area in the vertical direction = the length of the sub background content area located below the key content area in the vertical direction.
Illustratively, the video information of the video may further include: and after the video is zoomed, displaying the size of the video, the size of the key content area and the size of the background content area.
Illustratively, the presentation size refers to the size of the current presentation, and the presentation size includes a length in the horizontal direction and a length in the vertical direction.
Fig. 21 is a flowchart illustrating a video presentation method applied to a server according to an exemplary embodiment. The method includes steps S210 to S213.
In step S210, a video acquisition instruction sent by the electronic device is received.
In step S211, at least one video is obtained from the stored videos, and the at least one video includes the first video.
In step S212, video information corresponding to at least one of the videos is obtained; video information of one video comprises a display size of the video and a key content area in the video;
in step S213, the at least one video and the video information of the at least one video are transmitted to the electronic device.
The video information of one video is a basis for zooming the video when the electronic device detects video zooming operation implemented on a video playing interface showing the video, and the video obtained after zooming the video comprises a key content area in the video.
In an alternative implementation, before step S210, or before step S211, or before step S212, for each of the videos that have been stored, the following steps N11 to N12 are performed. Or step S212 includes steps N11 to N12.
In step N11, a plurality of frames of video images are acquired from the video.
In step N12, based on a plurality of frames of the video image, the key content area included in the video is determined.
For the description of step N11, please refer to the description of step I21, and for the description of step N12, please refer to the description of step I22.
There are three implementation manners for step N12, where the first implementation manner includes step J1 to step J3, and for the description of step J1 to step J3, reference may be made to corresponding parts, which are not described herein again. The second implementation includes step J1, step J2, step J4, step L1, step L2, step L3, and step L5. The third implementation includes step L1, step L2, and step L6.
Three implementations of step N12 can be found in the implementation of step I22, which are not described herein.
In the embodiment of the video display method applied to the server, a method for determining the probability that the target image area is the key content area is further included, for example, in steps K1 to K3, please refer to the corresponding description, which is not described herein again.
In an alternative implementation, referring to the descriptions of fig. 17a to 17c for determining the meaning of the probability that the target image region is the key content region, in order to improve the accuracy of scaling the video by the client based on the video information, the video information of the video with the corresponding first probability greater than or equal to the second threshold is sent to the electronic device, and the video information of the video with the corresponding first probability less than the second threshold is not sent to the electronic device. Step S213 includes steps N21 to N22.
In step N21, from among said at least one video, a video is determined for which said first probability is greater than or equal to a second threshold.
In step N22, video information of the at least one video and the corresponding video having the first probability greater than or equal to the second threshold is sent to the electronic device.
In an alternative embodiment, to expand the recall rate, the following steps L1, L2, L3 and N23 are performed for each video for which the corresponding first probability is less than the second threshold.
In step N23, the video information of the video in which the candidate key content area is the same as the target image area is sent to the electronic device.
It can be understood that, since the determined key content areas are the same by the two calculation methods, one calculation method is the method of step J1 to step J3, and the other calculation method is the method of step L1 to step L3, the accuracy of the obtained key content areas is high, and therefore, the key content areas can be sent to the electronic device.
For the descriptions of step L1 to step L3, reference may be made to the above corresponding descriptions, which are not described herein again.
In an alternative embodiment, FIG. 22 is a block diagram illustrating a video presentation apparatus applied to an electronic device in accordance with an exemplary embodiment.
The electronic device includes: a first acquisition module 2001, a second acquisition module 2002, a scaling module 2003, and a presentation module 2004.
The first acquisition module is configured to receive video zooming operation implemented on a video playing interface and acquire operation information of the video zooming operation;
the second obtaining module is configured to obtain video information of a first video displayed in the video playing interface, wherein the video information at least comprises a display size of the first video and a key content area;
a scaling module configured to scale the first video according to the operation information obtained by the first obtaining module and the video information of the first video obtained by the second obtaining module or the first video to obtain a second video, where the second video includes the key content area;
the display module is configured to respond to the video zooming operation and display the second video obtained by the zooming module in the video playing interface.
In an optional implementation, the scaling module is specifically configured to:
a first determining unit configured to determine a scaling manner and a scaling parameter of the first video according to the operation information and video information of the first video;
And the scaling unit is configured to scale the first video according to the scaling mode and the scaling parameter determined by the first determining unit to obtain the second video.
In an optional implementation manner, the operation information at least includes an operation type and an operation distance, and the first determining unit is specifically configured to:
a first determining subunit, configured to determine, when it is determined that the operation type is a zoom-out operation, a zoom-out manner and a zoom-out parameter of the first video according to the operation distance and video information of the first video; the reduction mode at least comprises whether the key content area is reduced or not and a reduction type; the reduction type comprises reduction in a preset direction or integral reduction; the reduction parameters at least comprise a reduction length in the preset direction;
a second determining subunit, configured to determine, when it is determined that the operation type is an enlargement operation, an enlargement manner and an enlargement parameter of the first video according to the operation distance and video information of the first video; the amplification mode at least comprises whether the key content area is amplified and the amplification type; the amplification type comprises amplification in a preset direction or integral amplification; the magnification parameter includes at least a magnification length in the preset direction.
In an optional implementation manner, the operation distance is a projection distance of the video scaling operation in the preset direction, and the first determining subunit is specifically configured to: a first determination submodule, a second determination submodule, a third determination submodule, and a fourth determination submodule.
A first determining sub-module configured to determine a background content area of the first video outside the key content area according to a key content area included in the video information.
A second determining sub-module, configured to determine, when the operation distance is not greater than the length of the background content area in the preset direction, that the zoom-out manner includes not zooming out the key content area, zooming out the background content area, and a zoom-out type of the background content area being zoom-out in the preset direction or zooming out as a whole.
A third determination sub-module configured to determine a reduction length in a preset direction based on the operation distance, in a case where a reduction type of the background content area is reduction in the preset direction.
A fourth determination submodule configured to determine, when the reduction type of the background content area is an overall reduction, a first reduction ratio and a reduction length in the preset direction based on the operation distance and the size of the background content area, where the first reduction ratio is a ratio of a length of the background content area in the preset direction to a length in a direction perpendicular to the preset direction.
In an optional implementation manner, the operation distance is a projection distance of the video scaling operation in the preset direction, and the first determining subunit is specifically configured to: a fifth determination sub-module, a sixth determination sub-module, and a seventh determination sub-module.
A fifth determining sub-module configured to determine, from the video information, a background content area of the first video outside the key content area.
A sixth determining sub-module, configured to determine, when the operation distance is greater than the length of the background content area in the preset direction, that the reducing manner includes not reducing the key content area and reducing the background content area.
A seventh determining sub-module configured to determine a reduced length of the background content area in the preset direction and a reduced length in a direction perpendicular to the preset direction based on a size of the background content area.
In an optional implementation manner, the operation distance is a projection distance of the video scaling operation in the preset direction, and the first determining subunit is specifically configured to: an eighth determination submodule, a ninth determination submodule, a tenth determination submodule, and an eleventh determination submodule.
An eighth determination submodule configured to the third determination submodule is configured to determine a background content area of the first video outside the key content area according to the video information.
A ninth determination sub-module configured to determine a reduction length of the background content area in the preset direction and a reduction length in a direction perpendicular to the preset direction based on a size of the background content area.
A tenth determining sub-module configured to determine, when the zoom-out type of the key content area is zoom-out in a preset direction, a zoom-out length of the key content area in the preset direction based on the length of the background content area in the preset direction and the operation distance.
An eleventh determining sub-module configured to determine, when the zoom-out type of the key content area is a whole zoom-out, a zoom-out length of the key content area in the preset direction and a second zoom-out ratio, based on the length of the background content area in the preset direction, the operation distance, and the size of the key content area, where the second zoom-out ratio is a ratio of the length of the key content area in the preset direction to the length of the key content area in a direction perpendicular to the preset direction.
In an optional implementation manner, the second determining subunit is specifically configured to: a twelfth determination sub-module, a thirteenth determination sub-module, a fourteenth determination sub-module, and a fifteenth determination sub-module.
A twelfth determining sub-module configured to determine, according to the video information, an original size corresponding to a background content area of the first video outside the key content area.
A thirteenth determining sub-module, configured to determine that the amplification manner includes not amplifying the key content area, amplifying the background content area, and whether the amplification type of the background content area is amplification in a preset direction or amplification in whole, if the length of the key content area in the preset direction is equal to the original length of the key content area.
A fourteenth determining sub-module configured to determine, when the type of enlargement of the background content area is a preset direction enlargement, an enlargement length of the background content area in the preset direction based on the operation distance.
A fifteenth determining sub-module configured to determine, based on the operation distance and the original size of the background content area, an enlargement length of the background content area in the preset direction and a first enlargement ratio that is a ratio of the original length of the background content area in the preset direction to an original length of a direction perpendicular to the preset direction, in a case where the type of enlargement of the background content area is enlargement as a whole.
In an optional implementation manner, the operation distance is a projection distance of the video scaling operation in the preset direction; the second determining subunit is specifically configured to: a sixteenth determination sub-module, a seventeenth determination sub-module, and an eighteenth determination sub-module.
A sixteenth determining sub-module, configured to determine that the amplification manner includes amplifying the key content area and that the amplification type of the key content area is amplification in a preset direction or amplification in whole, when the length of the key content area in the preset direction is less than or equal to the difference between the original length of the key content area and the operation distance.
A seventeenth determining sub-module configured to determine, when the type of enlargement of the key content area is a preset direction enlargement, an enlargement length of the key content area in the preset direction based on the operation distance.
An eighteenth determination sub-module configured to determine, based on the operation distance and the size of the key content area, an enlargement length of the key content area in the preset direction and a second enlargement ratio that is a ratio of a length of the key content area in the preset direction to a length of a direction perpendicular to the preset direction, in a case where the enlargement type of the key content area is the integral enlargement.
In an optional implementation manner, the operation distance is a projection distance of the video scaling operation in the preset direction; the second determining subunit is specifically configured to: a nineteenth element, a twentieth determination submodule, a twenty-first determination submodule, a twenty-second determination submodule, a twenty-third determination submodule, and a twenty-fourth determination submodule.
A nineteenth determining sub-module, configured to, when the length of the key content area in the preset direction is greater than the difference between the original length of the key content area and the operation distance, determine, according to the video information, an original size corresponding to a background content area of the first video outside the key content area.
A twentieth determining sub-module configured to determine that the amplification manner includes amplifying the key content area, that the amplification type of the key content area is amplification in a preset direction or amplification in entirety, amplifying the background content area, and that the amplification type of the background content area is amplification in a preset direction or amplification in entirety.
A twenty-first determining sub-module configured to determine, when the amplification type of the key content area is amplification in a preset direction, an amplification length of the key content area in the preset direction based on a length of the key content area in the preset direction and an original length of the key content area in the preset direction.
A twenty-second determining sub-module configured to, in a case that the amplification type of the key content area is overall amplification, determine, based on the size of the key content area and the original length of the key content area in the preset direction, an amplification length of the key content area in the preset direction and a third amplification scale, where the third amplification scale is a ratio of the amplification length of the key content area in the preset direction to an amplification length in a direction perpendicular to the preset direction.
A twenty-third determination sub-module configured to determine, in a case where the type of enlargement of the background content area is a preset direction enlargement, an enlargement length of the background content area in the preset direction based on the operation distance.
A twenty-fourth determining sub-module configured to determine, based on the operation distance and the original size of the background content area, an enlargement length of the background content area in the preset direction and a fourth enlargement ratio that is a ratio of the original length of the background content area in the preset direction to an original length of a direction perpendicular to the preset direction, in a case where the enlargement type of the background content area is the overall enlargement.
In an optional implementation manner, the background content area includes a first sub-background content area and a second sub-background content area, and the first video sequentially includes the first sub-background content area, the key content area, and the second sub-background content area in the preset direction;
the reduction parameter further includes a reduction ratio of the first sub-background content area in the preset direction and a reduction ratio of the second sub-background content area in the preset direction, and the reduction ratio is a ratio of a length of the second sub-background content area in the preset direction to a length of the background content area in the preset direction;
the amplification parameters further include an amplification ratio of the first sub-background content area in the preset direction, and an amplification ratio of the second sub-background content area in the preset direction, where the amplification ratio is a ratio of an original length of the second sub-background content area in the preset direction to an original length of the second sub-background content area in the preset direction.
In an optional implementation, the apparatus further comprises:
a first determining module configured to determine an operation type corresponding to the video scaling operation;
A key zooming-out module configured to remove a background content area in the first video except the key content area to obtain the second video if the operation type is a key zooming-out operation;
a one-key amplification module configured to, if the operation type is a one-key amplification operation, amplify the key content area to an original size of the key content area, and amplify the background content area to the original size of the background content area, so as to obtain the second video.
In an optional implementation manner, the second obtaining module is specifically configured to:
a first acquisition unit configured to acquire a plurality of frames of video images from the first video;
a second obtaining unit configured to determine the key content area included in the first video based on a plurality of frames of the video images.
In an optional implementation manner, the second obtaining unit is specifically configured to:
the first acquisition subunit is configured to acquire a difference image of two adjacent frames of video images at any position in a plurality of frames of video images to obtain at least one frame of difference image;
a second obtaining subunit, configured to obtain, based on the at least one frame of difference image, a target image, where a pixel value at each position in the target image is an average value of pixel values corresponding to the positions in the at least one frame of difference image;
A third determining subunit configured to determine, as the key content area, a target image area having a largest area among at least one image area included in the target image.
In an optional implementation manner, the second obtaining subunit is specifically configured to:
the first obtaining sub-module is configured to process the at least one frame of difference image respectively to obtain a first image corresponding to each frame of difference image, the first image of one frame includes a plurality of image areas that are not connected with each other, and at least one of the image areas is a multi-connection area;
a second obtaining sub-module configured to obtain a second image based on at least one frame of the first image, a pixel at each position in the second image being an average value of pixel values at the position in the at least one frame of the first image;
and the third acquisition sub-module is configured to process the second image to obtain a target image, and at least one image area contained in the target image is a single connected area.
In an optional implementation manner, the method further includes:
a first conversion module configured to convert an image in the target image region in the target image into a grayscale image;
A third acquisition module configured to acquire a first number of pixels in the grayscale image whose pixel values are greater than or equal to a first threshold;
a second determining module configured to determine a ratio of the first number to a second number of pixels included in the gray map as the first probability.
In an optional implementation, the apparatus further comprises: a first determining submodule configured to trigger the scaling module if the first probability is greater than or equal to a second threshold.
In an optional implementation, the apparatus further comprises:
a fourth obtaining module, configured to obtain vertical coordinates of horizontal straight-line segments respectively included in the video images of the multiple frames if the first probability is smaller than the second threshold, so as to obtain a position set of the straight-line segments;
a third determining module configured to determine a first ordinate and a second ordinate from a plurality of ordinates included in the set of straight-line segment positions;
a fourth determining module configured to determine a region surrounded by a first horizontal straight line with a vertical coordinate as the first vertical coordinate, a second horizontal straight line with a vertical coordinate as the second vertical coordinate, and a boundary in the vertical direction of the video image as a candidate key content region;
A second triggering module configured to trigger the scaling module if the candidate key content area is the same as the target image area.
In an optional implementation manner, the second obtaining unit is specifically configured to:
a third acquiring subunit, configured to acquire vertical coordinates of horizontal straight line segments respectively included in the multiple frames of video images, so as to obtain a set of straight line segment positions;
a fourth determining subunit configured to determine a first ordinate and a second ordinate from among a plurality of ordinates included in the set of straight-line segment positions;
a fifth determining subunit configured to determine, as the key content region, a region surrounded by a first horizontal straight line whose ordinate is the first ordinate, a second horizontal straight line whose ordinate is the second ordinate, and a boundary in a vertical direction of the video image.
In an optional implementation manner, the second obtaining module is specifically configured to:
a first sending module configured to send an instruction to a server to obtain video information of the first video;
a first receiving module configured to receive video information of the first video transmitted by a server.
In an alternative embodiment, FIG. 23 is a block diagram illustrating a video presentation device applied to a server in accordance with an exemplary embodiment.
This video display device includes: a receiving module 2101, a fifth acquiring module 2102, a sixth acquiring module 2103, a first sending module 2104.
The second receiving module is configured to receive a video acquisition instruction sent by the electronic equipment;
a fifth obtaining module configured to obtain at least one video from the stored videos, wherein the at least one video comprises the first video;
a sixth obtaining module configured to obtain video information corresponding to at least one of the videos; video information of one of said videos includes; a presentation size of the video and a key content area in the video;
a second sending module configured to send the at least one video and video information of the at least one video to the electronic device;
the video information of one video is a basis for zooming the video when the electronic device detects that video zooming operation is performed on a video playing interface showing the video, and the video obtained after zooming the video comprises a key content area in the video.
In an optional implementation manner, the apparatus further includes:
A seventh obtaining module configured to obtain a plurality of frames of video images from the video;
a fifth determining module configured to determine the key content area included in the video based on a plurality of frames of the video image.
In an optional implementation, the fifth determining module is specifically configured to:
the third acquisition unit is configured to acquire a difference image of two adjacent frames of video images in any position in multiple frames of video images so as to obtain at least one frame of difference image;
a second determining unit, configured to obtain a target image based on the at least one frame of difference image, where a pixel value of each position in the target image is an average value of pixel values corresponding to the positions in the at least one frame of difference image;
a third determining unit configured to determine a target image area having a largest area among at least one image area included in the target image as the key content area.
In an optional implementation manner, the second determining unit is specifically configured to:
a fourth obtaining subunit, configured to process the at least one frame of difference image, respectively, to obtain a first image corresponding to each frame of difference image, where one frame of first image includes multiple image areas that are not connected to each other, and at least one of the multiple image areas is a multiple-connected area;
A fifth obtaining subunit, configured to obtain a second image based on at least one frame of the first image, where a pixel at each position in the second image is an average value of pixel values at the position in the at least one frame of the first image;
and the sixth acquisition subunit is configured to process the second image to obtain a target image, wherein at least one image area included in the target image is a single connected area.
In an optional implementation, the apparatus further comprises:
a second conversion module configured to convert an image in the target image region in the target image into a grayscale image;
an eighth acquiring module configured to acquire a first number of pixels in the grayscale image whose pixel values are greater than or equal to a first threshold;
a sixth determining module configured to determine a ratio of the first number to a second number of pixels included in the gray map as the first probability.
In an alternative implementation, the first sending module is specifically configured to:
a fourth determination unit configured to determine, from the at least one video, a corresponding video of which the first probability is greater than or equal to a second threshold;
A first sending unit configured to send video information of the at least one video and a corresponding video of which the first probability is greater than or equal to the second threshold to the electronic device.
In an optional implementation, the apparatus further comprises:
a ninth obtaining module, configured to, if the first probability is smaller than the second threshold, obtain vertical coordinates of horizontal straight line segments respectively included in the video images of the multiple frames to obtain a set of positions of the straight line segments;
a seventh determining module configured to determine a first ordinate and a second ordinate from a plurality of ordinates included in the set of straight-line segment positions;
an eighth determining module, configured to determine, as candidate key content areas, areas surrounded by a first horizontal straight line with an ordinate of the first ordinate, a second horizontal straight line with an ordinate of the second ordinate, and a boundary in a vertical direction of the video image;
a third sending module configured to send video information of a video in which the candidate key content area is the same as the target image area to the electronic device.
In an optional implementation manner, the fifth determining module is specifically configured to:
A fourth acquiring unit configured to acquire vertical coordinates of horizontal straight line segments respectively included in the video images of the multiple frames to obtain a straight line segment position set;
a fifth determination unit configured to determine a first ordinate and a second ordinate from among a plurality of ordinates included in the set of straight-line segment positions;
a sixth determining unit configured to determine, as the key content region, a region surrounded by a first horizontal straight line whose ordinate is the first ordinate, a second horizontal straight line whose ordinate is the second ordinate, and a boundary in a vertical direction of the video image.
In an optional embodiment, the present disclosure further provides a video presentation system, including: a server and at least one electronic device.
The following describes an interaction procedure between theelectronic device 22 and theserver 21 with reference to the first application scenario and the second application scenario involved in the implementation environment disclosed in fig. 2.
In a first application scenario, theelectronic device 22 sends a video acquisition instruction to theserver 21, and theserver 21 receives the video acquisition instruction sent by theelectronic device 22 and acquires at least one video corresponding to the video acquisition instruction from the stored videos based on the video acquisition instruction. Theelectronic device 22 receives the at least one video sent by the server, displays a first video of the at least one video in the video playing interface based on the video display requirement, and analyzes the first video to obtain video information of the first video.
In a second application scenario, theelectronic device 22 sends a video acquisition instruction to theserver 21, and theserver 21 receives the video acquisition instruction sent by theelectronic device 22. And obtaining at least one video corresponding to the video obtaining instruction and video information corresponding to the at least one video from the stored videos based on the video obtaining instruction. The at least one video and the video information corresponding to the at least one video are sent to theelectronic device 22, so that the electronic device presents a first video of the at least one video in the video playing interface based on the video presentation requirement.
FIG. 24 is a block diagram illustrating an electronic device in accordance with an example embodiment. The electronic device includes, but is not limited to, aninput unit 241, afirst memory 242, adisplay unit 243, and afirst processor 244. Those skilled in the art will appreciate that the configuration shown in fig. 24 is merely an example of an implementation and does not constitute a limitation on electronic devices that may include more or fewer components than those shown, or that certain components may be combined, or that a different arrangement of components may be used.
The following describes each component of the electronic device in detail with reference to fig. 24:
For example, theinput unit 241 may be used to receive information input by a user, such as a zoom operation.
For example, theinput unit 241 may include atouch panel 2411 andother input devices 2412. Thetouch panel 2411, also referred to as a touch screen, can collect touch operations performed by a user (e.g., operations performed by the user on thetouch panel 2411 using a finger, a stylus, or any other suitable object or accessory), and drive a corresponding connection device according to a predetermined program (e.g., drive a video zoom function in the first processor 244). Alternatively, thetouch panel 2411 may include two parts, a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to thefirst processor 244, and receives and executes commands sent from thefirst processor 244. In addition, thetouch panel 2411 may be implemented by various types such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. Theinput unit 241 may includeother input devices 2412 in addition to thetouch panel 2411. In particular,other input devices 2412 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
Illustratively, thefirst memory 242 may be used to store software programs and modules, and thefirst processor 244 executes various functional applications and data processing of the electronic device by executing the software programs and modules stored in thefirst memory 242. Thefirst memory 242 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to use of the electronic device (such as a length of a key content area of the first video in a vertical direction, a length of a background content area in the vertical direction, and the like). Further, thefirst memory 242 may include a high speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
For example, thedisplay unit 243 may be used to display information input by a user or information provided to the user (e.g., display video) and various menus of the electronic device. TheDisplay unit 243 may include aDisplay panel 2431, and optionally, theDisplay panel 2431 may be configured in the form of an LCD (Liquid Crystal Display), an OLED (Organic Light-Emitting Diode), or the like. Further, thetouch panel 2412 can cover thedisplay panel 2431, and when thetouch panel 2412 detects a touch operation on or near thetouch panel 2412, the touch operation can be transmitted to thefirst processor 244 to determine the type of the touch event, and then thefirst processor 244 can provide a corresponding visual output on thedisplay panel 2431 according to the type of the touch event.
For example, thetouch panel 2412 and thedisplay panel 2431 can be provided as two separate components to implement the output and input functions of theelectronic device 22, but in some embodiments, thetouch panel 2412 and thedisplay panel 2431 can be integrated to implement the input and output functions of the electronic device.
Thefirst processor 244 is a control center of the electronic device, connects various parts of the entire electronic device using various interfaces and lines, and performs various functions of the electronic device and processes data by operating or executing software programs and/or modules stored in thefirst memory 242 and calling data stored in thefirst memory 242, thereby monitoring the electronic device as a whole. Illustratively, thefirst processor 244 may include one or more processing units; illustratively, thefirst processor 244 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into thefirst processor 244.
The electronic device also includes a power supply 245 (e.g., a battery) that provides power to the various components, illustratively, the power supply may be logically coupled to theprocessor 244 via a power management system, such that functions to manage charging, discharging, and power consumption management are performed via the power management system.
Although not shown, the electronic device may further include a camera, a bluetooth module, an RF (Radio Frequency) circuit, a sensor, an audio circuit, a WiFi (wireless fidelity) module, a sensor, a network unit, an interface unit, and the like.
The electronic device provides wireless broadband internet access to the user, such as accessing a server, through the network element.
The interface unit is an interface for connecting an external device and the electronic equipment. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the electronic apparatus or may be used to transmit data between the electronic apparatus and the external device.
In the disclosed embodiment, thefirst processor 244 included in the electronic device may be a central processing unit CPU, or an Application Specific Integrated Circuit ASIC (Application Specific Integrated Circuit), or one or more Integrated circuits configured to implement the embodiments of the present invention.
The electronic device includes afirst processor 244 having the following functions: receiving video zooming operation implemented on a video playing interface, and acquiring operation information of the video zooming operation; acquiring video information of a first video displayed in the video playing interface, wherein the video information at least comprises a display size of the first video and a key content area; according to the operation information and the video information of the first video, zooming the first video to obtain a second video, wherein the second video comprises the key content area; and responding to the video zooming operation, and displaying the second video in the video playing interface.
FIG. 25 is a block diagram illustrating a server according to an example embodiment. Servers include, but are not limited to: asecond processor 251, asecond memory 252, anetwork interface 253, an I/O controller 254, and acommunication bus 255.
It should be noted that, as will be understood by those skilled in the art, the structure of the server shown in fig. 25 is not limited to the server, and the server may include more or less components than those shown in fig. 25, or some components may be combined, or a different arrangement of components may be provided.
The following describes each component of the server in detail with reference to fig. 25:
thesecond processor 251 is a control center of the server, connects various parts of the entire server using various interfaces and lines, performs various functions of the server and processes data by running or executing software programs and/or modules stored in thesecond memory 252 and calling data stored in thesecond memory 252, thereby performing overall monitoring of the server. Thesecond processor 251 may include one or more processing units; illustratively, thesecond processor 251 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into thesecond processor 251.
Thesecond processor 251 may be a Central Processing Unit (CPU), or an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits configured to implement embodiments of the present invention, etc.;
thesecondary storage 252 may include Memory, such as a Random-Access Memory (RAM) 2521 and a Read-Only Memory (ROM) 2522, and may also include a mass storage device 2525, such as at least 1 disk storage. Of course, the server may also include hardware needed for other services.
Thesecond memory 252 is used for storing the executable instructions of thesecond processor 251. Thesecond processor 251 has the following functions: receiving a video acquisition instruction sent by electronic equipment; obtaining at least one video from the stored videos, wherein the at least one video comprises a first video; acquiring video information corresponding to at least one video; video information of one of said videos includes; a presentation size of the video and a key content area in the video; sending the at least one video and video information of the at least one video to the electronic equipment; the video information of one video is a basis for zooming the video when the electronic device detects that video zooming operation is performed on a video playing interface showing the video, and the video obtained after zooming the video comprises a key content area in the video.
A wired orwireless network interface 253 is configured to connect the server to a network.
Thesecond processor 251, thesecond memory 252, thenetwork interface 253, and the I/O controller 254 may be connected to each other by acommunication bus 255, which may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc.
In an exemplary embodiment, the server may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described electronic resource transfer method.
In an exemplary embodiment, the disclosed embodiments provide a storage medium comprising instructions, such as thefirst memory 252 comprising instructions, executable by thefirst processor 254 of the electronic device to perform the above-described method. Alternatively, the storage medium may be a non-transitory computer readable storage medium, which may be, for example, a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, the disclosed embodiment provides a storage medium comprising instructions, for example, thesecond memory 252 comprising instructions, which are executable by thesecond processor 251 of the server to perform the above-described method. Alternatively, the storage medium may be a non-transitory computer readable storage medium, which may be, for example, a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, a storage medium is further provided, which is directly loadable into an internal memory of a computer, such as thefirst memory 242 described above, and contains software codes, and the computer program is loaded into and executed by the computer to implement the steps shown in any embodiment of the video presentation method applied to the electronic device described above.
In an exemplary embodiment, a storage medium is further provided, which is directly loadable into an internal memory of a computer, such as thesecond memory 252 described above, and contains software codes, and the computer program is loaded into and executed by the computer to implement the steps shown in any of the embodiments of the video presentation method applied to the server described above.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.