Disclosure of Invention
In view of the foregoing defects of the prior art, an object of the present invention is to provide a video resolution adjustment method, an electronic device, and a storage medium, which can adjust the encoding resolution of a video according to the size of a display window.
The purpose of the invention is realized by the following technical scheme:
to solve the foregoing technical problem, in a first aspect, an embodiment of the present invention provides a method for adjusting a video resolution, including:
acquiring a display screen and the physical size of a display window in the display screen;
calculating the sight distance from human eyes to the display screen according to the physical size of the display screen;
calculating the pixel density which can be identified by the human eyes in the sight distance according to the angular resolution of the human eyes and the sight distance;
calculating the optimal resolution of the video displayed by the display window according to the physical size of the display window and the pixel density;
and adjusting the encoding resolution of the video according to the optimal resolution.
In some embodiments, the obtaining the physical size of the display screen includes:
acquiring the width and the height of the display screen;
and calculating the physical size of the display screen according to the width and the height of the display screen.
In some embodiments, the obtaining the physical size of the display window in the display screen includes:
acquiring the resolution ratios of the display screen and a display window in the display screen;
calculating the ratio of the display window in the display screen according to the display screen and the resolution of the display window in the display screen;
and calculating the physical size of the display window according to the ratio and the physical size of the display screen.
In some embodiments, the physical dimensions of the display window include a width and a height of the display window, the aspect ratio includes a width ratio and a height ratio,
calculating the physical size of the display window according to the ratio and the physical size of the display screen, wherein the calculation comprises the following steps:
calculating the width of the display window according to the width of the display screen and the width proportion;
and calculating the height of the display window according to the height of the display screen and the high proportion.
In some embodiments, said calculating the line of sight of the human eye to said display screen from the physical dimensions of said display screen comprises:
acquiring the optimal visual angle between human eyes and the display screen;
judging whether the physical size of the display screen is larger than a preset threshold value or not;
if the distance is larger than the optimal viewing angle, calculating the viewing distance from the human eyes to the display screen according to the width of the display screen and the optimal viewing angle;
and if the distance is smaller than the preset distance, calculating the sight distance from the human eyes to the display screen according to the physical size of the display screen.
In some embodiments, the calculating the density of pixels recognizable by the human eye for the visual range according to the angular resolution of the human eye and the visual range includes:
acquiring the angular resolution of the human eye;
calculating pixel point distances which can be identified by human eyes according to the angular resolution and the sight distance of the human eyes;
and calculating the pixel density which can be identified by the sight distance and the human eyes according to the pixel point distance which can be identified by the human eyes.
In some embodiments, the optimal resolution includes video bandwidth and video height,
the calculating the optimal resolution of the video displayed by the display window according to the physical size of the display window and the pixel density comprises:
calculating the view bandwidth according to the width of the display window and the pixel density;
and calculating the video height according to the height of the display window and the pixel density.
In some embodiments, said adjusting the encoding resolution of the video according to the optimal resolution comprises:
acquiring the maximum value of the optimal resolution in all receiving ends of the same video source;
acquiring the acquisition resolution of a video;
calculating the coding resolution according to the maximum value of the optimal resolution and the acquisition resolution;
re-encoding the video according to the encoding resolution, and outputting re-encoded video data;
decoding and displaying the re-encoded video data in the display window.
In order to solve the above technical problem, in a second aspect, an embodiment of the present invention provides an electronic device, including:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of the first aspect.
In order to solve the above technical problem, in a third aspect, an embodiment of the present invention further provides a computer-readable storage medium storing computer-executable instructions for causing a computer to perform the method according to the first aspect.
To solve the above technical problem, in a fourth aspect, the present invention further provides a computer program product including a computer program stored on a computer-readable storage medium, the computer program including program instructions that, when executed by a computer, cause the computer to perform the method according to the first aspect.
Compared with the prior art, the invention has the beneficial effects that: different from the situation of the prior art, the embodiment of the invention provides a video resolution adjusting method, electronic equipment and a storage medium, the method comprises the steps of firstly obtaining the physical size of a display screen, calculating the visual distance from human eyes to the display screen, then calculating the pixel density which can be identified by the human eyes according to the angular resolution and the visual distance of the human eyes, then calculating the optimal resolution of a video displayed by the display window according to the physical size and the pixel density of the display window, and finally adjusting the coding resolution of the video displayed by the display window which meets the visual characteristics of the human eyes according to the optimal resolution, wherein the coding resolution can meet the requirements of the human eyes on the definition and is matched with the size of the display window.
Detailed Description
The present invention will be described in detail with reference to specific examples. The following examples will assist those skilled in the art in further understanding the invention, but are not intended to limit the invention in any way. It should be noted that variations and modifications can be made by persons skilled in the art without departing from the spirit of the invention. All falling within the scope of the present invention.
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
It should be noted that, if not conflicted, the various features of the embodiments of the invention may be combined with each other within the scope of protection of the present application. Additionally, while functional block divisions are performed in apparatus schematics, with logical sequences shown in flowcharts, in some cases, steps shown or described may be performed in sequences other than block divisions in apparatus or flowcharts.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.
In addition, the technical features involved in the embodiments of the present invention described below may be combined with each other as long as they do not conflict with each other.
Please refer to fig. 1, which is a schematic diagram of an exemplary system structure applied to an embodiment of the video resolution adjustment method of the present invention. As shown in fig. 1, the system configuration includes anelectronic device 10a, anelectronic device 10b, and aserver 20. Theelectronic device 10a and theelectronic device 10b are respectively connected with theserver 20 in a communication way. The communication connection may be a network connection and may include various connection types, such as wired, wireless communication links, or fiber optic cables.
Theelectronic device 10a and theelectronic device 10b may be a display electronic device or a video coding electronic device, and in the embodiment of the present invention, theelectronic device 10a is taken as the display electronic device, and theelectronic device 10b is taken as the video coding electronic device as an example. In some embodiments, theelectronic device 10a and theelectronic device 10b may also be the same apparatus or apparatuses capable of performing the same function. It should be noted that the number of the display electronic devices and the number of the video coding electronic devices can be set according to actual situations, and need not be limited by the embodiments of the present invention.
Theelectronic device 10a and theelectronic device 10b are electronic devices provided with a display screen so as to be capable of playing and displaying a video in a display window of the display screen, and theelectronic device 10a and theelectronic device 10b are electronic devices capable of decoding and/or encoding a video. For example, theelectronic device 10a and theelectronic device 10b may be a mobile phone, a tablet, a computer, a projection system, and the like. The user can watch the video through theelectronic device 10a and theelectronic device 10b, and the size of the display window is adjusted. The maximum size of the physical size of the display window may be the physical size of the display screen.
The physical size of the display screen on theelectronic device 10a and the resolution of the display screen are configured in theelectronic device 10a, and the physical size of the display screen on theelectronic device 10a, the resolution of the display screen, and the resolution of the display window where the currently played video is located can be obtained by calling a system interface of theelectronic device 10 a. Further, in conjunction with the angular resolution of the human eye input or stored in theelectronic device 10a, an optimal resolution of the display window is calculated and transmitted to theserver 20.
Theelectronic device 10b is configured with the sampling resolution of the display screen on theelectronic device 10b, and the sampling resolution of the display screen on theelectronic device 10b may be obtained by calling a system interface of theelectronic device 10b, and the sampling resolution is sent to theserver 20.
Theelectronic device 10a and theelectronic device 10b are in communication connection with theserver 20, theserver 20 may be in communication connection with a plurality ofelectronic devices 10a of the same user or different users, obtain the optimal resolution of the same video source on the plurality ofelectronic devices 10a, obtain the maximum value of all the optimal resolutions by comparison, further perform operation processing in combination with the sampling resolution of theelectronic device 10b to obtain the encoding resolution of the video, re-encode the video according to the encoding resolution, generate re-encoded video data, and send the re-encoded video data to theelectronic device 10b to adjust the resolution of the video finally displayed in the display window of theelectronic device 10 b.
In some embodiments, the comparison to obtain the maximum of all the best resolutions may also be performed by theelectronic device 10 a. The further processing is performed in combination with the sampling resolution of theelectronic device 10b to obtain the encoding resolution of the video, and the processing may also be performed by theelectronic device 10 b. And generating the re-encoded video data after re-encoding the video according to the encoding resolution and sending the re-encoded video data to theelectronic device 10b, or theelectronic device 10b may execute the re-encoding by theelectronic device 10b, or after obtaining the encoding resolution, theelectronic device 10b directly inputs the encoding resolution into a video player or an application program capable of playing the video and switches to the encoding resolution, and further re-encoding the video is not required.
In some other embodiments, when theelectronic device 10a and theelectronic device 10b are the same device, theelectronic device 10a or theelectronic device 10b may not be in communication connection with theserver 20, and after theelectronic device 10a or theelectronic device 10b obtains the optimal resolution through calculation, theelectronic device 10a or theelectronic device 10b performs an arithmetic process by combining the optimal resolution and the sampling resolution of theelectronic device 10a or theelectronic device 10b, and displays and plays a video. Alternatively, theelectronic device 10a or theelectronic device 10b may also acquire the optimal resolution output by theelectronic device 10a of another video source, calculate the maximum value of the optimal resolution, further perform arithmetic processing to obtain the encoding resolution, and display and play the video.
Theserver 20 may be a server capable of storing a large amount of content data and capable of responding to theelectronic device 10a and theelectronic device 10 b. For example, theserver 20 can respond to an instruction sent by theelectronic device 10b to acquire the maximum value of the optimal resolution and send the maximum value of the optimal resolution to theelectronic device 10 b. Theserver 20 is further capable of acquiring and storing the optimal resolutions of the same video source uploaded by the plurality ofelectronic devices 10a, and comparing and determining the maximum value of the optimal resolutions.
Theserver 20 may be a physical terminal server, and is connected to theelectronic device 10a and theelectronic device 10b through a network in a communication manner via a certain communication protocol. Theserver 20 may be a cloud server, a cloud host, a cloud service platform, a cloud computing platform, or the like, and may be similarly communicatively connected to theelectronic device 10a and theelectronic device 10b via a network by a certain communication protocol. The network can be an ethernet or a local area network, the communication protocol can be TCP/IP, NETBEUI, IPX/SPX and other communication protocols, and the communication connection can be a wireless connection or a wired connection, and in particular, can be set according to actual needs.
Theserver 20 may be a separate computing and storage center/device, or may be a device/system integrated with theelectronic device 10a and theelectronic device 10 b. For example, when theelectronic device 10a, theelectronic device 10b, and theserver 20 are the same device, and the computing function of theserver 20 is included in theelectronic device 10a or theelectronic device 10b, theelectronic device 10a or theelectronic device 10b including the computing function of theserver 20 may be communicatively connected to the otherelectronic devices 10a, obtain an optimal resolution of the same video source of the otherelectronic devices 10a, and further adjust the encoding resolution of the video.
Specifically, the embodiments of the present invention will be further explained below with reference to the drawings.
An embodiment of the present invention provides a video resolution adjustment method, which can be executed by the apparatus in the system architecture, please refer to fig. 2, which shows a flowchart of a video resolution adjustment method applied according to the system architecture, and the method includes but is not limited to the following steps:
step 110: the method comprises the steps of obtaining a display screen and the physical size of a display window in the display screen.
The display screen is a device for displaying the decoded video data at a video receiving end, which may be theelectronic device 10 a. The physical size of the display screen, which may be in inches, may be obtained through a system interface of theelectronic device 10 a. It should be noted that the following examples of the present invention refer to physical length units of inches. If the physical size of the display screen cannot be directly obtained, the physical size can be obtained by obtaining the number of the screen physical pixel points and the corresponding pixel density.
The display window is a window used for displaying videos in the display screen, the physical size of the display window is smaller than or equal to the physical size of the display screen, and the physical size of the display window can be obtained by calculation according to the physical size of the display screen and the proportion of the display window in the display screen.
Step 120: and calculating the sight distance from human eyes to the display screen according to the physical size of the display screen.
In the embodiment of the invention, the distance from the human eyes to the display screen, namely the sight distance, is obtained without measurement by a distance sensor.
Step 130: and calculating the pixel density which can be recognized by the human eyes according to the angular resolution of the human eyes and the sight distance.
In the embodiment of the invention, after the sight distance from human eyes to the display screen is obtained through calculation, the pixel point distance which can be identified by the human eyes can be obtained through calculation by combining the angular resolution of the human eyes, and further, the pixel density can be obtained through calculation according to the pixel point distance. The pixel density represents the minimum detail of the image that the human eye can resolve in the range of the viewing distance, above which the human eye cannot resolve smaller details, and the user cannot resolve the difference between the image above the pixel density and the image at the pixel density.
Step 140: and calculating the optimal resolution of the video displayed by the display window according to the physical size of the display window and the pixel density.
In the embodiment of the invention, the pixel density is the maximum number of pixels which can be recognized by human eyes and has no inch, and further, the most reasonable video resolution, namely the optimal resolution, of the display window from the human eyes to the display screen in the sight distance can be calculated according to the pixel density and the physical size of the display window. When the video is displayed with the optimal resolution, the video can meet the requirement of human eyes on definition and can be matched with the size of a display window.
Step 150: and adjusting the encoding resolution of the video according to the optimal resolution.
In this embodiment of the present invention, when theelectronic device 10a and theelectronic device 10b are the same electronic device, theelectronic device 10a or theelectronic device 10b may directly compare the optimal resolution with the capture resolution of theelectronic device 10a or theelectronic device 10b, and take the minimum value as the video encoding resolution to display and play the video. In this case, theelectronic device 10a or theelectronic device 10b does not need to communicate with theserver 20.
Alternatively, in order to reduce the error problem that the optimal resolution calculated by the above method steps may have, the data of the optimal resolution of theelectronic device 10a is uploaded to theserver 20. Theserver 20 obtains the optimal resolution of all electronic devices capable of displaying and playing the same video source, compares the maximum value with the acquisition resolution of theelectronic device 10b, and analyzes the obtained maximum value to obtain the encoding resolution of the video. Theserver 20 or theelectronic device 10b re-encodes the video at the encoding resolution, and then transmits the re-encoded video data to theelectronic device 10b, and theelectronic device 10b decodes the video data and displays and plays the video at the encoding resolution.
It should be noted that the maximum value of the sampling resolution and the optimal resolution may be provided by the sameelectronic device 10a or theelectronic device 10b, or may be provided by a differentelectronic device 10a or theelectronic device 10b, and the sampling resolution is a sampling resolution of a display screen of theelectronic device 10a or theelectronic device 10b that finally displays a video at the encoding resolution. Specifically, the setting can be made by the actual application.
The embodiment of the invention provides a video resolution adjusting method, which comprises the steps of firstly obtaining the physical size of a display screen, calculating the visual distance from human eyes to the display screen, then calculating the pixel density which can be identified by the human eyes according to the angular resolution and the visual distance of the human eyes, then calculating the optimal resolution of a video displayed by a display window according to the physical size and the pixel density of the display window, and finally adjusting the coding resolution of the video displayed by the display window which meets the visual characteristics of the human eyes according to the optimal resolution, wherein the coding resolution can meet the requirements of the human eyes on the definition and is matched with the size of the display window.
In some embodiments, please refer to fig. 3, which illustrates a sub-flowchart ofstep 110 of the method shown in fig. 2, whereinstep 110 comprises:
step 111: and acquiring the width and the height of the display screen.
Step 112: and calculating the physical size of the display screen according to the width and the height of the display screen.
The physical size of the display screen refers to the diagonal length of the display screen. Therefore, after the width and the height of the display screen are obtained through the system port of theelectronic device 10a, the physical size of the display screen can be calculated according to the width and the height of the display screen. The calculation relation between the physical size of the display screen and the width and height of the display screen is as follows:
MonSize=(MonW×MonW+MonH×MonH)1/2
wherein MonSize represents the physical size of the display screen, MonW represents the width of the display screen, and MonH represents the height of the display screen.
In some embodiments, with continued reference to fig. 2, thestep 110 further includes:
step 113: and acquiring the resolution ratios of the display screen and a display window in the display screen.
Step 114: and calculating the ratio of the display window in the display screen according to the display screen and the resolution of the display window in the display screen.
In the embodiment of the present invention, the resolution of the display screen where the display window currently displaying the played video is located and the resolution of the display window may be obtained by calling a system interface, and further, the ratio of the display window in the display screen is calculated. The resolution of the display screen comprises the width and the height of the resolution of the display screen, and respectively represents the horizontal pixel number and the vertical pixel number of the display screen. The resolution of the display window comprises the width and the draft of the resolution of the display window, and respectively represents the number of horizontal pixels and the number of vertical pixels of the display window.
And, the ratio includes a wide ratio and a high ratio. Therefore, the calculation relationship between the display window occupation ratio on the display screen and the resolution of the display window in the display screen is as follows:
WScale=WndW/DisplaW
HScale=WndH/DisplaH
wherein WScale represents the width ratio, WndW represents the width of the display window resolution, displayw represents the width of the display screen resolution, HScale represents the height ratio, WndH represents the height of the display window resolution, and displayh represents the height of the display screen resolution.
Step 115: and calculating the physical size of the display window according to the ratio and the physical size of the display screen.
The physical dimensions of the display window include a width and a height of the display window, and therefore, in the embodiment of the present invention, thestep 115 specifically includes: calculating the width of the display window according to the width of the display screen and the width proportion; and calculating the height of the display window according to the height of the display screen and the high proportion. The calculation relationship between the physical size of the display window and the physical size of the display screen and the calculation relationship between the physical size of the display window and the physical size of the display screen are as follows:
PhyW=WScale*MonW
PhyH=HScale*MonH
wherein phyW represents the width of the display window, WScale represents the width scale, MonW represents the width of the display screen, phyH represents the height of the display window, HScale represents the high scale, and MonH represents the height of the display screen.
In some embodiments, please refer to fig. 4, which illustrates a sub-flowchart ofstep 120 of the method of fig. 2, whereinstep 120 comprises:
step 121: and acquiring the optimal visual angle between the human eyes and the display screen.
In the embodiment of the invention, the optimal viewing angle is the clearest and most comfortable viewing angle for the human eyes to see when the human eyes watch an object. The optimal viewing angle is 30 ° recommended by the society of motion picture and television engineers.
Step 122: and judging whether the physical size of the display screen is larger than a preset threshold value. If yes, jumping to step 123; if so, go to step 124.
In the embodiment of the present invention, since the size of the physical size of the display screen may affect the visual field range of human eyes, it is further necessary to further determine whether the physical size of the display screen is greater than a preset threshold. When the physical size of the display screen is greater than the preset threshold, the user needs to keep at least a certain distance from the electronic device 10 to make the display screen within the visual field range of human eyes, and therefore, the visual distance from the human eyes to the display screen needs to be calculated according to the optimal visual angle between the human eyes and the display screen, and the process goes to step 123. When the physical size of the display screen is smaller than the preset threshold, the display screen can be accommodated in the visual field range of human eyes under most use conditions, so that the visual distance from the human eyes to the display screen does not need to be calculated according to the optimal visual angle, and thestep 124 is skipped. The preset threshold may be 18 inches, and in an actual application scenario, other values may be taken according to actual needs.
It should be noted that the viewing distance is not necessarily the actual distance between the human eye and the display screen, and the viewing distance is the calculated optimal viewing distance between the human eye and the display screen, and at the viewing distance, the user can view the image with the clearest and the best display effect. Since the user usually places theelectronic device 10a as much as possible in the optimal visual field range of the human eyes when using theelectronic device 10a, the calculated visual distance can be used as the visual distance for further calculation to obtain the optimal resolution.
Step 123: and calculating the visual distance from the human eyes to the display screen according to the width of the display screen and the optimal visual angle.
When the physical size of the display screen is larger than the preset threshold, please refer to fig. 5, which shows a schematic diagram of a relationship between the viewing distance and the optimal viewing angle and the width of the display screen, and the viewing distance can be calculated according to a trigonometric function relationship between the line of sight of human eyes and an included angle formed between two ends of the display screen in the width direction. Thus, the relationship between the viewing distance and the width and optimal viewing angle of the display screen is:
ViewDist=MonW÷(2*tan(α/2))
wherein ViewDist represents the viewing distance, MonW represents the width of the display screen, α represents the optimal viewing angle, and α is taken to be 30 °.
In an actual application scenario, the optimal viewing angle α may also be set according to actual needs, and need not be limited by the embodiment of the present invention.
Step 124: and calculating the sight distance from the human eyes to the display screen according to the physical size of the display screen.
When the physical size of the display screen is smaller than the preset threshold, converting according to the result of the statistical distance measurement data, and obtaining the relation between the sight distance and the physical size of the display screen as follows:
ViewDist=1.2(0.6*MonSize+5.6)+8
wherein ViewDist represents the viewing distance and MonSize represents the physical size of the display screen.
In some embodiments, please refer to fig. 6, which illustrates a sub-flowchart ofstep 130 of the method shown in fig. 2, wherein thestep 130 comprises:
step 131: an angular resolution of the human eye is acquired.
The angular resolution of the human eye refers to the resolving power of the imaging system of the human eye, i.e. the resolving power of the retina. In an embodiment of the invention, the angular resolution is taken to be 60 seconds, which is the angular resolution of a normal-vision human eye.
Step 132: and calculating the pixel point distance which can be identified by the human eyes according to the angular resolution and the sight distance of the human eyes.
In the embodiment of the invention, the distance between two minimum pixel points which can be identified by human eyes can be calculated according to the angular resolution and the sight distance of the human eyes. Referring to fig. 7, a schematic diagram of a relationship between a pixel pitch and a line of sight and an angular resolution of a human eye is shown, and the relationship between the pixel pitch and the line of sight and the angular resolution of the human eye can be obtained according to a trigonometric function relationship as follows:
W=2*ViewDist*tan(θ/2)
wherein W represents the pixel dot pitch, ViewDist represents the apparent pitch, θ represents the angular resolution of the human eye, and θ is taken to be 60 seconds.
In an actual application scenario, the angular resolution θ of the human eye may also be set according to actual needs, and is not limited by the definition of the embodiment of the present invention.
Step 133: and calculating the pixel density which can be identified by the sight distance and the human eyes according to the pixel point distance which can be identified by the human eyes.
Further, the pixel density recognizable by human eyes can be calculated for the visual range, which is 1 inch. The relationship between the pixel density and the pixel dot pitch is as follows:
PPI=1/W
wherein PPI represents the pixel density and W represents the pixel dot pitch.
In some embodiments, the optimal resolution includes video bandwidth and video height, and therefore, thestep 140 specifically includes: calculating the view bandwidth according to the width of the display window and the pixel density; and calculating the video height according to the height of the display window and the pixel density. The relationship between the optimal resolution and the physical size of the display window and the pixel density is as follows:
VideoW=PhyW*PPI
VideoH=PhyH*PPI
wherein, video represents the video bandwidth, PhyW represents the width of the display window, video represents the video height, PhyH represents the height of the display window, and PPI represents the pixel density.
In some embodiments, please refer to fig. 8, which illustrates a sub-flowchart ofstep 150 of the method of fig. 2, whereinstep 150 comprises:
step 151: and acquiring the maximum value of the optimal resolution in all receiving ends of the same video source.
In the embodiment of the present invention, there may be multiple video receivers for displaying and playing the same video source, and the video receivers may be theelectronic device 10a described above. At this time, the optimal resolutions fed back by all receiving ends can be obtained, and after comparison and judgment, the maximum value of the optimal resolutions fed back by all receiving ends is obtained. The comparing and determining process may be executed in theelectronic device 10b or in theserver 20, and may count the maximum value of the optimal resolution at regular time.
Step 152: and acquiring the acquisition resolution of the video.
In the embodiment of the present invention, the acquisition resolution of theelectronic device 10a or 10b where the video source is located needs to be obtained, where the acquisition resolution is the acquisition resolution currently used by the camera. For example, when theelectronic device 10a or 10b where the video source is located is a mobile terminal and a front-facing camera is adopted, the acquisition resolution is the acquisition resolution of the front-facing camera; and when the rear camera is adopted, acquiring the acquisition resolution of the rear camera according to the current focal range of the rear camera.
Step 153: and calculating the coding resolution according to the maximum value of the optimal resolution and the acquisition resolution.
Further, the maximum value of the optimum resolution and the size of the acquisition resolution are compared, and the small value of the maximum value and the small value is taken as the encoding resolution. Specifically, when the maximum value of the optimal resolution is smaller than the acquisition resolution, the maximum value of the optimal resolution is taken as the encoding resolution; and when the acquisition resolution is smaller than the maximum value of the optimal resolution, taking the acquisition resolution as the coding resolution.
Step 154: and re-encoding the video according to the encoding resolution, and outputting the re-encoded video data.
Step 155: decoding and displaying the re-encoded video data in the display window.
And further, inputting the coding resolution into a video coder, recoding the video, outputting the recoded video data, and finally, decoding the video data and displaying and playing the decoded video data in a display window of a display screen. The video encoder may be provided in theelectronic device 10b or in theserver 20.
An embodiment of the present invention further provides an electronic device, please refer to fig. 9, which shows a hardware structure of an electronic device capable of executing the video resolution adjusting method described in fig. 2 to fig. 8. The electronic device 10 may be theelectronic device 10a and/or theelectronic device 10b shown in fig. 1.
The electronic device 10 includes: at least one processor 11; and a memory 12 communicatively coupled to the at least one processor 11, which is exemplified by one processor 11 in fig. 9. The memory 12 stores instructions executable by the at least one processor 11, and the instructions are executed by the at least one processor 11 to enable the at least one processor 11 to perform the video resolution adjustment method described above with reference to fig. 2 to 8. The processor 11 and the memory 12 may be connected by a bus or other means, and fig. 9 illustrates the connection by a bus as an example.
The memory 12, which is a non-volatile computer-readable storage medium, may be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as program instructions/modules corresponding to the video resolution adjusting method in the embodiment of the present application. The processor 11 executes various functional applications of the server and data processing by running the nonvolatile software programs, instructions and modules stored in the memory 12, that is, implements the video resolution adjustment method of the above-described method embodiment.
The memory 12 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the video resolution adjustment method, and the like. Further, the memory 12 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some embodiments, the memory 12 optionally includes a memory remotely located from the processor 11, and these remote memories may be connected to the video resolution adjustment device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The one or more modules are stored in the memory 12 and, when executed by the one or more processors 11, perform the video resolution adjustment method in any of the method embodiments described above, e.g., performing the method steps of fig. 2-8 described above.
The product can execute the method provided by the embodiment of the application, and has the corresponding functional modules and beneficial effects of the execution method. For technical details that are not described in detail in this embodiment, reference may be made to the methods provided in the embodiments of the present application.
Embodiments of the present application also provide a non-transitory computer-readable storage medium storing computer-executable instructions for execution by one or more processors, e.g., to perform the method steps of fig. 2-8 described above.
Embodiments of the present application further provide a computer program product comprising a computer program stored on a non-volatile computer-readable storage medium, the computer program comprising program instructions that, when executed by a computer, cause the computer to perform a video resolution adjustment method in any of the above-described method embodiments, for example, to perform the method steps of fig. 2 to 8 described above.
The embodiment of the invention provides a video resolution adjusting method, electronic equipment and a storage medium, wherein the method comprises the steps of firstly obtaining the physical size of a display screen, calculating the visual distance from human eyes to the display screen, then calculating the pixel density which can be identified by the human eyes according to the angular resolution and the visual distance of the human eyes, then calculating the optimal resolution of a video displayed by a display window according to the physical size and the pixel density of the display window, and finally adjusting the coding resolution of the video displayed by the display window according to the optimal resolution, wherein the coding resolution can meet the requirement of the human eyes on the definition and is matched with the size of the display window.
It should be noted that the above-described device embodiments are merely illustrative, where the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a general hardware platform, and certainly can also be implemented by hardware. It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware related to instructions of a computer program, which can be stored in a computer readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; within the idea of the invention, also technical features in the above embodiments or in different embodiments may be combined, steps may be implemented in any order, and there are many other variations of the different aspects of the invention as described above, which are not provided in detail for the sake of brevity; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.