Video processing method, device, computer equipment and medium

By obtaining the attribute information of the video and playback windows, determining the appropriate transmission code stream type and code stream level, solving the problems of video playback lag and image quality balance, and achieving smoother video playback.

CN117729357BActive Publication Date: 2025-02-25SHUXING TECH (BEIJING) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310409342.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-17
Publication Date
2025-02-25
Estimated Expiration
2043-04-17

AI Technical Summary

Technical Problem

In video playback scenarios, how to balance video playback lag and video quality, especially when transmission bandwidth is limited.

Method used

By obtaining the attribute information of the target video and the target playback window, including the window size and pixel density, the appropriate transmission code stream type and code stream level are determined, thereby optimizing the transmission code stream of the video.

Benefits of technology

While ensuring the quality of the video, it reduces the sense of stuttering video playback and improves the smoothness of video playback.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117729357B_ABST
    Figure CN117729357B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses a video processing method, apparatus, computer equipment and medium, wherein the method comprises: obtaining a target video to be played, and obtaining window size information of a target playback window for playing the target video; the target playback window is a playback window of a target device used to play the target video; determining a target bitstream type of a transmission bitstream for transmitting the target video based on the window size information; obtaining a pixel density of the target device, and determining a pixel density of a target playback window based on the pixel density of the target device; determining a target bitstream gear under the target bitstream type based on the target bitstream type and the pixel density of the target playback window, and playing the target video based on the target transmission bitstream under the target bitstream gear, which can reduce the sense of video playback jamming as much as possible and improve the smoothness of video playback while ensuring video quality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a video processing method, apparatus, computer equipment and medium. Background Art

[0002] With the rapid development of computer technology and multimedia technology, online video playback has become a high-frequency and widely used function in people's daily lives, including video playback in short videos, online live broadcasts, online TV and other scenarios. At present, with the massive growth in the number of users and the gradual increase in users' demand for high-definition video quality, transmission bandwidth has become one of the main bottlenecks of online video playback services. Generally, the higher the transmission bit rate of the video, the better the video quality when the video is played, and the higher the transmission bit rate, the more transmission bandwidth is required. If the transmission bandwidth is insufficient, it may cause video playback to freeze. Therefore, how to balance video playback freezes and video quality in video playback scenarios has become a current research hotspot. Summary of the invention

[0003] The embodiments of the present application provide a video processing method, apparatus, computer equipment and medium, which can reduce the freezing of video playback as much as possible and improve the smoothness of video playback while ensuring the video quality.

[0004] The first aspect of the embodiment of the present application discloses a video processing method, the method comprising:

[0005] Acquire a target video to be played, and acquire window size information of a target playback window used to play the target video; the target playback window is a playback window of a target device used to play the target video;

[0006] Determine a target bitstream type of a transport bitstream for transmitting the target video based on the window size information;

[0007] Acquire the pixel density of the target device, and determine the pixel density of the target playback window based on the pixel density of the target device;

[0008] A target bitstream gear under the target bitstream type is determined based on the target bitstream type and the pixel density of the target playback window, and the target video is played based on the target transmission bitstream under the target bitstream gear.

[0009] A second aspect of an embodiment of the present application discloses a video processing device, the device comprising:

[0010] An acquisition unit, used to acquire a target video to be played, and acquire window size information of a target playback window used to play the target video; the target playback window is a playback window of a target device used to play the target video;

[0011] A first determining unit, configured to determine a target bitstream type of a transport bitstream for transmitting the target video based on the window size information;

[0012] A second determining unit, configured to obtain a pixel density of the target device, and determine a pixel density of the target playback window based on the pixel density of the target device;

[0013] The third determining unit is used to determine the target bitstream gear under the target bitstream type based on the target bitstream type and the pixel density of the target playback window, and play the target video based on the target transmission bitstream under the target bitstream gear.

[0014] A third aspect of an embodiment of the present application discloses a computer device, comprising a processor and a memory, wherein the memory is used to store a computer program, the computer program comprises program instructions, and the processor is configured to call the program instructions to execute the method of the first aspect above.

[0015] A fourth aspect of an embodiment of the present application discloses a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor executes the method of the first aspect.

[0016] The fifth aspect of the embodiments of the present application discloses a computer program product or a computer program, wherein the computer program product or the computer program comprises program instructions, and when the program instructions are executed by a processor, the method of the first aspect is implemented.

[0017] In an embodiment of the present application, a target video to be played can be obtained, and the window size information of a target playback window for playing the target video can be obtained; the target playback window is the playback window of the target device used to play the target video; the target stream type of the transmission stream used to transmit the target video can also be determined based on the window size information; the pixel density of the target device is obtained, and the pixel density of the target playback window is determined based on the pixel density of the target device; further, the target stream gear under the target stream type can be determined based on the target stream type and the pixel density of the target playback window, and the target video can be played based on the target transmission stream under the target stream gear. In the above manner, the device attribute information of the device playing the video (such as the pixel density of the device, the window size of the playback window) can be combined to select a stream with a suitable bit rate for the video, which can reduce the sense of stuttering of the video playback as much as possible while ensuring the video quality, and improve the smoothness of the video playback. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0019] Figure 1 is a schematic diagram of the architecture of a video processing system provided in an embodiment of the present application;

[0020] Figure 2 It is a flowchart of a video processing method provided by an embodiment of the present application;

[0021] Figure 3 This is a schematic diagram of determining and obtaining a playback requirement provided by an embodiment of the present application;

[0022] Figure 4 is a flowchart of another video processing method provided in an embodiment of the present application;

[0023] Figure 5 It is a flowchart of another video processing method provided in an embodiment of the present application;

[0024] Figure 6 is a structural schematic diagram of a video processing device provided in an embodiment of the present application;

[0025] Figure 7 It is a structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0026] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.

[0027] The embodiment of the present application proposes a video processing scheme; the principle of the scheme is as follows: after obtaining the target video to be played, the pixel density of the target device used to play the target video and the window size information of the target playback window can also be obtained, so as to determine the target transmission code stream of the target video using the pixel density of the target device and the window size information of the target playback window, so that the target video can be played using the target transmission code stream. Among them, the target playback window is the playback window of the target device used to play the target video. In one embodiment, the target code stream type of the transmission code stream used to transmit the target video can be determined using the window size information, and the pixel density of the target playback window can be determined using the pixel density of the target device; further, the target transmission code stream of the target video can be determined based on the target code stream type and the pixel density of the target playback window, and then the target video can be played using the target transmission code stream. For example, the target code stream gear under the target code stream type can be determined based on the target code stream type and the pixel density of the target playback window, and then the target video can be played based on the target transmission code stream under the target code stream gear. Through the above implementation, the device attribute information of the device that plays the video (such as the pixel density of the device, the window size of the playback window) can be combined to select a bit stream with a suitable bit rate for the video. While ensuring the video quality, the playback of the video can be reduced as much as possible, thereby improving the smoothness of the video playback.

[0028] In a specific implementation, the execution subject of the above-mentioned video processing solution can be a computer device, which can be a terminal or a server. The terminal mentioned here can be a smart phone, tablet computer, laptop computer, desktop computer and other devices; the terminal can run a client (platform) with a video playback function, for example, the client can be a shopping client, an information stream client, a multimedia client, etc. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and basic cloud computing services such as big data and artificial intelligence platforms, etc.

[0029] For example, when the computer device is a server, the embodiment of the present application provides a video processing system, such as Figure 1As shown, the video processing system may include at least one terminal and at least one server; the terminal can obtain the target video to be played, and upload the obtained target video to the server (i.e., a computer device), so that the server can obtain the target video and determine the target transmission code stream required for playing the target video, and then can play the target video based on the target transmission code stream, that is, the server can use a video processing solution to achieve the playback of the target video.

[0030] It should be noted that the data related to user information in the embodiments of the present application are all data authorized by the user.

[0031] See also Figure 2 , Figure 2 is a flow chart of a video processing method provided by an embodiment of the present application. The video processing method described in this embodiment can be applied to the above-mentioned computer device, such as Figure 2 As shown, the method may include:

[0032] S201, obtaining a target video to be played, and obtaining window size information of a target playback window for playing the target video.

[0033] The target playback window may be a playback window of a target device used to play the target video. The target device may be any device with a playback function, such as a target device of any device type, a mobile phone, a tablet, a computer, a television, etc., and the target device may be any model of a device under a device type. For example, if the device type of the target device is a mobile phone, the target device may be any model of mobile phones such as mobile phone A or mobile phone B; for another example, if the device type of the target device is a television, the target device may be any model of televisions such as television A or television B.

[0034] The window size information may include the window height and window width of the target playback window; the window size information may be recorded as (H, W) or H*W, where H represents the window height and W represents the window width. For example, if the target device is a mobile phone, the window size information of the playback window of the mobile phone when playing a video may be obtained; for another example, if the target device is a television, the window size information of the playback window of the television when playing a video may be obtained. The window size information may also be understood as the resolution of the playback window. For example, the resolution of a laptop is 3024*1964, and this information is the window size information of the playback window corresponding to the laptop.

[0035] In one implementation, when a playback requirement for a target video is obtained, step S201 may be triggered.

[0036] Optionally, a play request for a target video may be obtained on a computer device, and the play requirement for the target video may be determined. The play request may be triggered by an object (which may refer to any user) performing a related operation on a user operation interface. For example, when an object needs to play the target video, a related operation may be performed on the user operation interface output by the terminal used to send a play request for the target video to the computer device. For example, see Figure 3 As shown, a user operation interface may be displayed on the terminal screen of the terminal used by the target, and the user operation interface may at least include a video input area 301 and a confirmation control 302. If the target object wants to play the target video, the target video related information may be input in the video input area 301 (such as the target video directly, or the link address corresponding to the target video); then, a trigger operation (such as clicking, pressing, etc.) may be performed on the confirmation control 302; after the terminal detects that the confirmation control 302 is triggered, the target video may be obtained based on the information in the input area 301, and after the terminal obtains the target video, a play request for the target video may be sent to the computer device.

[0037] Optionally, the play request may be a request initiated by the above-mentioned client with a play function (such as a multimedia client), for example, the request may be a play request (play instruction) for a target video.

[0038] Optionally, when a playback timing task is triggered, it can be determined that the playback demand for the target video is obtained. For example, a playback timing task can be set, and when the trigger condition in the playback timing task is triggered, it can be determined that the playback demand is obtained. In one embodiment, a large number of videos can be stored in a certain designated area, and the trigger condition can be that the current time reaches the preset processing time, or the remaining storage space of the designated storage area exceeds the preset remaining storage space, etc. Among them, the target video can be a video in the designated area.

[0039] S202: Determine a target bitstream type of a transmission bitstream for transmitting a target video based on the window size information.

[0040] In one implementation, the video resolution (such as the target video resolution) suitable for playing the target video can be determined based on the window size information; then, the mapping relationship between the reference bitstream type and the reference video resolution can be obtained, and based on the mapping relationship and the target video resolution, the target bitstream type of the transmission bitstream used to transmit the target video can be determined. For example, the reference bitstream type consistent with the target bitstream type can be found from the mapping relationship between the reference bitstream type and the reference video resolution, and the reference video resolution corresponding to the reference bitstream type found is used as the target video resolution. Among them, one reference video resolution in the mapping relationship corresponds to one reference bitstream type. For example, the reference video resolution in the mapping relationship can include 540p, 720p, 1080p, etc., and the reference video resolution 540p corresponds to the reference bitstream type bit V1.

[0041] S203: Obtain the pixel density of the target device, and determine the pixel density of the target playback window based on the pixel density of the target device.

[0042] Among them, pixel density refers to the PPI (Pixels Per Inch, the number of pixels per inch) of the display device, which is an important indicator for evaluating the display clarity of the display device. The higher the PPI value, the higher the density of the display device can display images, and the higher the display density, the higher the degree of realism, or the richer the details of the video picture. In the embodiment of the present application, pixel density can also be referred to as PPI; the display device here can refer to a device with a display screen, and can also be understood as the above-mentioned device with a playback function, that is, the display device can also be referred to as a playback device, such as a mobile phone, a tablet, a computer, a TV, etc. Usually, there are obvious differences in PPI between different types of display devices. For example, the relevant factors may be the viewing distance of the user and the screen size of the display screen of the device (i.e., the window size for playing the video). For example, the display screen of the mobile phone is small, and the user usually watches the display screen at a close distance, so the PPI value of the mobile phone is generally higher (for example, the pixel density of mobile phone A is 463), while the display screen of the TV is larger, and the user's viewing distance is farther, so the PPI value of the TV is relatively low (for example, the pixel density of high-definition LCD TV A is 80). Moreover, the display screens of the same type of devices may have different corresponding pixel densities due to issues such as the manufacturer or price positioning. For example, the pixel density of the display screen of mobile phone A produced by manufacturer a is 450, while the pixel density of the display screen of mobile phone A produced by manufacturer b is 461.

[0043] In summary, different playback devices can have different pixel densities. The device type of the playback device (such as mobile phones, TVs, etc.), the screen quality of the display screen, the color display scheme (such as 10-bit HDR, wide color gamut), etc. will affect the user experience; and to achieve the same level of picture quality experience, different playback devices will have different requirements for the video bitstream quality. Generally, the higher the pixel density of the playback device, the looser the requirements for bitstream quality. Then, under the premise of ensuring a certain picture quality, the video transmission bitstream can be reduced, thereby reducing the transmission bandwidth required, thereby reducing the sense of stuttering in video playback and ensuring the smoothness of video playback.

[0044] Based on this, we can know that we can obtain the pixel density of the target device, and match the target video with a suitable transmission bitstream in combination with the pixel density of the target device, so as to ensure the smoothness of video playback as much as possible while ensuring a certain image quality. It can be understood that the pixel density is a property of the device itself, and the corresponding pixel density can be obtained from the property information of the target device.

[0045] After the pixel density of the target device is acquired, the pixel density of the target playback window may be further determined based on the pixel density of the target device.

[0046] In one implementation, the pixel density of the target device may be determined as the pixel density of the target playback window.

[0047] In one implementation, considering that the video is only played in the playback window of the playback device, the size of the playback window is also directly related to the perception of the video quality. For example, the display screen of a TV usually plays the video in full screen by default, but on the computer (PC) and mobile phone sides, the video is played through an application (APP) or a web page, and in many cases the full screen video is not played without using it. Based on this, it can be seen that the actual pixel density (PPI) of the video during playback can be estimated by combining the size of the playback window and the pixel density (PPI) of the playback device itself. In summary, in order to determine the transmission bitstream of the target video using a more accurate pixel density, the pixel density that is more suitable for the target playback window can also be matched in combination with the window size of the target playback window.

[0048] Optionally, first, the target video resolution of the target video can be obtained, such as obtaining a mapping relationship between a reference bitstream type and a reference video resolution, and determining the target video resolution corresponding to the target bitstream type based on the mapping relationship. Alternatively, the target video resolution obtained in the process of determining the target bitstream type in step S202 can be directly obtained. The target video resolution can include target video size information for the target video, and the target video size information can include a target video height and a target video width. The target video size information can be recorded as (h, w) or h*w, where h represents the target video height and w represents the target video width. For example, if the target video resolution is 540p, the corresponding target video size information is (960, 540); for another example, if the target video resolution is 720p, the corresponding target video size information is (1280, 720).

[0049] After the target video size information is obtained, the pixel density of the target playback window can be determined based on the pixel density of the target device, the target video size information, and the window size information. In one embodiment, a reference value can be first determined based on the target video size information and the window size information, and then the pixel density of the target playback window can be determined based on the reference value and the pixel density of the target device. For example, the product of the reference value and the pixel density of the target device can be determined as the pixel density of the target playback window.

[0050] The specific implementation of determining the reference value based on the target video size information and the window size information may include the following methods.

[0051] Method 1: The ratio between the target video height in the target video size information and the window height in the window size information can be used as a reference value. In this implementation, the computer device can calculate the pixel density of the target playback window using the following formula (1):

[0052] WindowPPI=h / H*X(1)

[0053] Among them, WindowPPI represents the pixel density of the target playback window, h represents the target video height in the target video size information, H represents the window height in the window size information, and X represents the pixel density of the target device.

[0054] Method 2: The ratio between the target video width in the target video size information and the window width in the window size information can be used as a reference value. In this implementation, the computer device can calculate the pixel density of the target playback window using the following formula (2):

[0055] WindowPPI=w / W*X(2)

[0056] Method 3: The ratio between the target video width in the target video size information and the window width in the window size information can be calculated, and the ratio between the target video height in the target video size information and the window height in the window size information can be calculated; then the maximum of the two ratios is used as a reference value. In this implementation, the computer device can calculate the pixel density of the target playback window by the following formula (3):

[0057] WindowPPI=max(h / H,w / W)*X(3)

[0058] For example, the target video resolution of the target video is 1080p, that is, the corresponding target video size information is (1920, 1080), the window size information of the target playback window is (3024, 1964), and the pixel density (PPI) of the target device is 271; when the target video is played, the pixel density of the target playback window can be max (1920 / 3024, 1080 / 1964) * 271 = 172, that is, 172 video pixels can actually be accommodated in a screen with a unit area of ​​1 inch.

[0059] S204, determining a target bitstream level under the target bitstream type based on the target bitstream type and the pixel density of the target playback window, and playing the target video based on the target transmission bitstream under the target bitstream level.

[0060] In one implementation, the target bitstream level under the target bitstream type may be determined based on the target bitstream type and the pixel density of the target playback window.

[0061] Optionally, first, a mapping relationship between a reference pixel density and a reference bitstream gear that matches the target bitstream type can be obtained. In one embodiment, the mapping relationship can be preset, and for each category (i.e., each bitstream type), the database can maintain a mapping table (lookup table) from the pixel density of a playback window (such as WindowPPI) to the bitstream gear, and the mapping table is a manifestation of the above-mentioned mapping relationship. In a specific implementation, each bitstream type can be associated with a corresponding mapping table and stored. When a mapping table needs to be obtained, the mapping table corresponding to the target bitstream type can be searched from the database, and the obtained mapping table is the required mapping relationship.

[0062] For example, for a 720p bitstream type, a mapping table (i.e., a mapping relationship) from WindowPPI to bitstream level may be as shown in Table 1:

[0063] Table 1

[0064] WindowPPI Stream level [0,280] high [280,320] middle [320,+∞] Low

[0065] For example, if the target code stream type is 720p type, the corresponding mapping relationship can be obtained from the database based on this parameter, such as the mapping relationship shown in Table 1.

[0066] After obtaining the mapping relationship between the reference pixel density and the reference bitstream gear that matches the target bitstream type, the target bitstream gear under the target bitstream type can be determined based on the pixel density of the target playback window and the mapping relationship between the reference pixel density and the reference bitstream gear. For example, the reference pixel density that is consistent with the pixel density of the target playback window can be found from the mapping relationship between the reference pixel density and the reference bitstream gear, and the reference bitstream gear corresponding to the found reference pixel density can be determined as the target bitstream gear under the target bitstream type.

[0067] Exemplarily, assuming that the mapping relationship obtained is as shown in Table 1, if the pixel density of the target playback window is 250, the target bitrate gear can be determined to be high through the mapping relationship shown in Table 1; if the pixel density of the target playback window is 450, the target bitrate gear can be determined to be low through the mapping relationship shown in Table 1.

[0068] Optionally, as mentioned above, the pixel density of different device types may also be different. In order to more accurately determine the target bitstream gear corresponding to the pixel density of the target playback window, the corresponding target bitstream gear may be determined in combination with the device type of the target device. For ease of description, the device type of the target device may be referred to as the target device type. Based on this, the specific implementation of determining the target bitstream gear in step S204 may be described as follows.

[0069] First, the target device type of the target device used to play the target video can be obtained, and the target device type can be any one of a mobile phone, a computer, a tablet, a TV, etc. Then, the mapping relationship between the reference pixel density and the reference bitstream gear that matches the target device type and the target bitstream type can be obtained. In one embodiment, the mapping relationship can be pre-set, and for each category (i.e., a category composed of a device type and a bitstream type), the database can maintain a mapping table from the pixel density of a playback window to the bitstream gear, and the mapping table is a manifestation of the above-mentioned mapping relationship. In a specific implementation, the device type and the bitstream type can be associated with the corresponding mapping table and stored. When a certain mapping table needs to be obtained, the mapping table corresponding to the target device type and the target bitstream type can be found from the database, and the obtained mapping table is the required mapping relationship.

[0070] For example, if the device type is a mobile phone and the bitstream type is 720p, the mapping table (i.e., mapping relationship) from WindowPPI to bitstream level may be as shown in Table 2:

[0071] Table 2

[0072] WindowPPI Stream level [0,370] high [370,420] middle [420,+∞] Low

[0073] For example, if the target device type is a mobile phone and the target code stream type is a 720p type, a corresponding mapping relationship may be obtained from a database based on these two parameters. For example, the mapping relationship may be shown in Table 2.

[0074] After obtaining the mapping relationship between the reference pixel density and the reference bitstream gear that matches the target device type and the target bitstream type, the target bitstream gear under the target bitstream type can be determined based on the pixel density of the target playback window and the mapping relationship between the reference pixel density and the reference bitstream gear. For example, the reference pixel density that is consistent with the pixel density of the target playback window can be found from the mapping relationship between the reference pixel density and the reference bitstream gear, and the reference bitstream gear corresponding to the found reference pixel density can be determined as the target bitstream gear under the target bitstream type.

[0075] Exemplarily, assuming that the mapping relationship obtained is as shown in Table 2, if the pixel density of the target playback window is 350, the target bitrate gear can be determined to be high through the mapping relationship shown in Table 2; if the pixel density of the target playback window is 400, the target bitrate gear can be determined to be medium through the mapping relationship shown in Table 1.

[0076] It is understandable that, for a device, the pixel density of the playback window and the bitrate level may be negatively correlated, as shown in the data in Tables 1 and 2 above, that is, the lower the pixel density of the playback window, the higher the corresponding bitrate level may be, and the higher the pixel density of the playback window, the lower the corresponding bitrate level may be. In other words, if the pixel density of the playback window of the device is higher, the requirement for bitrate quality will be looser. In this case, a lower bitrate level may be set so that a lower transmission bitrate may be used to play the video later. In this way, while ensuring the quality of the video picture, the transmission bitrate may be reduced, thereby reducing the corresponding transmission bandwidth, thereby reducing the sense of stuttering in video playback and ensuring the smoothness of video playback.

[0077] As mentioned above, the mapping table in the embodiment of the present application can be a small database maintained on the server side. The mapping table in the database can be statistically summarized through a large number of subjective tests and user feedback data in advance. It can be seen that by using the mapping table query, the video processing method has strong scalability. For example, how to determine the bit stream gear of the corresponding transmission bit stream according to WindowPPI, there may be many specific mapping methods, and each user has different viewing habits and preferences, and the optimal strategy may vary from person to person. In addition, the mapping table maintenance is relatively convenient, and it can adapt to almost any mapping method, and can be customized based on the habits of different users.

[0078] It should be noted that, when the above classification of device types is performed, in one embodiment, the classification can be based on the purpose of the device, such as the device type can be divided into mobile phones, large screens, tablets, etc. In another embodiment, on the basis of the above classification of device purposes, further subdivision can be made for devices with high usage frequency; for example, mobile phones are devices with high usage frequency, and the screen quality of each manufacturer is significantly different, so mobile phones need to be divided twice; illustratively, device types can be divided into Class A mobile phones - iPhone, Class B mobile phones, other types of mobile phones, folding screen mobile phones, notebooks, desktops, tablets, TVs, etc. The embodiment of this application does not specifically limit the classification of device types.

[0079] In one implementation, after determining the target bitstream gear of the target video, the target video can be played based on the target transmission bitstream under the target bitstream gear. Among them, the transmission bitstream under different bitstream gears is different, and the mapping relationship between the bitstream gear and the transmission bitstream can be preset; the bitstream gear is positively correlated with the transmission bitstream, that is, the higher the bitstream gear, the higher the corresponding transmission bitstream, and the lower the bitstream gear, the lower the corresponding transmission bitstream. It should be understood that the transmission bitstream here can be understood as the transmission bitrate. Based on this, it can be seen that after determining the target bitstream gear, the mapping relationship can be obtained, and the corresponding target transmission bitstream can be determined based on the mapping relationship. In one embodiment, the target video can be encoded and decoded based on the target transmission bitstream to achieve the playback of the target video.

[0080] In an embodiment of the present application, the device attribute information of the device playing the video (such as the pixel density of the device, the window size of the playback window) can be combined to select a bitstream with a suitable bitrate for the video. Under the premise of ensuring a certain picture quality, the transmission bitstream of the video can be reduced as much as possible, thereby reducing the transmission bandwidth required, thereby reducing the sense of stuttering in the video playback and ensuring the smoothness of the video playback.

[0081] See also Figure 4 , Figure 4is a flow chart of another video processing method provided by an embodiment of the present application. The video processing method described in this embodiment can be applied to the above-mentioned computer device, such as Figure 4 As shown, the method may include:

[0082] S401, obtaining a target video to be played, and obtaining window size information of a target playback window for playing the target video.

[0083] The specific implementation of this step can refer to the above step S201, which will not be repeated here.

[0084] S402: Determine a target video resolution for the target video based on the window size information.

[0085] In one implementation, the transmission bitstream may be divided into N reference bitstream types according to N reference video resolutions to construct a mapping relationship between the reference bitstream type and the reference video resolution, wherein one reference bitstream type among the N reference bitstream types corresponds to one reference video resolution.

[0086] It can be understood that the resolution of a normal video can be 360p, 540p, 720p, 1080p, etc., and the reference video resolution here can be 360p, 540p, 720p, 1080p, etc. In the embodiment of the present application, the number N is not limited, such as N is 3, and the 3 reference video resolutions are 540p, 720p, and 1080p, respectively. One reference video resolution corresponds to one bitstream type, and the bitstream type here can be referred to as a reference bitstream type, that is, one reference video resolution corresponds to one reference bitstream type, such as corresponding a reference video resolution of 540p to one reference bitstream type, and corresponding a reference video resolution of 720p to another reference bitstream type, and so on. For N reference video resolutions, N reference bitstream types can be obtained, and a mapping relationship between reference bitstream types and reference video resolutions can also be constructed based on the N reference video resolutions and the corresponding N reference bitstream types. For example, the mapping relationship can be shown in Table 3 below,

[0087] Table 3

[0088] Reference stream type Reference video resolution VI 540p V2 720p V3 80p

[0089] In one implementation, step S402 may be specifically implemented as follows: first, based on the reference video resolution and window size information corresponding to each reference bitstream type, the target size ratio between each reference bitstream type and the target playback window is calculated to obtain N target size ratios; then, based on the N target size ratios, the target video resolution for the target video is determined. Wherein, any reference video resolution may include video size information for the video, such as the video size information may include video height and video width. For example, the video size information of the i-th reference video resolution among the N reference video resolutions may be recorded as (h i , w i ) or h i *w i .

[0090] In one implementation, the specific implementation of the above-mentioned determination of the ratios of the N target sizes is described as follows.

[0091] First, the window size ratio may be calculated based on the window size information; for example, the window size ratio may be a ratio between the window height and the window width, such as the window size ratio may be recorded as H / W.

[0092] The video size ratio under the corresponding reference bitstream type can be determined based on the video size information of the reference video resolution corresponding to each reference bitstream type, and N video size ratios can be obtained. For example, for the i-th reference video resolution among the N reference video resolutions, the video size ratio under the reference bitstream type can be the ratio between the video height and the video width, and the video size ratio can be called the i-th video size ratio. For example, the i-th video size ratio can be recorded as h i / w i Based on this, we can know that the size ratio of N videos can be h1 / w1,…,h i / w i ,…,h N / w N .

[0093] Then, the target video resolution for the target video is determined based on the window size ratio and the N video size ratios. Optionally, if the N video size ratios are the same as the window size ratio, the target size ratios between each reference stream type and the target playback window can be calculated directly based on the reference video resolution and window size information corresponding to each reference stream type to obtain N target size ratios. In one embodiment, taking the i-th reference stream type among the N reference stream types as an example, the calculation of the target size ratio between the i-th reference stream type and the target playback window is described as follows: the ratio between the video height of the reference video resolution corresponding to the i-th reference stream type and the window height can be used as the corresponding target size ratio. For example, the target size ratio can be referred to as the i-th target size ratio. For example, the i-th target size ratio can be recorded as h i / H, that is, the size ratios of N targets can be h1 / H,…,h i / H…,h N Alternatively, the ratio between the video width of the reference video resolution corresponding to the i-th reference bitstream type and the window width can be used as the corresponding target size ratio, such as the target size ratio can be referred to as the i-th target size ratio. For example, the i-th target size ratio can be recorded as w i / W, that is, the size ratios of the N targets can be w1 / W,…,w i / W…,w N / W.

[0094] Optionally, if there is a target video size ratio that is different from the window size ratio among the N video size ratios, the video size information corresponding to the target video size ratio can be adjusted to obtain the adjusted video size information, so that the video size ratio calculated by the adjusted video size information is the same as the window size ratio. In an actual application scenario, if the video size ratio is the same as the window size ratio, the target video can be expanded before playing (such as using black pixels (0,0,0) to ensure that the aspect ratio of the expanded video (i.e., the video size ratio calculated by the adjusted video size information) is consistent with the window size ratio. After the adjustment operation is performed, N target size ratios can be further calculated based on the adjustment.

[0095] In one embodiment, for any reference stream type among the N reference stream types, if the video size information of any reference stream type has been adjusted, the target size ratio between any reference stream type and the target playback window can be calculated based on the adjusted video size information and window size information corresponding to any reference stream type, and the target size ratio for any reference stream type can be obtained. The method for calculating the target size ratio here is consistent with the method for calculating the i-th target size ratio mentioned above, except that the target size ratio is calculated using the adjusted video size information. If the video size information of any reference stream type has not been adjusted, the target size ratio between any reference stream type and the target playback window can be calculated based on the original video size information and window size information of any reference stream type, and the target size ratio for any reference stream type can be obtained. The method for calculating the target size ratio here can also refer to the method for calculating the i-th target size ratio mentioned above.

[0096] In another implementation, the specific implementation of the above-mentioned determination of the N target size ratios is described as follows. The following is an example of calculating the target size ratio between the i-th reference stream type and the target playback window (or referred to as the i-th target size ratio) based on the reference video resolution and window size information corresponding to the i-th reference stream type.

[0097] First, the ratio between the video width in the video size information corresponding to the i-th reference stream type and the window width in the window size information can be calculated, and the ratio between the video height in the video size information and the window height in the window size information can be calculated. Then, the maximum value of the two ratios can be used as the i-th target size ratio.

[0098] In one implementation, the above-mentioned determination of the target video resolution for the target video based on N target size ratios is specifically implemented as described below.

[0099] The reference video resolution corresponding to the ratio closest to 1 can be selected from the N target size ratios to be determined as the target video resolution. Optionally, the target video resolution selection strategy can be specifically: first calculate the deviation value between each target size ratio in the N target size ratios and the target parameter to obtain N deviation values, and the target parameter can be 1; then determine the minimum deviation value from the N deviation values, the target size ratio corresponding to the minimum deviation value is the ratio closest to 1, and determine the reference video resolution associated with the target size ratio corresponding to the minimum deviation value as the target video resolution.

[0100] Optionally, the target video resolution selection strategy may also be any one of a rounding-up strategy, a rounding-down strategy, and a rounding-off strategy for the N target size ratios.

[0101] If the selection strategy is the round-up strategy, and the target size ratio is determined based on the video height and the window width, the computer device can determine the target video resolution by the following formula (4):

[0102]

[0103] Wherein, h represents the video height in the target size ratio closest to 1, and the video resolution corresponding to the video height is the target video resolution; h i / H represents the i-th video size ratio among N video size ratios, h i Represents the video height in N reference video resolutions.

[0104] If the selection strategy is a round-down strategy, and the target size ratio is determined based on the video height and the window width, the computer device can determine the target video resolution by the following formula (5):

[0105]

[0106] If the selection strategy is a rounding strategy, and the target size ratio is determined based on the video height and the window width, the computer device can determine the target video resolution by the following formula (6):

[0107]

[0108] S403: Determine a target bitstream type of a transmission bitstream for transmitting the target video based on a mapping relationship between the reference bitstream type and the reference video resolution and the target video resolution.

[0109] In one implementation, a reference video resolution that is consistent with the target video resolution can be found from a mapping relationship between reference bitstream types and reference video resolutions, and the reference bitstream type corresponding to the found reference video resolution can be determined as the target bitstream type of the transmission bitstream for transmitting the target video.

[0110] S404: Obtain the pixel density of the target device, and determine the pixel density of the target playback window based on the pixel density of the target device.

[0111] S405, determining a target bitstream level under the target bitstream type based on the target bitstream type and the pixel density of the target playback window, and playing the target video based on the target transmission bitstream under the target bitstream level.

[0112] The specific implementation of steps S404 and S405 may refer to the above steps S203 and S204, which will not be described again here.

[0113] To better understand the video processing method proposed in the embodiment of the present application, the following combination Figure 5 The video processing method is further explained.

[0114] It should be understood that, for a video, all transmission streams corresponding to the video can be divided into N stream types (i.e., the reference stream types mentioned above) according to the video resolution. For example, there are three common stream types corresponding to video resolutions of 540p, 720p, and 1080p, respectively; each reference stream type can be further divided into m stream levels according to the compression quality (for example, the reference stream type of 720p can be divided into three stream levels of high, medium, and low (for example, see Table 3 above). Among them, the higher the stream level, the better the video quality of the corresponding video playback using the transmission stream under the stream level, but the compression rate of the video will also be lower.

[0115] For example, see Figure 5 As shown, the embodiment of the present application can determine the video bitstream transmission strategy based on the properties of the target device. The computer device can obtain the pixel density (PPI) of the target device, the window size information of the playback window and other parameters from the client (i.e., the client used to play the target video); then, the resolution of the transmission bitstream for the target video (i.e., the target video resolution) and the corresponding target bitstream type can be determined based on the window size information of the target playback window; then, based on the pixel density, window size information and other parameters of the target device, the pixel density of the target playback window during the current video playback (such as WindowPPI) is calculated, and the mapping table is queried to determine the bitstream gear of the transmission bitstream of the target video.

[0116] For the target video, there may be N reference stream types, denoted as V1, V2, ... V i ,…,V N ; For each reference code stream type V i , the corresponding video size information of the reference video resolution can be recorded as (h i ,w i ), and the reference stream type is V i It can contain m bit stream levels, such as these m bit stream levels can be recorded as V i_1 ,V i_2 ,…,V i_m The current playback window size (i.e. window size information) is (H, W), and the pixel density of the target device is X.

[0117] For the convenience of description, it can be assumed that the size ratio of the target playback window (i.e., the window size ratio determined by the window height and the window width) and the aspect ratio of the video (i.e., the corresponding video size ratio obtained by the ratio of the video height and the video width corresponding to each reference video resolution) are the same, that is, H / W = h i / w i In actual application scenarios, if the size ratio of the target playback window is different from the aspect ratio of the video, the video can be expanded before playing (for example, black pixels (0,0,0) can be used for expansion) to ensure that the aspect ratio of the expanded video is consistent with the size ratio of the target playback window.

[0118] In a specific implementation, first, the target bitstream type for transmitting the target video transmission bitstream can be selected according to the window size information of the target playback window, that is, the target bitstream type of appropriate size can be selected. In one embodiment, the size ratios of all reference bitstream types and the target playback window can be calculated to obtain N target size ratios, and these N target size ratios can be h1 / H, h2 / H, ..., h N / H, and then determine the target bitstream type based on the N target size ratios. For example, the reference bitstream type with the ratio closest to 1 can be selected from the N target size ratios as the target bitstream type, wherein the selection strategy can be any one of rounding up, rounding down, or rounding off. The specific implementation can refer to the above description, which will not be repeated here.

[0119] Secondly, after selecting the target stream type, the target stream level under the target stream type can be determined according to the pixel density (PPI) of the target playback window. Among them, the method of calculating the pixel density of the target playback window can be calculated based on the above formula (1). Then, according to the target device type, target stream type, and pixel density of the target playback window of the target device, the stream level (i.e., target stream level) that should be transmitted at this time is obtained through the mapping table. For example, the corresponding mapping table can be selected based on the target device type and the target stream type, and then the target stream level can be determined by querying from the mapping table based on the pixel density of the target playback window. Among them, the specific implementation of determining the target stream level can refer to the above related description. It can be understood that for the same type of device, the higher the pixel density of the playback window, the looser the requirement for the stream quality. At this time, the bit rate can be reduced (i.e., a lower stream level under the stream type can be selected) to ensure the smoothness of video playback.

[0120] In an embodiment of the present application, the device attribute information of the device playing the video (such as the pixel density of the device, the window size of the playback window) can be combined to select a bitstream with a suitable bitrate for the video. Under the premise of ensuring a certain picture quality, the transmission bitstream of the video can be reduced as much as possible, thereby reducing the transmission bandwidth required, thereby reducing the sense of stuttering in the video playback and ensuring the smoothness of the video playback.

[0121] See also Figure 6 , is a schematic diagram of the structure of a video processing device provided in an embodiment of the present application. The video processing device described in this embodiment includes:

[0122] The acquisition unit 601 is used to acquire a target video to be played, and acquire window size information of a target playback window used to play the target video; the target playback window is a playback window of a target device used to play the target video;

[0123] A first determining unit 602 is used to determine a target bitstream type of a transport bitstream for transmitting the target video based on the window size information;

[0124] A second determining unit 603 is used to obtain the pixel density of the target device and determine the pixel density of the target playback window based on the pixel density of the target device;

[0125] The third determining unit 604 is used to determine the target bitstream level under the target bitstream type based on the target bitstream type and the pixel density of the target playback window, and play the target video based on the target transmission bitstream under the target bitstream level.

[0126] In one implementation, the first determining unit 602 is further configured to:

[0127] Dividing the transmission bitstream into N reference bitstream types according to the N reference video resolutions, and constructing a mapping relationship between the reference bitstream types and the reference video resolutions; one reference bitstream type among the N reference bitstream types corresponds to one reference video resolution;

[0128] The first determining unit 602 is specifically configured to:

[0129] Determine a target video resolution for the target video based on the window size information;

[0130] Based on the mapping relationship between the reference bitstream type and the reference video resolution and the target video resolution, a target bitstream type of a transmission bitstream for transmitting the target video is determined.

[0131] In one implementation, the first determining unit 602 is specifically configured to:

[0132] Based on the reference video resolution corresponding to each reference bitstream type and the window size information, respectively calculating the target size ratio between each reference bitstream type and the target playback window to obtain N target size ratios;

[0133] A target video resolution for the target video is determined based on the N target size ratios.

[0134] In one implementation, any reference video resolution includes video size information for the video; the first determining unit 602 is specifically configured to:

[0135] Calculating the window size ratio based on the window size information, and determining the video size ratio under the corresponding reference bitstream type based on the video size information of the reference video resolution corresponding to each reference bitstream type, to obtain N video size ratios;

[0136] If there is a target video size ratio that is different from the window size ratio among the N video size ratios, adjusting the video size information corresponding to the target video size ratio to obtain adjusted video size information, so that the video size ratio calculated by the adjusted video size information is the same as the window size ratio;

[0137] For any reference bitstream type among the N reference bitstream types, if the video size information of any reference bitstream type has been adjusted, a target size ratio between the any reference bitstream type and the target playback window is calculated based on the adjusted video size information corresponding to the any reference bitstream type and the window size information, to obtain the target size ratio for the any reference bitstream type.

[0138] In one implementation, the first determining unit 602 is specifically configured to:

[0139] Calculating the deviation value between each target size ratio of the N target size ratios and the target parameter to obtain N deviation values;

[0140] A minimum deviation value is determined from the N deviation values, and a reference video resolution associated with the target size ratio corresponding to the minimum deviation value is determined as the target video resolution.

[0141] In one implementation, the second determining unit 603 is specifically configured to:

[0142] Acquire a mapping relationship between a reference bitstream type and a reference video resolution, and determine a target video resolution corresponding to the target bitstream type based on the mapping relationship; the target video resolution includes target video size information for the target video;

[0143] The pixel density of the target playback window is determined based on the pixel density of the target device, the target video size information, and the window size information.

[0144] In one implementation, the third determining unit 604 is specifically configured to:

[0145] Obtain a target device type of a target device used to play the target video;

[0146] Acquire a mapping relationship between a reference pixel density and a reference bitstream gear that matches the target device type and the target bitstream type;

[0147] Based on the pixel density of the target playback window and the mapping relationship between the reference pixel density and the reference bitstream gear, the target bitstream gear under the target bitstream type is determined.

[0148] It is understood that the division of units in the embodiments of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. The functional units in the embodiments of the present application may be integrated into a processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware or in the form of software functional units.

[0149] See also Figure 7 , Figure 7 701 is a schematic diagram of a computer device provided in an embodiment of the present application. The computer device includes: a processor 701 and a memory 702. Optionally, the computer device may also include a network interface 703. The processor 701, the memory 702 and the network interface 703 may exchange data.

[0150] The processor 701 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0151] The memory 702 may include a read-only memory and a random access memory, and provide program instructions and data to the processor 701. A portion of the memory 702 may also include a non-volatile random access memory. When the processor 701 calls the program instructions, it is used to execute:

[0152] Acquire a target video to be played, and acquire window size information of a target playback window used to play the target video; the target playback window is a playback window of a target device used to play the target video;

[0153] Determine a target bitstream type of a transport bitstream for transmitting the target video based on the window size information;

[0154] Acquire the pixel density of the target device, and determine the pixel density of the target playback window based on the pixel density of the target device;

[0155] A target bitstream gear under the target bitstream type is determined based on the target bitstream type and the pixel density of the target playback window, and the target video is played based on the target transmission bitstream under the target bitstream gear.

[0156] In one implementation, the processor 701 is specifically configured to:

[0157] Dividing the transmission bitstream into N reference bitstream types according to the N reference video resolutions, and constructing a mapping relationship between the reference bitstream types and the reference video resolutions; one reference bitstream type among the N reference bitstream types corresponds to one reference video resolution;

[0158] Determine a target video resolution for the target video based on the window size information;

[0159] Based on the mapping relationship between the reference bitstream type and the reference video resolution and the target video resolution, a target bitstream type of a transmission bitstream for transmitting the target video is determined.

[0160] In one implementation, the processor 701 is specifically configured to:

[0161] Based on the reference video resolution corresponding to each reference bitstream type and the window size information, respectively calculating the target size ratio between each reference bitstream type and the target playback window to obtain N target size ratios;

[0162] A target video resolution for the target video is determined based on the N target size ratios.

[0163] In one implementation, any reference video resolution includes video size information for the video; the processor 701 is specifically configured to:

[0164] Calculating the window size ratio based on the window size information, and determining the video size ratio under the corresponding reference bitstream type based on the video size information of the reference video resolution corresponding to each reference bitstream type, to obtain N video size ratios;

[0165] If there is a target video size ratio that is different from the window size ratio among the N video size ratios, adjusting the video size information corresponding to the target video size ratio to obtain adjusted video size information, so that the video size ratio calculated by the adjusted video size information is the same as the window size ratio;

[0166] For any reference bitstream type among the N reference bitstream types, if the video size information of any reference bitstream type has been adjusted, a target size ratio between the any reference bitstream type and the target playback window is calculated based on the adjusted video size information corresponding to the any reference bitstream type and the window size information, to obtain the target size ratio for the any reference bitstream type.

[0167] In one implementation, the processor 701 is specifically configured to:

[0168] Calculating the deviation value between each target size ratio of the N target size ratios and the target parameter to obtain N deviation values;

[0169] A minimum deviation value is determined from the N deviation values, and a reference video resolution associated with the target size ratio corresponding to the minimum deviation value is determined as the target video resolution.

[0170] In one implementation, the processor 701 is specifically configured to:

[0171] Acquire a mapping relationship between a reference bitstream type and a reference video resolution, and determine a target video resolution corresponding to the target bitstream type based on the mapping relationship; the target video resolution includes target video size information for the target video;

[0172] The pixel density of the target playback window is determined based on the pixel density of the target device, the target video size information, and the window size information.

[0173] In one implementation, the processor 701 is specifically configured to:

[0174] Obtain a target device type of a target device used to play the target video;

[0175] Acquire a mapping relationship between a reference pixel density and a reference bitstream gear that matches the target device type and the target bitstream type;

[0176] Based on the pixel density of the target playback window and the mapping relationship between the reference pixel density and the reference bitstream gear, the target bitstream gear under the target bitstream type is determined.

[0177] The present application also provides a computer storage medium in which program instructions are stored. When the program is executed, it may include: Figure 2 or Figure 4 Part or all of the steps of the video processing method in the corresponding embodiment.

[0178] It should be noted that, for the above-mentioned various method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.

[0179] A person skilled in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0180] The embodiment of the present application also provides a computer program product or computer program, which includes program instructions, and when the program instructions are executed by a processor, some or all of the steps in the above method can be implemented. For example, the program instructions are stored in a computer-readable storage medium. The processor of the computer device reads the program instructions from the computer-readable storage medium, and the processor executes the program instructions, so that the computer device executes the steps performed in the embodiments of the above methods.

[0181] The above is a detailed introduction to a video processing method, device, computer equipment and medium provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the ideas of the present application, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A video processing method, characterized in that: The method comprises: Acquire a target video to be played, and acquire window size information of a target playback window used to play the target video; the target playback window is a playback window of a target device used to play the target video; Determine a target bitstream type of a transmission bitstream for transmitting the target video based on the window size information; the target bitstream type is used to indicate a target video resolution of the target video; Acquire the pixel density of the target device, and determine the pixel density of the target playback window based on the pixel density of the target device; The target bitstream gear under the target bitstream type is determined based on the target bitstream type and the pixel density of the target playback window, and the target video is played based on the target transmission bitstream under the target bitstream gear; the target transmission bitstream is used to indicate the transmission bitrate of the target video.

2. The method according to claim 1, characterized in that Also includes: Divide the transmission bitstream into N reference bitstream types according to the N reference video resolutions, and construct a mapping relationship between the reference bitstream type and the reference video resolution; One of the N reference bitstream types corresponds to a reference video resolution; The determining, based on the window size information, a target bitstream type of a transmission bitstream for transmitting the target video comprises: Determine a target video resolution for the target video based on the window size information; Based on the mapping relationship between the reference bitstream type and the reference video resolution and the target video resolution, a target bitstream type of a transmission bitstream for transmitting the target video is determined.

3. The method according to claim 2, characterized in that The determining a target video resolution for the target video based on the window size information includes: Based on the reference video resolution corresponding to each reference bitstream type and the window size information, respectively calculating the target size ratio between each reference bitstream type and the target playback window to obtain N target size ratios; A target video resolution for the target video is determined based on the N target size ratios.

4. The method according to claim 3, characterized in that Any reference video resolution includes video size information for the video; based on the reference video resolution corresponding to each reference bitstream type and the window size information, the target size ratio between each reference bitstream type and the target playback window is calculated respectively to obtain N target size ratios, including: Calculating the window size ratio based on the window size information, and determining the video size ratio under the corresponding reference bitstream type based on the video size information of the reference video resolution corresponding to each reference bitstream type, to obtain N video size ratios; If there is a target video size ratio that is different from the window size ratio among the N video size ratios, adjusting the video size information corresponding to the target video size ratio to obtain adjusted video size information, so that the video size ratio calculated by the adjusted video size information is the same as the window size ratio; For any reference bitstream type among the N reference bitstream types, if the video size information of any reference bitstream type has been adjusted, a target size ratio between the any reference bitstream type and the target playback window is calculated based on the adjusted video size information corresponding to the any reference bitstream type and the window size information, to obtain the target size ratio for the any reference bitstream type.

5. The method according to claim 3, characterized in that: The determining a target video resolution for the target video based on the N target size ratios includes: Calculating the deviation value between each target size ratio of the N target size ratios and the target parameter to obtain N deviation values; A minimum deviation value is determined from the N deviation values, and a reference video resolution associated with the target size ratio corresponding to the minimum deviation value is determined as the target video resolution.

6. The method according to claim 1, characterized in that The determining the pixel density of the target playback window based on the pixel density of the target device includes: Acquire a mapping relationship between a reference bitstream type and a reference video resolution, and determine a target video resolution corresponding to the target bitstream type based on the mapping relationship; the target video resolution includes target video size information for the target video; The pixel density of the target playback window is determined based on the pixel density of the target device, the target video size information, and the window size information.

7. The method according to claim 1, characterized in that The determining the target bitstream gear under the target bitstream type based on the target bitstream type and the pixel density of the target playback window includes: Obtain a target device type of a target device used to play the target video; Acquire a mapping relationship between a reference pixel density and a reference bitstream gear that matches the target device type and the target bitstream type; Based on the pixel density of the target playback window and the mapping relationship between the reference pixel density and the reference bitstream gear, the target bitstream gear under the target bitstream type is determined.

8. A video processing device, characterized in that: include: An acquisition unit, used to acquire a target video to be played, and acquire window size information of a target playback window for playing the target video; The target playback window is a playback window of a target device used to play the target video; A first determining unit is used to determine a target bitstream type of a transmission bitstream for transmitting the target video based on the window size information; the target bitstream type is used to indicate a target video resolution of the target video; A second determining unit, configured to obtain a pixel density of the target device, and determine a pixel density of the target playback window based on the pixel density of the target device; The third determination unit is used to determine the target bitstream gear under the target bitstream type based on the target bitstream type and the pixel density of the target playback window, and play the target video based on the target transmission bitstream under the target bitstream gear; the target transmission bitstream is used to indicate the transmission bitrate of the target video.

9. A computer device, characterized in that: The method comprises a processor and a memory, wherein the memory is used to store a computer program, the computer program comprises program instructions, and the processor is configured to call the program instructions to execute the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor is caused to perform the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Video playing control method and apparatus

    CN106162232A

  • Methods, apparatus, systems, and computer-readable storage media for acquiring video data

    CN107148776B