CN110691259B - Video playing method, system, device, electronic equipment and storage medium - Google Patents

Video playing method, system, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN110691259B
CN110691259B CN201911089811.2A CN201911089811A CN110691259B CN 110691259 B CN110691259 B CN 110691259B CN 201911089811 A CN201911089811 A CN 201911089811A CN 110691259 B CN110691259 B CN 110691259B
Authority
CN
China
Prior art keywords
image
frame
vertical screen
video
processed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911089811.2A
Other languages
Chinese (zh)
Other versions
CN110691259A (en
Inventor
周霆
庹虎
王健
王�忠
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN201911089811.2A priority Critical patent/CN110691259B/en
Publication of CN110691259A publication Critical patent/CN110691259A/en
Application granted granted Critical
Publication of CN110691259B publication Critical patent/CN110691259B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/23418Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving operations for analysing video streams, e.g. detecting features or characteristics
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/2343Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
    • H04N21/234363Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements by altering the spatial resolution, e.g. for clients with a lower screen resolution
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/44008Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving operations for analysing video streams, e.g. detecting features or characteristics in the video stream
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • H04N21/440263Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display by altering the spatial resolution, e.g. for displaying on a connected PDA

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Controls And Circuits For Display Device (AREA)

Abstract

The embodiment of the invention provides a video playing method, a video playing system, a video playing device, electronic equipment and a storage medium. The server identifies the content of each frame of image in the acquired horizontal version video to be processed and determines the focus area of each frame of image; determining the central position of a vertical screen playing area of each frame of image based on the central position of the focus area; determining a vertical screen playing area matched with a preset vertical screen resolution in each frame of image; the client sends a playing request to the server; when the server responds to a playing request, sending data to be played to the client according to the position information of the vertical screen playing area in the corresponding image frame, wherein the data to be played comprises a horizontal version video to be processed and the position information; and when the client plays the horizontal version video to be processed in a vertical screen with the preset vertical screen resolution, the content of the vertical screen playing area is played in a full screen mode. By the technical scheme provided by the embodiment of the invention, the screen utilization rate when the horizontal video and the vertical video are played is improved, so that the video display effect is improved.

Description

Video playing method, system, device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of streaming media video technologies, and in particular, to a video playing method, system, device, electronic device, and storage medium.
Background
With the development of streaming media technology, more and more users enjoy watching videos using mobile terminals. However, most of the conventional Professional produced Content (PGC) is produced in the same manner as movies and television programs, that is, the video is a landscape video. This makes the user when using mobile terminal to watch horizontal version video, in order to have better watching effect, need to change mobile terminal from vertically holding into holding violently, horizontal version video is broadcast to the horizontal screen.
Horizontal version video is played to horizontal screen, and whole screen is full of to horizontal version video, and it is effectual to watch. However, users are generally used to hold a mobile terminal vertically, and if a horizontal version video is played based on the user's habit in vertical screen display, in order to avoid image distortion caused by vertical pull-up of the horizontal version video, each frame of image of the horizontal version video is often scaled in equal proportion, that is, the long side of each frame of image of the horizontal version video is scaled in equal proportion to the length of the short side of the mobile terminal, so that the scaled horizontal version video is played. When the mode is adopted to play the horizontal version video on the vertical screen, a larger black area appears above and below the display screen of the mobile terminal, namely, no video area exists, so that the screen utilization rate is lower, and the video display effect is influenced.
Disclosure of Invention
Embodiments of the present invention provide a video playing method, system, apparatus, electronic device, and storage medium, so as to improve a screen utilization rate when a horizontal version video is played on a vertical screen, thereby improving a video display effect. The specific technical scheme is as follows:
in a first aspect of the present invention, there is provided a video playing method, including a system including a server and a client, the method including:
the server identifies the content of each frame of image in the acquired to-be-processed cross-bar video and determines the focus area of each frame of image; determining the central position of a vertical screen playing area of each frame of image in the horizontal version video to be processed based on the central position of the focus area of each frame of image; determining a vertical screen playing area matched with the preset vertical screen resolution in each frame of image based on the central position of the vertical screen playing area of each frame of image according to the preset vertical screen resolution;
the client responds to the playing operation of the horizontal version video to be processed and sends a playing request of the horizontal version video to be processed to a server based on the playing operation;
when the server responds to the playing request, sending data to be played to the client according to the position information of the vertical screen playing area in the corresponding image frame, wherein the data to be played comprises the horizontal version video to be processed and the position information;
the client receives the data to be played; and when the horizontal version video to be processed is played in a vertical screen with the preset vertical screen resolution, the content of a vertical screen playing area in each frame image of the horizontal version video to be processed is played in a full screen mode according to the position information.
In a second aspect of the present invention, there is also provided a video playing method applied to a server, where the method includes:
acquiring a horizontal version video to be processed;
identifying the content of each frame of image in the horizontal version video to be processed, and determining the focus area of each frame of image;
determining the central position of a vertical screen playing area of each frame of image in the horizontal version video to be processed based on the central position of the focus area of each frame of image;
determining a vertical screen playing area matched with the preset vertical screen resolution in each frame of image based on the central position of the vertical screen playing area of each frame of image according to the preset vertical screen resolution;
when a playing request of a client for the horizontal version video to be processed is received, sending data to be played to the client according to the position information of the vertical screen playing area in the corresponding image frame, wherein the data to be played comprises the horizontal version video to be processed and the position information of the vertical screen playing area of each frame of image.
In a third aspect of the present invention, there is also provided a video playing method applied to a client, where the method includes:
detecting whether a playing operation aiming at a to-be-processed horizontal version video is received;
if so, sending a playing request aiming at the to-be-processed horizontal version video to a server based on the playing operation;
receiving data to be played sent by the server according to the playing request, wherein the data to be played comprises the horizontal version video to be processed and position information of a vertical screen playing area of each frame of image in the horizontal version video to be processed in a corresponding image frame; the method comprises the steps that the vertical screen playing area of each frame of image is obtained by identifying the content of each frame of image in a to-be-processed horizontal version video, the focus area of each frame of image is determined, the central position of the vertical screen playing area of each frame of image in the to-be-processed horizontal version video is determined based on the central position of the focus area of each frame of image, and the central position of the vertical screen playing area of each frame of image in the to-be-processed horizontal version video is determined based on the central position of the vertical screen playing area of each frame of image according to preset vertical screen resolution;
and when the horizontal version video to be processed is played in a vertical screen with the preset vertical screen resolution, the content of a vertical screen playing area in each frame image of the horizontal version video to be processed is played in a full screen mode according to the position information.
In a fourth aspect of the present invention, there is also provided a video playing system, where the system includes a server and a client;
the server is used for identifying the content of each frame of image in the acquired to-be-processed cross-bar video and determining the focus area of each frame of image; determining the central position of a vertical screen playing area of each frame of image in the horizontal version video to be processed based on the central position of the focus area of each frame of image; determining a vertical screen playing area matched with the preset vertical screen resolution in each frame of image based on the central position of the vertical screen playing area of each frame of image according to the preset vertical screen resolution;
the client is used for responding to the playing operation of the horizontal version video to be processed and sending a playing request aiming at the horizontal version video to be processed to the server based on the playing operation;
the server is further used for sending data to be played to the client according to the position information of the vertical screen playing area in the corresponding image frame when responding to the playing request, wherein the data to be played comprises the horizontal version video to be processed and the position information;
the client is also used for receiving the data to be played; and when the horizontal version video to be processed is played in a vertical screen with the preset vertical screen resolution, the content of a vertical screen playing area in each frame image of the horizontal version video to be processed is played in a full screen mode according to the position information.
In a fifth aspect of the present invention, there is also provided a video playing apparatus applied to a server, the apparatus including:
the acquisition module is used for acquiring a horizontal version video to be processed;
the identification module is used for identifying the content of each frame of image in the horizontal version video to be processed and determining the focus area of each frame of image;
the first determining module is used for determining the central position of a vertical screen playing area of each frame of image in the horizontal version video to be processed based on the central position of the focus area of each frame of image;
the second determining module is used for determining a vertical screen playing area matched with the preset vertical screen resolution in each frame of image based on the central position of the vertical screen playing area of each frame of image according to the preset vertical screen resolution;
the first sending module is used for sending data to be played to a client according to the position information of the vertical screen playing area in the corresponding image frame when a playing request of the client for the horizontal version video to be processed is received, wherein the data to be played comprises the horizontal version video to be processed and the position information.
In a sixth aspect of the present invention, there is also provided a video playing apparatus applied to a client, where the apparatus includes:
the first detection module is used for detecting whether a playing operation aiming at the horizontal version video to be processed is received;
a second sending module, configured to send, based on the play operation, a play request for the to-be-processed flat video to a server when a detection result of the first detecting module is yes;
a receiving module, configured to receive data to be played, which is sent by the server according to the playing request, where the data to be played includes the horizontal version video to be processed and position information of a vertical screen playing area of each frame of image in the horizontal version video to be processed in a corresponding image frame; the method comprises the steps that the vertical screen playing area of each frame of image is obtained by identifying the content of each frame of image in a to-be-processed horizontal version video, the focus area of each frame of image is determined, the central position of the vertical screen playing area of each frame of image in the to-be-processed horizontal version video is determined based on the central position of the focus area of each frame of image, and the central position of the vertical screen playing area of each frame of image in the to-be-processed horizontal version video is determined based on the central position of the vertical screen playing area of each frame of image according to preset vertical screen resolution;
and the playing module is used for playing the content of the vertical screen playing area in each frame image of the horizontal version video to be processed in a full screen mode according to the position information when the horizontal version video to be processed is played in the vertical screen with the preset vertical screen resolution.
In a seventh aspect of the present invention, there is also provided an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
and the processor is used for realizing any video playing method step when executing the program stored in the memory.
In an eighth aspect implemented by the present invention, there is further provided a computer-readable storage medium, in which a computer program is stored, and the computer program, when executed by a processor, implements any of the video playing method steps described above.
In a ninth aspect implemented by the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform any of the video playback methods described above.
By adopting the technical scheme provided by the embodiment of the invention, the server determines the central position of the vertical screen playing area of each frame of image of the horizontal version video according to the focus area of each frame of image of the horizontal version video, so as to determine the vertical screen playing area of each frame of image, and thus, when the client side plays the horizontal version video in a vertical screen mode, the client side can play the video content corresponding to the vertical screen playing area of each frame of image determined by the server in a full screen mode. Because the central position of the vertical screen playing area changes along with the position change of the focus area, when the horizontal version video is played vertically, the full-screen playing content is ensured to always comprise the content of the focus area, the phenomenon of the area without video above and below the display screen is effectively avoided, the screen utilization rate when the horizontal version video is played vertically is improved, and the video display effect is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below.
FIG. 1-a is a schematic diagram of a conventional landscape video landscape screen;
FIG. 1-b is a schematic diagram of a conventional horizontal video vertical screen display;
fig. 2 is a schematic flowchart of a video playing method according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of a second video playing method according to an embodiment of the present invention;
FIG. 4-a is a first schematic diagram of a vertical screen playing area according to an embodiment of the present invention;
FIG. 4-b is a second schematic diagram of a vertical screen playing area according to an embodiment of the present invention;
fig. 5 is a schematic flowchart of a video playing method according to an embodiment of the present invention;
FIG. 6 is a diagram illustrating the partitioning of a video sequence according to an embodiment of the present invention;
fig. 7 is a fourth flowchart illustrating a video playing method according to an embodiment of the present invention;
fig. 8 is a schematic flowchart of a fifth method for playing a video according to an embodiment of the present invention;
fig. 9-a is a schematic diagram of a vertical screen playing area before being adjusted according to an embodiment of the present invention;
fig. 9-b is a schematic diagram of an adjusted vertical screen playing area according to an embodiment of the present invention;
fig. 10 is a schematic flowchart of a sixth video playing method according to an embodiment of the present invention;
fig. 11 is a schematic structural diagram of a video playing system according to an embodiment of the present invention;
fig. 12 is a schematic structural diagram of a video playback device according to an embodiment of the present invention;
fig. 13 is a schematic structural diagram of a video playback device according to a second embodiment of the present invention;
fig. 14 is a schematic structural diagram of a video playback device according to a third embodiment of the present invention;
fig. 15 is a schematic diagram illustrating a fourth structure of a video playback device according to an embodiment of the present invention;
fig. 16 is a schematic structural diagram of a fifth video playback device according to an embodiment of the present invention;
fig. 17 is a schematic structural diagram of a first electronic device according to an embodiment of the invention;
fig. 18 is a schematic structural diagram of a second electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be described below with reference to the drawings in the embodiments of the present invention.
The conventional horizontal version video vertical screen playing is explained by taking fig. 1-a and fig. 1-b as an example. Fig. 1-a is a schematic diagram of a conventional landscape video landscape screen. Fig. 1-b is a schematic diagram of a conventional horizontal version video vertical screen playing. The terminal 101 is a mobile terminal used by a user to watch a landscape video, and the area 102 is an area where a screen of the terminal 101 is located. When the banner video is displayed in a landscape screen, as shown in fig. 1-a, the banner video may be displayed in a full screen in area 102. However, when the horizontal version video is played in a vertical screen mode, the resolution of the horizontal version video cannot be matched with the vertical screen resolution of the terminal 101, and the long side of the horizontal version video is reduced to be matched with the short side of the area 102 in the terminal 101 in an equal proportion, for example, the size of the horizontal version video after the equal proportion reduction is the size of the area 103 in fig. 1-b. When the vertical screen is played, the horizontal version video can be played in the area 103, and at this time, two black areas, namely the area 104 and the area 105, appear in the area 102, which results in low screen utilization rate and affects the display effect of the video.
In order to solve the problems of low screen utilization rate and poor video display effect of the existing horizontal video and vertical screen playing, the embodiment of the invention provides a video playing method. The method can be applied to any electronic equipment, and the electronic equipment can be a server for providing video service and can also be a client for playing videos, wherein the client comprises but is not limited to electronic equipment such as a mobile phone and a tablet. As shown in fig. 2, fig. 2 is a first flowchart of a video playing method according to an embodiment of the present invention. The method is applied to a system comprising the server and the client. The method specifically comprises the following steps.
Step S201, a server identifies the content of each frame of image in the acquired to-be-processed horizontal version video and determines the focus area of each frame of image; determining the central position of a vertical screen playing area of each frame of image in the horizontal version video to be processed based on the central position of the focus area of each frame of image; and determining a vertical screen playing area matched with the preset vertical screen resolution in each frame of image based on the central position of the vertical screen playing area of each frame of image according to the preset vertical screen resolution.
Step S202, the client responds to the playing operation aiming at the to-be-processed horizontal version video, and sends a playing request aiming at the to-be-processed horizontal version video to the server based on the playing operation.
Step S203, when the server responds to the playing request, the server sends data to be played to the client according to the position information of the vertical screen playing area in the corresponding image frame, wherein the data to be played comprises the horizontal version video to be processed and the position information.
Step S204, the client receives the data to be played; and when the horizontal version video to be processed is played in the vertical screen with the preset vertical screen resolution, the content of the vertical screen playing area in each frame image of the horizontal version video to be processed is played in a full screen mode according to the position information.
By adopting the method provided by the embodiment of the invention, the server determines the central position of the vertical screen playing area of each frame of image of the horizontal version video according to the focus area of each frame of image of the horizontal version video, so as to determine the vertical screen playing area of each frame of image, and thus, when the client side plays the horizontal version video in a vertical screen mode, the client side can play the video content corresponding to the vertical screen playing area of each frame of image determined by the server in a full screen mode. Because the central position of the vertical screen playing area changes along with the position change of the focus area, when the horizontal version video is played vertically, the full-screen playing content is ensured to always comprise the content of the focus area, the phenomenon of the area without video above and below the display screen is effectively avoided, the screen utilization rate when the horizontal version video is played vertically is improved, and the video display effect is improved.
The following examples illustrate the present invention.
As shown in fig. 3, fig. 3 is a second flowchart of a video playing method according to an embodiment of the present invention. The method is applied to the server and specifically comprises the following steps.
And S301, acquiring a horizontal version video to be processed.
In this step, the server may obtain the to-be-processed cross-cut video from the video library. The horizontal version video to be processed can be any horizontal version video in a video library, and does not play any limiting role here.
In an alternative embodiment, for each video in the video library, the video includes audio data and video data. The embodiment of the invention mainly processes the video data, and after the server acquires a horizontal version video from the video library, the server can perform audio-video separation on the acquired horizontal version video and takes the video data after the audio-video separation as the horizontal version video to be processed.
Step S302, identifying the content of each frame of image in the horizontal version video to be processed, and determining the focus area of each frame of image.
In this step, for each frame of image in the acquired to-be-processed cross-bar video, the server may identify the content in each frame of image based on an intelligent identification technology, and determine the focus area of each frame of image according to the identification result. The intelligent identification technology includes, but is not limited to, a deep learning technology and a machine learning technology.
In the embodiment of the present invention, the focus area of each frame of image includes the main video content of the frame of image. Such as a person or an object in the frame of image. Taking an image frame including an avatar of a person as an example, the server may identify five sense organs of the face in the image frame, so as to determine the area where the face is located as the focus area. For a method of determining the focal region, reference is made to the following description, which is not specifically described herein.
Step S303, determining the central position of the vertical screen playing area of each frame of image in the horizontal version video to be processed based on the central position of the focus area of each frame of image.
The center position of the focus area corresponding to each frame of image can be represented as the relative position of the center point of the focus area in the corresponding frame of image, such as the coordinate position of the center point. When the central position of the vertical screen playing area of each frame of image in the horizontal version video to be processed is determined, the server can determine the coordinate position of the central point corresponding to the vertical screen playing area of each frame of image in the horizontal version video to be processed according to the coordinate position of the central point of the focusing area of each frame of image. The determination of the center position of the video playback area is not specifically described here.
And step S304, determining a vertical screen playing area matched with the preset vertical screen resolution in each frame of image based on the central position of the vertical screen playing area of each frame of image according to the preset vertical screen resolution.
In this step, the server may determine, according to the preset vertical screen resolution and the central position of the vertical screen playing area of each frame of image, a rectangular area that matches the preset vertical screen resolution and whose upper and lower boundaries coincide with the upper and lower boundaries of the corresponding image frame in each frame of image of the horizontal version video to be processed, as the vertical screen playing area when the video to be processed is played in the vertical screen.
The preset vertical screen resolution is set according to the screen resolution of the existing mobile terminal. The number of resolutions included in the preset vertical screen resolution is at least one. Here, the size and number of the preset portrait resolution are not particularly limited.
For convenience of understanding, the focus area and the vertical screen playback area are described by taking fig. 4-a and 4-b as examples. Fig. 4-a is a first schematic diagram of a vertical screen playing area according to an embodiment of the present invention. Fig. 4-b is a second schematic diagram of a vertical screen playing area according to an embodiment of the present invention. The image frame 401 is a frame of image in the horizontal edition video to be processed. The region 402 is a region in the image frame 401 where the head portrait of the human object is located. The area 403 is a focus area, and the area 404 is a portrait play area.
In the image frame 401, the server may recognize that the image of the frame mainly shows the expression of the person, and the server may recognize the area where the face is located in the image frame 401, that is, the area 403. The server may determine the region 403 as the focal region of the image frame 401. When determining the vertical screen playing area when the image frame 401 performs vertical screen playing, the server may determine the center position of the vertical screen playing area when the image frame 401 performs vertical screen playing according to the center position of the area 403, for example, the server may determine the center position of the area 403 as the center position of the vertical screen playing area when the image frame 401 performs vertical screen playing. If the preset vertical screen resolution is resolution a, the server determines a rectangular area in the image frame 401 according to the size of resolution a at the center of the vertical screen playing area, so that the upper and lower boundaries of the rectangular area coincide with the upper and lower boundaries of the image frame 401, as in area 404. The server may determine area 404 as the portrait play area that matches resolution a, as shown in fig. 4-b.
In an embodiment of the present invention, the vertical screen playing area may include all the content of the focus area, or may include most of the content of the focus area, for example, the vertical screen playing area may include 95% of the content in the focus area.
Step S305, when a playing request of the client for the horizontal version video to be processed is received, sending data to be played to the client according to the position information of the vertical screen playing area in the corresponding image frame, wherein the data to be played comprises the horizontal version video to be processed and the position information.
In this step, the user may click a video to be viewed in the video playing software installed in the client, and when the user selects to click the to-be-processed cross-cut video, that is, receives a playing operation of the user for the to-be-processed cross-cut video, the client sends a playing request for the to-be-processed cross-cut video to the server. The playing request comprises the identification information of the horizontal version video to be processed. After receiving the playing request, the server can acquire the to-be-processed cross-cut video and the position information of the vertical screen playing area of each frame of image in the to-be-processed cross-cut video in the corresponding image frame from the video library according to the identification information, and send the acquired to-be-processed cross-cut video and the position information as to-be-played data to the client. When the client performs vertical screen playing on the horizontal version video to be processed according to the preset vertical screen resolution, the client can play the content of the vertical screen playing area in each frame of image in a full screen mode according to the position information of the vertical screen playing area in the horizontal version video to be processed.
The identification information of the to-be-processed horizontal version video includes, but is not limited to, a name and a video identification (Identity) of the to-be-processed horizontal version video.
In an optional embodiment, after the vertical screen playing area of each frame of image is determined, the server may generate the position information of the vertical screen playing area in the horizontal version video to be processed according to the corresponding relationship between the vertical screen playing area and the preset vertical screen resolution, and store the position information in the local storage space. Taking table 1 as an example, table 1 is a representation of position information corresponding to video 1 provided in the embodiment of the present invention.
TABLE 1
Figure BDA0002266510970000121
Figure BDA0002266510970000131
The video 1 may be the above horizontal version video to be processed. When receiving data to be played sent by a server, a client can determine the position of a vertical screen playing area corresponding to a preset vertical screen resolution according to the position information shown in table 1, so that the played content is accurately determined, the vertical screen playing of horizontal videos is realized, and the screen utilization rate and the video display effect during the vertical screen playing are improved.
In another optional embodiment, after the vertical screen playing area of each frame of image is determined, the server may mark, according to the determined vertical screen playing area of each frame of image, position information of the vertical screen playing area matched with the preset vertical screen resolution on the horizontal version video to be processed. As shown in fig. 4-a, the server determines the vertical screen playing area corresponding to the image frame 401 as the area 404, and the server may mark the area 404 in the image frame 401 according to the vertical screen resolution corresponding to the area 404 as the position information of the area 404. After receiving the data to be played, the client can accurately determine the position of the vertical screen playing area according to the marks in each frame of image, thereby accurately determining the played content, realizing vertical screen playing of horizontal version video, and improving the screen utilization rate and the video display effect during vertical screen playing.
In an optional embodiment, in step S304, according to the preset vertical screen resolution, based on the central position of the vertical screen playing area of each frame of image, the vertical screen playing area in each frame of image, which is matched with the preset vertical screen resolution, may be specifically represented as: determining a maximum rectangular area in each frame of image according to the preset vertical screen resolution by taking the central position of the vertical screen playing area of each frame of image as a center; and adjusting the position of the rectangular area in each frame of image according to the upper and lower boundaries of each frame of image to obtain a vertical screen playing area matched with the vertical screen playing area in each frame of image. I.e. the position of the rectangular area is adjusted up and down such that the upper and lower borders of the rectangular area coincide with the upper and lower borders of the image frame.
In another alternative embodiment, the server may determine a maximum rectangular region in each frame of image according to the preset vertical screen resolution, that is, a rectangular region in which the upper and lower boundaries coincide with the upper and lower boundaries of the image frame, and adjust the position of the rectangular region according to the center position of the vertical screen playing region, that is, adjust the position of the rectangular region left and right, so that the center position of the vertical screen playing region and the position of the rectangular region are on the same vertical line.
Still taking the above-mentioned fig. 4-a as an example, the server may determine a rectangular region with the largest area in the image frame 401 according to the preset vertical screen resolution, that is, the upper and lower edges of the determined rectangular region coincide with the upper and lower edges of the image frame 401, and adjust the position of the rectangular region, so that the center position of the rectangular region and the center position of the vertical screen playing region are on the same vertical straight line, that is, the center position of the vertical screen playing region is located on the vertical bisector of the short side of the region 404.
By adopting the method shown in fig. 3, the server determines the center position of the vertical screen playing area of each frame of image of the horizontal version video according to the focus area of each frame of image of the horizontal version video, so as to determine the vertical screen playing area of each frame of image, which enables the client to play the video content corresponding to the vertical screen playing area of each frame of image determined by the server in a full screen manner when the client plays the horizontal version video in a vertical screen manner. Because the central position of the vertical screen playing area changes along with the position change of the focus area, when the horizontal version video is played vertically, the full-screen playing content is ensured to always comprise the content of the focus area, the phenomenon of the area without video above and below the display screen is effectively avoided, the screen utilization rate when the horizontal version video is played vertically is improved, and the video display effect is improved.
In an optional embodiment, according to the method shown in fig. 3, an embodiment of the present invention further provides a video playing method. As shown in fig. 5, fig. 5 is a third flowchart illustrating a video playing method according to an embodiment of the present invention. The method comprises the following steps.
Step S501, acquiring a horizontal version video to be processed.
Step S502, identifying the content of each frame of image in the horizontal version video to be processed, and determining the focus area of each frame of image.
The above steps S501 to S502 are the same as the above steps S301 to S302.
Step S503, dividing the horizontal version video to be processed into a plurality of image subsequences.
In this step, the server may perform shot segmentation on the obtained to-be-processed cross-cut video to obtain a plurality of shots, and each shot obtained by the segmentation may be represented as an image subsequence including a plurality of frames of images.
In an optional embodiment, the server may perform shot segmentation on the to-be-processed cross-cut video according to a histogram, a motion state change, profile information, and the like of each frame of image in the to-be-processed cross-cut video. Here, the method of shot segmentation is not particularly limited.
In the embodiment of the present invention, the execution sequence of the steps S502 and S503 is not particularly limited.
Step S504, based on the central position of the focus area of each frame image in each image sub-sequence of the horizontal version video to be processed, the central position of the vertical screen playing area of each frame image in each image sub-sequence is determined.
In this step, for each frame of image in each image subsequence obtained by dividing the horizontal version video to be processed, the server may determine the center position of the vertical screen playing area of each frame of image in the image subsequence according to the center position of each frame of image in the image subsequence.
For example, the server may calculate an average value corresponding to the central position of the focal point region of each frame of image in each image subsequence of the horizontal version video to be processed, and determine a position represented by the average value as the central position of the vertical screen playing region of each frame of image in the image subsequence.
And step S505, determining a vertical screen playing area matched with the preset vertical screen resolution in each frame of image based on the central position of the vertical screen playing area of each frame of image according to the preset vertical screen resolution.
Step S506, when a playing request of the client for the to-be-processed horizontal version video is received, sending to-be-played data to the client according to the position information of the vertical screen playing area in the corresponding image frame, wherein the to-be-played data comprises the to-be-processed horizontal version video and the position information.
The above steps S505 to S506 are the same as the above steps S304 to S305.
By the method shown in fig. 5, the server divides the horizontal version video to be processed into a plurality of image subsequences, and determines the central position of the vertical screen playing area of each frame image in each image subsequence according to the central position of the focus area of each frame image in each image subsequence, so that the phenomenon that the content of the vertical screen playing area shakes due to factors such as lens conversion in the horizontal version video to be processed can be effectively reduced, and the vertical screen playing area is more stable.
In an alternative embodiment, in the step S503, the dividing the horizontal version video to be processed into a plurality of image sub-sequences may specifically include the following steps.
Step S5031, a histogram of each frame of image in the horizontal version video to be processed is obtained.
In this step, the server may determine a histogram of each frame of image according to the color information of each frame of image in the horizontal version video to be processed.
Step S5032, calculating the similarity of the histograms of every two adjacent frames of images in the horizontal version video to be processed.
In this step, for each two adjacent frames of images in the horizontal version video to be processed, the server may calculate the similarity of the two frames of images according to the histogram corresponding to the two frames of images according to a preset similarity calculation method.
In an alternative embodiment, the server may use a KL Divergence-Divergence (Kullback-Leibler Divergence) algorithm to calculate a difference value of histograms of two adjacent frames of images in the to-be-processed cross-bar video, and the calculated difference value is used to represent a similarity of the histograms of the two adjacent frames of images. The smaller the calculated difference value is, the greater the similarity of the histograms of every two adjacent frames of images in the horizontal edition video to be processed is. The larger the calculated difference value is, the smaller the similarity of the histograms of every two adjacent frames of images in the horizontal version video to be processed is.
In the embodiment of the present invention, in addition to calculating the similarity of the histograms of every two adjacent frames of images by using the KL divergence algorithm, the server may also use other algorithms, for example, a Chi-Square test (Chi-Square) algorithm, a baryta distance (Bhattacharyya distance) algorithm, a substitution Chi-Square (Alternative Chi-Square) algorithm, and the like.
Step S5033, dividing two adjacent frames of images with similarity greater than a preset similarity threshold into a same image subsequence.
In this step, the server may compare the calculated similarity with a preset similarity threshold, and divide two adjacent frames of images, of which the similarity is greater than the preset similarity threshold, into the same image subsequence according to the comparison result.
In an optional embodiment, the preset similarity threshold may be calculated according to a mean value and a standard deviation of values corresponding to the similarity of each frame of image in the horizontal version video to be processed. Taking the value corresponding to the similarity as the difference value calculated by adopting the KL divergence algorithm as an example, the preset similarity threshold T may be represented as: and T is M + 3S, wherein M is the average value of the difference values of every two adjacent frames of images in the horizontal version video to be processed, and S is the standard deviation of the difference values of every two adjacent frames of images in the horizontal version video to be processed.
The server can compare the calculated difference value P of the histograms of every two adjacent frames of images with a preset similarity threshold value T, and when the P is less than or equal to the T, namely the similarity is greater than the preset similarity threshold value, the server can divide the two frames of images into the same image subsequence. When P > T, i.e. the similarity is not greater than the preset similarity threshold, the server may divide the two images into different image sub-sequences.
In the embodiment of the invention, the similarity of every two adjacent frames of images in the horizontal version video to be processed is compared with the preset similarity threshold, so that each frame of image in the horizontal version video to be processed can be accurately divided to obtain a plurality of image subsequences, and the accuracy of dividing the image subsequences is improved.
In another alternative embodiment, the foregoing embodiment performs shot segmentation on the histogram of each frame of image in the horizontal version video to be processed, and in addition, the horizontal version video to be processed may also be subjected to shot segmentation according to the motion state or the contour information, and the process of the shot segmentation is not specifically described here.
In an optional embodiment, in the step S504, the center position of the vertical screen playing area of each frame image in each image sub-sequence is determined based on the center position of the focus area of each frame image in each image sub-sequence of the horizontal version video to be processed, which may specifically include the following steps.
In step S5041, for each image sub-sequence, the shift amount between the center positions of the focus areas of every two adjacent frames of images in the image sub-sequence is calculated.
In this step, the server may calculate an offset amount of the center position of the focus area of each two adjacent frames of images in each image sub-sequence according to the center position of the focus area of each two adjacent frames of images in each image sequence. Taking the coordinate value with the central position of the focal region as the central point as an example, the server may calculate a distance between coordinate values corresponding to the central positions of every two adjacent frames of images in each image subsequence of the horizontal version video to be processed, and use the distance as an offset of the central positions of the focal regions of the two frames of images. The specific calculation process is not specifically described here.
In step S5042, for every two adjacent frames of images with the offset greater than the preset offset threshold, it is determined whether the number of frames included in the video sequence to which the previous frame of image belongs in the two frames of images is less than a preset number threshold. If yes, go to step S5043.
In this step, for each image subsequence, when every two adjacent images with an offset greater than a preset offset threshold exist in the image subsequence, the server may count image frame numbers included in a video sequence to which a previous image belongs in the two images, compare the counted image frame numbers with a preset number threshold, and determine whether the counted image frame numbers are less than the preset number threshold.
In step S5043, the two adjacent frames of images are divided into video sequences to which the previous frame of image belongs.
In this step, when the number of image frames included in the video sequence to which the previous image in each two adjacent frames of images with the offset greater than the preset offset threshold belongs is less than the preset number threshold, the server may divide the two adjacent frames of images into the video sequence to which the previous image in the two adjacent frames of images belongs.
In an alternative embodiment, when the video sequence to which the previous image in every two adjacent images with the offset greater than the preset offset threshold belongs includes no less than the preset number threshold, the server may divide the next image in the two adjacent images into a new video sequence, that is, a video sequence after the video sequence to which the previous image in the two adjacent images belongs.
For ease of understanding, fig. 6 is taken as an example for illustration. Fig. 6 is a schematic diagram of video sequence partitioning according to an embodiment of the present invention. In the image sub-sequence shown in fig. 6, 395 frames of images are included, the straight line 601 represents the preset offset threshold, and the offset of two adjacent frames of images corresponding to the area 602, the area 603 and the area 604 is greater than the preset offset threshold, i.e., the value corresponding to the straight line 601. And the number of image frames of each of video sequences 1-4 is greater than a preset number threshold. The server may divide the image sub-sequence into 4 video sequences, i.e. video sequence 1 to video sequence 4.
Step S5044, calculating an average value of the center positions of the focus areas of the frames of images in each video sequence, and using the average value as the center position of the vertical screen playing area of each frame of image in the video sequence.
In this step, for each video sequence in each image sequence of the horizontal version video to be processed, the server may calculate an average value of the center positions of the focus areas of the frames of images in the video sequence, as the center position of the vertical screen playing area of each frame of image in the video sequence.
In the embodiment of the invention, the server subdivides each image subsequence according to the offset of the central position of the focus area of every two adjacent frames of images in each image subsequence in the horizontal version video to be processed to obtain a plurality of video sequences, so that each image subsequence comprises a plurality of different vertical screen playing areas, and the accuracy of the determined vertical screen playing area can be further improved while the content jitter of the vertical screen playing area is reduced.
In an optional embodiment, in the step S502, the content of each frame of image in the to-be-processed cross-bar video is identified, and the determining of the focus area of each frame of image may specifically include the following steps.
Step S5021, identifying the content of each frame of image in each image subsequence of the horizontal version video to be processed, and determining whether the frame of image contains preset video content. If yes, go to step S5022. If not, go to step S5023.
The preset video content includes, but is not limited to, people, scenes and animals in each frame of image. The preset video content is different according to different types of the horizontal version video to be processed. For example, the to-be-processed cross-cut video is a recording film about an animal, and the preset video content may be an animal or a plant appearing in each image frame. In the embodiment of the present invention, the preset video content is not specifically limited.
Step S5022, the area where the preset video content is located is determined as the focus area of the frame image.
In this step, when it is determined that any frame image in each image subsequence of the to-be-processed horizontal edition video contains the preset video content, the server may determine an area where the preset video content is located in the frame image as a focus area of the frame image.
Step S5023, determine whether the frame image is the first frame image in the image subsequence in which the frame image is located. If yes, go to step S5024. If not, step S5025 is executed.
In this step, when it is determined that any frame image in each image sub-sequence of the to-be-processed flat video does not contain the preset video content, the server may determine whether the frame image is a first frame image in the image sub-sequence in which the frame image is located.
In step S5024, the central area of the frame image is determined as the focal area.
In this step, when it is determined that the image frame not containing the preset video content is the first frame image in the image sub-sequence in which the frame image is located, the server may determine the central area of the frame image as the focal area of the frame image.
In step S5025, the focus area of the frame image that is previous to the frame image is determined as the focus area of the frame image.
In this step, when it is determined that the image frame not containing the preset video content is not the first frame image in the image sub-sequence in which the frame image is located, the server may determine the focus area of the frame image that is previous to the frame image as the focus area of the frame image.
In the embodiment of the invention, the corresponding focus area of each frame of image can be accurately determined by identifying the preset video content in each frame of image in the horizontal version video to be processed.
Based on the same inventive concept, according to the video playing method provided by the embodiment of the invention, the embodiment of the invention also provides a video playing method. As shown in fig. 7, fig. 7 is a fourth flowchart illustrating a video playing method according to an embodiment of the present invention. The method is applied to the client and specifically comprises the following steps.
Step S701, detecting whether a play operation for the to-be-processed banner video is received. If yes, go to step S702.
In this step, the client is installed with video playing software, and the user can click the video to be watched in the video playing software. When the user clicks the video needing to be watched in the video playing software, the client receives the playing operation aiming at the video clicked by the user. The client can detect whether the playing operation aiming at the to-be-processed horizontal version video is received or not in real time.
Step S702, based on the playing operation, sending a playing request for the to-be-processed flat video to the server.
In this step, when receiving the play operation, the client may send a play request for the to-be-processed horizontal version video to the server, where the play request includes the identification information of the to-be-processed horizontal version video.
In an optional embodiment, if the client does not receive the play operation, the client does not send a play request to the server.
Step S703, receiving data to be played sent by the server according to the playing request, wherein the data to be played comprises a horizontal version video to be processed and position information of a vertical screen playing area of each frame of image in the horizontal version video to be processed in a corresponding image frame; the vertical screen playing area of each frame of image is determined based on the central position of the vertical screen playing area of each frame of image in the horizontal version video to be processed according to the preset vertical screen resolution.
In this step, when the server receives the play request, the server may obtain the to-be-processed horizontal version video, identify the content of each frame of image in the obtained to-be-processed horizontal version video, determine the focus region of each frame of image, determine the center position of the vertical screen play region of each frame of image in the to-be-processed horizontal version video based on the center position of the focus region of each frame of image, and determine the vertical screen play region of each frame of image based on the center position of the vertical screen play region of each frame of image according to the preset vertical screen resolution. The server can send to the client the data to be played, which contains the horizontal version video to be processed and the position information of the vertical screen playing area of each frame of image in the horizontal version video to be processed in the corresponding image frame. The client can receive the data to be played sent by the server.
Step S704, when the horizontal version video to be processed is played in the vertical screen with the preset vertical screen resolution, the content of the vertical screen playing area in each frame image of the horizontal version video to be processed is played in a full screen mode according to the position information.
In this step, when the client is in the vertical screen state, that is, when the user vertically holds the electronic device, the client may determine, according to the received data to be played, the position information of the vertical screen playing area corresponding to the vertical screen resolution of the client. The client can determine the position of the vertical screen playing area matched with the vertical screen resolution of the display screen in each frame of image of the horizontal version video to be processed according to the position information, so that the content of the vertical screen playing area in each frame of image of the horizontal version video to be processed is played in the display screen in a full screen mode.
By the method shown in fig. 7, the server determines the center position of the vertical screen playing area of each frame of image of the horizontal version video according to the focus area of each frame of image of the horizontal version video, so as to determine the vertical screen playing area of each frame of image, which enables the client to play the video content corresponding to the vertical screen playing area of each frame of image determined by the server in a full screen manner when the client plays the horizontal version video in a vertical screen manner. Because the central position of the vertical screen playing area changes along with the position change of the focus area, when the horizontal version video is played vertically, the full-screen playing content is ensured to always comprise the content of the focus area, the phenomenon of the area without video above and below the display screen is effectively avoided, the screen utilization rate when the horizontal version video is played vertically is improved, and the video display effect is improved.
In an optional embodiment, in the step S704, according to the position information, the content of the vertical screen playing area in each frame image of the horizontal version video to be processed is played in a full screen mode, which may specifically include the following steps.
Step S7041, according to the position information, a vertical screen playing area matched with a preset vertical screen resolution in each frame of image of the horizontal version video to be processed is determined.
In this step, the client may determine, according to the position information in the received data to be played and the vertical screen resolution of the client, a vertical screen playing area that is determined by the server and matches the vertical screen resolution in each frame of image of the horizontal version video to be processed. Namely, the corresponding position of the vertical screen playing area matched with the vertical screen resolution in each frame of image is determined.
Taking table 1 as an example, according to the vertical screen resolution of the client, such as resolution 1, and according to the position information shown in table 1, the client may determine the specific positions of the four vertices in the frame image corresponding to the vertical screen playing area of each frame image, so as to obtain the specific positions of the vertical screen playing area in each frame image.
Step S7042, the content of the vertical screen playing area in each frame of image of the horizontal version image to be processed is rendered in a full screen mode.
In this step, the client may perform full-screen rendering on the video content corresponding to the vertical screen playing area of each frame of image according to the position of the vertical screen playing area of each frame of image in the horizontal version video to be processed. That is, the video content corresponding to the vertical screen playing area is displayed on the display screen in a full screen mode.
In an optional embodiment, according to the method shown in fig. 8, an embodiment of the present invention further provides a video playing method. As shown in fig. 8, fig. 8 is a fifth flowchart illustrating a video playing method according to an embodiment of the present invention. The method comprises the following steps.
Step S801, detecting whether a play operation for the to-be-processed flat video is received. If yes, go to step S802.
Step S802, based on the playing operation, sending a playing request for the horizontal version video to be processed to the server.
Step S803, receiving data to be played sent by the server according to the playing request, wherein the data to be played comprises a horizontal version video to be processed and position information of a vertical screen playing area of each frame of image in the horizontal version video to be processed in a corresponding image frame; the vertical screen playing area of each frame of image is determined based on the central position of the vertical screen playing area of each frame of image in the horizontal version video to be processed according to the preset vertical screen resolution.
Step S804, when the horizontal version video to be processed is played in the vertical screen with the preset vertical screen resolution, the content of the vertical screen playing area in each frame image of the horizontal version video to be processed is played in a full screen mode according to the position information.
The above steps S801 to S804 are the same as the above steps S701 to S704.
Step S805, in the process of playing the vertical screen of the horizontal version video to be processed, detecting whether a moving operation for the vertical screen playing area is received. If yes, go to step S806.
In this step, in the vertical screen playing process of the horizontal version video to be processed, the user can slide on the display screen to move the vertical screen playing area. The client can detect whether the moving operation aiming at the vertical screen playing area is received or not in real time. The moving operation includes a direction and a displacement of the user sliding.
Step 806, according to the moving operation, adjusting the position of the vertical screen playing area in the horizontal version video to be processed, and playing the content of the adjusted vertical screen playing area in a full screen mode.
In this step, when receiving a moving operation for the vertical screen playing area, the client may adjust the position of the vertical screen playing area in each frame of image of the horizontal version video to be processed according to the sliding direction and displacement of the user, so as to obtain the adjusted vertical screen playing area. The client can render the video content corresponding to the adjusted vertical screen playing area in a full screen mode, namely, the content corresponding to the adjusted vertical screen playing area is played in the full screen mode.
For ease of understanding, fig. 9-a and 9-b are used as examples for illustration. Fig. 9-a is a schematic diagram of a vertical screen playing area before being adjusted according to an embodiment of the present invention. Fig. 9-b is a schematic diagram of an adjusted vertical screen playing area according to an embodiment of the present invention. Among them, the terminal 901 is an electronic device for a user to view a to-be-processed landscape video. An area 902 is a display screen of the terminal 901. The image frame 903 is an image frame corresponding to the playback content in the area 902. In fig. 9-a, the area 904 is the position where the portrait playing area is determined by the server. The content corresponding to the region 904 in the image frame 903 is played in the region 902. When receiving a movement operation of sliding the vertical screen playing area to the right by the user, the client may move the vertical screen playing area from the position of the area 904 to the position of the area 905, and play what is displayed in the area 902 and corresponding to the area 905 in the image frame 903, as shown in fig. 9-b.
In an optional embodiment, if the client receives the moving operation, the content played in full screen by the client is still the video content corresponding to the vertical screen playing area determined by the server.
In the embodiment of the invention, the user can select the video content outside the determined vertical screen playing area according to the self requirement through the mobile operation, so that the user operation is convenient, and the video playing process is more flexible.
In an optional embodiment, according to the method shown in fig. 8, an embodiment of the present invention further provides a video playing method. As shown in fig. 10, fig. 10 is a sixth flowchart illustrating a video playing method according to an embodiment of the present invention. The method comprises the following steps.
Step S1001 detects whether a play operation for the to-be-processed banner video is received. If yes, go to step S1002.
Step S1002, based on the play operation, sends a play request for the to-be-processed flat video to the server.
Step S1003, receiving data to be played sent by a server aiming at a playing request, wherein the data to be played comprises a horizontal version video to be processed and position information of a vertical screen playing area of each frame of image in the horizontal version video to be processed in a corresponding image frame; the vertical screen playing area of each frame of image is determined based on the central position of the vertical screen playing area of each frame of image in the horizontal version video to be processed according to the preset vertical screen resolution.
And step S1004, when the horizontal version video to be processed is played in a vertical screen with the preset vertical screen resolution, the content of the vertical screen playing area in each frame image of the horizontal version video to be processed is played in a full screen mode according to the position information.
Step S1005, detecting whether a moving operation for a vertical screen playing area is received in a vertical screen playing process of the horizontal version video to be processed. If yes, go to step S1006.
And step S1006, according to the moving operation, adjusting the position of the vertical screen playing area in the horizontal version video to be processed, and playing the content of the adjusted vertical screen playing area in a full screen mode.
The above steps S1001 to S1006 are the same as the above steps S801 to S806.
Step S1007, detecting whether a restore operation for the move operation is received in the process of playing the to-be-processed horizontal video according to the adjusted vertical screen playing area. If yes, the process returns to step S1004.
In this step, in the process of playing the to-be-processed horizontal version video according to the adjusted vertical screen playing area, the user may perform a restoring operation corresponding to the moving operation, so as to restore the adjusted vertical screen playing area to the vertical screen playing area determined by the server. The client can detect whether a restore operation for the move operation is received in real time. When the client receives the restoration operation aiming at the mobile operation, the client can play the content of the vertical screen playing area in each frame image of the horizontal version video to be processed in a full screen mode according to the position information in the received data to be played.
The restore operation includes, but is not limited to, the user releasing the finger sliding on the display screen and performing a double-click operation on the display screen.
In an optional embodiment, if the client receives the restore operation, the content played in full screen by the client is still the video content corresponding to the adjusted vertical screen playing area.
In the embodiment of the invention, the user can cancel the moving operation of the vertical screen playing area according to the self requirement through the moving operation, so that the user operation is convenient, and the video playing process is more flexible.
Based on the same inventive concept, according to the video playing method provided by the embodiment of the invention, the embodiment of the invention also provides a video playing system. As shown in fig. 11, fig. 11 is a schematic structural diagram of a video playing system according to an embodiment of the present invention. The system includes the server 1101 and the client 1102 described above.
The server 1101 is configured to identify the content of each frame of image in the acquired to-be-processed cross-bar video, and determine a focus area of each frame of image; determining the central position of a vertical screen playing area of each frame of image in the horizontal version video to be processed based on the central position of the focus area of each frame of image; determining a vertical screen playing area matched with the preset vertical screen resolution in each frame of image based on the central position of the vertical screen playing area of each frame of image according to the preset vertical screen resolution;
the client 1102 is configured to send, to the server 1101, a play request for the to-be-processed flat video based on a play operation in response to the play operation for the to-be-processed flat video;
the server 1101 is further configured to send data to be played to the client 1102 according to the position information of the vertical screen playing area in the corresponding image frame when responding to the playing request, where the data to be played includes the horizontal version video to be processed and the position information;
the client 1102 is further configured to receive data to be played; and when the horizontal version video to be processed is played in the vertical screen with the preset vertical screen resolution, the content of the vertical screen playing area in each frame image of the horizontal version video to be processed is played in a full screen mode according to the position information.
According to the system provided by the embodiment of the invention, the server determines the central position of the vertical screen playing area of each frame of image of the horizontal version video according to the focus area of each frame of image of the horizontal version video, so that the vertical screen playing area of each frame of image is determined, and therefore, when the client side plays the horizontal version video in a vertical screen mode, the client side can play the video content corresponding to the vertical screen playing area of each frame of image determined by the server in a full screen mode. Because the central position of the vertical screen playing area changes along with the position change of the focus area, when the horizontal version video is played vertically, the full-screen playing content is ensured to always comprise the content of the focus area, the phenomenon of the area without video above and below the display screen is effectively avoided, the screen utilization rate when the horizontal version video is played vertically is improved, and the video display effect is improved.
Based on the same inventive concept, according to the video playing method provided by the embodiment of the invention, the embodiment of the invention also provides a video playing device. As shown in fig. 12, fig. 12 is a schematic view of a first structure of a video playing apparatus according to an embodiment of the present invention. The device is applied to the server and specifically comprises the following modules.
An obtaining module 1201, configured to obtain a horizontal version video to be processed;
the identification module 1202 is configured to identify the content of each frame of image in the horizontal version video to be processed, and determine a focus area of each frame of image;
a first determining module 1203, configured to determine, based on a center position of a focus area of each frame of image, a center position of a vertical screen playing area of each frame of image in the horizontal version video to be processed;
a second determining module 1204, configured to determine, according to a preset vertical screen resolution, a vertical screen playing area in each frame of image, where the vertical screen playing area is matched with the preset vertical screen resolution, based on a center position of the vertical screen playing area in each frame of image;
the first sending module 1205 is configured to send, when receiving a play request for a to-be-processed horizontal version video from a client, to-be-played data to the client according to the position information of the vertical screen play area in the corresponding image frame, where the to-be-played data includes the to-be-processed horizontal version video and the position information.
Optionally, as shown in fig. 13, the video playing apparatus may further include:
a dividing module 1206, configured to divide the horizontal version video to be processed into a plurality of image subsequences;
the first determining module 1203 may be specifically configured to determine a center position of a vertical screen playing area of each frame image in each image subsequence of the horizontal version video to be processed, based on a center position of a focus area of each frame image in each image subsequence.
Optionally, the dividing module 1206 may be specifically configured to obtain a histogram of each frame of image in the horizontal version video to be processed; calculating the similarity of the histograms of every two adjacent frames of images in the horizontal version video to be processed; and dividing two adjacent frames of images with the similarity larger than a preset similarity threshold into the same image subsequence.
Optionally, the first determining module 1203 may be specifically configured to calculate, for each image sub-sequence, an offset between center positions of focus regions of every two adjacent frames of images in the image sub-sequence;
for every two adjacent frames of images with the offset larger than a preset offset threshold, judging whether the number of image frames included in a video sequence to which a previous frame of image belongs in the two frames of images is smaller than a preset number threshold;
if so, dividing the two adjacent frames of images into the video sequence of the previous frame of image in the two frames of images;
and calculating the average value of the central positions of the focus areas of the frames of images in each video sequence to be used as the central position of the vertical screen playing area of each frame of image in the video sequence.
Optionally, the identifying module 1202 may be specifically configured to identify content of each frame of image in each image subsequence of the horizontal version video to be processed, and determine whether the frame of image contains preset video content;
if the frame image comprises the preset video content, determining an area where the preset video content is located as a focus area of the frame image;
if the preset video content is not included, judging whether the frame image is a first frame image in the image subsequence in which the frame image is positioned, and if the frame image is the first frame image, determining a central area of the frame image as a focus area; if the frame image is not the first frame image, the focus area of the previous frame image of the frame image is determined as the focus area of the frame image.
Optionally, the second determining module is specifically configured to determine, by taking a central position of a vertical screen playing area of each frame of image as a center, a maximum rectangular area in each frame of image according to a preset vertical screen resolution; and adjusting the position of the rectangular area in each frame of image according to the upper and lower boundaries of each frame of image to obtain a vertical screen playing area matched with the vertical screen playing area in each frame of image.
Based on the same inventive concept, according to the video playing method provided by the embodiment of the invention, the embodiment of the invention also provides a video playing device. As shown in fig. 14, fig. 14 is a schematic structural diagram of a third video playing apparatus according to an embodiment of the present invention. The device is applied to the client and specifically comprises the following modules.
A first detection module 1401, configured to detect whether a play operation for a to-be-processed version of a video is received;
a second sending module 1402, configured to send, based on the play operation, a play request for the to-be-processed flat video to the server when the detection result of the first detecting module 1401 is yes;
a receiving module 1403, configured to receive data to be played, which is sent by a server according to a playing request, where the data to be played includes a horizontal version video to be processed and position information of a vertical screen playing area of each frame of image in the horizontal version video to be processed in a corresponding image frame; the method comprises the steps that the vertical screen playing area of each frame of image is obtained by identifying the content of each frame of image in a horizontal version video to be processed, the focus area of each frame of image is determined, the central position of the vertical screen playing area of each frame of image in the horizontal version video to be processed is determined based on the central position of the focus area of each frame of image, and the central position of the vertical screen playing area of each frame of image is determined based on the central position of the vertical screen playing area of each frame of image according to preset vertical screen resolution;
the playing module 1404 is configured to, when the to-be-processed cross-cut video is played on the vertical screen at the preset vertical screen resolution, play the content of the vertical screen playing area in each frame image of the to-be-processed cross-cut video in a full screen manner according to the position information.
Optionally, as shown in fig. 15, the video playing apparatus may further include:
a second detection module 1405, configured to detect whether a moving operation for a vertical screen playing area is received in a vertical screen playing process of a to-be-processed horizontal video;
an adjusting module 1406, configured to, when the detection result of the second detecting module 1405 is yes, adjust, according to the moving operation, a position of the vertical screen playing area in the to-be-processed horizontal version video, and play the content of the adjusted vertical screen playing area in a full screen manner.
Optionally, as shown in fig. 16, the video playing apparatus may further include:
a third detecting module 1407, configured to detect whether a restoring operation for the moving operation is received in a process of playing the to-be-processed horizontal video according to the adjusted vertical screen playing area; if so, returning to the step of executing the full-screen playing of the content of the vertical-screen playing area in each frame image of the horizontal version video to be processed according to the position information.
According to the device provided by the embodiment of the invention, the server determines the central position of the vertical screen playing area of each frame of image of the horizontal version video according to the focus area of each frame of image of the horizontal version video, so that the vertical screen playing area of each frame of image is determined, and therefore, when the client side plays the horizontal version video in a vertical screen mode, the client side can play the video content corresponding to the vertical screen playing area of each frame of image determined by the server in a full screen mode. Because the central position of the vertical screen playing area changes along with the position change of the focus area, when the horizontal version video is played vertically, the full-screen playing content is ensured to always comprise the content of the focus area, the phenomenon of the area without video above and below the display screen is effectively avoided, the screen utilization rate when the horizontal version video is played vertically is improved, and the video display effect is improved.
Based on the same inventive concept, according to the video playing method provided by the embodiment of the invention, the embodiment of the invention also provides electronic equipment. The electronic device may be a server, as shown in fig. 17, and includes a processor 1701, a communication interface 1702, a memory 1703 and a communication bus 1704, where the processor 1701, the communication interface 1702 and the memory 1703 communicate with each other through the communication bus 1704;
a memory 1703 for storing a computer program;
the processor 1701 is configured to execute the program stored in the memory 1703, and implement the following steps:
acquiring a horizontal version video to be processed;
identifying the content of each frame of image in the horizontal version video to be processed, and determining the focus area of each frame of image;
determining the central position of a vertical screen playing area of each frame of image in the horizontal version video to be processed based on the central position of the focus area of each frame of image;
determining a vertical screen playing area matched with the preset vertical screen resolution in each frame of image based on the central position of the vertical screen playing area of each frame of image according to the preset vertical screen resolution;
when a playing request of a client for a to-be-processed horizontal version video is received, sending to-be-played data to the client according to the position information of the vertical screen playing area in the corresponding image frame, wherein the to-be-played data comprises the to-be-processed horizontal version video and the position information.
Based on the same inventive concept, according to the video playing method provided by the embodiment of the invention, the embodiment of the invention also provides electronic equipment. The electronic device may be used as a client, as shown in fig. 18, and includes a processor 1801, a communication interface 1802, a memory 1803, and a communication bus 1804, where the processor 1801, the communication interface 1802, and the memory 1803 complete communication with each other through the communication bus 1804;
a memory 1803 for storing a computer program;
the processor 1801 is configured to, when executing the program stored in the memory 1803, implement the following steps:
detecting whether a playing operation aiming at a to-be-processed horizontal version video is received;
if so, sending a playing request aiming at the horizontal version video to be processed to a server based on the playing operation;
receiving data to be played sent by a server according to a playing request, wherein the data to be played comprises a horizontal version video to be processed and position information of a vertical screen playing area of each frame of image in the horizontal version video to be processed in a corresponding image frame; the method comprises the steps that the vertical screen playing area of each frame of image is obtained by identifying the content of each frame of image in a horizontal version video to be processed, the focus area of each frame of image is determined, the central position of the vertical screen playing area of each frame of image in the horizontal version video to be processed is determined based on the central position of the focus area of each frame of image, and the central position of the vertical screen playing area of each frame of image is determined based on the central position of the vertical screen playing area of each frame of image according to preset vertical screen resolution;
and when the horizontal version video to be processed is played in the vertical screen with the preset vertical screen resolution, the content of the vertical screen playing area in each frame image of the horizontal version video to be processed is played in a full screen mode according to the position information.
According to the electronic equipment provided by the embodiment of the invention, the server determines the central position of the vertical screen playing area of each frame of image of the horizontal version video according to the focus area of each frame of image of the horizontal version video, so that the vertical screen playing area of each frame of image is determined, and therefore, when the client side plays the horizontal version video in a vertical screen mode, the client side can play the video content corresponding to the vertical screen playing area of each frame of image determined by the server in a full screen mode. Because the central position of the vertical screen playing area changes along with the position change of the focus area, when the horizontal version video is played vertically, the full-screen playing content is ensured to always comprise the content of the focus area, the phenomenon of the area without video above and below the display screen is effectively avoided, the screen utilization rate when the horizontal version video is played vertically is improved, and the video display effect is improved.
The communication bus mentioned in the above terminal may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the terminal and other equipment.
The Memory may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
Based on the same inventive concept, according to the video playing method provided in the foregoing embodiments of the present invention, an embodiment of the present invention further provides a computer-readable storage medium, where instructions are stored, and when the computer-readable storage medium runs on a computer, the computer is caused to execute the video playing method in any of the foregoing embodiments.
Based on the same inventive concept, according to the video playing method provided in the above embodiments of the present invention, an embodiment of the present invention further provides a computer program product containing instructions, which, when run on a computer, causes the computer to execute the video playing method described in any of the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for embodiments such as the apparatus, the electronic device, the computer-readable storage medium, and the computer program product, since they are substantially similar to the method embodiments, the description is simple, and for relevant points, reference may be made to part of the description of the method embodiments.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (21)

1. A video playing method is applied to a system comprising a server and a client, and comprises the following steps:
the server identifies the content of each frame of image in the acquired to-be-processed cross-bar video and determines the focus area of each frame of image; determining the central position of a vertical screen playing area of each frame of image in the horizontal version video to be processed based on the central position of the focus area of each frame of image; determining a vertical screen playing area matched with the preset vertical screen resolution in each frame of image based on the central position of the vertical screen playing area of each frame of image according to the preset vertical screen resolution; generating position information of the vertical screen playing area in the horizontal version video to be processed according to the corresponding relation between the vertical screen playing area and the preset vertical screen resolution, and storing the position information into a local storage space;
the client responds to the playing operation of the horizontal version video to be processed and sends a playing request of the horizontal version video to be processed to a server based on the playing operation;
when the server responds to the playing request, sending data to be played to the client according to the position information of the vertical screen playing area in the corresponding image frame, wherein the data to be played comprises the horizontal version video to be processed and the position information;
the client receives the data to be played; when the horizontal version video to be processed is played in a vertical screen with the preset vertical screen resolution, the content of a vertical screen playing area in each frame image of the horizontal version video to be processed is played in a full screen mode according to the position information;
the client detects whether a moving operation aiming at the vertical screen playing area is received or not in the vertical screen playing process of the horizontal version video to be processed; if so, adjusting the position of the vertical screen playing area in the horizontal version video to be processed according to the moving operation, and playing the content of the adjusted vertical screen playing area in a full screen mode.
2. A video playing method is applied to a server, and the method comprises the following steps:
acquiring a horizontal version video to be processed;
identifying the content of each frame of image in the horizontal version video to be processed, and determining the focus area of each frame of image;
determining the central position of a vertical screen playing area of each frame of image in the horizontal version video to be processed based on the central position of the focus area of each frame of image;
determining a vertical screen playing area matched with the preset vertical screen resolution in each frame of image based on the central position of the vertical screen playing area of each frame of image according to the preset vertical screen resolution;
generating position information of the vertical screen playing area in the horizontal version video to be processed according to the corresponding relation between the vertical screen playing area and the preset vertical screen resolution, and storing the position information into a local storage space;
when a playing request of a client for the to-be-processed horizontal version video is received, sending to-be-played data to the client according to the position information of the vertical screen playing area in the corresponding image frame, wherein the to-be-played data comprises the to-be-processed horizontal version video and the position information.
3. The method of claim 2,
before determining the center position of the vertical screen playing area of each frame of image in the horizontal version video to be processed based on the center position of the focus area of each frame of image, the method further comprises the following steps: dividing the horizontal version video to be processed into a plurality of image subsequences;
the method for determining the central position of the vertical screen playing area of each frame of image in the horizontal version video to be processed based on the central position of the focus area of each frame of image comprises the following steps: and determining the central position of the vertical screen playing area of each frame of image in each image subsequence based on the central position of the focal area of each frame of image in each image subsequence of the horizontal version video to be processed.
4. The method of claim 3, wherein the dividing the to-be-processed flat video into a plurality of image sub-sequences comprises:
acquiring a histogram of each frame of image in the horizontal version video to be processed;
calculating the similarity of the histograms of every two adjacent frames of images in the horizontal version video to be processed;
and dividing two adjacent frames of images with the similarity larger than a preset similarity threshold into the same image subsequence.
5. The method according to claim 3, wherein the determining the center position of the vertical screen playing area of each frame image in each image sub-sequence based on the center position of the focus area of each frame image in each image sub-sequence of the horizontal edition video to be processed comprises:
calculating the offset between the central positions of the focus areas of every two adjacent frames of images in each image subsequence;
for every two adjacent frames of images with the offset larger than a preset offset threshold, judging whether the number of image frames included in a video sequence to which a previous frame of image belongs in the two frames of images is smaller than a preset number threshold;
if so, dividing the two adjacent frames of images into the video sequence of the previous frame of image in the two frames of images;
and calculating the average value of the central positions of the focus areas of the frames of images in each video sequence to be used as the central position of the vertical screen playing area of each frame of image in the video sequence.
6. The method according to claim 3, wherein the identifying the content of each frame of image in the to-be-processed cross-bar video and determining the focus area of each frame of image comprises:
identifying the content of each frame of image in each image subsequence of the horizontal edition video to be processed, and determining whether the frame of image contains preset video content;
if the preset video content is included, determining the area where the preset video content is located as the focus area of the frame image;
if the preset video content is not included, judging whether the frame image is a first frame image in the image subsequence in which the frame image is located, and if the frame image is the first frame image, determining a central area of the frame image as a focus area; if the frame image is not the first frame image, the focus area of the previous frame image of the frame image is determined as the focus area of the frame image.
7. The method of claim 2, wherein determining the vertical screen playing area in each frame of image, which matches the preset vertical screen resolution, based on the center position of the vertical screen playing area in each frame of image according to the preset vertical screen resolution comprises:
determining a maximum rectangular area in each frame of image according to the preset vertical screen resolution by taking the central position of the vertical screen playing area of each frame of image as a center;
and adjusting the position of the rectangular area in each frame of image according to the upper and lower boundaries of each frame of image to obtain a vertical screen playing area matched with the vertical screen playing area in each frame of image.
8. A video playing method is applied to a client side, and the method comprises the following steps:
detecting whether a playing operation aiming at a to-be-processed horizontal version video is received;
if so, sending a playing request aiming at the to-be-processed horizontal version video to a server based on the playing operation;
receiving data to be played sent by the server according to the playing request, wherein the data to be played comprises the horizontal version video to be processed and position information of a vertical screen playing area of each frame of image in the horizontal version video to be processed in a corresponding image frame; the method comprises the steps that the content of each frame of image in an acquired horizontal version video to be processed is identified, the focus area of each frame of image is determined, the center position of the vertical screen playing area of each frame of image in the horizontal version video to be processed is determined based on the center position of the focus area of each frame of image, and the center position of the vertical screen playing area of each frame of image in the horizontal version video to be processed is determined based on the center position of the vertical screen playing area of each frame of image according to preset vertical screen resolution, wherein the corresponding relation between the vertical screen playing area and the preset vertical screen resolution is stored in the position information of the vertical screen playing area in the horizontal version video to be processed;
when the horizontal version video to be processed is played in a vertical screen with the preset vertical screen resolution, the content of a vertical screen playing area in each frame image of the horizontal version video to be processed is played in a full screen mode according to the position information;
detecting whether a moving operation aiming at the vertical screen playing area is received or not in the vertical screen playing process of the horizontal version video to be processed;
if so, adjusting the position of the vertical screen playing area in the horizontal version video to be processed according to the moving operation, and playing the content of the adjusted vertical screen playing area in a full screen mode.
9. The method of claim 8, further comprising:
detecting whether a restoring operation aiming at the moving operation is received or not in the process of playing the horizontal version video to be processed according to the adjusted vertical screen playing area;
if yes, returning to the step of executing the step of playing the content of the vertical screen playing area in each frame image of the horizontal version video to be processed in a full screen mode according to the position information.
10. The method according to claim 8 or 9, wherein the full-screen playing the content of the vertical-screen playing area in each frame image of the horizontal version video to be processed according to the position information comprises:
determining a vertical screen playing area matched with the preset vertical screen resolution in each frame of image of the horizontal version video to be processed according to the position information;
and rendering the content of a vertical screen playing area in each frame of image of the horizontal version image to be processed in a full screen mode.
11. A video playing system is characterized in that the system comprises a server and a client;
the server is used for identifying the content of each frame of image in the acquired to-be-processed cross-bar video and determining the focus area of each frame of image; determining the central position of a vertical screen playing area of each frame of image in the horizontal version video to be processed based on the central position of the focus area of each frame of image; determining a vertical screen playing area matched with the preset vertical screen resolution in each frame of image based on the central position of the vertical screen playing area of each frame of image according to the preset vertical screen resolution; generating position information of the vertical screen playing area in the horizontal version video to be processed according to the corresponding relation between the vertical screen playing area and the preset vertical screen resolution, and storing the position information into a local storage space;
the client is used for responding to the playing operation of the horizontal version video to be processed and sending a playing request aiming at the horizontal version video to be processed to the server based on the playing operation;
the server is further used for sending data to be played to the client according to the position information of the vertical screen playing area in the corresponding image frame when responding to the playing request, wherein the data to be played comprises the horizontal version video to be processed and the position information;
the client is also used for receiving the data to be played; when the horizontal version video to be processed is played in a vertical screen with the preset vertical screen resolution, the content of a vertical screen playing area in each frame image of the horizontal version video to be processed is played in a full screen mode according to the position information;
the client detects whether a moving operation aiming at the vertical screen playing area is received or not in the vertical screen playing process of the horizontal version video to be processed; if so, adjusting the position of the vertical screen playing area in the horizontal version video to be processed according to the moving operation, and playing the content of the adjusted vertical screen playing area in a full screen mode.
12. A video playing apparatus, applied to a server, the apparatus comprising:
the acquisition module is used for acquiring a horizontal version video to be processed;
the identification module is used for identifying the content of each frame of image in the horizontal version video to be processed and determining the focus area of each frame of image;
the first determining module is used for determining the central position of a vertical screen playing area of each frame of image in the horizontal version video to be processed based on the central position of the focus area of each frame of image;
the second determining module is used for determining a vertical screen playing area matched with the preset vertical screen resolution in each frame of image based on the central position of the vertical screen playing area of each frame of image according to the preset vertical screen resolution; generating position information of the vertical screen playing area in the horizontal version video to be processed according to the corresponding relation between the vertical screen playing area and the preset vertical screen resolution, and storing the position information into a local storage space;
the first sending module is used for sending data to be played to a client according to the position information of the vertical screen playing area in the corresponding image frame when a playing request of the client for the horizontal version video to be processed is received, wherein the data to be played comprises the horizontal version video to be processed and the position information.
13. The apparatus of claim 12, further comprising:
the dividing module is used for dividing the horizontal version video to be processed into a plurality of image subsequences;
the first determining module is specifically configured to determine a center position of a vertical screen playing area of each frame of image in each image subsequence of the horizontal version video to be processed, based on the center position of a focus area of each frame of image in each image subsequence.
14. The apparatus according to claim 13, wherein the first determining module is specifically configured to calculate, for each image sub-sequence, an offset between center positions of focus areas of every two adjacent images in the image sub-sequence;
for every two adjacent frames of images with the offset larger than a preset offset threshold, judging whether the number of image frames included in a video sequence to which a previous frame of image belongs in the two frames of images is smaller than a preset number threshold;
if so, dividing the two adjacent frames of images into the video sequence of the previous frame of image in the two frames of images;
and calculating the average value of the central positions of the focus areas of the frames of images in each video sequence to be used as the central position of the vertical screen playing area of each frame of image in the video sequence.
15. The apparatus according to claim 13, wherein the identifying module is specifically configured to identify content of each frame of image in each image subsequence of the to-be-processed flat-bed video, and determine whether the frame of image contains preset video content;
if the preset video content is included, determining the area where the preset video content is located as the focus area of the frame image;
if the preset video content is not included, judging whether the frame image is a first frame image in the image subsequence in which the frame image is located, and if the frame image is the first frame image, determining a central area of the frame image as a focus area; if the frame image is not the first frame image, the focus area of the previous frame image of the frame image is determined as the focus area of the frame image.
16. The apparatus according to claim 12, wherein the second determining module is specifically configured to determine a maximum rectangular region in each frame of image according to a size of a preset vertical screen resolution, with a center position of a vertical screen playing region of each frame of image as a center; and adjusting the position of the rectangular area in each frame of image according to the upper and lower boundaries of each frame of image to obtain a vertical screen playing area matched with the vertical screen playing area in each frame of image.
17. A video playing apparatus, applied to a client, the apparatus comprising:
the first detection module is used for detecting whether a playing operation aiming at the horizontal version video to be processed is received;
a second sending module, configured to send, based on the play operation, a play request for the to-be-processed flat video to a server when a detection result of the first detecting module is yes;
a receiving module, configured to receive data to be played, which is sent by the server according to the playing request, where the data to be played includes the horizontal version video to be processed and position information of a vertical screen playing area of each frame of image in the horizontal version video to be processed in a corresponding image frame; the method comprises the steps that the content of each frame of image in an acquired horizontal version video to be processed is identified, the focus area of each frame of image is determined, the center position of the vertical screen playing area of each frame of image in the horizontal version video to be processed is determined based on the center position of the focus area of each frame of image, and the center position of the vertical screen playing area of each frame of image in the horizontal version video to be processed is determined based on the center position of the vertical screen playing area of each frame of image according to preset vertical screen resolution, wherein the corresponding relation between the vertical screen playing area and the preset vertical screen resolution is stored in the position information of the vertical screen playing area in the horizontal version video to be processed;
the playing module is used for playing the content of a vertical screen playing area in each frame image of the horizontal version video to be processed in a full screen mode according to the position information when the horizontal version video to be processed is played in a vertical screen mode with the preset vertical screen resolution;
the second detection module is used for detecting whether a moving operation aiming at the vertical screen playing area is received or not in the vertical screen playing process of the horizontal version video to be processed;
and the adjusting module is used for adjusting the position of the vertical screen playing area in the horizontal version video to be processed according to the moving operation when the detection result of the second detecting module is positive, and playing the content of the adjusted vertical screen playing area in a full screen mode.
18. The apparatus of claim 17, further comprising:
the third detection module is used for detecting whether a restoring operation aiming at the mobile operation is received or not in the process of playing the horizontal version video to be processed according to the adjusted vertical screen playing area; if yes, returning to the step of executing the step of playing the content of the vertical screen playing area in each frame image of the horizontal version video to be processed in a full screen mode according to the position information.
19. The apparatus according to claim 17 or 18, wherein the playing module is specifically configured to determine, according to the position information, a vertical screen playing area that matches the preset vertical screen resolution in each frame of image of the to-be-processed horizontal version video; and rendering the content of a vertical screen playing area in each frame of image of the horizontal version image to be processed in a full screen mode.
20. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any one of claims 1, or 2-7, or 8-10 when executing a program stored in a memory.
21. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method steps of any one of claims 1, or 2 to 7, or 8 to 10.
CN201911089811.2A 2019-11-08 2019-11-08 Video playing method, system, device, electronic equipment and storage medium Active CN110691259B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911089811.2A CN110691259B (en) 2019-11-08 2019-11-08 Video playing method, system, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911089811.2A CN110691259B (en) 2019-11-08 2019-11-08 Video playing method, system, device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110691259A CN110691259A (en) 2020-01-14
CN110691259B true CN110691259B (en) 2022-04-22

Family

ID=69115858

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911089811.2A Active CN110691259B (en) 2019-11-08 2019-11-08 Video playing method, system, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110691259B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111479162B (en) * 2020-04-07 2022-05-13 成都酷狗创业孵化器管理有限公司 Live data transmission method and device and computer readable storage medium
CN111726688A (en) * 2020-07-02 2020-09-29 深圳市鹰硕技术有限公司 Method and device for self-adapting screen projection picture in network teaching
CN112333513B (en) * 2020-07-09 2024-02-06 深圳Tcl新技术有限公司 Method, equipment and storage medium for creating vertical screen video library
CN112218160A (en) * 2020-10-12 2021-01-12 北京达佳互联信息技术有限公司 Video conversion method and device, video conversion equipment and storage medium
CN112367559B (en) * 2020-10-30 2022-10-04 北京达佳互联信息技术有限公司 Video display method and device, electronic equipment, server and storage medium
CN112738541B (en) * 2020-12-25 2023-05-16 北京字节跳动网络技术有限公司 Picture display method and device and electronic equipment
CN115828003A (en) * 2021-01-28 2023-03-21 腾讯科技(深圳)有限公司 Information display method and device, storage medium and computer equipment
CN112995666B (en) * 2021-02-22 2022-04-22 天翼爱音乐文化科技有限公司 Video horizontal and vertical screen conversion method and device combined with scene switching detection
CN117609547A (en) * 2021-08-12 2024-02-27 荣耀终端有限公司 Video thumbnail display method, apparatus and storage medium

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102377960B (en) * 2010-08-24 2014-11-05 腾讯科技(深圳)有限公司 Video picture displaying method and device
US8976292B2 (en) * 2011-12-09 2015-03-10 Texas Instruments Incorporated Perceptual video quality improvement for videos containing black bars
CN108432259B (en) * 2015-12-31 2020-09-04 华为技术有限公司 Method for adjusting multimedia playing progress
CN106028095A (en) * 2016-06-07 2016-10-12 北京奇虎科技有限公司 Method and device for controlling video playing
KR102453083B1 (en) * 2016-07-01 2022-10-11 스냅 인코포레이티드 Processing and formatting video for interactive presentation
CN106358036B (en) * 2016-08-31 2018-05-08 杭州当虹科技有限公司 A kind of method that virtual reality video is watched with default visual angle
US10469751B2 (en) * 2017-05-12 2019-11-05 Garmin Switzerland Gmbh Smart stabilization and reorientation for an omnidirectional camera
KR102373510B1 (en) * 2017-08-11 2022-03-11 삼성전자주식회사 Display device for visualizing contents as the display is rotated and control method thereof
CN107707954A (en) * 2017-10-27 2018-02-16 北京小米移动软件有限公司 Video broadcasting method and device
CN110189378B (en) * 2019-05-23 2022-03-04 北京奇艺世纪科技有限公司 Video processing method and device and electronic equipment

Also Published As

Publication number Publication date
CN110691259A (en) 2020-01-14

Similar Documents

Publication Publication Date Title
CN110691259B (en) Video playing method, system, device, electronic equipment and storage medium
CN109325933B (en) Method and device for recognizing copied image
US9600744B2 (en) Adaptive interest rate control for visual search
US9681201B2 (en) Comment information generating apparatus and comment information generating method
US11636610B2 (en) Determining multiple camera positions from multiple videos
US10762653B2 (en) Generation apparatus of virtual viewpoint image, generation method, and storage medium
CN106663196B (en) Method, system, and computer-readable storage medium for identifying a subject
US10586308B2 (en) Digital media environment for removal of obstructions in a digital image scene
EP3466050A1 (en) Improved video stabilization for mobile devices
CN107077725A (en) Data processing equipment, imaging device and data processing method
JP2016526713A (en) Tracker auxiliary image capture
CN111836118B (en) Video processing method, device, server and storage medium
GB2598015A (en) Action recognition method and device for target object, and electronic apparatus
US20070248243A1 (en) Device and method of detecting gradual shot transition in moving picture
US9317770B2 (en) Method, apparatus and terminal for detecting image stability
WO2024022301A1 (en) Visual angle path acquisition method and apparatus, and electronic device and medium
CN110324707B (en) Video playing time consumption testing method and device
CN112055258B (en) Time delay testing method and device for loading live broadcast picture, electronic equipment and storage medium
KR20160035104A (en) Method for detecting object and object detecting apparatus
WO2014176878A1 (en) Method, apparatus and terminal for detecting image stability
US11647294B2 (en) Panoramic video data process
US10282633B2 (en) Cross-asset media analysis and processing
CN112752110B (en) Video presentation method and device, computing device and storage medium
CN111641870B (en) Video playing method and device, electronic equipment and computer storage medium
CN112055246B (en) Video processing method, device and system and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant