CN111918125B - Video playing method, device and system - Google Patents

Video playing method, device and system Download PDF

Info

Publication number
CN111918125B
CN111918125B CN201910383974.5A CN201910383974A CN111918125B CN 111918125 B CN111918125 B CN 111918125B CN 201910383974 A CN201910383974 A CN 201910383974A CN 111918125 B CN111918125 B CN 111918125B
Authority
CN
China
Prior art keywords
image
frame
current rendering
rendering area
resolution
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
CN201910383974.5A
Other languages
Chinese (zh)
Other versions
CN111918125A (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201910383974.5A priority Critical patent/CN111918125B/en
Publication of CN111918125A publication Critical patent/CN111918125A/en
Application granted granted Critical
Publication of CN111918125B publication Critical patent/CN111918125B/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/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, rendering scenes according to MPEG-4 scene graphs
    • H04N21/44012Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving rendering scenes according to scene graphs, e.g. MPEG-4 scene graphs
    • 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, manipulating MPEG-4 scene graphs
    • H04N21/2343Processing of video elementary streams, e.g. splicing of video streams, manipulating MPEG-4 scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
    • H04N21/234381Processing of video elementary streams, e.g. splicing of video streams, manipulating MPEG-4 scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements by altering the temporal resolution, e.g. decreasing the frame rate by frame skipping
    • 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, rendering scenes according to MPEG-4 scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • H04N21/440281Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display by altering the temporal resolution, e.g. by frame skipping

Abstract

The embodiment of the invention discloses a video playing method, a video playing device and a video playing system, which are applied to the technical field of information processing. The video sending end sends each frame of image and the resolution ratio thereof in the video to the video receiving end, so that the video receiving end can adjust the size of the current rendering area according to the resolution ratio of each frame of image respectively under the condition that the resolution ratio of the image is not consistent with the resolution ratio corresponding to the current rendering area, and when the adjusted current rendering area displays the corresponding frame of image, the resolution ratio corresponding to the current rendering area is consistent with the resolution ratio of each frame of image or slightly larger than the resolution ratio of each frame of image, thereby avoiding the condition that the received video data is discarded because the current rendering area is fixed.

Description

Video playing method, device and system
Technical Field
The present invention relates to the field of information processing technologies, and in particular, to a video playing method, apparatus, and system.
Background
In the process of real-time video communication, the video sending end sends the video of the current end to the video receiving end in real time, so that the video receiving end can play the received video in real time.
In the prior art, when a video receiving end plays a received video, the received video is generally rendered to an area with a fixed size (i.e., a rendering area) for video playing, and in the process of rendering, when the resolution of the video collected by a video sending end is inconsistent with the rendering area of the video receiving end, the video receiving end performs scaling and cutting on the received video when rendering, so that part of video data can be discarded, and the video played by the video receiving end cannot completely represent the video sent by the video sending end.
Disclosure of Invention
The embodiment of the invention provides a video playing method, a video playing device and a video playing system, which realize that the size of a current rendering area is dynamically adjusted at a video receiving end so as to display received video data.
A first aspect of an embodiment of the present invention provides a video playing method, including:
receiving video data, wherein the video data comprises at least one frame of image and resolution ratios corresponding to the at least one frame of image respectively;
when the resolution of the at least one frame of image is inconsistent with the resolution corresponding to the current rendering area, adjusting the size of the current rendering area according to the resolution corresponding to the at least one frame of image;
and displaying the corresponding frame image in the adjusted current rendering area.
A second aspect of the embodiments of the present invention provides a video playing apparatus, including:
the video receiving unit is used for receiving video data, and the video data comprises at least one frame of image and resolution ratios corresponding to the at least one frame of image respectively;
the area adjusting unit is used for adjusting the size of the current rendering area according to the resolution corresponding to the at least one frame of image when the resolution of the at least one frame of image is not consistent with the resolution corresponding to the current rendering area;
and the display unit is used for displaying the corresponding frame image in the adjusted current rendering area.
A third aspect of the embodiments of the present invention provides a storage medium, where the storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the video playing method according to the first aspect of the embodiments of the present invention.
A fourth aspect of the embodiments of the present invention provides a terminal device, including a processor and a storage medium, where the processor is configured to implement each instruction;
the storage medium is configured to store a plurality of instructions, where the instructions are configured to be loaded by a processor and to execute the video playing method according to the first aspect of the embodiment of the present invention.
A fifth aspect of the embodiments of the present invention provides a video playing system, including a first terminal device and a second terminal device, where:
the first terminal device is used for sending video data to a second terminal device, wherein the video data comprises at least one frame of image and the resolution ratio corresponding to the at least one frame of image;
the second terminal device is the video playing apparatus according to the second aspect of the embodiment of the present invention, or the terminal device according to the fourth aspect of the embodiment of the present invention.
It can be seen that, in the method of this embodiment, the video sending end sends each frame image in the video and the resolution thereof to the video receiving end together, so that the video receiving end adjusts the size of the current rendering area according to the resolution of each frame image respectively when the resolution of the image is not consistent with the resolution corresponding to the current rendering area, so that when the adjusted current rendering area displays the corresponding frame image, the resolution corresponding to the current rendering area is consistent with the resolution of each frame image or slightly greater than the resolution of each frame image, and thus the situation that the received video data is discarded due to the fixed current rendering area does not occur.
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 embodiments or the description of the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic diagram of a video playing method according to an embodiment of the present invention;
fig. 2 is a flowchart of a video playing method according to an embodiment of the present invention;
fig. 3 is a schematic diagram of a video receiving end and a video transmitting end in an embodiment of the present invention;
fig. 4 is a flowchart of a video playing method provided in an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a video playing apparatus according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a terminal device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without inventive step based on the embodiments of the present invention, are within the scope of protection of the present invention.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are, for example, capable of operation in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
An embodiment of the present invention provides a video playing method, as shown in fig. 1, which is mainly applicable to a process of performing video communication between two communication devices in real time, where after a video sending end of the two communication devices sends video data, a video receiving end may implement video playing through the following steps:
receiving video data, wherein the video data comprises at least one frame of image and resolution ratios corresponding to the at least one frame of image respectively; when the resolution of the at least one frame of image is inconsistent with the resolution corresponding to the current rendering area, adjusting the size of the current rendering area according to the respective resolutions of the at least one frame of image; and displaying the frame images in the adjusted current rendering area.
Therefore, when each frame of image is displayed in the adjusted current rendering area, the resolution corresponding to the current rendering area is consistent with the resolution of each frame of image or slightly larger than the resolution of each frame of image, so that the situation that the received video data is discarded due to the fact that the current rendering area is fixed does not occur.
An embodiment of the present invention provides a video playing and transmitting method, which is a method executed by the video receiving end, and a flowchart is shown in fig. 2, where the method includes:
step 101, receiving video data, where the video data includes resolutions corresponding to at least one frame of image and at least one frame of image.
It can be understood that a user may operate any application terminal, so that the application terminal initiates real-time video communication with an application terminal of another user, and thus, after the application terminal establishes video communication connection with another application terminal, any application terminal may serve as a video sending terminal, collects video data at one side of any application terminal, and sends the collected video data to another application terminal, i.e., a video receiving terminal.
In this embodiment, the video data sent by the video sending end may include resolutions corresponding to at least one frame of image and at least one frame of image, where when the video data includes multiple frames of images, the video data further needs to include a correspondence between the resolutions of the frames of images in the multiple frames of images and the frame data, so that it can be determined what the resolution of which frame of image is; and the video data may further include at least one frame of audio information, which is not emphasized herein, so that the video data received by the video receiving end also includes the information.
The resolution of any frame of image is the sum of pixels of one frame of image, generally expressed by the number x of horizontal pixels and the number y of vertical pixels, and the higher the resolution is, the clearer the image is; the frame data of any one frame image may include time information or the like for acquiring the frame image.
Step 102, judging whether the resolution of each frame of image is consistent with the resolution corresponding to the current rendering area, and if not, executing steps 103 and 104; and when the images are consistent, directly displaying each frame of image in the current rendering area.
The current rendering area is an area where the video receiving end displays image information in the video data, and generally, the current rendering area is a preset default area, and the size of the current rendering area is smaller than that of a display screen in the video receiving end. And the resolution corresponding to the current rendering area refers to the sum of pixels of the image which can be displayed in the current rendering area.
Step 103, adjusting the size of the current rendering area according to the resolution corresponding to the at least one frame of image.
Specifically, when the resolution of a frame of image is greater than the resolution corresponding to the current rendering area, the video receiving end increases the size of the current rendering area, so that the increased resolution corresponding to the current rendering area is consistent with the resolution of the frame of image, that is, all pixels of the frame of image can be displayed in the increased current rendering area.
Specifically, when the size of the current rendering area is increased, the video receiving end may determine the length and height of a certain frame of image according to the resolution of the certain frame of image, and respectively use the length and height of the certain frame of image as the length and height of the adjusted current rendering area.
When the resolution of a frame of image is smaller than the resolution corresponding to the current rendering area, the video receiving end reduces the size of the current rendering area, so that the reduced resolution corresponding to the current rendering area is consistent with the resolution of the frame of image or slightly larger than the resolution of the frame of image.
Specifically, when the size of the current rendering area is reduced, the video receiving end determines the length and height of a certain frame of image according to the resolution of the certain frame of image, calculates a first scaling ratio of the length of the current rendering area to the length of the certain frame of image, calculates a second scaling ratio of the height of the current rendering area to the height of the certain frame of image, and determines the minimum scaling ratio of the first scaling ratio to the second scaling ratio; and then, the length formed after the length of a certain frame image is zoomed according to the minimum zoom ratio is taken as the length of the current rendering area after adjustment, and the height formed after the height of a certain frame image is zoomed according to the minimum zoom ratio is taken as the height of the current rendering area after adjustment.
Wherein, the length (or height) of a certain frame image is scaled according to the minimum scaling ratio, specifically: the length (or height) of a certain frame image is multiplied by the minimum scaling ratio.
Further, when the length of a frame of image after being scaled according to the minimum scaling ratio is greater than or equal to the length of the current rendering area, the video receiving end may directly take the length of the frame of image after being scaled according to the minimum scaling ratio as the length of the adjusted current rendering area; and when the length of a certain frame image is smaller than the length of the current rendering area after being scaled according to the minimum scaling ratio, the video receiving end takes the length of the certain frame image after being scaled according to the maximum scaling ratio as the length of the adjusted current rendering area, wherein the maximum scaling ratio is the maximum value of the first scaling ratio and the second scaling ratio.
Further, when the height of a certain frame of image after being scaled according to the minimum scaling ratio is greater than or equal to the height of the current rendering area, the video receiving end directly takes the height of the certain frame of image after being scaled according to the minimum scaling ratio as the height of the adjusted current rendering area; when the height of a certain frame of image is lower than the height of the current rendering area after being scaled according to the minimum scaling ratio, the video receiving end may use the height of the certain frame of image after being scaled according to the maximum scaling ratio as the height of the adjusted current rendering area, where the maximum scaling ratio is the maximum value of the first scaling ratio and the second scaling ratio.
And 104, displaying the corresponding frame image in the adjusted current rendering area.
Specifically, after the video receiving end can execute the step 103 for a certain frame image, the frame image is displayed by using the adjusted rendering area; after the above step 103 is performed for another frame image, the another frame image is displayed using the adjusted rendering area.
When the video data received in step 101 includes the corresponding relationship between the resolution of each frame image and the frame data, and when each frame image is displayed, the video receiving end may determine which frame image corresponds to which size of the adjusted current rendering area according to the frame data of each frame image, and render and display each frame image in the corresponding size of the current rendering area.
It can be seen that, in the method of this embodiment, the video sending end sends each frame image in the video and the resolution thereof to the video receiving end together, so that the video receiving end adjusts the size of the current rendering area according to the resolution of each frame image respectively when the resolution of the image is not consistent with the resolution corresponding to the current rendering area, so that when the adjusted current rendering area displays the corresponding frame image, the resolution corresponding to the current rendering area is consistent with the resolution of each frame image or slightly greater than the resolution of each frame image, and thus the situation that the received video data is discarded due to the fixed current rendering area does not occur.
It should be noted that, the above steps 101 to 104 are processes of playing the video data after the video receiving end receives the video data. In other embodiments, the video receiving end may further collect video data, that is, video collection data, on one side of the video receiving end, and send the video collection data to another application terminal for playing, where the video collection data includes resolutions corresponding to at least one frame of image and at least one frame of image respectively.
When the video acquisition data comprises a plurality of frames of images, the corresponding relation between the resolution of each frame of image and the frame data is also required to be included, so that the resolution of which frame of image is determined; and at least one frame of audio information may also be included in the video data, which is not emphasized here.
The video playing method of the present invention is described below with a specific application example, and the method of the present embodiment may be applied to Voice over Internet Protocol (VoIP) video communication of enterprise WeChat. As shown in fig. 3, the video sending end of this embodiment may include a video collecting module and an engine processing module, and the video receiving end may include the engine processing module and a rendering module, where the video collecting module collects video data, and the video data includes multiple frames of images and a corresponding relationship between a resolution of each frame of image and frame data; the video acquisition module sends the video data to an engine processing module of a video receiving end through an engine processing module in a video sending end; therefore, the rendering module can adaptively adjust the size of the current rendering area according to the corresponding relation between the resolution of each frame of image and the frame data, and display each frame of image in the adjusted current rendering area.
Therefore, by adopting the method of the embodiment, in the real-time video communication process between the video sending end and the video receiving end, the user sees the video of the user corresponding to the video sending end through the video receiving end and the video content seen by the user through the video sending end completely consistent, and no cutting or deformation is generated. Specifically, the method of this embodiment includes the following steps, and the flowchart is shown in fig. 4, and includes:
step 201, when a user operates a video sending end, a video communication connection is established between the video sending end and a video receiving end, so that a video acquisition module of the video sending end acquires video data on one side of the video sending end and transmits the video data to an engine processing module, and the video data comprises multiple frames of images, and the corresponding relation between the resolution ratio of each frame of image and frame data.
The frame data of a certain frame of image refers to time information and the like when the video acquisition module acquires the frame of image.
Step 202, an engine processing module of a video sending end connects video data through video communication and sends the video data to a video receiving end, after the engine processing module of the video receiving end receives the video data, whether the resolution corresponding to the current rendering area of the video receiving end is consistent with the resolution of each frame of image in the video data or not is judged, and if the resolution is not consistent, the step 203 is continuously executed; and if the video data are consistent with the video data, the engine processing module transmits the video data to the rendering module, and the rendering module directly displays each frame of image in the current rendering area.
Step 203, an engine processing module at the video receiving end judges whether the resolution corresponding to the current rendering area is greater than the resolution of each frame of image, and if so, step 204 is executed; if so, step 205 is performed.
Step 204, an engine processing module at the video receiving end calculates and determines the length and the height of each frame image according to the resolution of each frame image, calculates a first scaling ratio of the length of the current rendering area to the length of a certain frame image, and marks the first scaling ratio as XScale, and calculates a second scaling ratio of the height of the current rendering area to the height of a certain frame image, and marks the second scaling ratio as YScale; a minimum scaling ratio of the first scaling ratio and the second scaling ratio is determined, denoted as MinScale, i.e., minScale = min (XScale, ysscale), such that the length of each frame image is scaled by the minimum scaling ratio MinScale to form a length WMin = length W of the MinScale image, and the height of each frame image is scaled by the minimum scaling ratio to form a height HMin = height H of the MinScale image. Further, the engine processing module at the video receiving end continues to execute step 206.
In step 205, the engine processing module at the video receiving end determines the length and height of each frame image according to the resolution of each frame image, and takes the length of each frame image as the length of the adjusted current rendering area. Step 209 is then performed.
Step 206, the engine processing module at the video receiving end judges whether the length WMin formed after the length of each frame of image is scaled according to the minimum scaling ratio MinScale is greater than or equal to the length of the current rendering area, and judges whether the high HMin formed after the height of each frame of image is scaled according to the minimum scaling ratio MinScale is greater than or equal to the height of the current rendering area, and if both are greater than or equal to each other, the engine processing module executes step 207; when both are less than, the engine processing module will execute step 208.
In step 207, the engine processing module uses the length WMin formed by scaling the length of each frame image as the length of the adjusted current rendering area, and uses the height of each frame image as the height of the adjusted current rendering area according to the high HMin formed by scaling. Step 209 is then performed.
In step 208, the engine processing module at the video receiving end determines the maximum scaling ratio of the first scaling ratio and the second scaling ratio, which is denoted as MaxScale, i.e., maxScale = max (XScale, YScale), so that the length WMax of each frame image formed after scaling according to the maximum scaling ratio MaxScale = the length W of the MaxScale image, and the height of each frame image formed after scaling according to the maximum scaling ratio HMax = the height H of the MaxScale image.
Then the engine processing module scales the length of each frame of image to form a length WMax which is used as the length of the adjusted current rendering area; and taking the high HMax formed by scaling the height of each frame image as the height of the current rendering area after adjustment. Step 209 is then performed.
In step 209, the video receiving end engine processing module notifies the rendering module of the frame data of each frame of image and the size (specifically, the length) of the current rendering area adjusted according to the resolution of each frame of image. Therefore, when each frame of image is displayed according to the frame data, the rendering module renders each frame of image into the current rendering area with the corresponding size for display.
An embodiment of the present invention further provides a video playing apparatus, that is, the video receiving end, a schematic structural diagram of which is shown in fig. 5, and the video playing apparatus specifically includes:
the video receiving unit 10 is configured to receive video data, where the video data includes at least one frame of image and resolutions corresponding to the at least one frame of image.
When the video data comprises a plurality of frames of images, the video data further comprises the corresponding relation between the resolution of each frame of image in the plurality of frames of images and the frame data.
The area adjusting unit 11 is configured to, when the resolution of the at least one frame of image received by the video receiving unit 10 is inconsistent with the resolution corresponding to the current rendering area, adjust the size of the current rendering area according to the resolution corresponding to the at least one frame of image.
When adjusting the size of the current rendering area according to the resolution of a certain frame of image, specifically, when the resolution of the certain frame of image is greater than the resolution corresponding to the current rendering area, the area adjusting unit 11 increases the size of the current rendering area, so that the resolution corresponding to the increased current rendering area is consistent with the resolution of the certain frame of image; and the image processing device is further configured to, when the resolution of the certain frame of image is smaller than the resolution corresponding to the current rendering area, reduce the size of the current rendering area, so that the resolution corresponding to the reduced current rendering area is consistent with the resolution of the certain frame of image.
When the size of the current rendering area is increased, the area adjusting unit 11 is specifically configured to determine the length and the height of the certain frame of image according to the resolution of the certain frame of image; and respectively taking the length and the height of the certain frame of image as the length and the height of the adjusted current rendering area.
When the size of the current rendering area is reduced, the area adjusting unit 11 is specifically configured to determine the length and height of the certain frame image according to the resolution of the certain frame image; calculating a first scaling ratio of the length of the current rendering area to the length of a certain frame of image, and a second scaling ratio of the height of the current rendering area to the height of a certain frame of image; determining a minimum scaling ratio of the first and second scaling ratios; and taking the length formed after the length of the certain frame image is zoomed according to the minimum zoom ratio as the length of the current rendering area after adjustment, and taking the height formed after the height of the certain frame image is zoomed according to the minimum zoom ratio as the height of the current rendering area after adjustment.
Further, after determining the minimum zoom ratio of the first zoom ratio and the second zoom ratio, when the length of the frame image after being zoomed according to the minimum zoom ratio is greater than or equal to the length of the current rendering area, the area adjusting unit 11 performs the step of taking the length of the frame image after being zoomed according to the minimum zoom ratio as the length of the adjusted current rendering area; and when the length of the certain frame image after being scaled according to the minimum scaling ratio is smaller than the length of the current rendering area, the method is further configured to use the length of the certain frame image after being scaled according to the maximum scaling ratio as the length of the adjusted current rendering area, where the maximum scaling ratio is a maximum value of the first scaling ratio and the second scaling ratio.
Further, after determining the minimum scaling ratio of the first scaling ratio and the second scaling ratio, when the height of the certain frame image formed after scaling according to the minimum scaling ratio is greater than or equal to the height of the current rendering area, the area adjusting unit 11 performs the step of taking the height formed after scaling according to the minimum scaling ratio of the certain frame image as the height of the adjusted current rendering area; and when the height of the certain frame image is lower than the height of the current rendering area after being scaled according to the minimum scaling ratio, the height of the certain frame image is further used as the height of the adjusted current rendering area after being scaled according to the maximum scaling ratio, and the maximum scaling ratio is the maximum value of the first scaling ratio and the second scaling ratio.
A display unit 12, configured to display a corresponding frame image in the current rendering area adjusted by the area adjustment unit 11.
Further, the video playing apparatus of the present embodiment further includes: the video sending unit 13 is configured to send video acquisition data, where the video acquisition data includes at least one frame of image and resolutions corresponding to the at least one frame of image.
When the video acquisition data comprises a plurality of frames of images, the corresponding relation between the resolution of each frame of image and the frame data is also included.
In this embodiment, the video sending end sends each frame of image in the video and the resolution thereof to the video receiving end together, and in the video playing apparatus in this embodiment, the region adjusting unit 11 adjusts the size of the current rendering region according to the resolution of each frame of image respectively when the resolution of the image is not consistent with the resolution corresponding to the current rendering region, so that when the adjusted current rendering region displays the corresponding frame of image, the display unit 12 makes the resolution corresponding to the current rendering region consistent with the resolution of each frame of image or slightly greater than the resolution of each frame of image, thereby avoiding the situation that the received video data is discarded due to the fixed current rendering region.
The present invention further provides a terminal device, a schematic structural diagram of which is shown in fig. 6, where the terminal device may generate a relatively large difference due to different configurations or performances, and may include one or more Central Processing Units (CPUs) 20 (e.g., one or more processors) and a memory 21, and one or more storage media 22 (e.g., one or more mass storage devices) storing the application programs 221 or the data 222. Wherein the memory 21 and the storage medium 22 may be a transient storage or a persistent storage. The program stored in the storage medium 22 may include one or more modules (not shown), each of which may include a series of instruction operations for the terminal device. Still further, the central processor 20 may be configured to communicate with the storage medium 22 to execute a series of instruction operations in the storage medium 22 on the terminal device.
Specifically, the application programs 221 stored in the storage medium 22 include applications for video playing, and the programs may include the video receiving unit 10, the area adjusting unit 11, the display unit 12, and the video sending unit 13 in the video playing apparatus, which will not be described herein again. Further, the central processor 20 may be configured to communicate with the storage medium 22, and execute a series of operations corresponding to the application program for video playback stored in the storage medium 22 on the terminal device.
The terminal equipment may also include one or more power supplies 23, one or more wired or wireless network interfaces 24, one or more input-output interfaces 25, and/or one or more operating systems 223, such as Windows Server, mac OS XTM, unixTM, linuxTM, freeBSDTM, and the like.
The steps executed by the video playing unit in the above method embodiment may be based on the structure of the terminal device shown in fig. 6.
The embodiment of the present invention further provides a storage medium, where the storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the video playing method executed by the video playing apparatus.
The embodiment of the invention also provides the terminal device, which comprises a processor and a storage medium, wherein the processor is used for realizing each instruction; the storage medium is used for storing a plurality of instructions, and the instructions are used for being loaded by the processor and executing the video playing method executed by the video playing device.
The embodiment of the present invention further provides a video playing system, which includes a first terminal device and a second terminal device, wherein:
the first terminal device is used for sending video data to a second terminal device, wherein the video data comprises at least one frame of image and resolution ratios corresponding to the at least one frame of image respectively; the second terminal device is a video playing apparatus as shown in fig. 5 or a terminal device as shown in fig. 6.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by associated hardware instructed by a program, which may be stored in a computer-readable storage medium, and the storage medium may include: read Only Memory (ROM), random Access Memory (RAM), magnetic or optical disks, and the like.
The video playing method, device and system provided by the embodiment of the present invention are described in detail above, and a specific example is applied in the text to explain the principle and the implementation of the present invention, and the description of the above embodiment is only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, the specific embodiments and the application range may be changed, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (8)

1. A video playback method, comprising:
in the real-time video communication process between a video sending end and a video receiving end, when the video receiving end receives video data, the video data comprises at least one frame of image, the resolution ratio corresponding to each frame of image and the corresponding relation between the resolution ratio of each frame of image and frame data; the video data is sent from a video sending end in the real-time video communication process;
when the resolution of the at least one frame of image is inconsistent with the resolution corresponding to the current rendering area, the size of the current rendering area is adaptively adjusted according to the resolution corresponding to the at least one frame of image and the corresponding relation;
displaying a corresponding frame image in the adjusted current rendering area;
the adjusting the size of the current rendering area according to the resolution of a frame of image specifically includes:
when the resolution of a certain frame of image is smaller than the resolution corresponding to the current rendering area, determining the length and the height of the certain frame of image according to the resolution of the certain frame of image;
calculating a first scaling ratio of the length of the current rendering area to the length of a frame of image, and a second scaling ratio of the height of the current rendering area to the height of a frame of image;
determining a minimum scaling ratio of the first and second scaling ratios;
taking the length of the certain frame image formed after scaling according to the minimum scaling ratio as the length of the adjusted current rendering area, and taking the height of the certain frame image formed after scaling according to the minimum scaling ratio as the height of the adjusted current rendering area, so as to reduce the size of the current rendering area, and enable the resolution corresponding to the reduced current rendering area to be slightly larger than the resolution of the certain frame image;
when the length of the certain frame image is smaller than the length of the current rendering area after being scaled according to the minimum scaling ratio, and the height of the certain frame image is smaller than the height of the current rendering area after being scaled according to the minimum scaling ratio, the length of the certain frame image after being scaled according to the maximum scaling ratio is used as the length of the adjusted current rendering area, the maximum scaling ratio is the maximum value of the first scaling ratio and the second scaling ratio, and the height of the certain frame image after being scaled according to the maximum scaling ratio is used as the height of the adjusted current rendering area;
when the resolution of a certain frame of image is greater than the resolution corresponding to the current rendering area, determining the length and height of the certain frame of image according to the resolution of the certain frame of image; and respectively taking the length and the height of the certain frame of image as the length and the height of the adjusted current rendering area.
2. The method of claim 1, wherein after determining the minimum scaling ratio of the first scaling ratio and the second scaling ratio, the method further comprises:
and when the length of the certain frame image after being scaled according to the minimum scaling ratio is greater than or equal to the length of the current rendering area, executing the step of taking the length of the certain frame image after being scaled according to the minimum scaling ratio as the length of the adjusted current rendering area.
3. The method of claim 1, wherein after determining the minimum scaling ratio of the first scaling ratio and the second scaling ratio, the method further comprises:
and when the height of the certain frame image formed after scaling according to the minimum scaling ratio is greater than or equal to the height of the current rendering area, executing the step of taking the height of the certain frame image formed after scaling according to the minimum scaling ratio as the height of the adjusted current rendering area.
4. The method of any of claims 1 to 3, further comprising:
and sending video acquisition data, wherein the video acquisition data comprises at least one frame of image and the resolution ratio corresponding to the at least one frame of image.
5. The method according to claim 4, wherein when the video capture data includes multiple frames of images, the method further includes the correspondence between the resolution of each frame of image in the multiple frames of images and the frame data.
6. A video playback apparatus, comprising:
the video receiving unit is used for receiving video data by the video receiving end in the real-time video communication process of the video sending end and the video receiving end, wherein the video data comprises at least one frame of image, the resolution ratio respectively corresponding to the at least one frame of image and the corresponding relation between the resolution ratio of each frame of image and frame data; the video data is sent from a video sending end in the real-time video communication process;
the area adjusting unit is used for adaptively adjusting the size of the current rendering area according to the resolution corresponding to the at least one frame of image and the corresponding relation when the resolution of the at least one frame of image is not consistent with the resolution corresponding to the current rendering area;
the display unit is used for displaying the corresponding frame image in the adjusted current rendering area;
the region adjusting unit is specifically configured to determine the length and height of a certain frame of image according to the resolution of the certain frame of image when the resolution of the certain frame of image is smaller than the resolution corresponding to the current rendering region; calculating a first scaling ratio of the length of the current rendering area to the length of a certain frame of image, and a second scaling ratio of the height of the current rendering area to the height of a certain frame of image; determining a minimum scaling ratio of the first and second scaling ratios; taking the length of the certain frame image formed after scaling according to the minimum scaling ratio as the length of the adjusted current rendering area, and taking the height of the certain frame image formed after scaling according to the minimum scaling ratio as the height of the adjusted current rendering area, so as to reduce the size of the current rendering area, and enable the resolution corresponding to the reduced current rendering area to be slightly larger than the resolution of the certain frame image;
when the length of the certain frame image is smaller than the length of the current rendering area after being scaled according to the minimum scaling ratio, and the height of the certain frame image is smaller than the height of the current rendering area after being scaled according to the minimum scaling ratio, the length of the certain frame image after being scaled according to the maximum scaling ratio is used as the length of the adjusted current rendering area, the maximum scaling ratio is the maximum value of the first scaling ratio and the second scaling ratio, and the height of the certain frame image after being scaled according to the maximum scaling ratio is used as the height of the adjusted current rendering area;
the region adjusting unit is further configured to determine the length and the height of a certain frame of image according to the resolution of the certain frame of image when the resolution of the certain frame of image is greater than the resolution corresponding to the current rendering region; and respectively taking the length and the height of the certain frame of image as the length and the height of the adjusted current rendering area.
7. A terminal device comprising a processor and a storage medium, the processor configured to implement instructions;
the storage medium is configured to store a plurality of instructions for loading by a processor and executing the video playback method according to any one of claims 1 to 5.
8. A video playback system, comprising a first terminal device and a second terminal device, wherein:
the first terminal device is used for sending video data to a second terminal device, wherein the video data comprises at least one frame of image and resolution ratios corresponding to the at least one frame of image respectively;
the second terminal device is a video playback apparatus according to claim 6, or a terminal device according to claim 7.
CN201910383974.5A 2019-05-09 2019-05-09 Video playing method, device and system Active CN111918125B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910383974.5A CN111918125B (en) 2019-05-09 2019-05-09 Video playing method, device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910383974.5A CN111918125B (en) 2019-05-09 2019-05-09 Video playing method, device and system

Publications (2)

Publication Number Publication Date
CN111918125A CN111918125A (en) 2020-11-10
CN111918125B true CN111918125B (en) 2023-03-24

Family

ID=73242782

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910383974.5A Active CN111918125B (en) 2019-05-09 2019-05-09 Video playing method, device and system

Country Status (1)

Country Link
CN (1) CN111918125B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113469883B (en) * 2021-06-30 2022-05-06 完美世界(北京)软件科技发展有限公司 Rendering method and device of dynamic resolution, electronic equipment and readable storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103455571A (en) * 2013-08-19 2013-12-18 小米科技有限责任公司 Method and device for displaying picture in webpage, and terminal
CN105659590A (en) * 2013-10-22 2016-06-08 微软技术许可有限责任公司 Controlling resolution of encoded video

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100481000C (en) * 2004-09-08 2009-04-22 英业达股份有限公司 Window and icon set system and method
US8681180B2 (en) * 2006-12-15 2014-03-25 Qualcomm Incorporated Post-render graphics scaling
CN101848382A (en) * 2010-05-31 2010-09-29 深圳市景阳科技股份有限公司 Method and system for adjusting video streaming image resolution ratio and code stream
US20150201193A1 (en) * 2012-01-10 2015-07-16 Google Inc. Encoding and decoding techniques for remote screen sharing of media content using video source and display parameters
CN102917273B (en) * 2012-09-28 2016-03-02 深圳市茁壮网络股份有限公司 A kind of method of cross-platform display application and device
CN104065911B (en) * 2013-03-18 2019-01-15 联想(北京)有限公司 Display control method and device
US20150154778A1 (en) * 2013-11-29 2015-06-04 Calgary Scientific, Inc. Systems and methods for dynamic image rendering
CN103700360A (en) * 2013-12-09 2014-04-02 乐视致新电子科技(天津)有限公司 Screen display proportion regulating method and electronic equipment
CN104079978B (en) * 2014-06-27 2017-07-21 西安诺瓦电子科技有限公司 Window adaptive media playout method and device and media networking dissemination method
CN104461295A (en) * 2014-12-03 2015-03-25 广东威创视讯科技股份有限公司 Method and system for regulating video display window of jointing wall
US10313417B2 (en) * 2016-04-18 2019-06-04 Qualcomm Incorporated Methods and systems for auto-zoom based adaptive video streaming
CN109547838B (en) * 2018-12-06 2021-06-01 青岛海信传媒网络技术有限公司 Video window processing method and device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103455571A (en) * 2013-08-19 2013-12-18 小米科技有限责任公司 Method and device for displaying picture in webpage, and terminal
CN105659590A (en) * 2013-10-22 2016-06-08 微软技术许可有限责任公司 Controlling resolution of encoded video

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"数字图像和视频的空间分辨率变换研究";刘琉;《中国优秀硕士学位论文全文数据库》;20150315;全文 *

Also Published As

Publication number Publication date
CN111918125A (en) 2020-11-10

Similar Documents

Publication Publication Date Title
EP2005387B1 (en) Constructing image panorama using frame selection
JP2017517969A (en) Photo video camera with dynamic orientation locking, constant framing and defined aspect ratio
CN109089131B (en) Screen recording live broadcast method, device, equipment and storage medium based on IOS system
US11694316B2 (en) Method and apparatus for determining experience quality of VR multimedia
JP3950776B2 (en) Video distribution system and video conversion device used therefor
CN111147911A (en) Video clipping method and device, electronic equipment and storage medium
WO2014030405A1 (en) Display device, display method, television receiver, and display control device
CN106791915A (en) A kind of method and apparatus for showing video image
WO2016024546A1 (en) Image transmission device, image transmission method, and image transmission program
CN111918125B (en) Video playing method, device and system
CN111050204A (en) Video clipping method and device, electronic equipment and storage medium
JP2019149785A (en) Video conversion device and program
JP2014050018A (en) Information processing device and video conference system and program
WO2018103371A1 (en) Processing method in video recording and apparatus
JP2008236679A (en) Videoconference apparatus, control method, and program
CN113438550A (en) Video playing method, video conference method, live broadcasting method and related devices
WO2018184408A1 (en) Video recording method and device
WO2016117480A1 (en) Telecommunication system
CN110505428B (en) Information processing method and electronic equipment
JP2003189220A5 (en)
CN110708590A (en) Method for improving screen projection resolution
CN109348187A (en) Situation Awareness System based on power distribution network construction site
EP4258661A1 (en) Encoding/decoding method, electronic device, communication system, and storage medium
CN111343412B (en) Image processing method and electronic equipment
JP2009302762A (en) Network camera system

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