CN117615175A - Video playing method, device, electronic equipment and computer readable storage medium - Google Patents

Video playing method, device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN117615175A
CN117615175A CN202311586786.5A CN202311586786A CN117615175A CN 117615175 A CN117615175 A CN 117615175A CN 202311586786 A CN202311586786 A CN 202311586786A CN 117615175 A CN117615175 A CN 117615175A
Authority
CN
China
Prior art keywords
video
playing
coding format
video stream
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311586786.5A
Other languages
Chinese (zh)
Inventor
成艺丰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shuhang Technology Beijing Co ltd
Original Assignee
Shuhang Technology Beijing Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shuhang Technology Beijing Co ltd filed Critical Shuhang Technology Beijing Co ltd
Priority to CN202311586786.5A priority Critical patent/CN117615175A/en
Publication of CN117615175A publication Critical patent/CN117615175A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/2343Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
    • H04N21/234363Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements by altering the spatial resolution, e.g. for clients with a lower screen resolution
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/2343Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
    • H04N21/234381Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements by altering the temporal resolution, e.g. decreasing the frame rate by frame skipping
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/4402Processing 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/440263Processing 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/4402Processing 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/440281Processing 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 temporal resolution, e.g. by frame skipping

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The embodiment of the application discloses a video playing method, a video playing device, an electronic device and a computer readable storage medium, wherein the compression ratio of a first coding format is higher than that of a second coding format by acquiring a first video stream of a target video in the first coding format and a second video stream in at least one second coding format; acquiring current terminal system performance information, and if the terminal system performance information accords with video playing conditions of a first coding format, playing a first video stream under the first coding format; acquiring video playing information of a first video stream in the playing process; when the video playing information accords with the preset abnormal playing condition, selecting a target second coding format for switching the first coding format from at least one second coding format, and switching a second video stream for playing the target second coding format. The embodiment of the application can avoid the phenomenon of poor video playing effect while reducing the bandwidth cost required by video playing.

Description

Video playing method, device, electronic equipment and computer readable storage medium
Technical Field
The present disclosure relates to the field of video playing technologies, and in particular, to a video playing method, a device, an electronic apparatus, and a computer readable storage medium.
Background
Under the wave of the internet, as mobile devices are increasingly popular, more and more people use the mobile devices as a platform for video viewing, and a corresponding video player is provided on the mobile devices for viewing video. Since the video has a larger bandwidth cost than the picture, a coding format with a higher compression rate is generally adopted to reduce the bandwidth cost required for playing the video.
However, the higher the compression rate of the coding format is, the higher the calculation requirement of the required device hardware is, and if the video stream of the coding format with the higher compression rate is decoded by adopting a soft decoding manner, the poorer the video playing effect, such as video clamping, abnormal video pictures, and the like, will often occur due to insufficient device performance.
Disclosure of Invention
The embodiment of the application provides a video playing method, a video playing device, electronic equipment and a computer readable storage medium, which can reduce the bandwidth cost required by playing video and avoid the phenomenon of poor video playing effect.
In a first aspect, an embodiment of the present application provides a video playing method, where the method includes:
acquiring a first video stream of a target video in a first coding format and a second video stream of the target video in at least one second coding format, wherein the compression rate of the first coding format is higher than that of the second coding format;
acquiring current terminal system performance information, and playing a first video stream in the first coding format if the terminal system performance information accords with the video playing condition of the first coding format;
acquiring video playing information of the first video stream in the playing process;
and when the video playing information accords with a preset abnormal playing condition, selecting a target second coding format for switching the first coding format from at least one second coding format, and switching and playing a second video stream of the target second coding format.
In a second aspect, an embodiment of the present application further provides a video playing device, where the device includes:
the video stream acquisition module is used for acquiring a first video stream of a target video in a first coding format and a second video stream of at least one second coding format, wherein the compression rate of the first coding format is higher than that of the second coding format;
The video stream playing module is used for acquiring the current terminal system performance information, and playing the first video stream under the first coding format if the terminal system performance information accords with the video playing condition of the first coding format;
the information acquisition module is used for acquiring video playing information of the first video stream in the playing process;
and the video stream switching module is used for selecting a target second coding format for switching the first coding format from at least one second coding format and switching the second video stream for playing the target second coding format when the video playing information accords with a preset abnormal playing condition.
In a third aspect, embodiments of the present application further provide an electronic device, including a memory storing a plurality of instructions; the processor loads instructions from the memory to execute steps in any video playing method provided in the embodiments of the present application.
In a fourth aspect, embodiments of the present application further provide a computer readable storage medium storing a plurality of instructions adapted to be loaded by a processor to perform steps in any of the video playing methods provided in the embodiments of the present application.
In this embodiment of the present application, by acquiring a first video stream of a target video in a first coding format and a second video stream of at least one second coding format, a compression rate of the first coding format is higher than a compression rate of the second coding format. Then, by acquiring the current terminal system performance information, if the terminal system performance information meets the video playing condition of the first coding format, the performance of the current terminal supports playing the video stream of the coding format with higher compression rate so as to reduce the bandwidth under the premise of not influencing the video playing effect, and then playing the first video stream under the first coding format. Finally, the video playing information of the first video stream in the playing process is acquired to judge the video playing information, and when the video playing information accords with the preset abnormal playing condition, the condition that the performance of the current terminal is insufficient to support playing the video stream of the coding format with higher compression rate on the premise of not influencing the video playing effect is indicated, so that the target second coding format for switching the first coding format is selected from at least one second coding format, and the second video stream of the target second coding format is switched and played, thereby realizing the phenomenon that the video playing effect is poor while the bandwidth cost required by playing the video is reduced.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly introduced below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of an embodiment of a video playing method according to an embodiment of the present application;
fig. 2 is a timing diagram of a video playing method according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a video playing device according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
Before explaining the embodiments of the present application in detail, some terms related to the embodiments of the present application are explained.
Wherein in the description of embodiments of the present application, the terms "first," "second," and the like may be used herein to describe various concepts, but such concepts are not limited by these terms unless otherwise specified. These terms are only used to distinguish one concept from another. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The embodiment of the application provides a video playing method, a video playing device, electronic equipment and a computer readable storage medium. Specifically, the video playing method of the embodiment of the application may be executed by an electronic device, where the electronic device may be a terminal or a server. The terminal may be a terminal device such as a smart phone, a tablet computer, a notebook computer, a touch screen, a game console, a personal computer (PC, personal Computer), a personal digital assistant (Personal Digital Assistant, PDA), and the like, and the terminal may further include a client, which may be a game application client, a browser client carrying a game program, or an instant messaging client, and the like. The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs, basic cloud computing services such as big data and artificial intelligent platforms.
For example, the electronic device is described by taking a terminal as an example, where the terminal may obtain a first video stream of a target video in a first encoding format and a second video stream of the target video in at least one second encoding format, where a compression rate of the first encoding format is higher than a compression rate of the second encoding format; acquiring current terminal system performance information, and playing a first video stream in the first coding format if the terminal system performance information accords with the video playing condition of the first coding format; acquiring video playing information of the first video stream in the playing process; and when the video playing information accords with a preset abnormal playing condition, selecting a target second coding format for switching the first coding format from at least one second coding format, and switching and playing a second video stream of the target second coding format.
Based on the above-mentioned problems, embodiments of the present application provide a video playing method, apparatus, electronic device, and computer readable storage medium, which can reduce the bandwidth cost required for playing video, and avoid the phenomenon of poor video playing effect.
The following detailed description is provided with reference to the accompanying drawings. The following description of the embodiments is not intended to limit the preferred embodiments. Although a logical order is depicted in the flowchart, in some cases the steps shown or described may be performed in an order different than depicted in the figures.
In this embodiment, a terminal is taken as an example for illustration, and this embodiment provides a video playing method, as shown in fig. 1, a specific flow of the video playing method may be as follows:
101. the method comprises the steps of obtaining a first video stream of a target video in a first coding format and a second video stream of the target video in at least one second coding format, wherein the compression rate of the first coding format is higher than that of the second coding format.
The target video is a video to be currently played, for example, in a short video on demand scene, the target video is a short video of a non-real-time video frame that a user wants to view.
In this embodiment, the terminal obtains the video streams of the target video in different encoding formats, so that in the process of playing the target video by adopting the video stream of a certain encoding format, the video stream of the encoding format with a lower compression rate can be selectively switched to continue playing according to the playing condition of the target video, thereby ensuring the playing effect of the target video.
Specifically, the video streams of the target video under different coding formats may be generated by a server and sent to the terminal, and the server may obtain the video streams of the target video under different coding formats by transcoding. For example, as shown in fig. 2, the terminal may send a viewing instruction for the target video to the server, so that the server obtains, by transcoding, a video stream of the target video in different encoding formats based on the viewing instruction, and sends the video stream of the target video in different encoding formats to the terminal.
Compared with the second video stream, the first video stream can compress the target video more efficiently, so that the bandwidth consumption is reduced, and the bandwidth cost required by the target video during playing is saved.
Illustratively, the first encoding format with high compression rate may be an av1 format, which is an emerging video encoding standard with better video compression capability, and can compress video with higher compression rate, so as to achieve transmission of high-quality video content with less bandwidth, for example, when a user views video with av1 format, 20% of traffic can be saved with the same video quality (definition, resolution, and frame rate).
Accordingly, the second encoding format may be a hevc format and an avc format, which are also a video encoding standard, but processing the video stream using the av1 format can save more bandwidth costs compared to the hevc format and the avc format due to the higher compression rate of the av1 format.
Specifically, if the terminal has an Android system, the av1 format video stream can be processed by hard decoding, and if the terminal has an ios system, the av1 format video stream can be processed by soft decoding.
102. And acquiring current terminal system performance information, and playing the first video stream under the first coding format if the terminal system performance information accords with the video playing condition of the first coding format.
The terminal system performance information is used for indicating the system performance of the current terminal, namely, whether the current terminal is conditional or not is determined through the terminal system performance information, and the video stream with the coding format with higher compression rate is supported to be played on the premise of not affecting the video playing effect so as to reduce the bandwidth.
In this embodiment, since the decoding complexity corresponding to the video stream with the high-compression-rate encoding format is higher, when the decoding performance of the terminal is insufficient, more abnormal conditions such as playing stuck and abnormal playing pictures occur when the decoding is performed on the video stream with the high-compression-rate encoding format, so when the terminal starts to play the target video, whether the current terminal is conditional or not is determined by judging the terminal system performance information of the terminal, and the video stream with the higher-compression-rate encoding format is supported to play on the premise that the video playing effect is not affected, so as to reduce the bandwidth, and accordingly, based on the determined result, the video stream with the proper encoding format is selected to play.
Specifically, a player is preset and created in the terminal to play the target video through the player, and because the target video has video streams with different coding formats, the terminal can set the coding format of the video stream capable of playing in the player so as to select the video stream with the corresponding coding format for playing at a proper time. And when the player plays the target video stream, a video buffer queue can be set for buffering unreflected video frames in the target video stream, and based on the arrangement sequence of the video frames in the video buffer queue, when traversing to the current video frame, the player sends the current video frame to a decoder in a corresponding format for decoding, and based on video frame information obtained by decoding, renders the video frame to obtain a rendered video frame, and plays and displays the rendered video frame.
Illustratively, as shown in fig. 2, after the terminal receives video streams of the target video in different encoding formats, the terminal may select a video stream of a corresponding encoding format to play based on the terminal system information.
The terminal system performance information includes, but is not limited to, a terminal hardware consumption parameter and a terminal attribute parameter, where the terminal hardware consumption parameter is used to indicate a consumption condition of hardware in the terminal, such as a CPU consumption parameter indicating a CPU usage condition, a memory consumption parameter indicating a memory consumption condition, and the like, and the terminal attribute parameter is used to indicate a basic attribute condition of the terminal, such as a percentage of a battery level in the terminal. If the terminal has the ios system, the terminal may use the batteryLevel attribute and the batteryState attribute of the UIDevice class to obtain the percentage of the battery power in the terminal.
Correspondingly, when the terminal system performance information includes the terminal hardware consumption parameter and the terminal attribute parameter, after the current terminal system performance information is obtained, the terminal needs to judge the current terminal system performance information to determine whether the terminal system performance information accords with the video playing condition of the first coding format, that is, whether the terminal system performance information is conditional or not, and support to play the video stream of the coding format with higher compression rate under the premise of not affecting the video playing effect, so as to reduce the bandwidth.
Specifically, the process of determining whether the terminal system performance information meets the video playing condition of the first coding format may include: the terminal may configure corresponding parameter thresholds for different parameters in the terminal system performance information, so as to determine, according to the corresponding parameter thresholds, whether the corresponding parameters in the terminal system performance information meet the conditions, that is, the corresponding parameter thresholds are configured for the hardware consumption parameter and the terminal attribute parameter, so that a first comparison result of the hardware consumption parameter and a second comparison result of the terminal attribute parameter are obtained by comparing the hardware consumption parameter and the terminal attribute parameter with the corresponding parameter thresholds, that is, the first comparison result may be that the hardware consumption parameter is greater than the corresponding parameter threshold, that the hardware consumption parameter is equal to the corresponding parameter threshold, that may be that the hardware consumption parameter is less than the corresponding parameter threshold, and that the second comparison result is the same as the first comparison result and is not repeated herein.
Then, after obtaining the first comparison result of the hardware consumption parameter and the second comparison result of the terminal attribute parameter, the terminal may determine whether the terminal system performance information meets the video condition of the first coding format based on the first comparison result and the second comparison result.
Determining whether the terminal system performance information accords with the video condition of the first coding format based on the first comparison result and the second comparison result, if at least one of the first comparison result and the second comparison result accords with the video condition of the first coding format, determining that the terminal system performance information accords with the video condition of the first coding format; or if the first comparison result and the second comparison result both accord with the video condition of the first coding format, determining that the terminal system performance information accords with the video condition of the first coding format.
It can be understood that, because the hardware consumption parameter is smaller than the corresponding parameter threshold, it is indicated that the performance of the hardware to which the current hardware consumption parameter belongs is too much, such as excessive memory consumption, and it is indicated that the performance of the current hardware is insufficient to support playing of the video stream in the encoding format with higher compression rate without affecting the video playing effect, so it is indicated that the hardware consumption parameter in the current terminal system performance information does not conform to the video condition of the first encoding format.
In addition, because the terminal attribute parameter is smaller than the corresponding parameter threshold, the terminal attribute parameter is too low, for example, the electric quantity of the terminal is too low, and the performance of the current terminal is insufficient to support playing of the video stream with the coding format with higher compression rate on the premise of not influencing the video playing effect, so that the terminal attribute parameter in the current terminal system performance information is not in accordance with the video condition of the first coding format.
Correspondingly, in the case that the terminal system performance information meets the video condition of the first coding format, the hardware consumption parameter may be greater than or equal to the corresponding parameter threshold, and/or the terminal attribute parameter may be greater than or equal to the corresponding parameter threshold, which may be specifically set according to the requirement, and is not limited herein.
If the current terminal system performance information includes a CPU consumption parameter, a memory consumption parameter, and a percentage of battery power in the terminal, the percentage of battery power in the terminal is a terminal attribute parameter, and the comparison result corresponding to each parameter is set to be in accordance with the video condition of the first encoding format, the terminal system performance information is set to be in accordance with the video condition of the first encoding format. And the terminal compares the CPU consumption parameter, the memory consumption parameter and the percentage of the battery electric quantity with corresponding parameter thresholds respectively to obtain comparison results corresponding to the parameters, analyzes the comparison results corresponding to the parameters, and determines that the terminal system performance information accords with the video condition of the first coding format if the comparison results corresponding to the parameters are all smaller than the corresponding parameter thresholds.
In some embodiments, if the terminal system performance information does not conform to the video playing condition of the first coding format, it is indicated that the terminal system performance information does not have a condition that the video stream of the coding format with the higher compression rate is supported to be played on the premise of not affecting the video playing effect, so that the terminal needs to select the video stream of the coding format with the lower compression rate to play the target video, so as to ensure the playing effect of the target video, and therefore, the terminal needs to select a certain second coding format from at least one second coding format as the coding format to which the second video stream to be played currently belongs.
Specifically, the selecting a certain second coding format from the at least one second coding format as the coding format to which the second video stream to be played currently belongs may include: the terminal can randomly select a certain second coding format from at least one second coding format based on a random algorithm as the coding format of the second video stream to be played currently; or, the terminal may select a certain second coding format from the at least one second coding format based on a preset selection rule, where the second coding format is used as the coding format to which the second video stream to be played currently belongs.
The selection rule may be selected based on the compression rate, the transmission code stream, and the like, which are used for video processing information, that is, the second coding format with the highest transmission code stream is selected from at least one second coding format as the coding format of the second video stream to be played currently, or the second coding format with the highest compression rate is selected from at least one second coding format as the coding format of the second video stream to be played currently, which may be specifically set according to the requirement, and is not limited herein.
103. And acquiring video playing information of the first video stream in the playing process.
It can be understood that, because the current terminal plays the first video stream through the player, the first video stream is the video stream with the highest compression rate, and the decoding complexity corresponding to the video stream with the encoding format with the high compression rate is higher, in order to avoid that in the playing process of the first video stream, the playing effect of the video is worse and worse due to the increasing performance of equipment consumption, and the watching experience of the user is affected. In this embodiment, the terminal needs to obtain video playing information of the first video stream during playing, where the video playing information is used to indicate parameters related to video effects of the first video stream during playing, so as to determine, based on the video playing information, whether the target video is easy to have an abnormality, such as a jam, an abnormality of a video picture, etc., due to excessive consumption of decoding performance of the terminal during playing of the first video stream.
Specifically, the judging video playing information may be judging by acquiring information in real time, or may be judging by acquiring information in a certain period of time, for example, determining a first playing time for playing the first video stream, then, judging by acquiring video playing information corresponding to each time after the first playing time, or judging video playing information in a period of time between the first playing time and each time after the first playing time; or, acquiring video playing information in a preset time period after the first playing time to judge.
In some embodiments, the video playing information includes a time-related parameter, a device-related parameter, and a video frame-related parameter, the time-related parameter includes a single frame decoding duration, the device-related parameter includes a device temperature and the terminal system performance information, the video frame-related parameter includes a normal frame number and an abnormal frame number that have been processed in the first video stream, the normal frame number includes a decoded frame number and a rendered frame number, and the abnormal frame number includes a frame loss frame number and a decoding error frame number.
It can be understood that, in order to more accurately determine whether the video playing information of the first video stream in the playing process accords with the abnormal playing condition, the terminal may configure a corresponding abnormal playing sub-condition for each parameter in the video playing information, that is, the time-related parameter, the equipment-related parameter and the video frame-related parameter are respectively configured with a corresponding abnormal playing sub-condition, so that by determining each parameter, it is clear whether the video playing information of the first video stream in the playing process accords with the abnormal playing condition, that is, it is clear whether the video playing information shows that the current equipment performance is conditional, and it is supported to play the video stream in the coding format with higher compression rate on the premise of not affecting the video playing effect.
After obtaining the video playing information of the first video stream in the playing process, the terminal may determine the video playing information to determine whether the video playing information meets an abnormal playing condition, that is, determine at least one parameter of the time-related parameter, the equipment-related parameter and the video frame-related parameter, to determine whether the time-related parameter, the equipment-related parameter and the video frame-related parameter meet corresponding abnormal playing sub-conditions, where the specific determination condition may be set according to a user requirement, for example, when one parameter meets an abnormal playing sub-condition, that is, it is determined that the video playing information meets the abnormal playing condition; or when the preset number of parameters meet the abnormal playing sub-conditions, determining that the video playing information meets the abnormal playing conditions; or when all the parameters meet the abnormal playing sub-conditions, determining that the video playing information meets the abnormal playing conditions.
For example, if at least one parameter of the time-related parameter, the equipment-related parameter and the video frame-related parameter accords with a corresponding abnormal playing sub-condition, determining that the video playing information accords with a preset abnormal playing condition.
Specifically, the video frame association parameter includes a normal frame number and an abnormal frame number that have been processed in the first video stream, and the determining at least one parameter of the time association parameter, the equipment association parameter and the video frame association parameter may include determining a video frame association parameter, that is, a terminal may obtain a processing duration of the processed video frame in the first video stream, and determine a normal frame threshold and an abnormal frame threshold corresponding to the processing duration from abnormal playing sub-conditions corresponding to the video frame association parameter, and then determine a normal frame number and an abnormal frame number, where if the normal frame number is less than or equal to the normal frame threshold and/or the abnormal frame number is greater than or equal to the abnormal frame threshold, determine that the video frame association parameter meets the corresponding abnormal playing sub-conditions; if the normal frame number is greater than the normal frame number threshold and the abnormal frame number is less than the abnormal frame number threshold, the video frame association parameter is not in accordance with the corresponding abnormal playing sub-condition.
Specifically, the time-related parameter includes a single frame decoding duration, and the determining of the time-related parameter may include: the terminal can acquire a preset single frame decoding threshold value, then judge the single frame decoding time length, if the single frame decoding time length is larger than the single frame decoding threshold value, the decoding time length of the video frame is too high, and the time correlation parameter is determined to accord with the corresponding abnormal playing sub-condition; if the single frame decoding duration is less than or equal to the single frame decoding threshold, the decoding duration of the video frame is normal, and the time-related parameter is determined to be not in accordance with the corresponding abnormal playing sub-condition.
Specifically, the device-related parameter includes a device temperature, and the determining the device-related parameter may include: the terminal can acquire a preset temperature threshold, then judge the temperature of the equipment, if the temperature of the equipment is greater than the temperature threshold, the temperature of the equipment is too high, and the associated parameters of the equipment are determined to accord with the corresponding abnormal playing sub-conditions; if the equipment temperature is less than or equal to the temperature threshold, the equipment temperature is normal, and the equipment association parameter is determined to be not in accordance with the corresponding abnormal playing sub-condition. In addition, the judging process of the terminal system performance information included in the device association parameter may refer to the content in step 102, which is not described herein.
104. And when the video playing information accords with a preset abnormal playing condition, selecting a target second coding format for switching the first coding format from at least one second coding format, and switching and playing a second video stream of the target second coding format.
The abnormal playing condition is a condition for indicating that the target video playing is abnormal, the condition may be a limitation of a judging result of the video playing information, if the judging result is classified as a certain condition, the abnormal playing condition is met, or may be a limitation of an analyzed result of a plurality of judging results of the video playing information, if the analyzed result is classified as a certain condition, the abnormal playing condition is met.
It can be understood that if the video playing information accords with the preset abnormal playing condition, the video playing information shows that the performance of the current device is insufficient to support the playing of the video stream of the coding format with higher compression rate under the premise of not influencing the video playing effect, so that the terminal needs to select the video stream of the coding format with lower compression rate to realize the playing of the target video so as to ensure the playing effect of the target video, so that the terminal needs to select a certain second coding format from at least one second coding format as the coding format to which the first video stream needs to be switched currently and the second video stream to be continuously played belongs, wherein the second coding format selected by the terminal is the coding format of the target second coding format, and therefore, by monitoring the video playing information, the bandwidth cost required by playing the video can be reduced, the video stream of the other coding format needs to be switched in time when the video playing is found out to be remedied, the smoothness of the target video in playing is ensured, and the phenomenon that the video playing effect is poor is avoided is considered when the user watches the target video.
Specifically, selecting the target second coding format for switching the first coding format from the at least one second coding format may include: the terminal can randomly select a target second coding format for switching the first coding format from at least one second coding format based on a random algorithm; or, the terminal may select a target second coding format for switching the first coding format from at least one second coding format based on a preset selection rule.
The selection rule may be selected based on the compression rate, the transmission code stream, and the like for video processing information, that is, the second coding format with the highest transmission code stream is selected from at least one second coding format as the target second coding format, or the second coding format with the highest compression rate is selected from at least one second coding format as the target second coding format, which may be specifically set according to the requirement, and is not limited herein.
For example, the terminal may be the ios end, that is, the video playing method is performed in the ios end, and since hard decoding in the av1 format cannot be performed in the ios end, playing of the video stream in the av1 format needs to be performed in the ios end by means of soft decoding, and the requirement on performance of the selection system is high by means of long-time soft decoding, which easily results in a degradation of playing experience when the performance of the terminal system is degraded, for example, the smoothness in playing is low. In contrast, in this embodiment, when the performance of the terminal decreases and the video stream is abnormally played, the playing method and strategy of the av1 format falling to the ground at the ios end may be supported by switching the video stream mode of the compression encoding format with a lower compression rate.
As shown in fig. 2, if the first video stream in the first coding format is currently played by the terminal and the playing information of the first video stream in the playing process meets the preset abnormal playing condition, the terminal needs to switch the second video stream in the second coding format to continue playing, so as to ensure the playing effect of the target video.
In some embodiments, in order to reduce the bandwidth cost required for playing the video more, while considering the playing effect of the target video, the coverage rate of the first video stream is improved, when the terminal detects that the video playing information of the first video stream in the playing process accords with the preset abnormal playing condition, the terminal performance improvement policy may be adopted, that is, the power consumption required for decoding is reduced by performing corresponding processing on the first video stream, so as to improve the decoding efficiency, for example, discarding the content similar frames, non-reference frames and the like in the first video stream, thereby reducing the decoding power consumption and improving the decoding efficiency while guaranteeing the video quality of the target video, so as to continue playing the first video stream after the frame loss.
Specifically, when the video playing information meets a preset abnormal playing condition, selecting a target second coding format for switching the first coding format from at least one second coding format, and switching and playing a second video stream of the target second coding format may include: when the video playing information accords with a preset abnormal playing condition, determining unreported non-reference frames in the first video stream, discarding the unreported non-reference frames in the first video stream, and continuing to play the first video stream, namely continuing to play the first video stream of which the unreported non-reference frames are discarded, namely continuing to play the first video stream based on the reference frames in the first video stream.
Wherein the terminal may set a decoding type for a first video stream decoder decoding the first video stream, the decoding type being used to instruct the first video stream decoder to decode only reference frames in the first video stream and discard non-reference frames in the first video stream. For example, if the encoding format of the first video stream is av1, the first video stream decoder may employ a dav1d decoder.
And then, in the process of continuously playing the first video stream, the terminal acquires the latest video playing information of the first video stream so as to judge whether the equipment performance shown by the video playing information of the first video stream which is continuously played after frame loss can support playing the video stream with the coding format with higher compression rate on the premise of not influencing the video playing effect. Finally, determining whether the second video stream needs to be switched and played or not according to the judging result, namely selecting a target second coding format for switching the first coding format from at least one second coding format and switching and playing the second video stream of the target second coding format if the latest video playing information accords with the abnormal playing condition; if the latest video playing information does not accord with the abnormal playing condition, the current first video stream is normally played, so that the terminal does not need to perform any operation to continue playing the first video stream.
The latest video playing information of the first video stream which continues to be played after the frame loss is judged may be obtained in real time for judgment, or may be obtained in a certain period of time for judgment, for example, the second playing time of the first video stream which continues to be played and discards the non-reference frame is determined, then, the latest video playing information corresponding to each time after the second playing time is obtained for judgment, or the latest video playing information in a period between the second playing time and each time after the second playing time is judged; or, acquiring the latest video playing information in a preset time period after the second playing time to judge.
In some embodiments, if it is desired to switch the currently playing first video stream to the playing second video stream in the target second coding format, the stop playing position of the first video stream needs to be determined, so as to determine, based on the play stop position of the first video stream, from which frame the playing stop position of the first video stream is continued by the second video stream in the target second coding format, and continue playing. The play stop position corresponds to a switching position between the first video stream and the second video stream in the target second coding format.
Specifically, the switching playing the second video stream of the target second coding format may include: the terminal needs to be preset with a video buffer queue, at least two frames of video frames are buffered in the video buffer queue, the at least two frames of video frames are sequentially played according to the playing time sequence, and the terminal can identify the video frames which are well arranged in the video buffer queue through a player so as to select the video frames from the video buffer queue according to the arrangement sequence for playing.
Then, the terminal can determine a target key frame belonging to the latest buffer memory of the first video stream in the preset video buffer memory queue, and the terminal can take the playing position of the target key frame in the target video as a video switching position because the target key frame is the last buffer memory video frame in the first video stream, so that the terminal can switch the video stream based on the video switching position.
And finally, stopping playing the first video stream when the first video stream is played to the video switching position, and switching to play video frames after the video switching position in the second video stream of the target second coding format.
Specifically, after the target key frame is defined, the terminal may restart a player, and based on the video switching position, when the current player plays the first video stream to the video switching position, switch the restarted player to play the video frame after the video switching position in the second video stream in the target second coding format.
Specifically, after the target key frame is defined, the terminal may continue to buffer the video frames after the video switching position in the second video stream of the target second coding format in the video buffer queue, so that the player sequentially sends the corresponding video frames to the decoder of the corresponding format for decoding based on the arrangement sequence of the video frames in the video buffer queue, renders the video frame information obtained by decoding, obtains a rendered video frame picture, and plays and displays the rendered video frame picture.
In an exemplary embodiment, the current target video is set to be a short video on demand, the package format of the short video is set to be mp4, then when the short video is played and a first video stream under a first coding format is switched to a second video stream under a target second coding format, the playing position of the latest key frame in the current video buffer queue in the target video can be recorded as a video switching position, then one player is restarted, the position of a video frame after the video switching position in the second video stream under the target second coding format is found by the restarted player, and when the current player plays the first video stream to the video switching position, the restarted player is switched to play the video frame after the video switching position in the second video stream under the target second coding format.
In some embodiments, since switching video streams also requires device performance, and since there is sometimes a video to which the video stream to be switched belongs that is about to be played, in order to save device performance, when the video playing information meets a preset abnormal playing condition, selecting a target second encoding format for switching the first encoding format from at least one second encoding format, and switching to play the second video stream of the target second encoding format may include: when the video playing information accords with a preset abnormal playing condition, the terminal can determine the playing time length of the first video stream and the total video time length of the target video so as to determine the residual time length of the unreleased video in the first video stream based on the playing time length and the total video time length, namely, the residual time length is the difference value between the playing time length and the total video time length. Then, the terminal judges whether to switch the video stream according to the difference value, namely if the residual time length is longer than a preset time length threshold value, the target video is required to be played for a longer time, a target second coding format for switching the first coding format is selected from at least one second coding format, and the second video stream of the target second coding format is switched to be played; if the remaining duration is less than or equal to the duration threshold, indicating that the playing of the target video is about to be completed, switching the video streams without consuming performance, and continuing to play the first video stream.
In some embodiments, the situation that the decoding performance of the terminal is insufficient is easy to occur due to the too high compression rate of the first video stream, and when the second video stream is to be switched to play, the phenomenon that the decoding performance of the terminal is insufficient is rarely caused due to the low compression rate of the second video stream, so that when the second video stream is played, the video playing information of the second video stream in the playing process does not need to be acquired, and whether the video playing information of the second video stream accords with the preset abnormal playing condition does not need to be judged.
In some embodiments, during playing the video stream of the target second coding format, the terminal may monitor the terminal system performance information, and when the terminal system performance information meets the video playing condition of the first coding format, the terminal may attempt to switch from the video stream of the target second coding format to the first video stream of the first coding format, and continue playing the first video stream, so as to reduce the bandwidth cost. The determining whether the terminal system performance information meets the video playing condition of the first encoding format may refer to the content in step 102, which is not described herein.
In an exemplary embodiment, during the process of playing the video stream in the second encoding format of the target, the terminal may monitor the percentage of the battery power, the CPU consumption parameter and the memory consumption parameter, and when the percentage of the battery power is greater than or equal to the corresponding parameter threshold, the CPU consumption parameter is greater than or equal to the corresponding parameter threshold, or the memory consumption parameter is greater than or equal to the corresponding parameter threshold, the terminal may attempt to switch from the video stream in the second encoding format of the target to the first video stream in the first encoding format, and continue playing the first video stream, so as to reduce the bandwidth cost.
As can be seen from the above, by acquiring a first video stream of a target video in a first encoding format and a second video stream in at least one second encoding format, the compression rate of the first encoding format is higher than the compression rate of the second encoding format. Then, by acquiring the current terminal system performance information, if the terminal system performance information meets the video playing condition of the first coding format, the performance of the current terminal supports playing the video stream of the coding format with higher compression rate so as to reduce the bandwidth under the premise of not influencing the video playing effect, and then playing the first video stream under the first coding format. Finally, the video playing information of the first video stream in the playing process is acquired to judge the video playing information, and when the video playing information accords with the preset abnormal playing condition, the condition that the performance of the current terminal is insufficient to support playing the video stream of the coding format with higher compression rate on the premise of not influencing the video playing effect is indicated, so that the target second coding format for switching the first coding format is selected from at least one second coding format, and the second video stream of the target second coding format is switched and played, thereby realizing the phenomenon that the video playing effect is poor while the bandwidth cost required by playing the video is reduced.
In order to better implement the above method, the embodiment of the application also provides a video playing device, which may be specifically integrated in an electronic device, for example, a computer device, where the computer device may be a terminal, a server, or other devices.
The terminal can be a mobile phone, a tablet personal computer, an intelligent Bluetooth device, a notebook computer, a personal computer and other devices; the server may be a single server or a server cluster composed of a plurality of servers.
For example, in this embodiment, a method in this application will be described in detail by taking a specific integration of a video playing device in a terminal as an example, and this embodiment provides a video playing device, as shown in fig. 3, where the video playing device may include:
a video stream obtaining module 301, configured to obtain a first video stream of a target video in a first coding format, and a second video stream of the target video in at least one second coding format, where a compression rate of the first coding format is higher than a compression rate of the second coding format;
the video stream playing module 302 is configured to obtain current terminal system performance information, and if the terminal system performance information meets the video playing condition of the first coding format, play a first video stream in the first coding format;
An information obtaining module 303, configured to obtain video playing information of the first video stream during a playing process;
the video stream switching module 304 is configured to select, when the video playing information meets a preset abnormal playing condition, a target second coding format for switching the first coding format from at least one second coding format, and switch to play the second video stream of the target second coding format.
In some embodiments, the video stream switching module 304 is specifically configured to:
when the video playing information accords with a preset abnormal playing condition, determining unreported non-reference frames in the first video stream, discarding the unreported non-reference frames in the first video stream, and continuously playing the first video stream;
acquiring latest video playing information of the first video stream in the process of continuously playing the first video stream;
and if the latest video playing information meets the abnormal playing condition, selecting a target second coding format for switching the first coding format from at least one second coding format, and switching and playing the second video stream of the target second coding format.
In some embodiments, the video stream switching module 304 is specifically configured to:
When the video playing information accords with a preset abnormal playing condition, determining the playing duration of the first video stream and the total video duration of the target video;
determining the residual duration of the unreleased video in the first video stream based on the playing duration and the total video duration;
if the remaining time length is greater than a preset time length threshold, selecting a target second coding format for switching the first coding format from at least one second coding format, and switching a second video stream for playing the target second coding format;
the video stream playing module 302 is specifically further configured to:
and if the remaining duration is less than or equal to the duration threshold, continuing to play the first video stream.
In some embodiments, the video stream switching module 304 is specifically configured to:
determining a target key frame belonging to the latest buffer memory of the first video stream in a preset video buffer memory queue, wherein at least two frames of video frames are buffered in the video buffer memory queue, and the at least two frames of video frames are sequentially played according to the playing time sequence;
taking the playing position of the target key frame in the target video as a video switching position;
Stopping playing the first video stream when the first video stream is played to the video switching position, and switching video frames after the video switching position in the second video stream playing the target second coding format.
In some embodiments, the video playing device further includes a comparison module, where the comparison module is specifically configured to:
comparing the hardware consumption parameter and the terminal attribute parameter with corresponding parameter thresholds respectively to obtain a first comparison result of the hardware consumption parameter and a second comparison result of the terminal attribute parameter;
and determining whether the terminal system performance information accords with the video condition of the first coding format based on the first comparison result and the second comparison result.
In some embodiments, the video playing information includes a time-related parameter, a device-related parameter, and a video frame-related parameter, where the time-related parameter, the device-related parameter, and the video frame-related parameter are respectively configured with corresponding abnormal playing sub-conditions, and the video playing device further includes a judging module, where the judging module is specifically configured to:
judging at least one parameter of the time-related parameter, the equipment-related parameter and the video frame-related parameter;
If at least one of the time-related parameter, the equipment-related parameter and the video frame-related parameter accords with the corresponding abnormal playing sub-condition, determining that the video playing information accords with the preset abnormal playing condition.
In some embodiments, the video frame association parameter includes a normal frame number and an abnormal frame number processed in the first video stream, and the determining module is specifically configured to:
acquiring the processing time length of the processed video frames in the first video stream, and determining a normal frame threshold value and an abnormal frame threshold value corresponding to the processing time length from the abnormal playing sub-conditions corresponding to the video frame association parameters;
if the normal frame number is less than or equal to the normal frame threshold and/or the abnormal frame number is greater than or equal to the abnormal frame threshold, determining that the video frame association parameter meets the corresponding abnormal playing sub-condition.
From the above, it can be seen that by acquiring a first video stream of a target video in a first encoding format and a second video stream of at least one second encoding format, the compression rate of the first encoding format is higher than the compression rate of the second encoding format. Then, by acquiring the current terminal system performance information, if the terminal system performance information meets the video playing condition of the first coding format, the performance of the current terminal supports playing the video stream of the coding format with higher compression rate so as to reduce the bandwidth under the premise of not influencing the video playing effect, and then playing the first video stream under the first coding format. Finally, the video playing information of the first video stream in the playing process is acquired to judge the video playing information, and when the video playing information accords with the preset abnormal playing condition, the condition that the performance of the current terminal is insufficient to support playing the video stream of the coding format with higher compression rate on the premise of not influencing the video playing effect is indicated, so that the target second coding format for switching the first coding format is selected from at least one second coding format, and the second video stream of the target second coding format is switched and played, thereby realizing the phenomenon that the video playing effect is poor while the bandwidth cost required by playing the video is reduced.
Correspondingly, the embodiment of the application also provides electronic equipment, which can be a terminal, and the terminal can be terminal equipment such as a smart phone, a tablet personal computer, a notebook computer, a touch screen, a game machine, a personal computer (PC, personal Computer), a personal digital assistant (Personal Digital Assistant, PDA) and the like. As shown in fig. 4, fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application. The electronic device 400 includes a processor 401 having one or more processing cores, a memory 402 having one or more computer readable storage media, and a computer program stored on the memory 402 and executable on the processor. The processor 401 is electrically connected to the memory 402. It will be appreciated by those skilled in the art that the electronic device structure shown in the figures is not limiting of the electronic device and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
The processor 401 is a control center of the electronic device 400, connects various parts of the entire electronic device 400 using various interfaces and lines, and performs various functions of the electronic device 400 and processes data by running or loading software programs and/or modules stored in the memory 402, and calling data stored in the memory 402, thereby performing overall monitoring of the electronic device 400.
In the embodiment of the present application, the processor 401 in the electronic device 400 loads the instructions corresponding to the processes of one or more application programs into the memory 402 according to the following steps, and the processor 401 executes the application programs stored in the memory 402, so as to implement various functions:
acquiring a first video stream of a target video in a first coding format and a second video stream of the target video in at least one second coding format, wherein the compression rate of the first coding format is higher than that of the second coding format;
acquiring current terminal system performance information, and playing a first video stream in the first coding format if the terminal system performance information accords with the video playing condition of the first coding format;
acquiring video playing information of the first video stream in the playing process;
and when the video playing information accords with a preset abnormal playing condition, selecting a target second coding format for switching the first coding format from at least one second coding format, and switching and playing a second video stream of the target second coding format.
In some embodiments, when the video playing information meets a preset abnormal playing condition, selecting a target second coding format for switching the first coding format from at least one second coding format, and switching a second video stream for playing the target second coding format, where the second video stream includes:
When the video playing information accords with a preset abnormal playing condition, determining unreported non-reference frames in the first video stream, discarding the unreported non-reference frames in the first video stream, and continuously playing the first video stream;
acquiring latest video playing information of the first video stream in the process of continuously playing the first video stream;
and if the latest video playing information meets the abnormal playing condition, selecting a target second coding format for switching the first coding format from at least one second coding format, and switching and playing the second video stream of the target second coding format.
In some embodiments, when the video playing information meets a preset abnormal playing condition, selecting a target second coding format for switching the first coding format from at least one second coding format, and switching a second video stream for playing the target second coding format, where the second video stream includes:
when the video playing information accords with a preset abnormal playing condition, determining the playing duration of the first video stream and the total video duration of the target video;
determining the residual duration of the unreleased video in the first video stream based on the playing duration and the total video duration;
If the remaining time length is greater than a preset time length threshold, selecting a target second coding format for switching the first coding format from at least one second coding format, and switching a second video stream for playing the target second coding format;
further comprises:
and if the remaining duration is less than or equal to the duration threshold, continuing to play the first video stream.
In some embodiments, the switching plays the second video stream of the target second encoding format, including:
determining a target key frame belonging to the latest buffer memory of the first video stream in a preset video buffer memory queue, wherein at least two frames of video frames are buffered in the video buffer memory queue, and the at least two frames of video frames are sequentially played according to the playing time sequence;
taking the playing position of the target key frame in the target video as a video switching position;
stopping playing the first video stream when the first video stream is played to the video switching position, and switching video frames after the video switching position in the second video stream playing the target second coding format.
In some embodiments, the terminal system performance information includes a terminal hardware consumption parameter and a terminal attribute parameter, and after acquiring the current terminal system performance information, the method further includes:
Comparing the hardware consumption parameter and the terminal attribute parameter with corresponding parameter thresholds respectively to obtain a first comparison result of the hardware consumption parameter and a second comparison result of the terminal attribute parameter;
and determining whether the terminal system performance information accords with the video condition of the first coding format based on the first comparison result and the second comparison result.
In some embodiments, the video playing information includes a time-related parameter, a device-related parameter, and a video frame-related parameter, where the time-related parameter, the device-related parameter, and the video frame-related parameter are configured with corresponding abnormal playing sub-conditions, and after obtaining the video playing information of the first video stream during playing, the method further includes:
judging at least one parameter of the time-related parameter, the equipment-related parameter and the video frame-related parameter;
if at least one of the time-related parameter, the equipment-related parameter and the video frame-related parameter accords with the corresponding abnormal playing sub-condition, determining that the video playing information accords with the preset abnormal playing condition.
In some embodiments, the video frame association parameter includes a normal frame number and an abnormal frame number processed in the first video stream, and the determining at least one parameter of the time association parameter, the device association parameter, and the video frame association parameter includes:
acquiring the processing time length of the processed video frames in the first video stream, and determining a normal frame threshold value and an abnormal frame threshold value corresponding to the processing time length from the abnormal playing sub-conditions corresponding to the video frame association parameters;
if the normal frame number is less than or equal to the normal frame threshold and/or the abnormal frame number is greater than or equal to the abnormal frame threshold, determining that the video frame association parameter meets the corresponding abnormal playing sub-condition.
Thus, the electronic device 400 provided in this embodiment may have the following technical effects: the phenomenon of poor video playing effect is avoided while the bandwidth cost required by playing the video is reduced.
The specific implementation of each operation above may be referred to the previous embodiments, and will not be described herein.
Optionally, as shown in fig. 4, the electronic device 400 further includes: a touch display 403, a radio frequency circuit 404, an audio circuit 405, an input unit 406, and a power supply 407. The processor 401 is electrically connected to the touch display 403, the radio frequency circuit 404, the audio circuit 405, the input unit 406, and the power supply 407, respectively. Those skilled in the art will appreciate that the electronic device structure shown in fig. 4 is not limiting of the electronic device and may include more or fewer components than shown, or may combine certain components, or may be arranged in different components.
The touch display 403 may be used to display a graphical user interface and receive operation instructions generated by a user acting on the graphical user interface. The touch display screen 403 may include a display panel and a touch panel. Wherein the display panel may be used to display information entered by a user or provided to a user as well as various graphical user interfaces of the electronic device, which may be composed of graphics, text, icons, video, and any combination thereof. Alternatively, the display panel may be configured in the form of a liquid crystal display (LCD, liquid Crystal Display), an Organic Light-Emitting Diode (OLED), or the like. The touch panel may be used to collect touch operations on or near the user (such as operations on or near the touch panel by the user using any suitable object or accessory such as a finger, stylus, etc.), and generate corresponding operation instructions, and the operation instructions execute corresponding programs. Alternatively, the touch panel may include two parts, a touch detection device and a touch controller. The touch detection device detects the touch azimuth of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends the touch point coordinates to the processor 401, and can receive and execute commands sent from the processor 401. The touch panel may overlay the display panel, and upon detection of a touch operation thereon or thereabout, the touch panel is passed to the processor 401 to determine the type of touch event, and the processor 401 then provides a corresponding visual output on the display panel in accordance with the type of touch event. In the embodiment of the present application, the touch panel and the display panel may be integrated into the touch display screen 403 to implement the input and output functions. In some embodiments, however, the touch panel and the touch panel may be implemented as two separate components to perform the input and output functions. I.e. the touch-sensitive display 403 may also implement an input function as part of the input unit 406.
The radio frequency circuitry 404 may be used to transceive radio frequency signals to establish wireless communication with a network device or other electronic device via wireless communication.
The audio circuitry 405 may be used to provide an audio interface between a user and an electronic device through a speaker, microphone. The audio circuit 405 may transmit the received electrical signal after audio data conversion to a speaker, where the electrical signal is converted into a sound signal for output; on the other hand, the microphone converts the collected sound signals into electrical signals, which are received by the audio circuit 405 and converted into audio data, which are processed by the audio data output processor 401 and sent via the radio frequency circuit 404 to e.g. another electronic device, or which are output to the memory 402 for further processing. The audio circuit 405 may also include an ear bud jack to provide communication of the peripheral headphones with the electronic device.
The input unit 406 may be used to receive input numbers, character information, or user characteristic information (e.g., fingerprint, iris, facial information, etc.), and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.
The power supply 407 is used to power the various components of the electronic device 400. Alternatively, the power supply 407 may be logically connected to the processor 401 through a power management system, so as to implement functions of managing charging, discharging, and power consumption management through the power management system. The power supply 407 may also include one or more of any of a direct current or alternating current power supply, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
Although not shown in fig. 4, the electronic device 400 may further include a camera, a sensor, a wireless fidelity module, a bluetooth module, etc., which are not described herein.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and for parts of one embodiment that are not described in detail, reference may be made to related descriptions of other embodiments.
Those of ordinary skill in the art will appreciate that all or a portion of the steps of the various methods of the above embodiments may be performed by instructions, or by instructions controlling associated hardware, which may be stored in a computer-readable storage medium and loaded and executed by a processor.
To this end, embodiments of the present application provide a computer readable storage medium having stored therein a plurality of computer programs that can be loaded by a processor to perform steps in any of the video playback methods provided by the embodiments of the present application. For example, the computer program may perform the steps of:
Acquiring a first video stream of a target video in a first coding format and a second video stream of the target video in at least one second coding format, wherein the compression rate of the first coding format is higher than that of the second coding format;
acquiring current terminal system performance information, and playing a first video stream in the first coding format if the terminal system performance information accords with the video playing condition of the first coding format;
acquiring video playing information of the first video stream in the playing process;
and when the video playing information accords with a preset abnormal playing condition, selecting a target second coding format for switching the first coding format from at least one second coding format, and switching and playing a second video stream of the target second coding format.
In some embodiments, when the video playing information meets a preset abnormal playing condition, selecting a target second coding format for switching the first coding format from at least one second coding format, and switching a second video stream for playing the target second coding format, where the second video stream includes:
when the video playing information accords with a preset abnormal playing condition, determining unreported non-reference frames in the first video stream, discarding the unreported non-reference frames in the first video stream, and continuously playing the first video stream;
Acquiring latest video playing information of the first video stream in the process of continuously playing the first video stream;
and if the latest video playing information meets the abnormal playing condition, selecting a target second coding format for switching the first coding format from at least one second coding format, and switching and playing the second video stream of the target second coding format.
In some embodiments, when the video playing information meets a preset abnormal playing condition, selecting a target second coding format for switching the first coding format from at least one second coding format, and switching a second video stream for playing the target second coding format, where the second video stream includes:
when the video playing information accords with a preset abnormal playing condition, determining the playing duration of the first video stream and the total video duration of the target video;
determining the residual duration of the unreleased video in the first video stream based on the playing duration and the total video duration;
if the remaining time length is greater than a preset time length threshold, selecting a target second coding format for switching the first coding format from at least one second coding format, and switching a second video stream for playing the target second coding format;
Further comprises:
and if the remaining duration is less than or equal to the duration threshold, continuing to play the first video stream.
In some embodiments, the switching plays the second video stream of the target second encoding format, including:
determining a target key frame belonging to the latest buffer memory of the first video stream in a preset video buffer memory queue, wherein at least two frames of video frames are buffered in the video buffer memory queue, and the at least two frames of video frames are sequentially played according to the playing time sequence;
taking the playing position of the target key frame in the target video as a video switching position;
stopping playing the first video stream when the first video stream is played to the video switching position, and switching video frames after the video switching position in the second video stream playing the target second coding format.
In some embodiments, the terminal system performance information includes a terminal hardware consumption parameter and a terminal attribute parameter, and after acquiring the current terminal system performance information, the method further includes:
comparing the hardware consumption parameter and the terminal attribute parameter with corresponding parameter thresholds respectively to obtain a first comparison result of the hardware consumption parameter and a second comparison result of the terminal attribute parameter;
And determining whether the terminal system performance information accords with the video condition of the first coding format based on the first comparison result and the second comparison result.
In some embodiments, the video playing information includes a time-related parameter, a device-related parameter, and a video frame-related parameter, where the time-related parameter, the device-related parameter, and the video frame-related parameter are configured with corresponding abnormal playing sub-conditions, and after obtaining the video playing information of the first video stream during playing, the method further includes:
judging at least one parameter of the time-related parameter, the equipment-related parameter and the video frame-related parameter;
if at least one of the time-related parameter, the equipment-related parameter and the video frame-related parameter accords with the corresponding abnormal playing sub-condition, determining that the video playing information accords with the preset abnormal playing condition.
In some embodiments, the video frame association parameter includes a normal frame number and an abnormal frame number processed in the first video stream, and the determining at least one parameter of the time association parameter, the device association parameter, and the video frame association parameter includes:
Acquiring the processing time length of the processed video frames in the first video stream, and determining a normal frame threshold value and an abnormal frame threshold value corresponding to the processing time length from the abnormal playing sub-conditions corresponding to the video frame association parameters;
if the normal frame number is less than or equal to the normal frame threshold and/or the abnormal frame number is greater than or equal to the abnormal frame threshold, determining that the video frame association parameter meets the corresponding abnormal playing sub-condition.
It can be seen that the computer program can be loaded by a processor to perform the steps in any of the video playing methods provided in the embodiments of the present application, so as to bring about the following technical effects: the phenomenon of poor video playing effect is avoided while the bandwidth cost required by playing the video is reduced.
The specific implementation of each operation above may be referred to the previous embodiments, and will not be described herein.
Wherein the computer-readable storage medium may comprise: read Only Memory (ROM), random access Memory (RAM, random Access Memory), magnetic or optical disk, and the like.
Since the computer program stored in the computer readable storage medium may execute the steps in any video playing method provided in the embodiments of the present application, the beneficial effects that any video playing method provided in the embodiments of the present application may be achieved are detailed in the previous embodiments, and will not be described herein.
The foregoing has described in detail a video playing method, apparatus, electronic device and computer readable storage medium provided in the embodiments of the present application, and specific examples have been applied to illustrate the principles and embodiments of the present application, where the foregoing description of the embodiments is only for aiding in understanding the method and core idea of the present application; meanwhile, those skilled in the art will have variations in the specific embodiments and application scope in light of the ideas of the present application, and the present description should not be construed as limiting the present application in view of the above.

Claims (10)

1. A video playing method, the method comprising:
acquiring a first video stream of a target video in a first coding format and a second video stream of the target video in at least one second coding format, wherein the compression rate of the first coding format is higher than that of the second coding format;
acquiring current terminal system performance information, and if the terminal system performance information accords with the video playing condition of the first coding format, playing a first video stream under the first coding format;
acquiring video playing information of the first video stream in the playing process;
And when the video playing information accords with a preset abnormal playing condition, selecting a target second coding format for switching the first coding format from at least one second coding format, and switching and playing a second video stream of the target second coding format.
2. The video playing method according to claim 1, wherein when the video playing information meets a preset abnormal playing condition, selecting a target second coding format for switching the first coding format from at least one second coding format, and switching to play the second video stream of the target second coding format, includes:
when the video playing information accords with a preset abnormal playing condition, determining unreported non-reference frames in the first video stream, discarding the unreported non-reference frames in the first video stream, and continuing to play the first video stream;
acquiring latest video playing information of the first video stream in the process of continuously playing the first video stream;
and if the latest video playing information accords with the abnormal playing condition, selecting a target second coding format for switching the first coding format from at least one second coding format, and switching and playing a second video stream of the target second coding format.
3. The video playing method according to claim 1, wherein when the video playing information meets a preset abnormal playing condition, selecting a target second coding format for switching the first coding format from at least one second coding format, and switching to play the second video stream of the target second coding format, includes:
when the video playing information accords with a preset abnormal playing condition, determining the playing duration of the first video stream and the total video duration of the target video;
determining the residual duration of the unreleased video in the first video stream based on the playing duration and the total video duration;
if the residual time length is greater than a preset time length threshold, selecting a target second coding format for switching the first coding format from at least one second coding format, and switching to play a second video stream of the target second coding format;
further comprises:
and if the remaining duration is less than or equal to the duration threshold, continuing to play the first video stream.
4. The video playing method according to claim 1, wherein said switching to play the second video stream of the target second encoding format includes:
Determining a target key frame belonging to the latest buffer memory of the first video stream in a preset video buffer memory queue, wherein at least two frames of video frames are buffered in the video buffer memory queue, and the at least two frames of video frames are sequentially played according to the playing time sequence;
taking the playing position of the target key frame in the target video as a video switching position;
stopping playing the first video stream when the first video stream is played to the video switching position, and switching to play video frames after the video switching position in the second video stream of the target second coding format.
5. The video playing method of claim 1, wherein the terminal system performance information includes a terminal hardware consumption parameter and a terminal attribute parameter, and further comprising, after acquiring the current terminal system performance information:
comparing the hardware consumption parameter and the terminal attribute parameter with corresponding parameter thresholds respectively to obtain a first comparison result of the hardware consumption parameter and a second comparison result of the terminal attribute parameter;
and determining whether the terminal system performance information accords with the video condition of the first coding format or not based on the first comparison result and the second comparison result.
6. The video playing method according to any one of claims 1 to 5, wherein the video playing information includes a time-related parameter, a device-related parameter, and a video frame-related parameter, the time-related parameter, the device-related parameter, and the video frame-related parameter being respectively configured with corresponding abnormal playing sub-conditions, and after obtaining the video playing information of the first video stream during playing, further comprising:
judging at least one parameter of the time-related parameter, the equipment-related parameter and the video frame-related parameter;
and if at least one of the time-related parameter, the equipment-related parameter and the video frame-related parameter accords with the corresponding abnormal playing sub-condition, determining that the video playing information accords with the preset abnormal playing condition.
7. The video playing method according to claim 6, wherein the video frame association parameters include a normal frame number and an abnormal frame number processed in the first video stream, and the determining at least one of the time association parameter, the device association parameter, and the video frame association parameter includes:
Acquiring the processing time length of the processed video frames in the first video stream, and determining a normal frame threshold value and an abnormal frame threshold value corresponding to the processing time length from the abnormal playing sub-conditions corresponding to the video frame association parameters;
and if the normal frame number is smaller than or equal to the normal frame threshold value and/or the abnormal frame number is larger than or equal to the abnormal frame threshold value, determining that the video frame association parameter meets the corresponding abnormal playing sub-condition.
8. A video playback device, the device comprising:
the video stream acquisition module is used for acquiring a first video stream of a target video in a first coding format and a second video stream of at least one second coding format, wherein the compression rate of the first coding format is higher than that of the second coding format;
the video stream playing module is used for acquiring current terminal system performance information, and playing a first video stream under the first coding format if the terminal system performance information accords with the video playing condition of the first coding format;
the information acquisition module is used for acquiring video playing information of the first video stream in the playing process;
And the video stream switching module is used for selecting a target second coding format for switching the first coding format from at least one second coding format when the video playing information accords with a preset abnormal playing condition, and switching and playing the second video stream of the target second coding format.
9. An electronic device comprising a processor and a memory, the memory storing a plurality of instructions; the processor loads instructions from the memory to perform the steps in the video playing method according to any one of claims 1 to 7.
10. A computer readable storage medium storing a plurality of instructions adapted to be loaded by a processor to perform the steps in the video playback method of any one of claims 1 to 7.
CN202311586786.5A 2023-11-24 2023-11-24 Video playing method, device, electronic equipment and computer readable storage medium Pending CN117615175A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311586786.5A CN117615175A (en) 2023-11-24 2023-11-24 Video playing method, device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311586786.5A CN117615175A (en) 2023-11-24 2023-11-24 Video playing method, device, electronic equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN117615175A true CN117615175A (en) 2024-02-27

Family

ID=89945815

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311586786.5A Pending CN117615175A (en) 2023-11-24 2023-11-24 Video playing method, device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN117615175A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104768051A (en) * 2015-03-06 2015-07-08 深圳市九洲电器有限公司 Self-adaption switching method and system for multi-coding form program streams
CN108040258A (en) * 2017-11-21 2018-05-15 北京臻迪科技股份有限公司 A kind of coding, coding/decoding method, apparatus and system
CN112367564A (en) * 2020-10-30 2021-02-12 北京达佳互联信息技术有限公司 Video playing parameter determination method and device
WO2023024801A1 (en) * 2021-08-23 2023-03-02 北京字跳网络技术有限公司 Video decoding method and device, storage medium, and program product
CN115883877A (en) * 2022-11-24 2023-03-31 浪潮数字(山东)科技有限公司 Method and system for transmitting ultra-high-definition video stream

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104768051A (en) * 2015-03-06 2015-07-08 深圳市九洲电器有限公司 Self-adaption switching method and system for multi-coding form program streams
CN108040258A (en) * 2017-11-21 2018-05-15 北京臻迪科技股份有限公司 A kind of coding, coding/decoding method, apparatus and system
CN112367564A (en) * 2020-10-30 2021-02-12 北京达佳互联信息技术有限公司 Video playing parameter determination method and device
WO2023024801A1 (en) * 2021-08-23 2023-03-02 北京字跳网络技术有限公司 Video decoding method and device, storage medium, and program product
CN115883877A (en) * 2022-11-24 2023-03-31 浪潮数字(山东)科技有限公司 Method and system for transmitting ultra-high-definition video stream

Similar Documents

Publication Publication Date Title
CN111135569B (en) Cloud game processing method and device, storage medium and electronic equipment
US11606564B2 (en) Video encoding code rate control method, apparatus, and device, and storage medium
WO2020248909A1 (en) Video decoding method and apparatus, computer device, and storage medium
CN107360458B (en) Play control method, device, storage medium and terminal
CN110996134B (en) Video playing method, device and storage medium
CN107547940A (en) Video playback processing method, equipment and computer-readable recording medium
CN111866433B (en) Video source switching method, video source playing method, video source switching device, video source playing device, video source equipment and storage medium
US11202066B2 (en) Video data encoding and decoding method, device, and system, and storage medium
CN109151469B (en) Video coding method, device and equipment
CN114189700A (en) Live broadcast card pause prompting method and device, computer equipment and storage medium
US20230066899A1 (en) Video data processing method and apparatus, and electronic device
CN108235075B (en) Video quality grade matching method, computer readable storage medium and terminal
CN114025389B (en) Data transmission method, device, computer equipment and storage medium
CN109474833B (en) Network live broadcast method, related device and system
CN117615175A (en) Video playing method, device, electronic equipment and computer readable storage medium
CN112312370B (en) Switching threshold value processing method and device
CN114025170A (en) Video playing method and device, computer equipment and computer readable storage medium
CN114422866A (en) Video processing method and device, electronic equipment and storage medium
CN115776593A (en) Video content processing method and related device
CN114416013A (en) Data transmission method, data transmission device, electronic equipment and computer-readable storage medium
CN117676249B (en) Live video processing method and device, electronic equipment and storage medium
US20130113874A1 (en) Bit rate control apparatus and method thereof
CN114222162B (en) Video processing method, device, computer equipment and storage medium
CN117676249A (en) Live video processing method and device, electronic equipment and storage medium
CN117412102A (en) Multimedia data transmission method, device, medium and equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination