Video playback method, device, electronic device and storage medium
By automatically determining the resolution based on standards and historical bandwidth during video switching, the lag problem during network video file switching is solved, and a smoother video playback experience is achieved.
Patent Information
- Application Number
- CN202310013824.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-05
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2043-01-05
AI Technical Summary
In the prior art, network video files are stuttered due to bandwidth and network speed factors during switching, and the user manually adjusts the video resolution to affect the viewing experience.
When receiving a video switching request, the video parameters are obtained, and the resolution to be used is determined based on the standard playback bandwidth and the bandwidth of the previous historical playback video, and the current playback bandwidth is monitored in real time as the historical bandwidth, which is used to determine the resolution during the next video switching.
It improves the smoothness of video playback, improves user viewing experience, and avoids the inconvenience caused by manual resolution adjustment.
Smart Images

Figure CN116017062B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer processing technology, and in particular to a video playback method, device, electronic device and storage medium. Background Art
[0002] Currently, many electronic products on the market are equipped with video playback functions. Video playback has different sources such as local and network. For local video files, playback is often normal, but for network video files, due to factors such as bandwidth and network speed, when the video starts playing after the video is switched, the default bandwidth value will be used for playback. This method often causes problems such as lag.
[0003] In order to solve this problem, the existing technology adopts the method of manually adjusting the video resolution by the user, adjusting the high resolution to a low resolution, so as to reduce the amount of data transmission and thus reduce the number of freezes. However, this method is not only time-consuming and laborious to operate, but also affects the user's video viewing experience. Summary of the Invention
[0004] The present invention provides a video playback method, device, electronic device and storage medium to achieve the technical effect of improving video playback effect, improving the smoothness of video playback, and improving user viewing experience.
[0005] According to one aspect of the present invention, a video playback method is provided, the method comprising:
[0006] Upon receiving a video switching request, obtaining video parameters of a currently played video corresponding to the video switching request; wherein the video parameters include a standard playback bandwidth and a standard resolution;
[0007] Determining a resolution to be used corresponding to the currently played video based on the standard playback bandwidth and a historical playback bandwidth corresponding to a previously played video;
[0008] The current video to be played is played based on the resolution to be used, and the current playback bandwidth when playing the current video to be played is determined as the historical playback bandwidth, so that when a video switching request is received again, the resolution to be used corresponding to the next video to be played is determined based on the historical playback bandwidth and the standard playback bandwidth of the next video to be played.
[0009] According to another aspect of the present invention, a video playback device is provided, the device comprising:
[0010] A video parameter acquisition module is configured to, upon receiving a video switching request, acquire video parameters of a currently played video corresponding to the video switching request; wherein the video parameters include a standard playback bandwidth and a standard resolution;
[0011] a module for determining a resolution to be used, configured to determine a resolution to be used corresponding to the currently played video based on the standard playback bandwidth and a historical playback bandwidth corresponding to a previously played video;
[0012] The bandwidth recording module is used to play the current video to be played based on the resolution to be used, and determine the current playback bandwidth when playing the current video to be played as the historical playback bandwidth, so that when a video switching request is received again, the resolution to be used corresponding to the next video to be played is determined based on the historical playback bandwidth and the standard playback bandwidth of the next video to be played.
[0013] According to another aspect of the present invention, an electronic device is provided, comprising:
[0014] at least one processor; and
[0015] a memory communicatively connected to the at least one processor; wherein,
[0016] The memory stores a computer program that can be executed by the at least one processor. The computer program is executed by the at least one processor so that the at least one processor can execute the video playback method described in any embodiment of the present invention.
[0017] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the video playback method described in any embodiment of the present invention when executed.
[0018] The technical solution of the embodiment of the present invention is as follows: when a video switching request is received, the standard playback bandwidth and standard resolution of the current video to be played corresponding to the video switching request are obtained; based on the standard playback bandwidth and the historical playback bandwidth corresponding to the last historically played video, a to-be-used resolution corresponding to the current video to be played is determined; the current video to be played is played based on the to-be-used resolution, and the current playback bandwidth when the current video to be played is determined as the historical playback bandwidth, so that when the video switching request is received again, the to-be-used resolution corresponding to the next video to be played is determined based on the historical playback bandwidth and the standard playback bandwidth of the next video to be played. This solves the problem in the prior art that manual adjustment of the video resolution by the user affects the user's viewing experience. By determining the standard playback bandwidth of the current video to be played when the video is switched, comprehensively considering the standard playback bandwidth and the historical playback bandwidth corresponding to the last historically played video, the most suitable to-be-used resolution for the current video to be played is determined, and the current video to be played is played based on the to-be-used resolution, the video playback effect is improved, and the smoothness of the video playback is improved, thereby achieving the technical effect of improving the user's viewing experience.
[0019] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0021] Figure 1 This is a flowchart of a video playback method provided according to the first embodiment of the present invention;
[0022] Figure 2 This is a schematic diagram of a video playback method provided according to a second embodiment of the present invention;
[0023] Figure 3 This is a structural diagram of a video playback device provided according to a third embodiment of the present invention;
[0024] Figure 4 The figure is a schematic diagram of the structure of an electronic device for implementing the video playback method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0025] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0026] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0027] Example 1
[0028] Figure 1 This is a flow chart of a video playback method provided according to the first embodiment of the present invention. This embodiment is applicable to the case of playing videos. The method can be executed by a video playback device. The video playback device can be implemented in the form of hardware and / or software. The video playback device can be configured in a computing device. Figure 1 As shown, the method includes:
[0029] S110 . When a video switching request is received, obtain video parameters of a currently played video corresponding to the video switching request.
[0030] The video switching request is the instruction and code for requesting a video switch. Video parameters include the standard playback bandwidth and standard resolution. Video parameters correspond to the video itself and can be different or the same for each video.
[0031] In this embodiment, the server can be considered to have received a video switch request when a user triggers a video link control while browsing a video. Alternatively, the system can be considered to have received a video switch request when the system automatically triggers a control to play the next video after a video finishes playing. The video corresponding to the triggered video link control can be used as the current video to be played. After the system receives the video switch request, it obtains the video parameters configured for the current video to be played.
[0032] It should be noted that in actual applications, when processing video playback of certain APPs, the m3u8 format, or h.264 and vp9 formats are usually used for playback. Before playback, the video playback link is usually obtained, and the video parameters of the video are obtained based on the playback link.
[0033] Optionally, obtaining video parameters of the current video to be played corresponding to the video switching request includes: parsing the video switching request to obtain the resource locator corresponding to the current video to be played carried in the video switching request; obtaining a parameter file corresponding to the resource locator; and parsing the parameter file to obtain video parameters.
[0034] The resource locator is a URL (uniform resource locator). The parameter file can be in the m3u8 format.
[0035] Specifically, the video switching request can be parsed to obtain the URL (resource locator) corresponding to the currently playing video carried in the video switching request. A parameter file corresponding to the resource locator can then be loaded. The parameter file can be parsed to obtain video parameters such as the standard playback bandwidth and standard resolution contained in the parameter file.
[0036] Exemplarily, after determining the URL (i.e., resource locator), the corresponding m3u8 file can be downloaded through the URL, which contains two files, master.m3u8 and mediadata.m3u8, wherein master.m3u8 is the parameter file, and the data format in the parameter file can be as follows:
[0037] #EXT-X-STREAM-INF:BANDWIDTH=306568,CODECS="avc1.4D400C,mp4a.40.5",RESOLUTION=426x240,AUDIO="233",FRAME-RATE=25,VIDEO-RANGE=SDR,CLOSE D-CAPTIONS=NONE
[0038] The parameter file includes the bandwidth value (i.e. standard playback bandwidth): 306568; encoding method: avc1.4D400C; resolution (i.e. standard resolution): 426x240, etc.
[0039] S120: Determine a resolution to be used corresponding to the video to be currently played based on the standard playback bandwidth and the historical playback bandwidth corresponding to the last historically played video.
[0040] The last played video in history refers to the video played before the switch, that is, the video played before the current video to be played.
[0041] It should be noted that the existing method of playing videos is as follows: when each video starts playing, the bandwidth value is set to zero by default. Then, 10 seconds after the video starts playing, the actual bandwidth is monitored and the corresponding resolution is selected based on the actual bandwidth. As a result, the resolution is switched each time a video is played, and a lower resolution is used for the first 10 seconds or so of the video, resulting in poor playback quality. To better solve this problem, in this embodiment, after determining the video parameters of the current video to be played, the standard playback bandwidth in the video parameters and the historical playback bandwidth corresponding to the last historically played video are combined to select an appropriate resolution for the current video to be played. At this time, the historical playback bandwidth is closest to the network bandwidth used to load the current video to be played at the current moment, which can well meet the playback conditions of the current video to be played and prevent video freezes or unclear video when the current video to be played starts.
[0042] Specifically, based on the standard playback bandwidth and the historical playback bandwidth corresponding to the last historically played video, the resolution to be used corresponding to the currently played video is determined, including: if the standard playback bandwidth is smaller than the historical playback bandwidth corresponding to the last historically played video, the standard resolution is used as the resolution to be used for the currently played video.
[0043] In this embodiment, the standard playback bandwidth and the historical playback bandwidth corresponding to the last historically played video can be compared. If the standard playback bandwidth is smaller than the historical playback bandwidth, it can be said that if the current video to be played is played at the standard resolution at the current moment, there will be no playback freeze, and the playback conditions of the current video to be played are met. There is no need to adjust the resolution, and the standard resolution in the video parameters can be used as the to-be-used resolution of the current video to be played, so that the current video to be played is played based on the to-be-used resolution.
[0044] For example, during the actual playback process, if it is detected that the historical playback bandwidth is not greater than the standard playback bandwidth of 306568, the standard resolution is directly used for playback. If the standard playback bandwidth is higher, the resolution corresponding to the historical playback bandwidth is selected for playback.
[0045] In this embodiment, based on the standard playback bandwidth and the historical playback bandwidth corresponding to the last historically played video, determining the resolution to be used corresponding to the currently played video also includes: if the standard playback bandwidth is greater than the historical playback bandwidth corresponding to the last historically played video, determining the resolution to be applied corresponding to the historical playback bandwidth; and using the resolution to be applied as the resolution to be used for the currently played video.
[0046] Specifically, if the standard playback bandwidth is greater than the historical playback bandwidth, this indicates that playing the currently playing video at standard resolution may cause playback stuttering, necessitating resolution adjustment. The resolution to be applied can be determined based on the historical playback bandwidth. For example, a larger historical playback bandwidth corresponds to a higher resolution to be applied, while a smaller historical playback bandwidth corresponds to a lower resolution to be applied. The resolution to be applied can be used as the resolution to be used, thereby improving playback smoothness by playing the currently playing video at the resolution to be used.
[0047] S130. Play the current video to be played based on the resolution to be used, and determine the current playback bandwidth when playing the current video to be played as the historical playback bandwidth, so that when a video switching request is received again, the resolution to be used corresponding to the next video to be played is determined based on the historical playback bandwidth and the standard playback bandwidth of the next video to be played.
[0048] In this embodiment, during the process of playing the current video to be played based on the resolution to be used, the current playback bandwidth during playback can be monitored in real time. The current playback bandwidth may change during the playback of the video. Based on the time dimension, when a new real-time playback bandwidth is detected, the last recorded playback bandwidth can be updated to ensure that when the current video to be played ends, the detected current playback bandwidth is closest to the next switching video, that is, the switching moment of the next video to be played. The current playback bandwidth can be used as the historical playback bandwidth. When a video switching request is received next time, the resolution to be used corresponding to the next video to be played can be determined based on the historical playback bandwidth and the standard playback bandwidth of the next video to be played. During the video stream playback process, the playback effect of each video can be improved.
[0049] It should be noted that, in the process of determining the current playback bandwidth when playing the currently-to-be-played video, the current playback network speed when playing the currently-to-be-played video can be determined; and the current playback bandwidth is determined based on the current playback network speed.
[0050] In this embodiment, the current playback network speed can be monitored in real time during the playback of the current video to be played. Furthermore, the current playback network speed can be converted into network bandwidth, that is, the current playback bandwidth is obtained.
[0051] In order to better satisfy the user's viewing experience, a switching prompt can be provided during the video switching process. Optionally, a video switching prompt message can be generated and displayed when a video switching request is received.
[0052] Specifically, when a video switching request is received, it can be considered that a video switching is in progress, and a menu prompt can be added to display a video switching prompt in the switching area. For example, the video switching prompt message can be "Currently switching." It should be noted that the switching area can be any area of the display interface and can be determined by technical personnel based on actual work conditions. It is not limited here.
[0053] The technical solution of this embodiment is as follows: when receiving a video switching request, obtaining the standard playback bandwidth and standard resolution of the current video to be played corresponding to the video switching request; determining the to-be-used resolution corresponding to the current video to be played based on the standard playback bandwidth and the historical playback bandwidth corresponding to the last historically played video; playing the current video to be played based on the to-be-used resolution, and determining the current playback bandwidth when playing the current video to be played as the historical playback bandwidth, so that when the video switching request is received again, the to-be-used resolution corresponding to the next video to be played is determined based on the historical playback bandwidth and the standard playback bandwidth of the next video to be played. This solves the problem in the prior art that manual adjustment of the video resolution by the user affects the user's viewing experience, and realizes that when the video is switched, the standard playback bandwidth of the current video to be played is determined, the standard playback bandwidth of the current video to be played is comprehensively considered with the historical playback bandwidth corresponding to the last historically played video, the most suitable to-be-used resolution for the current video to be played is determined, and the current video to be played is played based on the to-be-used resolution, thereby improving the video playback effect, thereby improving the smoothness of the video playback, and achieving the technical effect of improving the user's viewing experience.
[0054] Example 2
[0055] As an alternative embodiment to the above embodiment, in order to make those skilled in the art further understand the technical solution of the embodiment of the present invention, a specific application scenario example is given. For details, please refer to the following specific content.
[0056] For example, see Figure 2 , Figure 2This can be represented as a schematic diagram of a video playback method. When playing a video using an app, after playing the first source, the current network speed can be recorded and the corresponding bandwidth value can be obtained. If no network speed is detected, it indicates that there is no network connection and the video is in a network card state. When switching videos, the gstframework layer needs to send a message to the upper layer. Message 1 indicates that the resolution switch is currently in progress, and message 2 sends the first detected bandwidth value to the upper layer app. After receiving the resolution switch message, the upper layer will first display a menu prompt, that is, when the video switches, a menu prompt is added to indicate that the switch is currently in progress. Secondly, the bandwidth value is recorded and then set according to the bandwidth when building the pipeline. When playing the second video, the bandwidth used for playing the first source is used. Since the saved bandwidth value is directly used, the most appropriate resolution is directly selected without switching resolutions, thus meeting user needs. Alternatively, the system can obtain the corresponding URL based on the video link and then download the corresponding m3u8 file from this URL. The m3u8 file includes: master.m3u8 (i.e., parameter file) and mediadata.m3u8 (stream fragment file). For example, the parameter file content can be
[0057] #EXT-X-STREAM-INF:BANDWIDTH=306568,CODECS="avc1.4D400C,mp4a.40.5",RESOLUTION=426x240,AUDIO="233",FRAME-RATE=25,VIDEO-RANGE=SDR,CLOSE D-CAPTIONS=NONE. The parameter file contains the bandwidth (i.e., standard playback bandwidth): 306568; encoding method: avc1.4D400C; and resolution (i.e., standard resolution): 426x240. During actual playback, if the playback bandwidth corresponding to the previous video is greater than 306568, playback will be performed directly at 426x240. If the standard playback bandwidth is higher, the most suitable link will be selected for playback. The corresponding link can then be used to download the m3u8 file corresponding to the actual stream, which contains the actual stream fragment. It should be noted that since the upper layer directly transmits the network speed, the gst_hls_master_playlist_get_variant_for_bitrate(hlsdemux->master,NULL,demux->connection_speed) function will be executed directly, so there is no need to switch the resolution, which improves the video playback effect.
[0058] The technical solution of this embodiment is as follows: when receiving a video switching request, obtaining the standard playback bandwidth and standard resolution of the current video to be played corresponding to the video switching request; determining the to-be-used resolution corresponding to the current video to be played based on the standard playback bandwidth and the historical playback bandwidth corresponding to the last historically played video; playing the current video to be played based on the to-be-used resolution, and determining the current playback bandwidth when playing the current video to be played as the historical playback bandwidth, so that when the video switching request is received again, the to-be-used resolution corresponding to the next video to be played is determined based on the historical playback bandwidth and the standard playback bandwidth of the next video to be played. This solves the problem in the prior art that manual adjustment of the video resolution by the user affects the user's viewing experience, and realizes that when the video is switched, the standard playback bandwidth of the current video to be played is determined, the standard playback bandwidth of the current video to be played is comprehensively considered with the historical playback bandwidth corresponding to the last historically played video, the most suitable to-be-used resolution for the current video to be played is determined, and the current video to be played is played based on the to-be-used resolution, thereby improving the video playback effect, thereby improving the smoothness of the video playback, and achieving the technical effect of improving the user's viewing experience.
[0059] Example 3
[0060] Figure 3 FIG. 1 is a schematic diagram of the structure of a video playback device according to the third embodiment of the present invention. Figure 3 As shown, the apparatus includes: a video parameter acquisition module 310 , a to-be-used resolution determination module 320 and a bandwidth recording module 330 .
[0061] Among them, the video parameter acquisition module 310 is used to obtain the video parameters of the current video to be played corresponding to the video switching request when receiving the video switching request; wherein the video parameters include standard playback bandwidth and standard resolution; the to-be-used resolution determination module 320 is used to determine the to-be-used resolution corresponding to the current video to be played based on the standard playback bandwidth and the historical playback bandwidth corresponding to the last historically played video; the bandwidth recording module 330 is used to play the current video to be played based on the to-be-used resolution, and determine the current playback bandwidth when playing the current video to be played as the historical playback bandwidth, so that when the video switching request is received again, the to-be-used resolution corresponding to the next video to be played is determined based on the historical playback bandwidth and the standard playback bandwidth of the next video to be played.
[0062] The technical solution of this embodiment is as follows: when receiving a video switching request, obtaining the standard playback bandwidth and standard resolution of the current video to be played corresponding to the video switching request; determining the to-be-used resolution corresponding to the current video to be played based on the standard playback bandwidth and the historical playback bandwidth corresponding to the last historically played video; playing the current video to be played based on the to-be-used resolution, and determining the current playback bandwidth when playing the current video to be played as the historical playback bandwidth, so that when the video switching request is received again, the to-be-used resolution corresponding to the next video to be played is determined based on the historical playback bandwidth and the standard playback bandwidth of the next video to be played. This solves the problem in the prior art that manual adjustment of the video resolution by the user affects the user's viewing experience, and realizes that when the video is switched, the standard playback bandwidth of the current video to be played is determined, the standard playback bandwidth of the current video to be played is comprehensively considered with the historical playback bandwidth corresponding to the last historically played video, the most suitable to-be-used resolution for the current video to be played is determined, and the current video to be played is played based on the to-be-used resolution, thereby improving the video playback effect, thereby improving the smoothness of the video playback, and achieving the technical effect of improving the user's viewing experience.
[0063] Based on the above device, optionally, the video parameter acquisition module 310 includes: a resource locator determination unit, a parameter file determination unit and a video parameter determination unit.
[0064] a resource locator determining unit, configured to parse the video switching request to obtain a resource locator corresponding to the current video to be played carried in the video switching request;
[0065] a parameter file determining unit, configured to obtain a parameter file corresponding to the resource locator;
[0066] The video parameter determination unit is used to parse the parameter file to obtain the video parameters.
[0067] Based on the above device, optionally, the to-be-used resolution determination module 320 is further configured to use the standard resolution as the to-be-used resolution of the current to-be-played video if the standard playback bandwidth is smaller than the historical playback bandwidth corresponding to the last historically played video.
[0068] On the basis of the above device, optionally, the module for determining the resolution to be used 320 further includes: a unit for determining a resolution to be applied and a unit for determining a resolution to be used.
[0069] a unit for determining a resolution to be applied, configured to determine a resolution to be applied corresponding to the historical playback bandwidth if the standard playback bandwidth is greater than the historical playback bandwidth corresponding to the last historically played video;
[0070] The to-be-used resolution determining unit is configured to use the to-be-applied resolution as the to-be-used resolution of the currently-to-be-played video.
[0071] Based on the above device, optionally, the bandwidth recording module 330 includes: a current playback network speed determination unit and a current playback bandwidth determination unit.
[0072] A current playback network speed determining unit, configured to determine a current playback network speed when playing the video currently to be played;
[0073] The current playback bandwidth determining unit is configured to determine the current playback bandwidth based on the current playback network speed.
[0074] On the basis of the above device, optionally, the device further includes: a switching prompt module.
[0075] The switching prompt module is used to generate and display video switching prompt information when receiving a video switching request.
[0076] The video playback device provided in the embodiment of the present invention can execute the video playback method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0077] Example 4
[0078] Figure 4 Schematic diagram of the structure of an electronic device that implements the video playback method of an embodiment of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are only examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0079] like Figure 4As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., which is communicatively connected to the at least one processor 11. The memory stores a computer program that can be executed by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. Various programs and data required for the operation of the electronic device 10 can also be stored in the RAM 13. The processor 11, ROM 12, and RAM 13 are connected to each other via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0080] Multiple components in the electronic device 10 are connected to the I / O interface 15, including an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0081] The processor 11 can be any general-purpose and / or specialized processing component with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various processors that run machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the video playback method.
[0082] In some embodiments, the video playback method can be implemented as a computer program that is tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the video playback method described above can be performed. Alternatively, in other embodiments, processor 11 can be configured to perform the video playback method in any other appropriate manner (e.g., by means of firmware).
[0083] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0084] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer program is executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer program may be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0085] In the context of the present invention, computer-readable storage media can be tangible media that can contain or store a computer program for use with an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Computer-readable storage media can include but are not limited to electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, computer-readable storage media can be machine-readable signal media. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0086] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0087] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0088] A computing system may include clients and servers. The clients and servers are typically remote from each other and typically interact via a communication network. This client-server relationship arises through computer programs running on the respective computers, creating a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host. This server is a hosting product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosting and VPS services.
[0089] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in the present invention can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved. This is not limited herein.
[0090] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.
Claims
1. A video playback method, characterized in that: include: Upon receiving a video switching request, obtaining video parameters of a currently played video corresponding to the video switching request; wherein the video parameters include a standard playback bandwidth and a standard resolution; If the standard playback bandwidth is smaller than the historical playback bandwidth corresponding to the last historically played video, the standard resolution is used as the resolution to be used for the currently played video; If the standard playback bandwidth is greater than the historical playback bandwidth corresponding to the last historically played video, determining a resolution to be applied corresponding to the historical playback bandwidth; Using the resolution to be applied as the resolution to be used for the currently played video; The current video to be played is played based on the resolution to be used, and the current playback bandwidth when playing the current video to be played is determined as the historical playback bandwidth, so that when a video switching request is received again, the resolution to be used corresponding to the next video to be played is determined based on the historical playback bandwidth and the standard playback bandwidth of the next video to be played.
2. The method according to claim 1, characterized in that The obtaining of the video parameters of the current to-be-played video corresponding to the video switching request includes: Parsing the video switching request to obtain a resource locator corresponding to the current video to be played carried in the video switching request; Obtaining a parameter file corresponding to the resource locator; The parameter file is parsed to obtain the video parameters.
3. The method according to claim 1, characterized in that The determining of the current playback bandwidth when playing the currently-to-be-played video includes: Determine the current playback network speed when playing the video currently to be played; The current playback bandwidth is determined based on the current playback network speed.
4. The method according to claim 1, wherein Also includes: When a video switching request is received, video switching prompt information is generated and displayed.
5. A video playback device, characterized in that: include: A video parameter acquisition module is configured to, upon receiving a video switching request, acquire video parameters of a currently played video corresponding to the video switching request; wherein the video parameters include a standard playback bandwidth and a standard resolution; a module for determining a resolution to be used, configured to use the standard resolution as the resolution to be used for the video to be played if the standard playback bandwidth is smaller than the historical playback bandwidth corresponding to the last historically played video; and to determine a resolution to be applied corresponding to the historical playback bandwidth if the standard playback bandwidth is larger than the historical playback bandwidth corresponding to the last historically played video; and use the resolution to be applied as the resolution to be used for the video to be played; The bandwidth recording module is used to play the current video to be played based on the resolution to be used, and determine the current playback bandwidth when playing the current video to be played as the historical playback bandwidth, so that when a video switching request is received again, the resolution to be used corresponding to the next video to be played is determined based on the historical playback bandwidth and the standard playback bandwidth of the next video to be played.
6. The device according to claim 5, characterized in that The video parameter acquisition module includes: a resource locator determining unit, configured to parse the video switching request to obtain a resource locator corresponding to the current video to be played carried in the video switching request; a parameter file determining unit, configured to obtain a parameter file corresponding to the resource locator; The video parameter determination unit is used to parse the parameter file to obtain the video parameters.
7. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor. The computer program is executed by the at least one processor so that the at least one processor can execute the video playback method according to any one of claims 1 to 4.
8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the video playback method according to any one of claims 1 to 4 when executed.
Citation Information
Patent Citations
Video definition determination method and system, computer equipment and storage medium
CN111510747A
Video playing method and device, terminal and storage medium
CN114363674A