WO2017157191A1 - 视频清晰度的切换方法及装置 - Google Patents
视频清晰度的切换方法及装置 Download PDFInfo
- Publication number
- WO2017157191A1 WO2017157191A1 PCT/CN2017/075638 CN2017075638W WO2017157191A1 WO 2017157191 A1 WO2017157191 A1 WO 2017157191A1 CN 2017075638 W CN2017075638 W CN 2017075638W WO 2017157191 A1 WO2017157191 A1 WO 2017157191A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- video source
- video
- network
- playing
- transparency
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 95
- 230000008569 process Effects 0.000 claims abstract description 37
- 230000007704 transition Effects 0.000 claims description 41
- 239000000872 buffer Substances 0.000 claims description 14
- 238000012544 monitoring process Methods 0.000 claims description 12
- 230000007423 decrease Effects 0.000 claims description 7
- 238000006243 chemical reaction Methods 0.000 abstract description 14
- 238000012360 testing method Methods 0.000 description 16
- 230000008859 change Effects 0.000 description 10
- 238000013507 mapping Methods 0.000 description 10
- 230000007246 mechanism Effects 0.000 description 10
- 230000000694 effects Effects 0.000 description 6
- 230000008901 benefit Effects 0.000 description 4
- 230000003139 buffering effect Effects 0.000 description 4
- 230000009977 dual effect Effects 0.000 description 4
- 238000005259 measurement Methods 0.000 description 4
- 238000004891 communication Methods 0.000 description 3
- 230000009467 reduction Effects 0.000 description 3
- 238000004590 computer program Methods 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 230000009191 jumping Effects 0.000 description 2
- 239000013589 supplement Substances 0.000 description 2
- 230000001360 synchronised effect Effects 0.000 description 2
- 230000001133 acceleration Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 208000018747 cerebellar ataxia with neuropathy and bilateral vestibular areflexia syndrome Diseases 0.000 description 1
- 230000003247 decreasing effect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 239000000126 substance Substances 0.000 description 1
- 238000010998 test method Methods 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
- 230000016776 visual perception Effects 0.000 description 1
- 230000003313 weakening effect Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
- H04N21/44—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
- H04N21/4402—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
- H04N21/44—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
- H04N21/4402—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
- H04N21/440263—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display by altering the spatial resolution, e.g. for displaying on a connected PDA
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
- H04N21/442—Monitoring of processes or resources, e.g. detecting the failure of a recording device, monitoring the downstream bandwidth, the number of times a movie has been viewed, the storage space available from the internal hard disk
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
- H04N21/442—Monitoring of processes or resources, e.g. detecting the failure of a recording device, monitoring the downstream bandwidth, the number of times a movie has been viewed, the storage space available from the internal hard disk
- H04N21/44209—Monitoring of downstream path of the transmission network originating from a server, e.g. bandwidth variations of a wireless network
Definitions
- the present invention relates to the field of video playback, and in particular, to a method and an apparatus for switching video clarity.
- the switching of video sharpness is mainly completed by manual operation, and the user clicks the "sharpness" control in the player to select the desired sharpness level in the triggered sharpness level menu.
- the client stops the playback of the original video and requests a new resolution level video from the server.
- the player After loading the streaming data of the new video, the player starts playing a new one from the interruption point of stopping the playback. Video, thereby completing the sharpness switching of the video.
- the existing way of switching video resolution requires manual intervention by the user, and the player is in an unplayable state after the client stops playing the original video and before loading the new video, and the playback cannot continue until the new video is loaded. Therefore, the video playing process is forced to be interrupted due to the switching of the sharpness, thereby affecting the smoothness of the video playing, and causing inconvenience to the user to watch the video.
- the invention provides a method and a device for switching video clarity, which can solve the problem that the resolution switching process affects the smoothness of video playback.
- the present invention provides a method for switching video clarity, the method comprising:
- the second decoding library is created, and the second video source corresponding to the current network speed corresponding to the current network speed is loaded by the second decoding library, and the second video source and the first video source are different from the same video content.
- Video source
- Seamless switching from the first video source to the second video source is achieved by cooperating with an increase in transparency of the first video source and a decrease in transparency of the second video source.
- the method includes: synchronizing playing the second video source according to the playing progress of the first video source on the newly created canvas overlapping with the first video source canvas, wherein the initial transparency of the newly created canvas is completely transparent, and the second video source is The initial playback volume is the same as the playback volume of the first video source;
- the present invention also provides a video clarity switching device, the device comprising:
- a determining unit configured to determine whether to switch video clarity according to current network conditions during a process in which the playing unit plays the first video source through the first decoding library
- a loading unit configured to: if the video definition is switched, establish a second decoding library, and load, by using the second decoding library, a second video source of a sharpness level corresponding to the current network speed, where the second video source is the same as the first video source a different video source for a video content;
- control unit configured to seamlessly switch the first video source to the second video source
- a playing unit for playing a video source according to control of the control unit.
- control unit is further configured to implement seamless switching from the first video source to the second video source by cooperating with the improvement of transparency of the first video source and the reduction of transparency of the second video source.
- the playing unit is further configured to synchronously play the second video source according to the playing progress of the first video source on the newly created canvas overlapping with the first video source canvas, wherein the initial transparency of the newly created canvas is completely transparent, and the second video source is The initial playback volume is the same as the playback volume of the first video source;
- control unit configured to: display the first video within a preset duration from the start of playing the second video source
- the transparency transition of the source canvas is converted to completely transparent, and the transparency transition of the new canvas is converted to completely opaque; and the sound of the first video source is switched to the sound of the second video source;
- the playing unit is also used to stop playing the first video source.
- the present invention provides a computing device comprising: a network interface that enables the computing device to acquire a video source; a display that enables the technical device to display a video; a processor coupled to the display interface, the processor configured to perform an operation of determining whether to switch video clarity according to current network conditions during playback of the first video source through the first decoding library; If the video resolution is switched, the second decoding library is established, and the second video source is loaded with the second video source of the sharpness level corresponding to the current network speed, where the second video source and the first video source are Different video sources of the same video content; and seamlessly switching the first video source to the second video source.
- the present invention provides a non-transitory machine readable storage medium having stored thereon executable code that, when executed by a processor, causes the processor to perform the method described above.
- the method and device for switching video sharpness can automatically determine whether to switch video definition according to current network conditions, and if needed to switch, select a second video source with a sharpness level matching the current network speed for loading, switching
- the process does not require the user to perform any operation; when switching the resolution, the present invention implements the dual decoding library mechanism, that is, in the process of playing the first video source in the first decoding library, the second decoding library is used to canvas with the first video source.
- the second video source is synchronously played on the overlapping new canvas, thereby eliminating the buffer gap between the video sources and achieving seamless connection of the video source image; in addition, the present invention also uses a gradient form switching mechanism to pass the transition of the canvas transparency.
- the method and device for switching the video sharpness can automatically and seamlessly switch the video sharpness, and can effectively ensure the smoothness of the video playing during the switching process.
- FIG. 1 is a flowchart of a method for switching video clarity according to an embodiment of the present invention
- FIG. 2 is a flowchart of another method for switching video resolution according to an embodiment of the present invention.
- FIG. 3 is a flowchart of still another method for switching video clarity according to an embodiment of the present invention.
- FIG. 4 is a block diagram showing the composition of a video sharpness switching apparatus according to an embodiment of the present invention.
- FIG. 5 is a block diagram showing the composition of another video sharpness switching apparatus according to an embodiment of the present invention.
- the embodiment of the invention provides a method for switching video clarity, which is mainly implemented on an electronic device side capable of installing a streaming media player, such as a mobile phone, a personal computer (PC), a tablet computer, a wearable device, and the like.
- a streaming media player such as a mobile phone, a personal computer (PC), a tablet computer, a wearable device, and the like.
- the media player can be an APP native player or a web player.
- the method includes:
- step 101 in the process of playing the first video source through the first decoding library, it is determined whether to switch the video definition according to the current network condition.
- the player will play the video source according to the defined or user-selected sharpness level.
- the sharpness level can be divided into smooth, standard definition according to the order of definition from low to high. , HD, Ultra HD and so on.
- different definition standards for clarity may be formulated according to different vendor standards, industry standards, industry alliance standards, or national/international standards. This embodiment does not limit this.
- the first video source is the video source currently being played, and the clarity level of the first video source can be It is set by default for the player or video site, or it can be manually set by the user during video playback or playback.
- the device determines whether to switch the video definition based on the current network condition.
- the network condition may be a bandwidth speed of the network (hereinafter referred to as a network speed) or a network type, such as a 3G network, a WIFI network, a VPN network, or the like.
- the device can switch the resolution when the network speed changes, or when the network type changes (more due to network switching).
- the network condition may further include a location of the device in the cell, a load status of the base station to which the device belongs, a communication mode between the device and the base station (simplex, duplex), and The size of the device's transmit/receive power, etc.
- the above conditions change the signal strength of the device in the cell, thereby affecting the communication speed in the downlink direction.
- the change of the above conditions can be used as a factor for triggering the sharpness switching.
- the network condition may further include the strength of the device receiving the WIFI signal, the number of bridge levels of the router, and the number of devices accessed by the router. These changes in conditions can affect the bandwidth allocated by the device and thus the speed of the data download, so it can also be used as a trigger for clarity switching.
- the foregoing network conditions may be used alone or in combination of multiple conditions. This embodiment does not specifically limit the types of network conditions and the manner of use.
- the device can initiate the monitoring process of the network conditions actively, or passively receive the notification message sent by the outside to know what changes have occurred in the network conditions.
- the device may initiate a location update request to the base station to obtain the identity of the current base station, or send a Ping packet to the network server for downlink data speed measurement.
- the device may receive the cell update information transmitted by the target base station when the cell handover occurs, or receive the network type change notification broadcasted by the operating system after switching from the mobile network to the local area network.
- the device sequentially performs steps 102 to 105.
- the device cancels the execution of the subsequent process and continues to actively or passively monitor the network conditions.
- step 102 if the video definition is switched, a second decoding library is created, and the second video source of the sharpness level corresponding to the current network speed is loaded by the second decoding library.
- the second video source and the first video source are different video sources of the same video content, that is, the two The played video content is the same and the playing duration is the same, for example, the cartoon "Black Cat Sheriff", the difference is that the clarity level of the second video source is generally different from the sharpness level of the first video source.
- the resolution level is set corresponding to the network speed
- different network speeds correspond to different definition levels. Therefore, when the network speeds corresponding to different network conditions are the same or substantially similar, the second video source may also exist. In the case where the definition level of the video source is the same, this embodiment is not exclusive to this case.
- the device uses a decoding library to switch the video clarity.
- the decoding library loads and plays the second video source. Since it takes a certain time to load the second video source, after the first video source is terminated and before the second video source is started, there are time intervals ranging from several seconds to several tens of seconds, which disrupts the smoothness of the video playback. .
- the device uses a dual decoding library mechanism for resolution conversion.
- the device establishes a second decoding library, and loads the second video source through the second decoding library, which does not affect the first in the process.
- the decoding library plays the first video source.
- step 103 the first video source is seamlessly switched to the second video source.
- seamless switching from the first video source to the second video source can be achieved by cooperating with the enhancement of the transparency of the first video source and the reduction of the transparency of the second video source.
- Figure 2 shows a preferred switching method based on the method shown in Figure 1.
- steps 201 and 202 of FIG. 2 For details of the steps 201 and 202 of FIG. 2, refer to the related content of step 101 and step 102 of FIG. 1 , and details are not described herein again.
- step 203 on the new canvas overlapping with the first video source canvas, the second video source is synchronously played according to the playback progress of the first video source.
- the device creates a new canvas through the second decoding library, and the canvas has the same size as the first video source canvas, and overlaps over or under the first video source canvas.
- the device plays the second video source synchronously according to the playback progress of the first video source.
- the first video source is played to the 1:43:59 position, and the device adjusts the initial playback progress of the second video source to 1:43:59, from 1 At 43:59, the second video source is played on the new canvas, thereby realizing the first video source and the second video source. Play synchronously.
- the initial transparency of the newly created canvas is completely transparent, that is, the second video source is played on the newly created canvas with a completely transparent image effect. Since the first video source canvas normally plays the first video source with a completely opaque image effect, when the two canvases overlap and the new canvas is completely transparent, the content seen by the user is still the first video source. content.
- the device in addition to the transition of the image content, the device also needs to perform the non-differential conversion of the sound of the video source.
- This non-differential conversion is embodied by the difference in the playback volume of the two video sources, so the second video source needs to be guaranteed.
- the initial playback volume is the same as the playback volume of the first video source for subsequent volume switching.
- step 204 the transparency transition of the first video source canvas is converted to completely transparent, and the transparency transition of the new canvas is converted to completely opaque; and the first video source is converted within a preset duration from the start of playing the second video source. The sound is switched to the sound of the second video source.
- the preset duration is the length of time that the transition of the sharpness transition can be set by the designer, or a dedicated setup interface interface can be developed to provide the user with the possibility of custom settings. Under normal circumstances, the greater the preset duration, the smoother and smoother the transition effect, and the smaller the preset duration, the sharper the transition effect becomes more obvious. In the actual application, the preset duration can be set based on the order of seconds or milliseconds. This embodiment does not limit the specific value of the preset duration.
- the device when the second video source is played from 1:43:59 and the preset duration is set to 10 seconds, the device needs to complete the transition transition of the sharpness before 1:44:09.
- the device needs to gradually convert the transparency of the first video source canvas to be completely transparent, and at the same time convert the transparency of the new canvas into a completely opaque transition.
- the transparency of the first video source canvas and the new canvas can be synchronously transitioned, that is, the transition speed of the transparency of the two is the same.
- the transition speed of the transparency of the two is the same.
- the transition speed of the first video source canvas and the new canvas it is necessary to ensure that the two use the same transition speed.
- the transition accelerations of the two are the same.
- the transition effect of proper parallax in the actual application is also allowed. In this case, it is not necessary to require the transition speed of the first video source canvas and the new canvas to be exactly the same, as long as the two are completely transparent to complete within a preset time period. It is opaque, or completely opaque to a completely transparent conversion.
- the device may perform sound switching when starting to play the second video source, or may perform sound switching at any one of the preset durations, or may perform sound switching at any time after the transparency conversion is completed.
- the device only needs to complete the sound switching before stopping the playing of the first video source, and the embodiment does not limit the specific timing of switching the sound.
- step 205 the first video source is stopped.
- the first video source canvas becomes completely transparent, the user does not observe the playing content of the first video source, and after the new canvas becomes completely opaque, the user can see the second video source, from the user.
- the visual sense of the user the device has completed the conversion of the definition.
- the device still plays the first video source through the first decoding library. Since the playback of the first video source has no meaning at this time, in order to save the resource consumption of the player, the device performs step 205 to stop the first video.
- the playback of the source at this point, the process shown in Figure 2 is completed. Steps 203-205 can be viewed as a preferred implementation of step 103 of FIG.
- the method for switching the video sharpness can automatically determine whether to switch the video definition according to the current network condition, and if the switch is required, select the second video source of the sharpness level matching the current network speed to load, and the switching process
- the user does not need to perform any operations; when switching the resolution, the embodiment adopts a dual decoding library mechanism, that is, in the process of playing the first video source in the first decoding library, the second decoding library is used to canvas with the first video source.
- the second video source is synchronously played on the overlapping new canvas, thereby eliminating the buffer gap between the video sources and achieving seamless connection of the video source image.
- the embodiment also uses a gradient form switching mechanism to pass the transparency of the canvas.
- the transition adjustment achieves a smooth transition of the sharpness of the picture, thereby avoiding a jump change in the sharpness of the picture, making the switching process more natural and smooth.
- the video clarity switching method provided in this embodiment can automatically and seamlessly switch the video clarity, and can effectively ensure the smoothness of video playback during the switching process.
- an embodiment of the present invention further provides a method for switching video clarity. As shown in FIG. 3, the method includes:
- step 301 in the process of playing the first video source through the first decoding library, according to the current Network conditions determine whether to switch video clarity.
- the device When actively monitoring changes in network conditions, the device periodically performs conditional monitoring throughout the use of the player, such as testing the network speed every 2 minutes, or requesting a location update every 100 seconds.
- the device caches the network parameters obtained for each monitoring, so that it can be used for the next condition monitoring.
- the network parameters of the current monitoring change compared with the previously monitored network parameters, it can be determined that the video definition needs to be switched.
- the timing of monitoring network conditions is not determined by the device itself, and the device directly determines the switching video clarity after receiving notification of changes in network conditions.
- the device When the device is located in a network, the device periodically tests the network speed and determines whether the current network speed has changed compared to the network speed obtained in the previous test. If the network speed of the current network changes, the device determines to switch the video clarity.
- the device is connected to the home WIFI local area network, and during the process of playing the first video source, the device tests the network speed in a cycle of 90 seconds.
- the device compares it with the cached network speed test result of 900KB/S, and finds that the two are inconsistent, and the device determines the switching video clarity.
- the device also determines the switching video definition.
- the device can be preset. A minimum speed difference, for example 0.5M/S. The device determines the switching video resolution only when the difference between the measured network speeds is greater than or equal to the minimum network speed difference. Otherwise, the network speed is not changed.
- the network speeds of different types of networks are different.
- the 3G network generally has a higher network speed than the GSM network, and the network speed of the 100 megabit bandwidth LAN is often higher than that of the 3G network.
- even the same type of network may have a network speed.
- the difference for example, the network speed of a 100 Mbps bandwidth LAN will be higher than that of a 10 Mbps bandwidth LAN, and the carrier network A's 3G network speed is lower than that of Carrier B's 3G network.
- the device can determine whether to switch to the new network. If it switches to the new network, the device determines to switch the video clarity and test the network speed of the new network.
- the operating system listens to the network through a dedicated thread, and the device subscribes to the system notification message to the operating system, and the system notification message is used to notify the network switching event.
- the device determines whether to switch to the new network based on whether the system notification message sent by the operating system is received, that is, when the system notification message is received, it is determined that the new network is switched, and when the system notification message is received, the device confirms that Switch to the new network.
- the Android operating system is taken as an example: the operating system provides a BroadcastReceiver service to all applications. Based on the service, the operating system notifies the currently occurring events to all applications subscribed to the event.
- an event is defined as a specified string in the operating system. For an event that occurs during network switching, the corresponding string is "android.net.conn.CONNECTIVITY_CHANGE".
- the string of the network switch event is sent to each application as a system notification message through the BroadcastReceiver service.
- the device may also actively request the network type of the current network from the operating system, and determine whether to switch to the new network by whether the network type changes.
- the application in the device can execute the getNetworkInfo method to call the ConnectivityManager service, and request the operating system to determine the network type of the current network.
- the device may also be limited to the number of devices that the device switches to the base station, whether the device is located at the edge of the cell, and the LAN router accesses. Whether the change of various network conditions is changed or not, determining the clarity of the switched video is limited by the length, and the other embodiments are not introduced one by one in this embodiment.
- the device needs to test the network speed of the current network, so that the subsequent network can find the corresponding network speed.
- the device may establish a dedicated thread in the application to perform network speed testing, or may perform network speed testing through a third-party speed measurement application and obtain test results through an inter-process communication mechanism.
- the network speed test is a relatively mature technical means, and the present embodiment does not introduce too much about its test principle and test method.
- step 302 if the video definition is switched, the resolution level corresponding to the current network speed is searched for.
- mapping table is pre-set in the device, and the mapping table is used to record the level of clarity corresponding to different network speeds. After performing the network speed test, the device accesses the mapping table to find the resolution level corresponding to the current network speed.
- the network speed parameter in the mapping table may be a discrete value, such as 100 KB/S, 200 KB/S, 500 KB/S, 1 M/S, 2 M/S, 2.5 M/S, etc., each network speed parameter corresponds to one or more of the parameters.
- the level of clarity that can be supported under network speed conditions.
- the device can select any of the levels of sharpness.
- the mapping table can be shaped as shown in the following table:
- the device selects the highest definition level that the network speed parameter can support, that is, loads the highest resolution level supported by the current network speed through the second decoding library.
- the second video source For example, in the above table, when the network speed is 1M/S, the device selects the sharpness level “smooth”, and when the network speed is 5M/S, the device selects the sharpness level “HD”.
- the improved mapping table can be shaped as shown in the following table:
- the device searches the mapping table with the network speed parameter closest to the actual network speed. For example, when the actual speed is 4M/S, the device selects the definition level “HD” according to the 5M/S speed position.
- step 303 a second decoding library is established, and the second video source of the sharpness level corresponding to the current network speed is loaded by the second decoding library.
- the device After determining the sharpness level, the device sends a video source request to the video site through the second decoding library, requesting to load the second video source corresponding to the sharpness level.
- the device may preferentially request a second video source from a site that provides the first video source, and when the site does not provide the second video source, the device selects to request the second video source from other video sites.
- step 304 the playing progress of the first video source is recorded when the second video source is loaded, and is recorded as the first playing progress.
- the decoding library When the video source is played, the decoding library often needs a short buffer time. If the playback progress of the first video source is used as the initial playback progress of the second video source when the second video source is loaded, then when the second video source starts to When the initial playback progress is played, the playback progress of the first video source has exceeded the initial playback progress, so that the second video source and the first video source cannot be played in absolute synchronization.
- the playback progress of the first video source is 1:24:02.
- the initial playback progress of the second video source is buffered from 00:00:00 to 1:24:02, which takes 1 second, then the initial playback progress of 1:24:02 as the second video source will appear.
- the second video source is buffered and starts playing at 1:24:02, the playback progress of the first video source has reached 1:24:03, and there is a 1 second progress difference between the two.
- the embodiment adopts a post-stage mechanism, and steps 304 to 307 are adopted.
- the implementation ensures absolute synchronization of the playback of the two video sources.
- the device records the playing progress of the first video source at the time when the second video source is loaded, and records it as the first playing progress.
- the first playback progress recorded by the device is 1:24:02.
- step 305 the first play progress is added to the preset progress margin, and the second play progress is obtained.
- the unit of the post-station balance is in seconds, and the duration can be set according to experience.
- the setting of the post-progress margin should meet the following requirements: the post-progress margin is not less than the video source buffer under the specific network speed.
- the so-called specific network speed refers to the minimum network speed that the current network may reach. For example, under the minimum network speed condition of the current network, it takes 3 seconds to buffer a video source, and the post-schedule balance should be equal to or greater than 3 seconds.
- the purpose of the above requirement is to ensure that the second video source completes buffering before the first video source is played to the second playback progress.
- factors affecting the buffering speed of the video source include the speed at which the site responds to the video source request, the DNS resolution speed, and the firewall filtering speed.
- the margin should be comprehensively considered based on various factors to ensure that the duration of the post-scheduled margin can meet the time-consuming requirements of the video source buffer.
- the second playback progress calculated in this step is 1:24:05.
- step 306 the initial playback progress of the second video source is adjusted to the second playback progress.
- the second decoding library buffers the second video source and adjusts its initial playback progress from the default 00:00:00 to 1:24:05. During this process, the first video source continues to play, but the playback progress has not yet reached 1:24:05. The second video source is buffered until 1:24:05 to pause playback, waiting for the first video source to play to 1:24:05.
- step 307 when the first video source is played to the second playback progress, the second video source is started to be played on the newly created canvas.
- the device After the second decoding library is created, the device creates a new canvas for playing the second video source through the second decoding library.
- the first video source is played to 1:24:05
- the second decoding library starts playing on the new canvas.
- the transparency and normal playback of the first video source canvas at the moment when the second video source starts playing The transparency is the same, it is completely opaque, and the initial transparency of the new canvas is completely transparent. At this time, the user still sees the first video source, and the video clarity has not changed.
- the sound of the first video source is turned off when the second video source is started to be played.
- the sound of the first video source is turned off by the first decoding library. Since the playback volume of the second video source is the same as that of the first video source, no difference switching on the sound can be achieved. The first video source still plays according to the playback progress after the sound is turned off.
- step 309 the transparency parameter of the first video source canvas is gradually lowered according to the preset transparency step value, and the transparency parameter of the new canvas is gradually adjusted according to the transparency step value.
- the first video source and the second video source need to be completed within a period of 1:24:05 to 1:24:09.
- the first video source and the second video source have a uniform transition transparency, and both use the same transparency step value.
- This embodiment provides two implementations for determining the transparency step value.
- the device automatically calculates the transparency step value according to the transparency parameter range and the preset duration; second, the developer or the user manually sets the transparency step value.
- the transparency parameter ranges from 0 to 100, and 0 is completely transparent. 100 is completely opaque (of course, in other standards, the transparency parameter can also range from 0 to 1 or 0 to 200, not shown here).
- the device divides the upper limit value 100 of the transparency parameter by the preset duration by 4 seconds, and calculates the transparency step value as 25, that is, the transparency change rate of the two video sources is 25 transparency units per second.
- the transparency step value is artificially set according to the empirical value or personal preference, and the set transparency step value should satisfy that the transparency can be converted from the upper limit value (lower limit value) to the lower limit value within the preset time period ( Upper limit value), for example, the transparency step value can be set to 30 or 50.
- the device may recalculate the new conversion duration according to the transparency parameter range and the set transparency step value. For example, when the transparency step value is set to 40, the device divides the transparency upper limit value 100 by 40 to obtain a new one.
- the conversion time is 2.5 seconds.
- the first video source is uniformly converted from the transparency 100 to the transparency 0 according to the transparency step value
- the second video source is uniformly converted from the transparency 0 to the transparency 100 according to the transparency step value. Since the conversion of transparency is linear, the transition of sharpness is gentle and soft in visual perception, and there is no jumping change.
- the first video source and the second video source are always synchronized, and when the playback progress reaches 1:24:09 (ie, when the conversion is completed), the first video source canvas becomes completely transparent. The new canvas becomes completely opaque, and the content viewed by the user is the second video source.
- step 310 the first decoding library is deleted, and the cache of the first video source is cleared.
- the device stops playing the first video source, deletes the first decoding library, and deletes the data of the first video source (including the played data and the buffered data that has not been played yet) from the cache.
- the second decoding library remains in the player to play the second video source, and the resolution switching process ends.
- an embodiment of the present invention further provides a method for switching video clarity.
- the method is based on the principle of providing a higher definition video source to the user. If the resolution level of the second video source is equal to or smaller than the first video source, the device does not perform the definition in order to save network transmission resources and processing resources of the device. Switch. specific:
- the device performs step 302 of FIG. 3, the table obtains the sharpness level of the second video source, and reads the sharpness level of the first video source from the data packet file of the first video data, and compares the two. If the sharpness level of the first video source is equal to or greater than the sharpness level of the second video source, it indicates that the sharpness level of the second video source is not superior to the first video source, and in this case, switching the video definition has no substance. Meaning, the device cancels the establishment of the second decoding library, does not perform steps 303 to 310, and continues to play the first video source.
- the device establishes a second decoding library, loads the second video source, and sequentially executes Figure 3 is the follow-up process.
- the device may count the number of buffers that occur during the playing of the first video source, when buffering When the number of times exceeds the preset number of times threshold, a second decoding library is created to load the second video source. For example, after comparing the sharpness levels of the two video sources, if the playback process of the first video source generates multiple interrupt buffers (eg, more than 3 times) for a predetermined period of time, the device establishes a second decoding. The library loads the second video source and sequentially executes the subsequent processes of FIG.
- the purpose of the above mechanism is to: when the resolution level of the first video source is greater than the second video source, theoretically indicating that the current network speed has decreased, in order to avoid video playback, the first video source should be switched to resolution.
- the decline in network speed is not necessarily caused by the single factor of the actual bandwidth drop.
- the poor stability of the network signal may also cause the network speed to fluctuate in a short period of time, for example, in WIFI.
- the weakening of the network signal causes the actual downlink rate on the device side to decrease.
- the network When the device is in an environment with high bandwidth but poor signal stability, the network should be given a period of time to restore stability. At this time, the resolution switching is not rushed. Only when the first video source has multiple interrupt buffers, can it be more certain that the situation is caused by the bandwidth drop. At this time, some user experience needs to be sacrificed to switch to low definition. Otherwise, when the network signal is stable, it will appear.
- the problem of playing low-definition video at high bandwidth is contrary to the principle of providing users with the highest possible definition of video.
- the device periodically tests the network speed. When the network speed changes, it switches to the highest resolution level supported by the current network speed.
- the video source's sharpness level may be appropriately lowered, or directly lowered to the lowest sharpness level, in which case the resolution quality is not For the primary pursuit; when switching to the WIFI network, in order to maximize the clarity level of the video source, you can switch to the maximum resolution level supported by the current network speed.
- the device records and learns the behavior of the user manually setting the sharpness level in different network speed environments, obtains the user's clarity level preference in different network speed environments, and switches to the user's preferred clarity level according to the current network speed. .
- the embodiment of the present invention further provides a video clarity switching device, which can be located in a mobile phone, a personal computer (PC), a tablet computer, a wearable device, and the like.
- a video clarity switching device which can be located in a mobile phone, a personal computer (PC), a tablet computer, a wearable device, and the like.
- the apparatus includes a determining unit 41, a loading unit 42, a playing unit 43, and a control unit 44. among them,
- a determining unit 41 configured to determine whether to switch the video clarity according to the current network condition during the playing of the first video source by the playing unit 43 through the first decoding library
- the loading unit 42 is configured to: if the video definition is switched, establish a second decoding library, and load, by using the second decoding library, a second video source of a sharpness level corresponding to the current network speed, where the second video source and the first video source are Different video sources for the same video content;
- the control unit 44 is configured to switch the first video source to the second video source
- the playback unit 43 is configured to play a video source according to the control of the control unit 44.
- control unit 44 can achieve seamless switching from the first video source to the second video source by cooperating with the enhancement of the transparency of the first video source and the reduction of the transparency of the second video source.
- the playing unit 43 can be configured to play the second video source synchronously according to the playing progress of the first video source on the newly created canvas overlapping with the first video source canvas, wherein the initial transparency of the newly created canvas is completely transparent.
- the control unit 44 may be configured to convert the transparency transition of the first video source canvas to be completely transparent within a preset duration from the start of playing the second video source, and convert the transparency transition of the newly created canvas to be completely opaque;
- the playing unit 43 can also be used to stop playing the first video source.
- the control unit 44 can also be configured to cause the initial playback volume of the second video source to be the same as the playback volume of the first video source, and to switch the sound of the first video source to the sound of the second video source during the transparency transition.
- the determining unit 41 includes a first determining module 411, configured to:
- the determining unit 41 includes a second determining module 412, configured to:
- Whether to switch to the new network is determined according to whether a system notification message is received.
- the second determining module 412 is configured to:
- the device further includes:
- An obtaining unit 45 configured to acquire a sharpness level of the second video source before establishing the second decoding library
- the comparing unit 46 is configured to compare the sharpness levels of the first video source and the second video source;
- the loading unit 42 is configured to cancel the establishment of the second decoding library if the sharpness level of the first video source is equal to or greater than the sharpness level of the second video source;
- the loading unit 42 is further configured to: if the sharpness level of the first video source is less than the sharpness level of the second video source, establish a second decoding library, and load the second video source.
- the device further includes:
- the counting unit 47 is configured to count the number of buffers that occur during the playing of the first video source, if the sharpness level of the first video source is greater than the sharpness level of the second video source;
- the loading unit 42 is configured to establish a second decoding library and load the second video source when the buffering number exceeds a preset number of times threshold.
- the loading unit 42 is configured to load, by the second decoding library, the second video source of the highest definition level supported by the current network speed.
- the playing unit 43 is configured to: when the second video source is loaded, record the playing progress of the first video source, and record the first playing progress;
- the second video source is started to be played.
- control unit 44 is configured to:
- the transparency parameter of the first video source canvas is gradually lowered according to the preset transparency step value, and the transparency parameter of the new canvas is gradually adjusted according to the transparency step value.
- control unit 44 is configured to turn off the sound of the first video source when starting to play the second video source.
- the playing unit 43 is configured to stop after playing the first video source:
- the video sharpness switching device provided in this embodiment can automatically determine whether to switch video definition according to current network conditions, and if necessary, select a resolution that matches the current network speed.
- the second video source of the level is loaded, and the switching process does not need to perform any operation by the user; when switching the definition, the embodiment adopts a dual decoding library mechanism, that is, in the process of playing the first video source in the first decoding library, The second decoding library synchronously plays the second video source on the newly created canvas overlapping with the first video source canvas, thereby eliminating the buffer gap between the video sources, and achieving seamless connection of the video source image; in addition, the embodiment also uses The switching mechanism of the gradual form realizes the smooth transition of the sharpness of the picture by the transition adjustment of the transparency of the canvas, thereby avoiding the jumping change of the sharpness of the picture, and making the switching process more natural and smooth. It can be seen that the video sharpness switching device provided in this embodiment can automatically and seamlessly switch the video sharpness, and can effectively ensure the smoothness of video playback during the switching process
- the present invention may also be embodied as a computing device comprising: a network interface that enables the computing device to acquire a video source; a display that enables the technical device to display video; A network interface and a processor coupled to the display.
- the processor is configured to perform the above method of switching video sharpness.
- the invention may also be practiced with stored thereon executable code that, when executed by a processor, causes the processor to perform the methods described above.
- executable code that, when executed by a processor, causes the processor to perform the methods described above.
- modules in the devices of the embodiments can be adaptively changed and placed in one or more devices different from the embodiment.
- the modules or units or components of the embodiments may be combined into one module or unit or component, and further they may be divided into a plurality of sub-modules or sub-units or sub-components.
- any combination of the features disclosed in the specification, including the accompanying claims, the abstract and the drawings, and any methods so disclosed, or All processes or units of the device are combined.
- Each feature disclosed in this specification (including the accompanying claims, the abstract and the drawings) may be replaced by alternative features that provide the same, equivalent or similar purpose.
- the various component embodiments of the present invention may be implemented in hardware, or in a software module running on one or more processors, or in a combination thereof.
- DSPs digital signal processors
- the invention can also be implemented as a device or device program (e.g., a computer program and a computer program product) for performing some or all of the methods described herein.
- a program implementing the invention may be stored on a computer readable medium or may be in the form of one or more signals.
- signals may be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Computer Networks & Wireless Communication (AREA)
- Databases & Information Systems (AREA)
- Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
Abstract
本发明公开了一种视频清晰度的切换方法及装置,涉及视频播放领域,为解决清晰度切换过程影响视频播放流畅度的问题而发明。本发明的方法包括:在播放第一视频源的过程中根据当前的网络条件确定是否切换视频清晰度;若切换视频清晰度则建立第二解码库,通过第二解码库加载与当前网速对应的清晰度等级的第二视频源;将第一视频源无缝切换成所述第二视频源。从第一到第二视频源的无缝切换可以通过透明度的对应转换来实现。本发明主要应用于切换在线视频清晰度的过程中。
Description
本发明涉及视频播放领域,尤其涉及一种视频清晰度的切换方法及装置。
目前,各大视频站点都会针对在线视频提供不同清晰度的视频,较为常见的清晰度等级包括“标清”、“高清”、“超清”等。用户在通过浏览器的网页播放器或者APP客户端的原生播放器观看在线视频时,可以根据网络条件以及个人需求选择适合的清晰度等级。通常,在网络带宽没有限制的情况下,用户一般会优先选择清晰度较高的视频观看,而当网络带宽无法支持当前的清晰度等级时,则需要用户下调视频的清晰度等级。
现有技术中,视频清晰度的切换主要通过手动操作完成,用户点击播放器中的“清晰度”控件,在触发的清晰度等级菜单中选择需要的清晰度等级。在用户选择完毕后,客户端停止原视频的播放,并向服务端请求新的清晰度等级的视频,当加载到新视频的流媒体数据后,播放器从停止播放的中断点开始播放新的视频,由此完成视频的清晰度切换。
现有切换视频清晰度的方式需要用户手动操作的干预,并且客户端在停止播放原视频之后、加载新的视频之前,播放器处于无法播放的状态,直到新的视频加载完成才能继续播放。因此视频播放过程会因清晰度的切换而被迫中断,从而影响视频播放的流畅度,对用户观看视频造成不便。
发明内容
本发明提供了一种视频清晰度的切换方法及装置,能够解决清晰度切换过程影响视频播放流畅度的问题。
为解决上述问题,一方面,本发明提供了一种视频清晰度的切换方法,该方法包括:
在通过第一解码库播放第一视频源的过程中,根据当前的网络条件确
定是否切换视频清晰度;
若切换视频清晰度,则建立第二解码库,通过第二解码库加载与当前网速对应的清晰度等级的第二视频源,第二视频源与第一视频源为同一个视频内容的不同视频源;以及
将第一视频源无缝切换成第二视频源。
通过协同所述第一视频源透明度的提升和所述第二视频源透明度的降低实现从所述第一视频源到所述第二视频源的无缝切换。
具体地,该方法包括:在与第一视频源画布重叠的新建画布上,按照第一视频源的播放进度同步播放第二视频源,其中,新建画布的初始透明度为完全透明,第二视频源的初始播放音量与第一视频源的播放音量相同;
在开始播放第二视频源起的预设时长内,将第一视频源画布的透明度过渡转换为完全透明,同时将新建画布的透明度过渡转换为完全不透明;并且将第一视频源的声音切换为第二视频源的声音;
停止播放第一视频源。
另一方面,本发明还提供了一种视频清晰度的切换装置,该装置包括:
确定单元,用于在播放单元通过第一解码库播放第一视频源的过程中,根据当前的网络条件确定是否切换视频清晰度;
加载单元,用于若切换视频清晰度,则建立第二解码库,通过第二解码库加载与当前网速对应的清晰度等级的第二视频源,第二视频源与第一视频源为同一个视频内容的不同视频源;
控制单元,用于将第一视频源无缝切换成第二视频源;以及
播放单元,用于根据控制单元的控制,播放视频源。
具体地,该控制单元,还可用于通过协同所述第一视频源透明度的提升和所述第二视频源透明度的降低实现从所述第一视频源到所述第二视频源的无缝切换。
播放单元,还可用于在与第一视频源画布重叠的新建画布上,按照第一视频源的播放进度同步播放第二视频源,其中,新建画布的初始透明度为完全透明,第二视频源的初始播放音量与第一视频源的播放音量相同;
控制单元,用于在开始播放第二视频源起的预设时长内,将第一视频
源画布的透明度过渡转换为完全透明,同时将新建画布的透明度过渡转换为完全不透明;并且将第一视频源的声音切换为第二视频源的声音;
播放单元还用于停止播放第一视频源。
另一方面,本发明提供了一种计算设备,包括:网络接口,所述网络接口使得所述计算设备能够获取视频源;显示器,所述显示器使得所述技术设备能够显示视频;以及与所述网络接口和所述显示器相连接的处理器,所述处理器被配置为执行如下操作:在通过第一解码库播放第一视频源的过程中,根据当前的网络条件确定是否切换视频清晰度;若切换视频清晰度,则建立第二解码库,通过所述第二解码库加载与当前网速对应的清晰度等级的第二视频源,所述第二视频源与所述第一视频源为同一个视频内容的不同视频源;以及将第一视频源无缝切换成第二视频源。
又一方面,本发明提供了一种非暂时性机器可读存储介质,其上存储有可执行代码,当所述可执行代码被处理器执行时,使所述处理器执行上述的方法。
本发明提供的视频清晰度的切换方法及装置,能够根据当前的网络条件自动确定是否切换视频清晰度,如需切换则选择与当前网速匹配的清晰度等级的第二视频源进行加载,切换过程无需用户执行任何操作;在切换清晰度时,本发明采用双解码库机制进行实现,即在第一解码库播放第一视频源的过程中,通过第二解码库在与第一视频源画布重叠的新建画布上同步播放第二视频源,由此消除视频源之间的缓冲间隙,实现视频源画面的无缝衔接;此外,本发明还使用渐变形式的切换机制,通过对画布透明度的过渡调整实现画面清晰度的平滑转换,从而避免画面清晰度的跳跃式变化,使得切换过程更加自然流畅。综合上述几点可以看出,本发明提供的视频清晰度的切换方法及装置,能够自动对视频清晰度进行无缝平滑切换,可以在切换过程中有效保障视频播放的流畅度。
上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:
图1示出了本发明实施例提供的一种视频清晰度的切换方法流程图;
图2示出了本发明实施例提供的另一种视频清晰度的切换方法流程图;
图3示出了本发明实施例提供的又一种视频清晰度的切换方法流程图;
图4示出了本发明实施例提供的一种视频清晰度的切换装置的组成框图;
图5示出了本发明实施例提供的另一种视频清晰度的切换装置的组成框图。
下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。
本发明实施例提供了一种视频清晰度的切换方法,该方法主要位于手机、个人电脑(PC)、平板电脑、可穿戴式设备等能够安装流媒体播放器的电子设备侧执行,所述流媒体播放器可以是APP原生播放器或网页播放器。如图1所示,该方法包括:
在步骤101、在通过第一解码库播放第一视频源的过程中,根据当前的网络条件确定是否切换视频清晰度。
通常情况下,播放器会按照既定或用户选择的清晰度等级播放视频源,在一种清晰度分级标准中,按照清晰度由低到高的顺序可以将清晰度等级依次划分为:流畅、标清、高清、超高清等几种。实际应用中还可以根据不同的厂商标准、行业标准、产业联盟标准或国家/国际标准制定不同的清晰度划分标准,本实施例对此不作限制。
第一视频源为当前正在播放的视频源,第一视频源的清晰度等级可以
是播放器或视频站点默认设置的,也可以是用户在视频播放开始或播放过程中手动设置的。本实施例中,在播放器通过第一解码库播放第一视频源时,设备以当前的网络条件为判断依据,确定是否切换视频清晰度。
所述网络条件可以是网络的带宽速度(后续简称为网速),也可以是网络类型,后者例如3G网络、WIFI网络、VPN网络等。设备可以在网速发生变化时进行清晰度切换,或者在网络类型发生变化时(多由于网络切换导致)进行清晰度切换。对于GSM、3G、4G等移动网络而言,所述网络条件还可以进一步包括设备在小区中的位置、设备所属基站的负载状况、设备与基站之间的通信方式(单工、双工)以及设备发射/接收功率的大小等。一般而言,上述条件的变化会改变设备在小区中的信号强弱,从而影响下行方向的通讯速度,因此可以将上述条件的变化作为触发清晰度切换的因素使用。对于以WIFI为主的局域网而言,所述网络条件还可以进一步包括设备接收WIFI信号的强弱、路由器的桥接级数、路由器接入的设备数量等。这些条件的改变能够影响设备分配的带宽,并由此影响数据下载的网速,因此同样可以将其作为清晰度切换的触发因素使用。上述网络条件可以单独使用也可以多种条件组合使用,本实施例不对网络条件的种类及使用方式进行具体限制。
实际应用中,设备可以主动发起对网络条件的监测流程,也可以被动接收外部发送的通知消息以获知网络条件发生了何种变化。示例性的,对于前者情形,设备可以向基站发起位置更新请求以获取当前所属基站的标识,或者向网络服务器发送Ping包进行下行数据测速。对于后者情形,设备可以在发生小区切换时接收目标基站的发送的小区更新信息,或者在从移动网络切换到局域网后接收操作系统广播的网络类型变更通知。
当确定切换视频清晰度时,设备顺序执行步骤102至步骤105,当确定无需切换视频清晰度时,设备取消后续流程的执行,继续对网络条件进行主动或被动的监测。
在步骤102、若切换视频清晰度,则建立第二解码库,通过第二解码库加载与当前网速对应的清晰度等级的第二视频源。
该第二视频源与第一视频源为同一个视频内容的不同视频源,即两者
所播放的视频内容相同且播放时长相同,例如均为动画片《黑猫警长》,区别在于一般情况下第二视频源的清晰度等级不同于第一视频源的清晰度等级。当然,由于清晰度等级是与网速相对应设置的,不同网速对应不同的清晰度等级,因此当不同网络条件对应的网速相同或大致相似时,也可能存在第二视频源与第一视频源的清晰度等级相同的情况,本实施例对此情况并不排斥。
现有技术中,设备使用一个解码库进行视频清晰度的切换,在通过解码库播放第一视频源时,如果需要进行清晰度切换,则设备会终止第一视频源的播放,然后通过该解码库加载并播放第二视频源。由于加载第二视频源需要耗费一定的时间,因此在终止播放第一视频源之后、开始播放第二视频源之前,会有几秒至几十秒不等的时间间隔,破坏视频播放的流畅度。
在本实施例中,设备采用双解码库机制进行清晰度转换,当需要切换清晰度时,设备建立第二解码库,通过第二解码库加载第二视频源,在此过程中不影响第一解码库对第一视频源的播放。
在步骤103、将第一视频源无缝切换为第二视频源。
在此步骤中,可以通过协同第一视频源透明度的提升和第二视频源透明度的降低实现从第一视频源到第二视频源的无缝切换。
图2示出了一种基于图1所示方法的优选切换方法。
其中,图2步骤201和步骤202的具体描述可以参见图1的步骤101和步骤102相关内容,在此不再赘述。
在步骤203、在与第一视频源画布重叠的新建画布上,按照第一视频源的播放进度同步播放第二视频源。
设备通过第二解码库新建一个画布,该画布尺寸与第一视频源画布的尺寸相同,重叠覆盖于第一视频源画布之上或之下。在新建画布上,设备按照第一视频源的播放进度同步播放第二视频源。
示例性的,当完成第二视频源的加载时,第一视频源播放到1:43:59的位置,设备将第二视频源的起始播放进度调整到1:43:59处,从1:43:59处开始在新建画布上播放第二视频源,从而实现第一视频源与第二视频源的
同步播放。
需要说明的是,本实施例中,新建画布的初始透明度为完全透明,即在新建画布上以完全透明的图像效果播放第二视频源。由于正常情况下第一视频源画布是以完全不透明的图像效果播放第一视频源的,因此在两个画布重叠并且新建画布完全透明的情况下,用户看到的内容仍然是第一视频源的内容。
此外,除了要对图像内容进行过渡转换外,设备还需要对视频源的声音进行无差别转换,这种无差别转换具体体现为两个视频源播放音量的无差别,因此需要保证第二视频源的初始播放音量与第一视频源的播放音量相同,以便后续进行音量切换。
在步骤204、在开始播放第二视频源起的预设时长内,将第一视频源画布的透明度过渡转换为完全透明,同时将新建画布的透明度过渡转换为完全不透明;并且将第一视频源的声音切换为第二视频源的声音。
该预设时长为清晰度过渡转换所消耗的时间长度,可由设计人员自行设置,也可开发专用的设置界面接口,为用户提供自定义设置的可能性。一般情况下,预设时长越大清晰度的过渡效果越平缓柔和,预设时长越小清晰度的过渡效果越加明显。实际应用中预设时长可以基于秒或毫秒的数量级进行设置,本实施例不对预设时长的具体数值进行限制。
示例性的,当从1:43:59开始播放第二视频源,并且预设时长设置为10秒时,设备需要在1:44:09以前完成清晰度的过渡转换。
在这10秒的时间内,设备需要将第一视频源画布的透明度逐步过渡转换为完全透明,同时将新建画布的透明度逐步过渡转换为完全不透明。在本实施例中,为追求绝对零视差的过渡效果,可以对第一视频源画布和新建画布的透明度进行同步过渡,即保证两者透明度的过渡速度相同。例如,当两者进行匀速过渡时,需要保证两者使用相同的过渡速度,当两者进行变速过渡时,需要保证两者的过渡加速度相同。当然,实际应用中适当存在视差的过渡效果也是被允许的,此情况下不必要求第一视频源画布与新建画布的过渡速度严格相同,只要保证两者在预设时长内完成从完全透明到完全不透明,或者完全不透明到完全透明的转换即可。
对于声音的切换,由于第一视频源和第二视频源的播放音量相同,所以无需进行过渡转换,只要一次性将第一视频源的声音切换为第二视频源的声音即可。本实施例中,设备可以在开始播放第二视频源时进行声音切换,也可以在预设时长中的任何一个时刻进行声音切换,或者还可以在透明度转换完成之后的任何一个时刻进行声音切换。设备只要在停止播放第一视频源之前完成声音切换即可,本实施例不对切换声音的具体时机进行限制。
在步骤205、停止播放第一视频源。
在执行完步骤204后,第一视频源画布变为完全透明,用户不会观察到第一视频源的播放内容,而新建画布变为完全不透明之后,用户则可以看到第二视频源,从用户的视觉感官上,设备已经完成清晰度的转换。但是此时设备内部仍然在通过第一解码库播放播放第一视频源,由于此时第一视频源的播放已无任何意义,因此为节省播放器的资源消耗,设备执行步骤205停止第一视频源的播放,至此,图2所示流程执行完毕。步骤203-205可以看做是图1步骤103的一个优选实现。
本实施例提供的视频清晰度的切换方法,能够根据当前的网络条件自动确定是否切换视频清晰度,如需切换则选择与当前网速匹配的清晰度等级的第二视频源进行加载,切换过程无需用户执行任何操作;在切换清晰度时,本实施例采用双解码库机制进行实现,即在第一解码库播放第一视频源的过程中,通过第二解码库在与第一视频源画布重叠的新建画布上同步播放第二视频源,由此消除视频源之间的缓冲间隙,实现视频源画面的无缝衔接;此外,本实施例还使用渐变形式的切换机制,通过对画布透明度的过渡调整实现画面清晰度的平滑转换,从而避免画面清晰度的跳跃式变化,使得切换过程更加自然流畅。综合上述几点可以看出,本实施例提供的视频清晰度的切换方法,能够自动对视频清晰度进行无缝平滑切换,可以在切换过程中有效保障视频播放的流畅度。
进一步的,作为对图2所示方法的补充,本发明实施例还提供了一种视频清晰度的切换方法,如图3所示,该方法包括:
在步骤301、在通过第一解码库播放第一视频源的过程中,根据当前的
网络条件确定是否切换视频清晰度。
当主动监测网络条件的变化时,设备在播放器使用的整个过程中周期性的进行条件监测,例如每2分钟测试一次网速,或者每100秒请求一次位置更新。设备对每次监测获得的网络参数进行缓存,以便下一次进行条件监测时进行比对之用。当与前次监测的网络参数相比本次监测的网络参数发生变化时,即可确定需要切换视频清晰度。
需要说明的是,对于启动播放器之后第一次监测得到的网络参数,由于其没有前次监测的网络参数可进行比对,因此实际应用中可以根据不同的设计需求制定不同的执行策略。例如,当以节省设备及网络资源为首要原则时,在首次测得网络参数后设备不执行切换视频清晰度的任务;而当以用户体验为首要原则时,在首次测得网络参数后设备直接确定切换视频清晰度。
当被动监测网络条件的变化时,监测网络条件的时机不由设备本身决定,设备在接收到网络条件变化的通知后直接确定切换视频清晰度。
下面给出本实施例中两种根据网络条件确定切换视频清晰度的方案:
1、根据网速切换视频清晰度
当设备位于某个网络中时,设备定期测试网速,并判断当前网络的网速相对前次测试获得的网速而言是否发生了变化。若当前网络的网速发生了变化,则设备确定切换视频清晰度。
示例性的,设备接入到家庭WIFI局域网中,在播放第一视频源的过程中,设备以90秒为周期测试网速。当测得的网速为1.2M/S时,设备将其与缓存的前次网速测试结果900KB/S进行比较,发现两者不一致,设备确定切换视频清晰度。或者,当前次网速测试结果大于当前测得网速时,例如1.8M/S,设备同样设备确定切换视频清晰度。
实际应用中,网络速度可能存在微小变化,例如900KB/S与932KB/S,对于这种微小变化,没有必要频繁切换视频清晰度,因此在本方案的一种实现方式中,设备中可以预设一个最小网速差值,例如0.5M/S。设备只有在前后两次测得的网速之差值大于等于这个最小网速差值时,才确定切换视频清晰度,否则认为网速未发生变化。
2、根据网络变化切换视频清晰度
通常,不同类型网络的网速各有不同,例如3G网络一般网速高于GSM网络,百兆带宽局域网的网速往往又高于3G网络;此外,即使是同一类型的网络也可能存在网速差异,例如百兆带宽局域网的网速会高于十兆带宽局域网、运营商A的3G网络网速低于运营商B的3G网络等。设备可以判断是否切换到新的网络中,若切换到新的网络中,则设备确定切换视频清晰度,并对新网络的网速进行测试。
本方案中,操作系统通过专用的线程对网络进行监听,设备向操作系统订阅系统通知消息,该系统通知消息用于通知网络切换事件。设备以是否接收到操作系统发送的系统通知消息为依据,判断是否切换到新的网络,即当接收到系统通知消息时确定切换了新的网络,而在为接收到系统通知消息时则确认未切换到新的网络中。
具体的,以Android操作系统为例:操作系统会向所有应用提供一个BroadcastReceiver的服务,基于该服务,操作系统会将当前发生的事件以广播形式通知给所有订阅这个事件的应用。通常,事件在操作系统中都会定义成一个指定的字符串,对于发生网络切换的事件,其对应的字符串为“android.net.conn.CONNECTIVITY_CHANGE”。当操作系统发现设备接入的网络发生变化时,通过BroadcastReceiver服务将网络切换事件的字符串作为系统通知消息发送给各个应用。
在本方案中的一种实现方式中,设备还可以主动向操作系统请求当前网络的网络类型,并通过网络类型是否发生变化来判断是否切换到新的网络中。具体的,设备中的应用可以执行getNetworkInfo方法调用ConnectivityManager服务,向操作系统请求将当前网络的网络类型。
以上两种确定切换视频清晰度的方案仅为本实施例提供的部分可行方案,实际应用中,设备还可以但不限于以设备是否切换基站、设备是否位于小区边缘、局域网路由器接入的设备数量是否改变等各种网络条件的变化为依据,确定切换视频清晰度,受篇幅所限,本实施例不再对其他方案进行一一介绍。
需要说明的是,无论以何种网络条件为依据确定切换视频清晰度,设备都需要对当前网络的网速进行测试,以便后续查找对应当前网速的清晰
度等级的第二视频源。本实施例中,设备可以在应用中建立专用线程进行网速测试,也可以通过第三方测速应用进行网速测试并通过进程间的通信机制获得测试结果。目前网速测试属于较为成熟的技术手段,本实施例对其测试原理、测试方式等内容不作过多介绍。
在步骤302、若切换视频清晰度,则查找对应当前网速的清晰度等级。
设备中预设有“网速-清晰度等级”映射表,该映射表用于记录不同网速对应的清晰度等级。在进行网速测试后,设备访问该映射表查找对应当前网速的清晰度等级。
映射表中的网速参数可以是离散数值,例如100KB/S、200KB/S、500KB/S、1M/S、2M/S、2.5M/S等,每个网速参数对应一个或多个该网速条件下能够支持的清晰度等级。当一个参数对应多个清晰度等级时,设备可以选择其中的任意一个清晰度等级。示例性的,映射表可以形如下表所示:
网速 | 清晰度等级 |
1M/S | 流畅 |
2M/S | 流畅、标清 |
5M/S | 流畅、标清、高清 |
10M/S | 流畅、标清、高清、超高清 |
在本实施例的一种实现方式中,为尽可能提高视频的播放质量,设备选择网速参数能够支持的最高清晰度等级,即通过第二解码库加载当前网速所支持的最高清晰度等级的第二视频源。例如在上表中,当网速为1M/S时,设备选择清晰度等级“流畅”、当网速为5M/S时,设备选择清晰度等级“高清”。
进一步的,为减少设备遍历的表数据,缩短设备访问映射表的时长,映射表中也可以仅记录对应各个网速参数的最高清晰度等级。示例性的,改进后的映射表可以形如下表所示:
网速 | 清晰度等级 |
1M/S | 流畅 |
2M/S | 标清 |
5M/S | 高清 |
10M/S | 超高清 |
以上表格中的具体数值仅为示例性说明,不构成对本实施例的限制。实际应用中,当测得网速未记录在映射表中时,设备以与实际网速最接近的网速参数查找映射表。例如当实际测速为4M/S时,设备根据5M/S的网速档位选择清晰度等级“高清”。
在步骤303、建立第二解码库,通过第二解码库加载与当前网速对应的清晰度等级的第二视频源。
在确定清晰度等级后,设备通过第二解码库向视频站点发送视频源请求,请求加载该清晰度等级对应的第二视频源。实际应用中,设备可以优先向提供第一视频源的站点请求第二视频源,当该站点未提供第二视频源时,设备选择向其他视频站点请求该第二视频源。
在步骤304、在第二视频源加载完毕时记录第一视频源的播放进度,记为第一播放进度。
解码库在播放视频源时,往往需要短暂的缓冲时间,如果以加载完第二视频源时第一视频源的播放进度作为第二视频源的起始播放进度,那么当第二视频源开始从起始播放进度播放时,此时第一视频源的播放进度已经超过该起始播放进度,从而导致第二视频源与第一视频源无法绝对同步播放。例如,第二解码库加载完第二视频源时第一视频源的播放进度为1:24:02。假设将第二视频源的起始播放进度从00:00:00缓冲到1:24:02需要1秒的时间,那么以1:24:02作为第二视频源的起始播放进度就会出现这样的问题:当第二视频源缓冲完毕并且从1:24:02开始播放时,此时第一视频源的播放进度已经到达1:24:03,两者之间存在1秒的进度差异,导致两个视频源无法同步播放。
为解决该问题,本实施例采用进度后置机制,通过步骤304至步骤307
的实现保证两视频源播放的绝对同步。具体的,设备在第二视频源加载完毕时记录此时第一视频源到达的播放进度,将其记为第一播放进度。在上述示例中,设备记录的第一播放进度为1:24:02。
在步骤305、将第一播放进度与预设的进度后置余量相加,获得第二播放进度。
该进度后置余量单位为秒,其时长可根据经验设置,一般情况下进度后置余量的设置应当满足如下要求:进度后置余量不小于在特定网速状况下进行视频源缓冲所需的最大时长。所谓特定网速是指当前网络可能达到的最小网速。例如,在当前网络的最小网速条件下,缓冲一个视频源最慢需要3秒,则进度后置余量应当等于或大于3秒。做上述要求的目的在于,保证第二视频源在第一视频源播放到第二播放进度以前完成缓冲。
实际应用中,影响视频源缓冲快慢的因素还包括站点响应视频源请求的速度、DNS解析速度、防火墙过滤速度等。在设置进度后置余量时应当基于各方因素综合考虑,以保证进度后置余量的时长能够满足视频源缓冲的耗时所需。
本实施例中,假设进度后置余量设置为3秒,则当第一播放进度为1:24:02时,本步骤计算得到的第二播放进度为1:24:05。
在步骤306、将第二视频源的起始播放进度调整为第二播放进度。
第二解码库对第二视频源进行缓冲,将其起始播放进度从默认的00:00:00调整到1:24:05。在此过程中,第一视频源继续进行播放,但播放进度尚未到达1:24:05。第二视频源缓冲到1:24:05后暂停播放,等待第一视频源播放到1:24:05。
在步骤307、当第一视频源播放至第二播放进度时,在新建画布上启动播放第二视频源。
设备在建立第二解码库后,通过第二解码库创建播放第二视频源的新建画布,当第一视频源播放到1:24:05时,通过第二解码库在新建画布上启动播放第二视频源。由于第二视频源的起始播放进度同样为1:24:05,因此可以保证两视频源均从1:24:05起同步播放。
开始播放第二视频源的时刻上,第一视频源画布的透明度与正常播放
时的透明度相同,为完全不透明,而新建画布的初始透明度则为完全透明,此时用户观看到的仍然为第一视频源,视频清晰度尚未发生变化。
在步骤308、在开始播放第二视频源时,关闭第一视频源的声音。
在开始播放第二视频源的1:24:05处,通过第一解码库关闭第一视频源的声音。由于第二视频源的播放音量与第一视频源相同,因此可以实现声音上的无差异切换。第一视频源在关闭声音后仍然按照播放进度进行播放。
在步骤309、按照预设的透明度步进值逐步下调第一视频源画布的透明度参数,同时按照透明度步进值逐步上调新建画布的透明度参数。
假设用于过渡透明度的预设时长为4秒,第一视频源和第二视频源需要在1:24:05至1:24:09这段时长内完成。本实施例中,第一视频源及第二视频源匀速过渡透明度,两者使用相同的透明度步进值。
本实施例提供两种确定透明度步进值的实现方式。其一,设备根据透明度参数范围以及预设时长自动计算获得透明度步进值;第二,开发人员或用户人工设置透明度步进值。对于前者方式,假设透明度参数范围为0至100,0为完全透明100为完全不透明(当然在其他标准中透明度参数的取值范围还可以为0至1或者0至200,此处不表),设备以透明度参数的上限值100除以预设时长4秒,计算得出透明度步进值为25,即两个视频源的透明度变化速率为25个透明度单位每秒。对于后者方式,透明度步进值人为根据经验值或个人喜好设定,设定的透明度步进值应当满足在预设时长内透明度可以从上限值(下限值)转换到下限值(上限值),例如可将透明度步进值设定为30或50。或者,设备可以根据透明度参数范围以及设定的透明度步进值重新计算获得新的转换时长,例如当透明度步进值设定为40时,设备将透明度上限值100除以40,得到新的转换时长为2.5秒。
在进行透明度转换时,第一视频源按照透明度步进值从透明度100匀速转换为透明度0,第二视频源按照透明度步进值从透明度0匀速转换为透明度100。由于透明度的转换是线性的,因此清晰度的过渡在视觉感受上是平缓柔和的,不会出现跳跃性的变化。
在透明度转换的过程中,第一视频源及第二视频源始终保持同步播放,当播放进度到达1:24:09时(即转换完成时),第一视频源画布变为完全透
明,新建画布变为完全不透明,此时用户观看到的内容为第二视频源。
在步骤310、删除第一解码库,清除第一视频源的缓存。
设备停止第一视频源的播放,删除第一解码库并将第一视频源的数据(包括已播放的数据及缓冲完成尚未播放的数据)从缓存中删除。至此,播放器中仅保留有第二解码库对第二视频源进行播放,清晰度切换流程结束。
进一步的,作为对图1-3所示方法的补充,本发明实施例还提供了一种视频清晰度的切换方法。该方法以向用户提供更高清晰度的视频源为原则,如果第二视频源的清晰度等级等于或小于第一视频源,那么为节省网络传输资源及设备的处理资源,设备不进行清晰度切换。具体的:
设备执行图3步骤302,查表获取第二视频源的清晰度等级,并从第一视频数据的数据包文件中读取第一视频源的清晰度等级,对两者进行比较。若第一视频源的清晰度等级等于或大于第二视频源的清晰度等级,则表示第二视频源的清晰度等级不会优于第一视频源,此情况下切换视频清晰度并无实质意义,设备取消建立第二解码库,不再执行步骤303至步骤310,并且继续播放第一视频源。若第一视频源的清晰度等级小于第二视频源的清晰度等级,则表示第二视频源能够提供更高质量的清晰度图像,设备建立第二解码库,加载第二视频源并顺序执行图3后续流程。
进一步的,作为对上述方法的完善,对于第一视频源的清晰度等级大于第二视频源的清晰度等级的情况,设备可以对播放第一视频源过程中出现的缓冲次数进行计数,当缓冲次数超过预设的次数阈值时,建立第二解码库,加载第二视频源。例如,在比较完两视频源的清晰度等级后,在一段预设的时间段内,如果第一视频源的播放过程产生了多次中断缓冲(例如超过3次),那么设备建立第二解码库,加载第二视频源并顺序执行图3后续流程。
设计上述机制的目的在于:当第一视频源的清晰度等级大于第二视频源时,理论上表示当前网速有所下降,为避免视频播放卡顿,应当将第一视频源切换为清晰度等级更低的第二视频源,以保证视频播放的流畅度。但是网速下降并不一定是由实际带宽下降这一单一因素导致的。实际应用中,网络信号的稳定性较差也可能导致网速在短时间内的波动,例如在WIFI
信号减弱或设备位于小区边缘等情况下,虽然实际带宽没有下降,但是网络信号的减弱会使得设备侧的实际下行速率下降。当设备处于一个带宽较高但信号稳定性较差的环境中时,应当给予网络一段恢复稳定性的时间,此时并不急于进行清晰度切换。只有第一视频源多次出现中断缓冲时,才能够更有把握的确定此情况是由于带宽下降导致,此时需要牺牲一些用户体验切换到低清晰度,否则当网络信号恢复稳定后,会出现高带宽条件下播放低清晰度视频的问题,有悖于向用户提供尽可能高清晰度视频的原则。
以上,即为本发明实施例提供的几种视频清晰度的切换方法。下面简单介绍几种本发明实施例的应用场景:
1、在播放视频源的过程中,设备定时测试网络速度,当网速发生变化时,切换到当前网速所支持的最高清晰度等级。
2、在切换到新网络中后,对新网络的网速进行测试,并切换到新网络的网速所支持的最高清晰度等级。
3、在切换到新网络中后,根据新网络的网络类型,切换到相适应的清晰度等级。例如,当切换到GSM、3G、4G等移动网络中时,为节省用户的流量,可适当下调视频源的清晰度等级,或者直接下调到最低的清晰度等级,此情况下不以清晰度质量为首要追求;而当切换到WIFI网络中时,为尽量提高视频源的清晰度等级,可以切换到当前网速所支持的最大清晰度等级。
4、设备对用户在不同网速环境下手动设置清晰度等级的行为进行记录和学习,获得用户在不同网速环境下的清晰度等级偏好,并根据当前网速切换到用户偏好的清晰度等级。
进一步的,作为对上述方法及应用场景的实现,本发明实施例还提供了一种视频清晰度的切换装置,该装置可以位于手机、个人电脑(PC)、平板电脑、可穿戴式设备等电子设备中,或者独立于上述电子设备,但与上述电子设备之间建立有数据交互关系。如图4所示,该装置包括:确定单元41、加载单元42、播放单元43以及控制单元44。其中,
确定单元41,用于在播放单元43通过第一解码库播放第一视频源的过程中,根据当前的网络条件确定是否切换视频清晰度;
加载单元42,用于若切换视频清晰度,则建立第二解码库,通过第二解码库加载与当前网速对应的清晰度等级的第二视频源,第二视频源与第一视频源为同一个视频内容的不同视频源;
控制单元44,用于将第一视频源切换为第二视频源;以及
播放单元43用于根据控制单元44的控制,播放视频源。
优选地,控制单元44可以通过协同第一视频源透明度的提升和第二视频源透明度的降低实现从第一视频源到第二视频源的无缝切换。
在一个实施例中,播放单元43可以用于在与第一视频源画布重叠的新建画布上,按照第一视频源的播放进度同步播放第二视频源,其中,新建画布的初始透明度为完全透明;
控制单元44可以用于在开始播放第二视频源起的预设时长内,将第一视频源画布的透明度过渡转换为完全透明,同时将新建画布的透明度过渡转换为完全不透明;
播放单元43还可以用于停止播放第一视频源。
控制单元44还可以用于使得第二视频源的初始播放音量与第一视频源的播放音量相同,并且在透明度过渡转换过程中将第一视频源的声音切换为第二视频源的声音。
进一步的,如图5所示,确定单元41包括第一确定模块411,用于:
判断当前网络的网速是否发生了变化;
若当前网络的网速发生了变化,则确定切换视频清晰度。
进一步的,如图5所示,确定单元41包括第二确定模块412,用于:
监听操作系统广播的系统通知消息,系统通知消息用于通知网络切换事件;
根据是否接收到系统通知消息判断是否切换到新的网络。
进一步的,第二确定模块412,用于:
监听操作系统广播的系统通知消息,系统通知消息中携带有当前网络的网络类型信息;
根据网络类型信息判断是否切换到新的网络。
进一步的,如图5所示,该装置进一步包括:
获取单元45,用于在建立第二解码库之前,获取第二视频源的清晰度等级;
比较单元46,用于对第一视频源和第二视频源的清晰度等级进行比较;
加载单元42,用于若第一视频源的清晰度等级等于或大于第二视频源的清晰度等级,则取消建立第二解码库;
加载单元42还用于若第一视频源的清晰度等级小于第二视频源的清晰度等级,则建立第二解码库,加载第二视频源。
进一步的,如图5所示,该装置进一步包括:
计数单元47,用于若第一视频源的清晰度等级大于第二视频源的清晰度等级,则对播放第一视频源过程中出现的缓冲次数进行计数;
加载单元42,用于当缓冲次数超过预设的次数阈值时,建立第二解码库,加载第二视频源。
进一步的,加载单元42用于通过第二解码库加载当前网速所支持的最高清晰度等级的第二视频源。
进一步的,播放单元43,用于:在第二视频源加载完毕时记录第一视频源的播放进度,记为第一播放进度;
将第一播放进度与预设的进度后置余量相加,获得第二播放进度;
将第二视频源的起始播放进度调整为第二播放进度;
当第一视频源播放至第二播放进度时,启动播放第二视频源。
进一步的,控制单元44,用于:
按照预设的透明度步进值逐步下调第一视频源画布的透明度参数,同时按照透明度步进值逐步上调新建画布的透明度参数。
进一步的,控制单元44,用于在开始播放第二视频源时,关闭第一视频源的声音。
进一步的,播放单元43用于在停止播放第一视频源之后:
删除第一解码库;
清除第一视频源的缓存。
本实施例提供的视频清晰度的切换装置,能够根据当前的网络条件自动确定是否切换视频清晰度,如需切换则选择与当前网速匹配的清晰度等
级的第二视频源进行加载,切换过程无需用户执行任何操作;在切换清晰度时,本实施例采用双解码库机制进行实现,即在第一解码库播放第一视频源的过程中,通过第二解码库在与第一视频源画布重叠的新建画布上同步播放第二视频源,由此消除视频源之间的缓冲间隙,实现视频源画面的无缝衔接;此外,本实施例还使用渐变形式的切换机制,通过对画布透明度的过渡调整实现画面清晰度的平滑转换,从而避免画面清晰度的跳跃式变化,使得切换过程更加自然流畅。综合上述几点可以看出,本实施例提供的视频清晰度的切换装置,能够自动对视频清晰度进行无缝平滑切换,可以在切换过程中有效保障视频播放的流畅度。
另外,本发明还可实现为一种计算设备,包括:网络接口,所述网络接口使得所述计算设备能够获取视频源;显示器,所述显示器使得所述技术设备能够显示视频;以及与所述网络接口和所述显示器相连接的处理器。所述处理器被配置用以执行上述视频清晰度的切换方法。
本发明还可实现为,其上存储有可执行代码,当所述可执行代码被处理器执行时,使所述处理器执行上述的方法。在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。
可以理解的是,上述方法及装置中的相关特征可以相互参考。另外,上述实施例中的“第一”、“第二”等是用于区分各实施例,而并不代表各实施例的优劣。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在此提供的算法和显示不与任何特定计算机、虚拟系统或者其它设备固有相关。各种通用系统也可以与基于在此的示教一起使用。根据上面的描述,构造这类系统所要求的结构是显而易见的。此外,本发明也不针对任何特定编程语言。应当明白,可以利用各种编程语言实现在此描述的本发明的内容,并且上面对特定语言所做的描述是为了披露本发明的最佳实施方式。
在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。
类似地,应当理解,为了精简本公开并帮助理解各个发明方面中的一个或多个,在上面对本发明的示例性实施例的描述中,本发明的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将该公开的方法解释成反映如下意图:即所要求保护的本发明要求比在每个权利要求中所明确记载的特征更多的特征。更确切地说,如下面的权利要求书所反映的那样,发明方面在于少于前面公开的单个实施例的所有特征。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本发明的单独实施例。
本领域那些技术人员可以理解,可以对实施例中的设备中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个设备中。可以把实施例中的模块或单元或组件组合成一个模块或单元或组件,以及此外可以把它们分成多个子模块或子单元或子组件。除了这样的特征和/或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。
此外,本领域的技术人员能够理解,尽管在此所述的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本发明的范围之内并且形成不同的实施例。例如,在下面的权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。
本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的发明名称(如确定网站内链接等级的装置)中的一些
或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。
应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。
Claims (21)
- 一种视频清晰度的切换方法,包括:在通过第一解码库播放第一视频源的过程中,根据当前的网络条件确定是否切换视频清晰度;若切换视频清晰度,则建立第二解码库,通过所述第二解码库加载与当前网速对应的清晰度等级的第二视频源,所述第二视频源与所述第一视频源为同一个视频内容的不同视频源;以及将所述第一视频源无缝切换成所述第二视频源。
- 根据权利要求1所述的方法,其中,将所述第一视频源无缝切换成所述第二视频源包括:通过协同所述第一视频源透明度的提升和所述第二视频源透明度的降低实现从所述第一视频源到所述第二视频源的无缝切换。
- 根据权利要求2所述的方法,其中,通过协同所述第一视频源透明度的提升和所述第二视频源透明度的降低实现从所述第一视频源到所述第二视频源的无缝切换包括:在与第一视频源画布重叠的新建画布上,按照所述第一视频源的播放进度同步播放所述第二视频源,其中,所述新建画布的初始透明度为完全透明;在开始播放所述第二视频源起的预设时长内,将第一视频源画布的透明度过渡转换为完全透明,同时将所述新建画布的透明度过渡转换为完全不透明;以及停止播放所述第一视频源。
- 根据权利要求3所述的方法,其中,所述第二视频源的初始播放音量与所述第一视频源的播放音量相同,并且在透明度过渡转换过程中将所述第一视频源的声音切换为所述第二视频源的声音。
- 根据权利要求1所述的方法,其中,所述根据当前的网络条件确定是否切换视频清晰度,包括:判断当前网络的网速是否发生了变化;若当前网络的网速发生了变化,则确定切换视频清晰度。
- 根据权利要求1所述的方法,其中,所述根据当前的网络条件确定是否切换视频清晰度,包括:判断是否切换到新的网络中;若切换到新的网络中,则确定切换视频清晰度。
- 根据权利要求6所述的方法,其中,所述判断是否切换到新的网络中,包括:监听操作系统广播的系统通知消息,所述系统通知消息用于通知网络切换事件;根据是否接收到所述系统通知消息判断是否切换到新的网络。
- 根据权利要求1所述的方法,其中,在所述建立第二解码库之前,所述方法进一步包括:获取所述第二视频源的清晰度等级;对所述第一视频源和所述第二视频源的清晰度等级进行比较;若所述第一视频源的清晰度等级等于或大于所述第二视频源的清晰度等级,则取消建立第二解码库;若所述第一视频源的清晰度等级小于所述第二视频源的清晰度等级,则建立第二解码库,加载所述第二视频源。
- 根据权利要求8所述的方法,其中,若所述第一视频源的清晰度等级大于所述第二视频源的清晰度等级,则所述方法进一步包括:对播放所述第一视频源过程中出现的缓冲次数进行计数;当所述缓冲次数超过预设的次数阈值时,建立第二解码库,加载所述第二视频源。
- 根据权利要求1所述的方法,其中,所述通过所述第二解码库加载与当前网速对应的清晰度等级的第二视频源,包括:通过所述第二解码库加载当前网速所支持的最高清晰度等级的第二视频源。
- 根据权利要求1所述的方法,其中,所述按照所述第一视频源的播放进度同步播放所述第二视频源,包括:在所述第二视频源加载完毕时记录所述第一视频源的播放进度,记为 第一播放进度;将所述第一播放进度与预设的进度后置余量相加,获得第二播放进度;将所述第二视频源的起始播放进度调整为所述第二播放进度;当所述第一视频源播放至所述第二播放进度时,启动播放所述第二视频源。
- 一种视频清晰度的切换装置,其特征在于,所述装置包括:确定单元,用于在播放单元通过第一解码库播放第一视频源的过程中,根据当前的网络条件确定是否切换视频清晰度;加载单元,用于若切换视频清晰度,则建立第二解码库,通过所述第二解码库加载与当前网速对应的清晰度等级的第二视频源,所述第二视频源与所述第一视频源为同一个视频内容的不同视频源;控制单元,用于将所述第一视频源无缝切换成所述第二视频源;以及所述播放单元,用于根据所述控制单元的控制,播放视频源。
- 根据权利要求12所述的装置,其中,所述控制单元用于:通过协同所述第一视频源透明度的提升和所述第二视频源透明度的降低实现从所述第一视频源到所述第二视频源的无缝切换。
- 根据权利要求13所述的装置,其中,所述播放单元用于在与第一视频源画布重叠的新建画布上,按照所述第一视频源的播放进度同步播放所述第二视频源,其中,所述新建画布的初始透明度为完全透明;所述控制单元用于在开始播放所述第二视频源起的预设时长内,将第一视频源画布的透明度过渡转换为完全透明,同时将所述新建画布的透明度过渡转换为完全不透明;以及所述播放单元还用于停止播放所述第一视频源。
- 根据权利要求14所述的装置,其中,所述控制单元用于使所述第二视频源的初始播放音量与所述第一视频源的播放音量相同,并在透明度过渡转换过程中将所述第一视频源的声音切换为所述第二视频源的声音。
- 根据权利要求12所述的装置,其中,所述确定单元包括第一确定模块,用于:判断当前网络的网速是否发生了变化;若当前网络的网速发生了变化,则确定切换视频清晰度。
- 根据权利要求12所述的装置,其中,所述确定单元包括第二确定模块,用于:监听操作系统广播的系统通知消息,所述系统通知消息用于通知网络切换事件;根据是否接收到所述系统通知消息判断是否切换到新的网络。
- 根据权利要求17所述的装置,其中,所述第二确定模块,用于:监听操作系统广播的系统通知消息,所述系统通知消息中携带有当前网络的网络类型信息;根据所述网络类型信息判断是否切换到新的网络。
- 根据权利要求12所述的装置,其中,所述装置进一步包括:获取单元,用于在建立第二解码库之前,获取所述第二视频源的清晰度等级;比较单元,用于对所述第一视频源和所述第二视频源的清晰度等级进行比较;所述加载单元,用于若所述第一视频源的清晰度等级等于或大于所述第二视频源的清晰度等级,则取消建立第二解码库;所述加载单元还用于若所述第一视频源的清晰度等级小于所述第二视频源的清晰度等级,则建立第二解码库,加载所述第二视频源。
- 一种计算设备,包括:网络接口,所述网络接口使得所述计算设备能够获取视频源;显示器,所述显示器使得所述技术设备能够显示视频;以及与所述网络接口和所述显示器相连接的处理器,所述处理器被配置为执行如下操作:在通过第一解码库播放第一视频源的过程中,根据当前的网络条件确定是根据权利要求1-11任一项所述的方法。
- 一种非暂时性机器可读存储介质,其上存储有可执行代码,当所述可执行代码被处理器执行时,使所述处理器执行根据权利要求1-11任一项所述的方法。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610149109.0 | 2016-03-15 | ||
CN201610149109.0A CN107197371B (zh) | 2016-03-15 | 2016-03-15 | 视频清晰度的切换方法及装置 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2017157191A1 true WO2017157191A1 (zh) | 2017-09-21 |
Family
ID=59850544
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2017/075638 WO2017157191A1 (zh) | 2016-03-15 | 2017-03-03 | 视频清晰度的切换方法及装置 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN107197371B (zh) |
WO (1) | WO2017157191A1 (zh) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111294641A (zh) * | 2020-03-10 | 2020-06-16 | 北京奇艺世纪科技有限公司 | 视频播放方法、系统、装置、电子设备及可读存储介质 |
US11178451B2 (en) | 2018-08-17 | 2021-11-16 | Roku, Inc. | Dynamic playout of transition frames while transitioning between playout of media streams |
CN116781951A (zh) * | 2023-08-24 | 2023-09-19 | 湖南快乐阳光互动娱乐传媒有限公司 | 一种清晰度调节方法、装置和服务器 |
CN118042197A (zh) * | 2024-04-09 | 2024-05-14 | 牡丹江师范学院 | 一种音乐视频的自动切换方法及系统 |
Families Citing this family (19)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110545461A (zh) * | 2018-05-29 | 2019-12-06 | 北京字节跳动网络技术有限公司 | 一种媒体文件的分辨率切换方法、装置及存储介质 |
CN110582012B (zh) * | 2018-06-11 | 2021-07-30 | 腾讯科技(深圳)有限公司 | 视频切换方法、视频处理方法、装置及存储介质 |
CN110602425A (zh) * | 2018-06-13 | 2019-12-20 | 上海哔哩哔哩科技有限公司 | 视频清晰度调节方法、系统、计算机可读存储介质及终端 |
CN109144613B (zh) * | 2018-09-03 | 2021-10-15 | 武汉斗鱼网络科技有限公司 | Android清晰度切换方法、装置、终端及可读介质 |
CN109144612B (zh) * | 2018-09-03 | 2021-10-15 | 武汉斗鱼网络科技有限公司 | Android清晰度切换方法、装置、终端及可读介质 |
CN109144611B (zh) * | 2018-09-03 | 2021-07-23 | 武汉斗鱼网络科技有限公司 | Android清晰度切换方法、装置、终端及可读介质 |
CN109413457B (zh) * | 2018-10-18 | 2021-11-09 | 武汉斗鱼网络科技有限公司 | Android系统的码流清晰度切换方法、装置、终端及可读介质 |
CN109451361B (zh) * | 2018-10-18 | 2022-01-04 | 武汉斗鱼网络科技有限公司 | Android系统的码流清晰度切换方法、装置、终端及可读介质 |
CN111510770B (zh) * | 2019-01-30 | 2021-08-24 | 上海哔哩哔哩科技有限公司 | 切换清晰度的方法、装置、计算机设备及可读存储介质 |
CN111726642B (zh) * | 2019-03-19 | 2023-05-30 | 北京京东尚科信息技术有限公司 | 直播方法、装置和计算机可读存储介质 |
CN110166810B (zh) * | 2019-04-25 | 2022-03-29 | 腾讯科技(深圳)有限公司 | 视频渲染引擎切换方法、装置、设备及可读存储介质 |
CN110149536B (zh) * | 2019-05-27 | 2021-11-16 | 湖南快乐阳光互动娱乐传媒有限公司 | 视频播放方法及装置 |
CN110278452A (zh) * | 2019-06-24 | 2019-09-24 | 北京字节跳动网络技术有限公司 | 视频启动加速方法、装置、存储介质、终端和服务器 |
CN110753266A (zh) * | 2019-10-23 | 2020-02-04 | 深圳市酷开网络科技有限公司 | 视频清晰度的调整方法、装置和存储介质 |
CN110719526B (zh) * | 2019-10-28 | 2021-05-07 | 腾讯科技(深圳)有限公司 | 视频播放方法及装置 |
CN113055833B (zh) * | 2019-12-11 | 2022-08-12 | 中国移动通信有限公司研究院 | 一种业务优化方法、基站和应用层设备 |
CN112291611A (zh) * | 2020-10-27 | 2021-01-29 | 重庆虚拟实境科技有限公司 | 视频播放方法、计算机装置及可读存储介质 |
CN113038243B (zh) * | 2021-05-28 | 2021-09-17 | 卡莱特云科技股份有限公司 | 一种视频源画面播放过程中的透明度调整方法及设备 |
CN113825020B (zh) * | 2021-09-18 | 2023-09-29 | 北京百度网讯科技有限公司 | 视频清晰度切换方法、装置、设备、存储介质及程序产品 |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4912696B2 (ja) * | 2006-02-28 | 2012-04-11 | パナソニック株式会社 | ビデオデータの無線伝送方式 |
CN103702042A (zh) * | 2013-12-27 | 2014-04-02 | Tcl新技术(惠州)有限公司 | 一种基于双通道显示设备的信源切换方法和装置 |
CN103763618A (zh) * | 2013-12-27 | 2014-04-30 | 乐视网信息技术(北京)股份有限公司 | 一种清晰度切换方法及电子设备 |
CN104219579A (zh) * | 2014-08-20 | 2014-12-17 | 北京奇艺世纪科技有限公司 | 一种视频切换方法和装置 |
-
2016
- 2016-03-15 CN CN201610149109.0A patent/CN107197371B/zh active Active
-
2017
- 2017-03-03 WO PCT/CN2017/075638 patent/WO2017157191A1/zh active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4912696B2 (ja) * | 2006-02-28 | 2012-04-11 | パナソニック株式会社 | ビデオデータの無線伝送方式 |
CN103702042A (zh) * | 2013-12-27 | 2014-04-02 | Tcl新技术(惠州)有限公司 | 一种基于双通道显示设备的信源切换方法和装置 |
CN103763618A (zh) * | 2013-12-27 | 2014-04-30 | 乐视网信息技术(北京)股份有限公司 | 一种清晰度切换方法及电子设备 |
CN104219579A (zh) * | 2014-08-20 | 2014-12-17 | 北京奇艺世纪科技有限公司 | 一种视频切换方法和装置 |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US11178451B2 (en) | 2018-08-17 | 2021-11-16 | Roku, Inc. | Dynamic playout of transition frames while transitioning between playout of media streams |
US11503366B2 (en) | 2018-08-17 | 2022-11-15 | Roku, Inc. | Dynamic playout of transition frames while transitioning between play out of media streams |
US11812103B2 (en) | 2018-08-17 | 2023-11-07 | Roku, Inc. | Dynamic playout of transition frames while transitioning between playout of media streams |
CN111294641A (zh) * | 2020-03-10 | 2020-06-16 | 北京奇艺世纪科技有限公司 | 视频播放方法、系统、装置、电子设备及可读存储介质 |
CN111294641B (zh) * | 2020-03-10 | 2022-10-21 | 北京奇艺世纪科技有限公司 | 视频播放方法、系统、装置、电子设备及可读存储介质 |
CN116781951A (zh) * | 2023-08-24 | 2023-09-19 | 湖南快乐阳光互动娱乐传媒有限公司 | 一种清晰度调节方法、装置和服务器 |
CN116781951B (zh) * | 2023-08-24 | 2023-12-05 | 湖南快乐阳光互动娱乐传媒有限公司 | 一种清晰度调节方法、装置和服务器 |
CN118042197A (zh) * | 2024-04-09 | 2024-05-14 | 牡丹江师范学院 | 一种音乐视频的自动切换方法及系统 |
Also Published As
Publication number | Publication date |
---|---|
CN107197371A (zh) | 2017-09-22 |
CN107197371B (zh) | 2019-12-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2017157191A1 (zh) | 视频清晰度的切换方法及装置 | |
CN109089261B (zh) | 无线漫游触发的方法、装置、计算机设备以及存储介质 | |
CN109548075B (zh) | 测量报告上报方法、装置、存储介质及移动终端 | |
KR102554281B1 (ko) | 다양한 유형의 세션 연속성을 갖는 pdu 세션 | |
CN109314793B (zh) | 提供自适应流服务的方法及流服务器 | |
KR101744224B1 (ko) | 회선 교환 폴백 절차의 수행 후에 제2 무선 네트워크로부터 제1 무선 네트워크로의 복귀의 가능화 | |
CN113099497B (zh) | 一种网络切换方法、存储介质及电子设备 | |
WO2021077293A1 (zh) | 一种通信方法、装置、设备及系统 | |
CN111800892A (zh) | 无线双频网络的连接方法、系统、设备及存储介质 | |
CN105227588A (zh) | 一种流媒体文件的下载方法及用户终端 | |
CN114125974B (zh) | 小区选择方法、装置、终端及存储介质 | |
CN113438702A (zh) | 小区切换方法、装置、电子设备及可读存储介质 | |
WO2021148012A1 (zh) | 报告信息的发送方法和通信装置以及通信系统 | |
CN102075976A (zh) | 移动流媒体播放器和移动流媒体播放方法 | |
US20180376362A1 (en) | Video Optimization Method, User Equipment, And Network Device | |
CN105940714B (zh) | 用于回放缓存的管理的方法和设备 | |
CN114650616B (zh) | 网络模式的控制方法及装置 | |
CN114125942A (zh) | 一种网络资源的管理方法、装置、终端及存储介质 | |
WO2018201318A1 (zh) | 一种信号测量方法及相关设备 | |
JP7564330B2 (ja) | メディアストリーム切り替え方法および装置 | |
WO2024239900A1 (zh) | 算力及网络服务的处理方法、装置及存储介质 | |
CN105208595A (zh) | 一种控制数据传输的方法及基站 | |
JP7508707B2 (ja) | アップリンクストリーミングを測定および監視するためのメトリック | |
JP2021064901A (ja) | モバイルデバイス及びネットワーク通信ハンドオーバープログラム | |
CN118402274A (zh) | 增强型用户设备报告 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 17765733 Country of ref document: EP Kind code of ref document: A1 |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 17765733 Country of ref document: EP Kind code of ref document: A1 |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 17765733 Country of ref document: EP Kind code of ref document: A1 |