CN115334352A - Automatic matching video decoding method, device, decoder and storage medium - Google Patents

Automatic matching video decoding method, device, decoder and storage medium Download PDF

Info

Publication number
CN115334352A
CN115334352A CN202210960189.3A CN202210960189A CN115334352A CN 115334352 A CN115334352 A CN 115334352A CN 202210960189 A CN202210960189 A CN 202210960189A CN 115334352 A CN115334352 A CN 115334352A
Authority
CN
China
Prior art keywords
decoding
video stream
mode
configuration information
decoding mode
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
CN202210960189.3A
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.)
Beijing Weiling Times Technology Co Ltd
Original Assignee
Beijing Weiling Times Technology 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 Beijing Weiling Times Technology Co Ltd filed Critical Beijing Weiling Times Technology Co Ltd
Priority to CN202210960189.3A priority Critical patent/CN115334352A/en
Publication of CN115334352A publication Critical patent/CN115334352A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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/44008Processing 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 operations for analysing video streams, e.g. detecting features or characteristics in the video stream
    • 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/440218Processing 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 transcoding between formats or standards, e.g. from MPEG-2 to MPEG-4

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The present application relates to the field of video decoding, and in particular, to an automatic matching video decoding method, apparatus, decoder, and storage medium. The method comprises the following steps: when detecting that the electronic equipment receives the video stream, detecting whether decoding configuration information exists, wherein the decoding configuration information is used for representing a set decoding mode; if the decoding configuration information does not exist, decoding the video stream according to a preset rule; the preset rule comprises a hard decoding mode, a soft decoding mode, a matching sequence of the hard decoding mode and the soft decoding mode; the hard decoding method comprises the following steps: at least two types of display cards used for hard decoding and decoding sequences corresponding to the at least two types of display cards. The present application has an effect of enabling each electronic device to decode a video stream.

Description

Automatic matching video decoding method, device, decoder and storage medium
Technical Field
The present application relates to the field of video decoding, and in particular, to a method and an apparatus for automatically matching video decoding, a decoder, and a storage medium.
Background
With the development of video technology, the bandwidth of video signals gradually becomes higher, the data bandwidth of the digitization of video signals is basically more than 20MB/S at present, and due to the high bandwidth, when the electronic device receives video streams, the processing of the video streams is difficult, and the calculation processing amount is large.
At present, when an electronic device transmits a video, a video coding compression technology is usually adopted first to convert a video format of a video stream to be transmitted into a file of another video format in advance, so that a bandwidth of the video stream is reduced to 1-10MB/S, and the video stream can be stored in the electronic device and processed accordingly.
The video stream received by the electronic device is usually encoded and compressed data, and the electronic device needs to decode the video stream before processing and playing the video. However, because the configurations of different electronic devices are different, the same video stream does not match the configurations of some electronic devices, and thus the effect that each electronic device can decode the same video stream cannot be achieved. Therefore, how to enable each electronic device to decode the same video stream becomes a problem.
Disclosure of Invention
In order to enable each electronic device to decode a video stream, the application provides an automatic matching video decoding method, an automatic matching video decoding device, a decoder and a storage medium.
In a first aspect, the present application provides an automatic matching decoding method, which adopts the following technical solution:
an auto-matching video decoding method, performed by a decoder, comprising:
when detecting that the electronic equipment receives a video stream, detecting whether decoding configuration information exists, wherein the decoding configuration information is used for representing a set decoding mode;
if the decoding configuration information does not exist, decoding the video stream according to a preset rule;
the preset rule comprises a hard decoding mode, a soft decoding mode and a matching sequence of the hard decoding mode and the soft decoding mode;
the hard decoding mode comprises the following steps: at least two types of the display cards utilized by hard decoding and decoding sequences corresponding to the at least two types of the display cards.
By adopting the technical scheme, when the decoder detects that the electronic equipment receives the video stream, if the electronic equipment does not have decoding configuration information, that is, the electronic equipment does not have a set decoding mode currently, the video stream is decoded and matched one by one according to the decoding modes respectively corresponding to the display cards in the hard decoding mode and the decoding sequence between the soft decoding modes, so that the video stream is decoded in a matched mode, and each electronic equipment can realize the effect of decoding the same video stream according to the matching mode.
In another possible implementation manner, the method further includes:
and if the decoding configuration information exists, decoding the video stream based on the decoding configuration information.
By adopting the technical scheme, when the electronic equipment has decoding configuration information, the decoding mode is preset for the representation, namely the preset decoding mode can be used for decoding the video stream, at the moment, the video stream can be directly decoded according to the preset decoding mode, and the video stream does not need to be matched one by one according to the preset rule to obtain a proper decoding mode, so that the efficiency of decoding the video stream can be improved, and the user experience can be further improved.
In another possible implementation manner, the determining the decoding configuration information includes any one of:
receiving decoding configuration information input by a user, and determining the decoding configuration information input by the user as the decoding configuration information; acquiring the corresponding relation between a historical video stream and a decoding mode, determining the corresponding relation between a video stream format and the decoding mode based on the corresponding relation, and determining the decoding configuration information based on the corresponding relation between the video stream format and the decoding mode; and acquiring a decoding mode used by the electronic equipment corresponding to the decoder for decoding the historical video stream, and determining decoding configuration information corresponding to the electronic equipment based on the decoding mode used for decoding the historical video stream.
By adopting the technical scheme, when the video stream is decoded based on the decoding configuration information, on one hand, the corresponding decoding mode can be determined through the decoding configuration information preset by a user, so that a possible decoding mode is provided for decoding the video stream, and the user experience can be further improved; on the other hand, the decoding mode corresponding to the video stream format can be determined based on the corresponding relationship between the video stream format and the decoding mode, so that the video stream of the related format can be decoded subsequently by adopting the corresponding decoding mode, the probability that the video stream of a certain format cannot be decoded is reduced, and the user experience can be further improved; on the other hand, the decoding mode corresponding to the associated electronic device can be determined according to the decoding mode of the associated electronic device for decoding the historical video stream, so that the probability that the associated electronic device cannot decode the video stream can be reduced, the decoding efficiency of the associated electronic device is improved, and the user experience can be further improved.
In another possible implementation manner, if any video stream format corresponds to at least two decoding manners, determining, based on a correspondence between the any video stream format and the decoding manner, decoding configuration information corresponding to the any video stream format includes:
acquiring decoding efficiencies corresponding to various decoding modes respectively, wherein the decoding efficiency corresponding to any decoding mode is obtained by decoding a historical video stream based on any decoding mode;
and determining decoding configuration information corresponding to any video stream format based on the decoding efficiency corresponding to each decoding mode.
By adopting the technical scheme, when any video stream format corresponds to at least two decoding modes, the decoding modes corresponding to the video stream format can be determined by determining the decoding efficiency corresponding to each decoding mode, so that the decoding efficiency and the decoding quality of decoding the video stream of a certain format can be improved, and the user experience can be further improved.
In another possible implementation manner, the determining, based on the decoding manner used for decoding the historical video stream, decoding configuration information corresponding to the electronic device includes any one of:
determining a first decoding mode as decoding configuration information corresponding to the electronic device, wherein the first decoding mode is a decoding mode with the most frequency used for decoding the historical video stream;
if the decoding mode used for decoding the historical video stream comprises a hard decoding mode, determining the decoding efficiency corresponding to the hard decoding mode, determining a second decoding mode based on the decoding efficiency corresponding to the hard decoding mode, and determining the second decoding mode as the decoding configuration information corresponding to the electronic equipment;
if the decoding efficiencies corresponding to the hard decoding modes are all lower than a preset efficiency threshold, the second decoding mode is a soft decoding mode; and if the decoding efficiency corresponding to the hard decoding mode is not lower than the preset efficiency threshold, determining the second decoding mode from the hard decoding modes.
By adopting the technical scheme, on one hand, the decoding mode with the most frequency used by the historical video stream decoding is determined as the decoding configuration information, wherein the decoding mode with the most frequency used by the decoding has higher probability of successfully decoding the decoding configuration information from a certain degree, and the decoding efficiency and the decoding quality are higher, so that the decoding success rate can be further improved, and the decoding efficiency and the decoding quality can be further improved; on the other hand, the decoding modes used by the historical video stream include a hard decoding mode, and by determining the decoding efficiency corresponding to the hard decoding mode, a more matched decoding mode can be determined, so that the probability of successful decoding through the decoding configuration information is improved, the decoding efficiency and the decoding quality can be further improved, and the user experience is further improved.
In another possible implementation manner, the decoding the video stream based on the decoding configuration information further includes:
acquiring a decoding result of the electronic equipment for decoding based on the decoding configuration information;
and if the decoding result represents that the decoding fails, decoding the video stream according to the preset rule.
By adopting the technical scheme, when decoding fails through the preset decoding configuration information, the decoding can be performed in a one-to-one matching mode according to the preset rule, so that the probability that the video stream cannot be decoded can be reduced, and the user experience can be further improved.
In another possible implementation manner, the decoding the video stream according to the preset rule includes:
deleting the decoding mode corresponding to the decoding configuration information from the preset rule to form a deleted preset rule;
and decoding the video stream according to the deleted preset rule.
By adopting the technical scheme, when the decoding fails through the preset decoding configuration information, the decoding mode of the decoding failure is deleted from the preset rule, and the decoding modes are matched one by one based on the remaining decoding modes, so that the matching efficiency of the decoding modes can be improved, the time for decoding matching and decoding is shortened, and the user experience can be further improved.
In another possible implementation manner, the decoding the video stream according to the preset rule includes:
determining a third decoding mode according to a preset rule, and decoding the video stream based on the third decoding mode, wherein the third decoding mode is a first decoding mode capable of decoding the video stream according to a decoding sequence;
when the decoding duration exceeds a first preset duration and the decoding is not finished, determining a next decoding mode based on the preset rule, and continuously decoding the video stream based on the next decoding mode, wherein the first preset duration is a standard decoding duration corresponding to the decoding of the video stream with a first preset frame number;
when the decoding time length of the next decoding mode exceeds a second preset time length and the decoding is not finished, determining the next decoding mode based on the preset rule in a circulating mode, and continuously decoding the video stream based on the next decoding mode until a preset condition is met, wherein the second preset time length is a standard decoding time length corresponding to the decoding of the video stream with a second preset frame number;
wherein the preset condition comprises at least one of the following:
the video stream decoding is complete;
the decoding mode used by the current decoding is a soft decoding mode;
the decoding duration of the decoding mode used by the current decoding is not more than a second preset duration.
By adopting the technical scheme, when the video stream is decoded by a certain decoding mode, the decoding speed is detected in real time, and the decoding mode is timely replaced when the decoding speed is lower, so that the decoding is finally realized, the decoding efficiency can be further improved, the decoding time is shortened, and the user experience can be further improved.
In a second aspect, the present application provides an apparatus for automatically matching video, which adopts the following technical solutions:
an auto-match video decoding apparatus, comprising:
the device comprises a configuration detection module, a decoding module and a decoding module, wherein the configuration detection module is used for detecting whether decoding configuration information exists when detecting that the electronic equipment receives a video stream, and the decoding configuration information is used for representing a set decoding mode;
the first decoding module is used for decoding the video stream according to a preset rule when the decoding configuration information does not exist; the preset rule comprises a hard decoding mode, a soft decoding mode and a matching sequence of the hard decoding mode and the soft decoding mode;
the hard decoding mode comprises the following steps: at least two types of the display cards utilized by hard decoding and decoding sequences corresponding to the at least two types of the display cards.
By adopting the above technical scheme, when the configuration detection module detects that the electronic device receives the video stream, when the electronic device does not have decoding configuration information, that is, the electronic device does not currently have a set decoding mode, at this time, the first decoding module performs decoding matching on the video stream one by one according to the decoding modes respectively corresponding to the display cards in the hard decoding mode and the decoding sequence between the soft decoding modes, so as to match out the mode of decoding the video stream, and thus each electronic device can realize the effect of decoding the same video stream according to the matching mode.
In another possible implementation manner, the apparatus further includes:
a second decoding module, configured to decode the video stream based on the decoding configuration information when the decoding configuration information exists.
In another possible implementation manner, the apparatus further includes a configuration determining module, where the configuration determining module is configured to determine a manner of decoding configuration information, where the configuration determining module includes any one of a first determining unit, a second determining unit, and a third determining unit, where:
the first determining unit is used for receiving decoding configuration information input by a user and determining the decoding configuration information input by the user as the decoding configuration information;
the second determining unit is used for acquiring the corresponding relation between the historical video stream and the decoding mode, determining the corresponding relation between the video stream format and the decoding mode based on the corresponding relation, and determining the decoding configuration information based on the corresponding relation between the video stream format and the decoding mode;
the third determining unit is configured to acquire a decoding manner used by the electronic device corresponding to the decoder to decode the historical video stream, and determine the decoding configuration information corresponding to the electronic device based on the decoding manner used by the electronic device to decode the historical video stream.
In another possible implementation manner, when any video stream format corresponds to at least two decoding manners, the second determining unit, when determining, based on the correspondence between the any video stream format and the decoding manners, the decoding configuration information corresponding to the any video stream format, is specifically configured to:
acquiring decoding efficiencies corresponding to various decoding modes respectively, wherein the decoding efficiency corresponding to any decoding mode is obtained by decoding the historical video stream based on any decoding mode;
and determining decoding configuration information corresponding to any video stream format based on the decoding efficiency corresponding to each decoding mode.
In another possible implementation, the third determining unit includes a frequency determining subunit or an efficiency determining subunit, where;
the frequency determining subunit is configured to determine a first decoding manner as decoding configuration information corresponding to the electronic device, where the first decoding manner is a decoding manner in which the frequency used for decoding the historical video stream is the highest;
the efficiency determining subunit is configured to determine, when a decoding manner used for decoding the historical video stream includes a hard decoding manner, a decoding efficiency corresponding to the hard decoding manner, determine, based on the decoding efficiency corresponding to the hard decoding manner, a second decoding manner, and determine the second decoding manner as decoding configuration information corresponding to the electronic device;
when the decoding efficiency corresponding to the hard decoding mode is lower than a preset efficiency threshold, the second decoding mode is a soft decoding mode; and when the decoding efficiency corresponding to the hard decoding mode is not lower than the preset efficiency threshold, determining the second decoding mode from the hard decoding mode.
In another possible implementation manner, the apparatus further includes:
the result acquisition module is used for acquiring a decoding result of the electronic equipment for decoding based on the decoding configuration information;
and the third decoding module is used for decoding the video stream according to the preset rule when the decoding result represents that the decoding fails.
In another possible implementation manner, when the third decoding module decodes the video stream according to the preset rule, the third decoding module is specifically configured to:
deleting the decoding mode corresponding to the decoding configuration information from the preset rule to form a deleted preset rule;
and decoding the video stream according to the deleted preset rule.
In another possible implementation manner, when the first decoding module decodes the video stream according to a preset rule, the first decoding module is specifically configured to:
determining a third decoding mode according to a preset rule, and decoding the video stream based on the third decoding mode, wherein the third decoding mode is a first decoding mode capable of decoding the video stream according to a decoding sequence;
when the decoding duration exceeds a first preset duration and the decoding is not finished, determining a next decoding mode based on the preset rule, and continuously decoding the video stream based on the next decoding mode, wherein the first preset duration is a standard decoding duration corresponding to the decoding of the video stream with a first preset frame number;
when the decoding time length of the next decoding mode exceeds a second preset time length and the decoding is not finished, determining the next decoding mode based on the preset rule in a circulating mode, and continuously decoding the video stream based on the next decoding mode until a preset condition is met, wherein the second preset time length is a standard decoding time length corresponding to the decoding of the video stream with a second preset frame number;
wherein the preset condition comprises at least one of the following:
the video stream decoding is complete;
the decoding mode used by the current decoding is a soft decoding mode;
the decoding duration of the decoding mode used by the current decoding is not more than a second preset duration.
In a third aspect, the present application provides a decoder, which adopts the following technical solutions:
a decoder, the decoder comprising:
at least one processor;
a memory;
at least one application, wherein the at least one application is stored in the memory and configured to be executed by the at least one processor, the at least one application configured to: the above method of automatic matching video decoding is performed.
In a fourth aspect, the present application provides a computer-readable storage medium, which adopts the following technical solutions:
a computer-readable storage medium, comprising: a computer program is stored which can be loaded by a processor and which performs the above-described auto-matching video decoding method.
To sum up, the application comprises the following beneficial technical effects:
when the decoder detects that the electronic device receives the video stream, if the electronic device does not have decoding configuration information, that is, the electronic device is characterized that a set decoding mode does not exist currently, the video stream is decoded and matched one by one according to a decoding mode respectively corresponding to each display card in a hard decoding mode and a decoding sequence between soft decoding modes, so that the video stream is decoded in a matching mode, and therefore each electronic device can achieve the effect of decoding the same video stream according to the matching mode.
When the video stream is decoded based on the decoding configuration information, on one hand, a corresponding decoding mode can be determined through the decoding configuration information preset by a user, so that a possible decoding mode is provided for decoding the video stream, and the user experience can be further improved; on the other hand, the decoding mode corresponding to the video stream format can be determined based on the corresponding relationship between the video stream format and the decoding mode, so that the video stream of the related format can be decoded subsequently by adopting the corresponding decoding mode, the probability that the video stream of a certain format cannot be decoded is reduced, and the user experience can be further improved; on the other hand, the decoding mode corresponding to the associated electronic device can be determined according to the decoding mode of the associated electronic device for decoding the historical video stream, so that the probability that the associated electronic device cannot decode the video stream can be reduced, the decoding efficiency of the associated electronic device is improved, and the user experience can be further improved.
Drawings
FIG. 1 is a flow chart of an embodiment of an automatic matching video decoding method;
FIG. 2 is a schematic diagram of a matching process of decoding according to a preset rule in the embodiment of the present application;
FIG. 3 is a block diagram of an apparatus for auto-match video decoding according to an embodiment of the present application;
fig. 4 is a schematic diagram of a decoder according to an embodiment of the present application.
Detailed Description
The present application is described in further detail below with reference to figures 1-4.
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
At present, methods for decoding a received compressed video stream by an electronic device include hardware decoding and software decoding, where the software decoding refers to decoding by using a Central Processing Unit (CPU) of the electronic device, and a quality of the decoding is determined by a decoding program in the CPU. The hardware decoding is a mode of decoding by using a display card configured in the electronic equipment, and because the hardware decoding is decoded by using a special display card, the image quality after decoding is generally higher than that of a software decoding mode, and the CPU resource of the electronic equipment is not required to be occupied.
However, some electronic devices have superior video card performance, and can decode most video streams, and the decoding performance is often higher and the decoded effect is better; however, for some electronic devices, the video card may not match the video format, so that the cellular video stream cannot be decoded; moreover, as the performance of part of the video cards is relatively general, for some videos with a large number of frames, the problem of too long decoding time can occur.
In order to enable all electronic devices to decode video streams, in one possible implementation manner, since software decoding is performed by using a CPU of the electronic devices, decoding of the video streams of all electronic devices can be performed by using a decoding program on the basis of hardware devices of the CPU, that is, all electronic devices can be decoded by using a software decoding manner.
However, if all electronic devices decode by using the software decoding method, the effect of the software decoding is often unsatisfactory, and a large amount of CPU resources are occupied, and the decoding cost is relatively high and long. Therefore, the embodiment of the present application provides an automatic matching video decoding method, which performs decoding by using hardware decoding as much as possible on the basis that all electronic devices can perform decoding, so that the decoding quality can be further improved and the waste of CPU resources can be reduced on the basis that all electronic devices can perform decoding.
The embodiment of the application provides an automatic matching video decoding method, which is executed by a decoder, wherein the decoder can decode a video stream received by an electronic device, and specifically, the decoder can be integrated on the electronic device or can be used as a separate device and is connected with the electronic device in a wireless or wired manner.
Further, as shown in fig. 1, the automatic matching video decoding method may include:
step S101, when detecting that the electronic equipment receives the video stream, detecting whether decoding configuration information exists.
The decoding configuration information is used for representing a set decoding mode.
Specifically, when the decoder detects that the electronic device currently receives a video stream, the video stream will be decoded. In the embodiment of the present application, if the decoder is integrated in the electronic device, the decoder may automatically detect that the electronic device receives the video stream; if the decoder is not integrated in the electronic device, the electronic device sends a notification message to the decoder after receiving the video stream to indicate that the video stream to be decoded is currently received.
Before decoding, the decoder needs to determine a decoding method for decoding the video stream, and then apply the corresponding decoding method for decoding.
The decoding configuration information represents a set decoding mode, that is, the representation electronic device needs to decode according to the decoding mode specified by the decoding configuration information. The decoding configuration information can be manually set in the decoder, or the decoder can automatically set according to the historical decoding condition. In general, if the decoder is provided with decoding configuration information, the decoder decodes the video stream based on the decoding configuration information.
Therefore, when the decoding mode corresponding to the electronic device is determined, it is determined whether the preset decoding configuration information exists in the electronic device.
And step S102, if the decoding configuration information does not exist, decoding the video stream according to a preset rule.
The preset rule comprises a hard decoding mode, a soft decoding mode, and a matching sequence of the hard decoding mode and the soft decoding mode. In the embodiment of the present application, in order to preferentially match a decoding scheme with high decoding quality and improve the decoding quality of a video stream as much as possible, a hard decoding scheme may be matched first, and if the hard decoding scheme is not matched, a soft decoding scheme may be matched again.
Furthermore, in order to improve the decoding efficiency, the video stream may be divided into two parts, one part is used for matching the hard decoding mode, the other part is used for matching the soft decoding mode, and the matching and decoding of the decoding modes are performed simultaneously, so as to improve the decoding efficiency.
Further, the hard decoding method may include: at least two types of the display cards utilized by the hard decoding and the decoding sequence corresponding to the at least two types of the display cards.
In the embodiment of the application, the types of the display cards can be classified according to manufacturers of the display cards, and the matching sequence corresponding to the display cards of each manufacturer is determined. For example, the hard decoding mode includes a display card produced by the manufacturer 1 and a display card produced by the manufacturer 2, the decoding sequence is the sequence that the display card produced by the manufacturer 1 is prior and the display card produced by the manufacturer 2 is later, when the hard decoding mode is matched, whether the display card produced by the manufacturer 1 is matched or not is judged, if the display card produced by the manufacturer 1 is not matched, whether the display card produced by the manufacturer 2 is matched or not is judged, and if the display card produced by the manufacturer 1 is not matched with the display card produced by the manufacturer 2, the soft decoding mode is matched.
The types of the display cards can be classified according to other classification modes, for example, all the display cards are classified according to the difference of the core display card, the integrated display card and the independent display card, the processing efficiency of the core display card is high, and the power consumption is low; the integrated display card is integrated on the mainboard, so that the power consumption is low, the heat productivity is small, and the performance is low; the independent display cards are integrated into a whole and exist as an independent board card, and the independent display cards have good performance but high power consumption and high heat productivity; the display cards are classified according to the differences of the core display card, the independent display card and the integrated display card, and when the performance is taken as a main consideration, the matching sequence can be the sequence of the core display card, the independent display card and the integrated display card in sequence. The classification mode of the display card types can also be as follows: on the basis of classifying according to different manufacturers, the display cards produced by the same manufacturer are classified and sequenced again according to the differences of the core display cards, the integrated display cards and the independent display cards, for example, the display cards are all produced by the manufacturer 1, the display cards produced by the manufacturer 1 have the core display cards, the integrated display cards and the independent display cards, the core display cards produced by the manufacturer 1 are used as one display card type, the independent display cards produced by the manufacturer 1 are used as the other display card type, and the integrated display cards produced by the manufacturer 1 are also used as the display card type. It should be noted that the classification method of the graphics card types is not limited in the embodiments of the present application, and only a method of classifying the graphics card types according to different manufacturers is taken as an example.
Further, after the decoding mode is matched in the above mode, the video stream is decoded in the matched decoding mode; for example, if the matched decoding mode is a hard decoding mode of the graphics card produced by the manufacturer 2, the video stream is decoded by the graphics card produced by the manufacturer 2.
In order to save the matching time of the decoding mode and the decoding time, in some cases, the matching may be performed directly according to a preset rule without determining whether the decoding configuration information exists in the electronic device, for example, when the decoder is connected to the electronic device for the first time, the decoding may be performed directly according to the preset rule without determining whether the decoding configuration information exists in the electronic device.
Further, when the hard decoding mode is matched, the decoder needs to detect the display card configured in the electronic device in advance, and then decode the video stream by using the display card, because manufacturers of various display card types are different and corresponding detection means are also different, the decoder will detect whether the display card of the display card type is configured in the electronic device in sequence according to the decoding sequence of the display card types, and when the display card is available, the display card is used for decoding the video stream.
In order to improve the efficiency of detecting whether a certain graphics card is configured in the electronic device and improve the decoding efficiency of the video stream, the matching sequence of the graphics cards in the hard decoding mode may be a sequence that is set in order from high to low in the market share of the graphics card type. The display card type with high market share indicates that the electronic equipment provided with the display card of the display card type is large in number, namely the higher the market share is, the higher the possibility that the display card type is provided in the electronic equipment is, and the higher the possibility that the display card is detected is. For example, the video card produced by the manufacturer 1 has the largest market share, the video card produced by the manufacturer 2 is the next video card, the video card produced by the manufacturer 3 is the last video card, and the matching sequence of the types of the video cards is the video card produced by the manufacturer 1, the video card produced by the manufacturer 2, and the video card produced by the manufacturer 3 in sequence according to the decoding sequence. That is, when decoding is performed according to a preset rule, whether a display card produced by manufacturer 1 is configured in the electronic equipment is detected, if so, the detected display card is used for decoding the video stream, and if the display card produced by manufacturer 1 is not configured in the electronic equipment, whether a display card produced by manufacturer 2 is configured is detected; and when the display card produced by the manufacturer 2 is not configured in the electronic equipment, continuously judging whether the display card produced by the manufacturer 3 is configured.
For example, if the electronic device n is configured with the display card produced by the manufacturer 1 and the display card produced by the manufacturer 2 at the same time, the decoder detects whether the display card produced by the manufacturer 1 is configured in the electronic device n according to the decoding sequence, and detects that the display card produced by the manufacturer 1 is configured in the electronic device n, the decoder directly decodes by using the display card produced by the manufacturer 1, and does not detect whether the electronic device n further has the display card produced by the manufacturer 2 according to the preset decoding sequence.
Wherein, whether dispose the mode of the display card of corresponding producer production in the detection electronic equipment, specifically can include: detecting whether a file driven by the display card exists in the electronic equipment, wherein the drive file is used for driving the display card produced by the manufacturer to decode, and if the drive file exists, representing that the display card produced by the manufacturer exists in the electronic equipment; the method can also comprise the following steps: detecting by using a corresponding interface of the produced display card to determine whether the display card of the type exists, for example, the detection mode of the NVIDIA display card can be detected by an Ffmpeg interface; the method can also comprise the following steps: the method comprises the steps that the type of the display card exists in default electronic equipment, a decoding program for decoding by the type of the display card is started, the display card does not exist in the electronic equipment when the decoding program is applied and decoding fails, and the display card can be decoded when the decoding program corresponding to the display card is started, so that the display card exists in the electronic equipment.
Further, after the electronic device is configured with the video card, the electronic device is decoded by using the video card, but not all videos can be decoded by using the video card, and when the format of the video card is not matched with that of the video stream, the video card is difficult to successfully decode the video stream, for example, part of the video cards produced by the manufacturer 3 do not support decoding of the video stream in the H265 format, and when the video card produced by the manufacturer 3 is used to decode the video stream in the H265 format, a decoding result representing that decoding fails is generated; therefore, after the type of the display card existing in the electronic equipment is determined and the video stream is decoded by using the display card, a decoding result also needs to be obtained, if the decoding is successful, a decoding result representing the successful decoding is generated, namely the display card representing the electronic equipment can decode; if the video stream cannot be decoded, generating a decoding result representing decoding failure, judging whether the type of the display card is the last type of the display card, if so, representing that the current electronic equipment has no other available display card to decode the video stream, and directly decoding by using a soft decoding mode; if the type of the display card is not the last type of the display card, whether the electronic equipment is provided with the display cards of other display card types or not is continuously detected according to the decoding sequence, whether the display card can be successfully decoded or not is judged, if the display card of other display card types exists and can be successfully decoded, the display card is successfully decoded, and if the display card of other display card types does not exist or the display card of other types cannot be successfully decoded, the display card is decoded in a soft decoding mode.
For example, after the electronic device n is configured with the graphics card produced by the manufacturer 1 and the graphics card produced by the manufacturer 2, after the fact that the graphics card produced by the manufacturer 1 is configured in the electronic device n is detected, the graphics card produced by the manufacturer 1 is decoded, if the graphics card produced by the manufacturer 1 cannot decode the currently received video stream at this time, a decoding result representing decoding failure is generated, at this time, the decoder starts to detect the graphics card produced by the manufacturer 2 according to a decoding sequence, if the graphics card produced by the manufacturer 2 is detected, the graphics card produced by the manufacturer 2 is used for decoding, if the graphics card produced by the manufacturer 2 also fails to decode at this time, whether the graphics card produced by the manufacturer 3 exists is continuously detected, if the graphics card of the last graphics card type does not exist, the graphics card matched with the video stream does not exist in the electronic device n, that is, the video stream cannot be decoded by the graphics card, at this time, the decoding is performed by a soft decoding mode, and it is ensured that the electronic device can decode the video stream. If the decoding is successful after the display card produced by the manufacturer 2 is used for decoding, whether the display card produced by the manufacturer 3 exists or not is no longer detected, and the decoding of the video stream is completed at this moment.
Still further, when decoding is performed by using the corresponding graphics card, some graphics cards may support decoding of the encoding format of the current video stream due to the problem of processing performance, but due to the low processing performance, decoding takes a long time, that is, some graphics cards may decode the current video stream, but decoding performance is low, and when decoding is performed by using the graphics card, the decoding performance is lower than that of decoding by applying a CPU soft decoding manner. When the decoder detects that the corresponding display card is arranged in the electronic equipment and the corresponding display card is used for video decoding, the performance of the display card is detected, and when the decoding performance of the display card is lower than the preset performance standard, the decoding mode of decoding by using the display card is abandoned.
Further, when the decoding performance of the display card is lower than a preset performance standard, whether the matching is finished is judged, if yes, no other display card exists in the electronic equipment, and at the moment, the video stream is directly decoded by using a soft decoding mode; if not, sequentially detecting other display cards in the electronic equipment according to the decoding sequence, decoding by using the display card when other display cards exist, and detecting the decoding performance of the display card, if the decoding performance of the display card is lower than a preset performance standard, continuously executing the step of judging whether the display card is the last display card type until the display card is the last display card type, or detecting that the decoding performance of the display card is not lower than the preset performance standard.
For example, a display card 2 produced by a manufacturer 2 and a display card 3 produced by the manufacturer 3 are configured in an electronic device q, according to a decoding sequence, the display card 2 produced by the manufacturer 2 is detected to be configured in the electronic device q, the display card 2 is used for decoding, if the decoding performance of the display card 2 is lower than a preset performance standard at the moment, the display card 2 is abandoned to be decoded, the display card 2 is not the display card of the last display card type, whether the display card produced by the manufacturer 3 exists or not is continuously detected until the display card 3 produced by the manufacturer 3 is detected, the video stream is decoded by using the display card 3, when the video stream is decoded by using the display card 3, the compressed video stream before the display card 2 produced by the manufacturer 2 is not decoded is decoded, namely the compressed video stream is decoded again, if the decoding performance of the display card 3 is also lower than the preset performance standard, and the display card produced by the manufacturer 3 corresponds to the display card of the last display card type, and the decoding is directly performed by using a soft decoding mode; if the decoding performance of the display card 3 is not lower than the preset performance standard, the video stream is decoded by directly using the display card 3. The decoding is carried out in a mode of selecting the processing performance to be more excellent as much as possible, and the decoding mode with more excellent performance can be selected for decoding on the basis that all electronic equipment can realize decoding.
Specifically, the manner of determining whether the performance of the graphics card is lower than the preset performance standard may include: when the video card starts to decode the video stream, timing is started, and when the timing duration is greater than or equal to a preset timing threshold, the duration for representing that the video card decodes the video stream is too long, namely the performance of the representation video card is lower than a preset performance standard; when the video card decodes the video streams with different frame rates, the corresponding time lengths are different, and the higher the frame rate is, the longer the decoding time length is.
In another possible implementation manner, the determining whether the performance of the graphics card is lower than the preset performance standard may further include: when the video stream is decoded by using the video card, according to the format of the video stream, obtaining a historical video stream with the same format as the video stream, obtaining the historical processing duration of the historical video stream, calculating the ratio of the frame number of the historical video stream to the historical processing duration, and generating the processing efficiency corresponding to the video stream format. When the ratio is higher than a preset ratio threshold, the performance of the display card is higher than a preset performance standard, and when the ratio is lower than the preset ratio threshold, the performance of the display card is lower than the preset performance standard.
The embodiment of the application provides an automatic matching video decoding method, when a decoder detects that an electronic device receives a video stream, if the electronic device does not have decoding configuration information, that is, the electronic device does not currently have a set decoding mode, at this time, the video stream is decoded and matched one by one according to a decoding mode respectively corresponding to each display card in a hard decoding mode and a decoding sequence between soft decoding modes, so as to match out a mode of decoding the video stream, and each electronic device can realize the effect of decoding the same video stream according to the matching mode.
In the above embodiment, a specific decoding manner is described when the decoding configuration information does not exist in the decoder, and further, if the decoding configuration information exists, the video stream is decoded based on the decoding configuration information.
Specifically, when it is detected that the electronic device receives the video stream and the decoding configuration information exists, the video stream is decoded according to a decoding mode corresponding to the decoding configuration information. For example, if the user directly sets that the soft decoding method is used for decoding, the soft decoding method is directly used for decoding when the video stream is received.
Further, before the electronic device receives the video stream, decoding configuration information is preset, wherein a mode of the decoding configuration information is determined, and the mode includes any one of a mode one, a mode two, and a mode three, wherein:
the first method is as follows: receiving decoding configuration information input by a user, and determining the decoding configuration information input by the user as decoding configuration information.
Specifically, the decoding configuration information may be set by the user himself, and the user inputs the set decoding manner through the electronic device as the decoding configuration information.
The second method comprises the following steps: acquiring the corresponding relation between the historical video stream and the decoding mode, determining the corresponding relation between the video stream format and the decoding mode based on the corresponding relation, and determining the decoding configuration information based on the corresponding relation between the video stream format and the decoding mode.
The historical video stream is a video stream decoded by the electronic device before the current video stream is received.
In general, for different video streams having the same video stream format, the decoding manners capable of decoding the video streams are the same, for example, video streams having an H264 format, and video stream a can be decoded by using a video card produced by manufacturer 2 and can also be decoded by using a video card produced by manufacturer 1; the video stream B is also a video stream in H264 format, and the video stream B can be decoded by using a video card produced by manufacturer 2 or a video card produced by manufacturer 1. For video streams with different video stream formats, the decoding manner capable of decoding the video streams may be the same or different.
Therefore, all historical video streams are classified according to different video stream formats, and then the decoding mode corresponding to each video stream format is respectively determined based on all historical video streams with the same video stream format and the corresponding decoding modes. And taking the decoding mode corresponding to the historical video stream with the same format in all the historical video streams as the decoding mode corresponding to the video stream format. When all historical video streams of the video stream format adopt the same decoding mode, the video stream format corresponds to one decoding mode; when part of historical video streams in all the historical video streams in the video stream format adopt one decoding mode and the other decoding mode, the video stream format corresponds to the two decoding modes; that is, one video stream format may correspond to one decoding method, and may also correspond to a plurality of decoding methods.
And generating decoding configuration information corresponding to the video stream format based on the corresponding relation between the video stream format and the decoding mode, wherein each video stream format corresponds to one kind of decoding configuration information. For example: common video stream formats include H265 format and H264 format; the decoder has decoded a preset number of video streams, and the corresponding historical video stream includes a historical video stream a (decoding mode is the video card produced by manufacturer 2), a historical video stream B (decoding mode is the video card produced by manufacturer 2) and a historical video stream C (decoding mode is the video card produced by manufacturer 1) in H265 format; and, history video stream H (decoding mode is graphics card produced by manufacturer 3) and history video stream E (decoding mode is graphics card produced by manufacturer 3) in H264 format; then, the decoding mode corresponding to the H265 format includes two modes, i.e., a display card produced by the manufacturer 1 and a display card produced by the manufacturer 2, and then, as shown in table 1, the two decoding modes, i.e., the display card produced by the manufacturer 1 and the display card produced by the manufacturer 2, are set as decoding configuration information 1 corresponding to the H265 format, the decoding mode corresponding to the H264 format includes a display card produced by the manufacturer 3, and then, the display card produced by the manufacturer 3 is set as decoding configuration information 2 corresponding to the H264 format, as shown in table 1.
TABLE 1
Figure BDA0003792717150000141
After the decoding configuration information corresponding to each video stream format is determined, if the electronic device receives the video stream again, the decoder detects whether the decoding configuration information corresponding to the video stream format of the current video stream is configured or not according to the video stream format corresponding to the current video stream, and if so, the currently received video stream is decoded by using the decoding mode corresponding to the decoding configuration information. If not, the representation has no corresponding decoding configuration information, and the video stream is decoded according to a preset rule.
As described in the above example, the electronic device receives the video stream in the H265 format, the decoder detects that the decoding configuration information 1 in the H265 format is currently configured, and the decoding manners corresponding to the decoding configuration information 1 are two types, namely, the graphics card produced by the manufacturer 1 and the graphics card produced by the manufacturer 2, and at this time, any one of the decoding manners may be adopted to decode the video stream received by the electronic device.
Further, in the second method for determining correspondence of decoding configuration information, when any video stream format corresponds to at least two decoding methods (for example, the H265 format shown in table 1), any one of the decoding methods is selected to complete decoding operation on the video stream, and in order to obtain a better decoding speed when decoding the video stream so as to improve the experience of a user watching video, when any video stream format corresponds to a plurality of decoding methods, the decoding method with the fastest decoding speed and the highest decoding efficiency may be preferred to perform decoding, and therefore, the decoding configuration information corresponding to any video stream format is determined based on the correspondence relationship between any video stream format and the decoding method, including step Sb1 (not shown in the figure) and step Sb2 (not shown in the figure), wherein:
step Sb1: and acquiring the decoding efficiency corresponding to each decoding mode.
The decoding efficiency corresponding to any decoding mode is obtained by decoding the historical video stream based on any decoding mode.
Specifically, when the decoding efficiency corresponding to any one of the decoding methods is obtained, the decoder uses one of the historical video streams in any one of the video stream formats during decoding by using the any one of the decoding methods as a reference video stream corresponding to the any one of the decoding methods. Then, acquiring the complete decoding time length of the reference historical video stream, wherein the complete decoding time length represents the time length for decoding the reference historical video stream by using any one decoding mode; and then acquiring the frame number of the reference historical video stream, calculating the ratio of the frame number of the historical video stream to the complete decoding time by using the frame number, and generating the decoding efficiency, wherein the larger the ratio is, the higher the decoding efficiency is.
Taking the video stream in the H265 format corresponding to the electronic device shown in table 1 as an example, the decoding configuration information 2 corresponds to two decoding manners, and the historical video stream corresponding to the graphics card produced by the manufacturer 1 includes a historical video stream a and a historical video stream B; then, the reference historical video stream corresponding to the display card produced by the manufacturer 1 may be any one of the historical video stream a and the historical video stream B, for example, if the historical video stream a is used as the reference historical video stream, the frame number of the historical video stream a is 30 frames, and the corresponding complete decoding time is 20ms, then the decoding efficiency corresponding to the display card produced by the manufacturer 1 is 1.5 frames/ms; the historical video stream corresponding to the display card produced by the manufacturer 2 includes a historical video stream C, the historical video stream C is used as a reference historical video stream, and if the frame number of the historical video stream C is 60 frames and the complete decoding duration is 20ms, the decoding efficiency corresponding to the display card produced by the manufacturer 2 is 3 frames/ms.
Step Sb2: and determining decoding configuration information corresponding to any video stream format based on the decoding efficiency corresponding to each decoding mode.
In order to improve the efficiency of the electronic device in decoding the video stream, it is preferable that the decoding method with the highest decoding efficiency be used for decoding, and the decoding method with the highest decoding efficiency among the decoding methods may be determined as the decoding configuration information corresponding to any video stream format. For example, in the step Sb1, the decoding efficiency of the graphics card produced by the manufacturer 2 is 3 frames/ms, which is greater than the decoding efficiency (1.5 frames/ms) of the graphics card produced by the manufacturer 1, the graphics card produced by the manufacturer 2 is selected as the decoding mode corresponding to the H265 format, the decoding configuration information 2 is updated, and the decoding mode corresponding to the decoding configuration information 2 is updated from the graphics card produced by the manufacturer 1 and the graphics card produced by the manufacturer 2 to the graphics card produced by the manufacturer 2.
In another possible implementation manner, a decoding manner with a decoding efficiency higher than or equal to a preset efficiency reference in the decoding manners may be used as the decoding manner corresponding to any video stream format to generate decoding configuration information, and the decoding manner with the decoding efficiency lower than the preset efficiency reference may be deleted from the decoding configuration information. For example, in the two decoding modes corresponding to the H265 format in the step Sb1, the decoding efficiency corresponding to the graphics card produced by the manufacturer 2 is 3 frames/ms; the decoding efficiency corresponding to the display card produced by the manufacturer 1 is 1.5 frames/ms; if the preset efficiency standard is 2 frames/ms, the decoding mode corresponding to the H265 format is the display card produced by the manufacturer 2, and if the preset efficiency standard is 1 frame/ms, the decoding mode corresponding to the H265 format includes the display card produced by the manufacturer 2 and the display card produced by the manufacturer 1, and when the video stream in the H265 format is received again, any one of the display card produced by the manufacturer 2 and the display card produced by the manufacturer 1 can be adopted.
In the above, the first mode is to determine decoding configuration information according to a decoding mode set by a user, and the second mode is to determine one decoding configuration information according to different video stream formats, and perform decoding by using the decoding mode corresponding to the decoding configuration information; in another possible implementation manner, each electronic device may further correspond to one piece of decoding configuration information according to a difference between the electronic devices, and the video stream is decoded by using the decoding configuration information corresponding to the different electronic devices, where:
the third method comprises the following steps: and acquiring a decoding mode used by the electronic equipment corresponding to the decoder for decoding the historical video stream, and determining decoding configuration information corresponding to the electronic equipment based on the decoding mode used for decoding the historical video stream.
The electronic device corresponding to the decoder may be one or more. The decoder may be connected to a plurality of electronic devices for performing an operation of decoding the video stream received by each of the electronic devices.
For any electronic device, after the decoder is associated with the any electronic device for the first time, the decoder does not acquire whether the any electronic device has a graphics card, so that after the decoder is associated with the any electronic device for the first time, the type of the graphics card in the electronic device is generally matched to determine the graphics card in the electronic device, and then the graphics card corresponding to the type of the matched graphics card is applied to decode, or when the graphics card is not matched, a soft decoding mode is applied to decode.
After decoding the historical video streams with the preset number, the decoder is matched with whether the electronic equipment is provided with the display card or not and the type of the configured display card; and when the electronic device receives the video stream again, if the video card types are continuously matched in sequence according to the preset rule for decoding, the decoding efficiency is low. In order to improve the decoding efficiency, the decoder automatically sets the decoding configuration information of the electronic device according to the available decoding mode matched by the history, so that when the video stream is received again, the video stream can be directly decoded according to the available decoding mode matched by the history, and the decoding efficiency is improved.
For example, the decoder is connected to an electronic device C, and the electronic device C completes decoding of 5 historical video streams, and the corresponding decoding modes are: historical video stream C1-video card produced by manufacturer 2; historical video stream C2-display card produced by manufacturer 2; historical video stream C3-soft decoding mode; historical video stream C4-display card produced by manufacturer 2; historical video stream C5-a display card produced by a manufacturer 2, wherein the decoding mode corresponding to the electronic equipment C comprises the display card produced by the manufacturer 2 and a soft decoding mode, and decoding configuration information is automatically set; then, when the electronic device receives the video stream C5, the decoding mode corresponding to the detected decoding configuration information is the video card and the soft decoding mode produced by the manufacturer 2, and at this time, the video card or the soft decoding mode produced by the manufacturer 2 is used for decoding the video stream C5, and the decoding mode does not need to be sequentially matched according to the preset rule again, so that the decoding efficiency is improved.
In addition, each electronic device connected with the decoder corresponds to at least one decoding mode, and when the video stream is received, the electronic device directly decodes according to the corresponding decoding mode so as to improve the decoding efficiency.
Further, when determining the decoding configuration information corresponding to the electronic device, determining the decoding configuration information corresponding to the electronic device based on a decoding manner used for decoding the historical video stream, including any one of step Sc1 (not shown in the figure) and step Sc2 (not shown in the figure), wherein:
step Sc1: and determining the first decoding mode as decoding configuration information corresponding to the electronic equipment.
The first decoding mode is a decoding mode which is used most frequently for decoding the historical video stream.
Specifically, the decoding mode corresponding to the electronic device determined from all the historical video streams may be one or multiple. When the decoding method is applied to a plurality of decoding methods, the decoding method which is most frequently used is used as the first decoding method. For example, in the electronic device C shown in the above example, the frequency of decoding by the graphics card produced by the manufacturer 2 in the historical video stream is greater than the frequency of decoding by the soft decoding method, that is, the first decoding method corresponding to the electronic device C is a method of performing hard decoding by the graphics card produced by the manufacturer 2.
It should be noted that, if the electronic device only corresponds to one decoding method, the decoding method with the most frequency is the one that is used, that is, the first decoding method is the one that is used.
In addition, when the decoding is performed by adopting the hard decoding method, the decoding efficiency may be lower than that of the soft decoding method due to the influence of the performance of the video card, so in another possible implementation manner, the decoding method of the electronic device may be determined according to the decoding efficiency.
Step Sc2: if the decoding method used for decoding the historical video stream includes a hard decoding method, the decoding efficiency corresponding to the hard decoding method is determined, and the second decoding method is determined based on the decoding efficiency corresponding to the hard decoding method.
Specifically, if the decoding efficiencies corresponding to the hard decoding modes are all lower than the preset efficiency threshold, the second decoding mode is a soft decoding mode; and if the decoding efficiency corresponding to the hard decoding mode is not lower than the preset efficiency threshold, determining the second decoding mode from the hard decoding modes.
For example, for a 30-frame video stream, when the decoding duration is 30ms, the decoding efficiency is 1 frame/ms, and the higher the decoding efficiency is, that is, the more frames are decoded in each millisecond.
Further, if the decoding modes used for decoding the historical video stream include a hard decoding mode and a decoding mode not lower than the preset efficiency threshold exists, one decoding mode is selected as a second decoding mode from all the decoding modes not lower than the preset efficiency threshold, and when the electronic device receives the video stream again, the electronic device directly performs decoding through the second decoding mode. In order to further improve the decoding efficiency, the decoding mode with the highest decoding efficiency among all the decoding modes not lower than the preset efficiency threshold may be selected as the second decoding mode.
As described in the above example, the decoding mode used by the historical video stream of the electronic device C includes the video card produced by the manufacturer 2 and the soft decoding mode, the video card produced by the manufacturer 2 is the hard decoding mode, if the decoding efficiency corresponding to the video card produced by the manufacturer 2 is 2 frames/ms, the preset efficiency threshold is 2 frames/ms, it is characterized that the video card produced by the manufacturer 2 belongs to the decoding mode whose decoding efficiency is not lower than the preset efficiency threshold, and the video card produced by the manufacturer 2 is used as the second decoding mode.
In addition, if there is no hard decoding manner in the decoding manners used by all the historical video streams, it is characterized that when the video stream is decoded according to the preset rule, only the soft decoding manner can decode the video stream, and the soft decoding manner is directly used as the decoding manner corresponding to the electronic device, that is, as the second decoding manner.
For the above embodiment, the decoder may automatically set the decoding manner, so that when the subsequent electronic device receives the video stream, the decoding is directly performed according to the set decoding manner, and when the decoding manner is set, the decoder takes the decoding manner of the historical video stream as consideration, and selects the video card which can be decoded and has relatively good decoding performance as the set decoding manner.
However, if the set video card is physically damaged, the situation that the video stream is difficult to decode by the set decoding mode occurs; alternatively, when the decoding method is set manually, the set graphics card may not match the format of the received video stream, and therefore, when decoding is performed using the set decoding method, decoding may fail.
In order to decode the video stream when the decoding fails by applying the set decoding method, the method further includes a step Sd1 (not shown) and a step Sd2 (not shown) after decoding the video stream according to the decoding method indicated by the decoding configuration information, where:
step Sd1: and acquiring a decoding result of the electronic equipment for decoding based on the decoding configuration information.
Step Sd2: and if the decoding result indicates that the decoding fails, decoding the video stream according to a preset rule.
Specifically, when the decoding result represents that the decoding is successful, the decoding mode is represented to be feasible, and the video stream is successfully decoded. When the decoding result represents that the decoding fails, the representation cannot realize the decoding of the video stream through a preset decoding mode at the moment, so that the applicable hard decoding modes are sequentially matched again according to a preset rule, and when the hard decoding modes are not matched, the soft decoding mode is started for decoding, so that the electronic equipment can decode all the received video streams.
Further, after the decoding fails according to the decoding manner corresponding to the decoding configuration information, in order to improve the matching efficiency, in the embodiment of the present application, the decoding is performed on the video stream according to a preset rule, including steps Sd21 (not shown in the figure) and Sd22 (not shown in the figure), where:
step Sd21: and deleting the decoding mode corresponding to the decoding configuration information from the preset rule to form the deleted preset rule.
Step Sd22: and decoding the video stream according to the deleted preset rule.
Specifically, in order to improve matching efficiency, decoding modes which have failed to decode may be deleted from the preset rule to form a deleted preset rule, and when the video stream is decoded according to the deleted preset rule, whether corresponding display cards are configured in the electronic device is sequentially detected from the deleted display card types according to a decoding sequence, until it is detected that display cards of other display card types exist in the electronic device, or until all display card types in the deleted preset rule are completely matched.
For example, the electronic device n is configured with a display card produced by the manufacturer 1 and a display card produced by the manufacturer 2, the decoding mode corresponding to the decoding configuration information is the display card produced by the manufacturer 1, that is, the set decoding mode is the display card produced by the manufacturer 1, when the display card produced by the manufacturer 1 is decoded, the decoding result represents that the decoding fails, at this time, the display card produced by the manufacturer 1 is deleted from the preset rule, and the sequence of the remaining display card types is adaptively adjusted, the deleted preset rule includes a deleted hard decoding mode and a soft decoding mode, the deleted hard decoding mode includes the deleted display card type and a deleted decoding sequence, wherein the deleted display card type includes the display card produced by the manufacturer 2 and the display card produced by the manufacturer 3, and the deleted decoding sequence is the sequence of the display card produced by the manufacturer 2 first and the display card produced by the manufacturer 3 later; and subsequently, matching and decoding the video stream according to the sequence of firstly matching the video cards produced by the manufacturer 2 and then matching the video cards produced by the manufacturer 3.
In another possible implementation manner, after the decoding mode corresponding to the decoding configuration information is applied for decoding, if the decoding fails, the video stream may also be decoded without according to a preset rule, and the video stream received by the electronic device may be directly decoded by using a soft decoding mode.
Further, in the embodiment of the present application, decoding a video stream according to a preset rule may specifically include: step S1021 (not shown), step S1022 (not shown), and step S1023 (not shown), wherein step S1021: and determining a third decoding mode according to a preset rule, and decoding the video stream based on the third decoding mode.
The third decoding method is a first decoding method capable of decoding the video stream in the decoding order.
Specifically, whether the display card corresponding to the display card type is provided in the matched electronic device is detected in sequence according to a decoding sequence in a preset rule, and when the display card corresponding to the display card type is matched, the display card is used for decoding. However, the decoding performance of the matched video card may be poor, which results in that the decoding takes too long, and at this time, the decoding of the decoding mode may be suspended, and the other decoding modes may be switched to speed up the decoding of the video stream.
Therefore, after the video stream is received, the decoding modes are sequentially matched according to the preset rule, and when the corresponding display card exists in the electronic equipment is detected for the first time, the detected display card is used as a third decoding mode to decode the video stream. If after the video stream is received, after all the types of the display cards are detected in sequence according to the decoding sequence, the display cards in the electronic equipment are still not detected, and then a soft decoding mode is matched, wherein the soft decoding mode is a mode capable of decoding detected for the first time, and the third decoding mode is a soft decoding mode.
Step S1022: and when the decoding time length exceeds the first preset time length and the decoding is not finished, determining a next decoding mode based on a preset rule, and continuously decoding the video stream based on the next decoding mode.
The first preset time length is a corresponding standard decoding time length when the video stream with the first preset frame number is decoded.
Specifically, when the third decoding method is applied to decode the video stream, the decoding efficiency of the third decoding method is balanced, and when the decoding efficiency of the third decoding method is lower than the standard decoding efficiency, other decoding methods need to be switched to decode, so as to have the fastest decoding efficiency.
Therefore, after the third decoding mode starts decoding, measuring the time length used by the third decoding mode for decoding the video stream with the first preset frame number as the decoding time length; for example, if the first preset number of frames is 10 frames, and 10ms is used for recording the third decoding mode to decode the 10-frame video stream, the decoding time duration is 10ms.
The first preset time is preset and is used for judging whether the decoding efficiency of the third decoding mode meets the standard or not, and the first preset time is the corresponding standard decoding time when the video stream with the first preset frame number is decoded. For example, if the first preset frame number is 10 frames and the corresponding first preset duration is 5ms, the representation is to decode 10 frames of video stream, and the standard decoding duration is 5ms.
And when the decoding duration corresponding to the third decoding mode exceeds a first preset duration, the decoding efficiency of the current decoding mode is lower than the standard decoding efficiency, and if the decoding is not finished, namely the decoding of the currently received video stream is not finished, other decoding modes are switched to continue decoding so as to improve the decoding efficiency. If the decoding duration corresponding to the third decoding mode is less than or equal to the first preset duration, the decoding efficiency representing the current decoding mode is greater than or equal to the standard, and the decoding is continued in the third decoding mode, that is, the decoding is continued in the detected first decoding mode capable of decoding the video stream.
When the decoding duration exceeds the first preset duration and the decoding is not finished, other available decoding modes in the electronic equipment are continuously detected again according to the preset rule, the third decoding mode is used as the start, whether the video cards of other video card types exist or not is detected according to the decoding sequence and the matching sequence, the continuously detected next decoding mode is used as the next decoding mode, and the next decoding mode is used for continuously decoding. For example, if a 20-frame video stream is decoded using the third decoding scheme, the next decoding scheme will continue decoding from the twenty-first frame.
Step S1023: and when the decoding time length of the next decoding mode exceeds a second preset time length and the decoding is not finished, circularly executing to determine the next decoding mode based on a preset rule, and continuously decoding the video stream based on the next decoding mode until a preset condition is met.
Wherein the preset condition comprises at least one of the following conditions:
the video stream decoding is completed;
the decoding mode used by the current decoding is a soft decoding mode;
the decoding duration of the decoding mode used by the current decoding is not more than a second preset duration.
And the second preset time length is the corresponding standard decoding time length when the video stream with the second preset frame number is decoded.
Specifically, when the next decoding method is used for decoding, the decoding efficiency of the next decoding method also needs to be measured, so that the decoding time duration corresponding to the next decoding method is continuously measured, that is, the time duration of the next decoding method when decoding the video stream with the second preset frame number is continuously measured, for example, if the second preset frame number is 10 frames, the decoding time duration is the time duration used for decoding the 10 frames of video.
The second preset time is a standard decoding time corresponding to the decoding of the video stream with the second preset frame number. As explained in the above example, the second preset frame number is 10 frames, 10 frames of video are decoded, and the corresponding standard decoding time length is 5ms, then the second preset time length is 5ms.
If the decoding duration of the next decoding mode is not higher than the second preset duration, the decoding efficiency of the next decoding mode is higher than or equal to the standard decoding efficiency, and at this time, the next decoding mode is continuously utilized to decode the video stream. Continuing to explain with the example in step S1022, if the remaining 35 frames of video streams are not decoded, the next decoding mode is the video card produced by the manufacturer 2, the preset frame number is 10 frames, the second preset time duration is 10ms, and when the video card produced by the manufacturer 2 decodes the 10 frames of video streams, the decoding time duration is 5ms, the decoding efficiency of the video card produced by the manufacturer 2 is not lower than the standard, and the decoding of the remaining 25 frames of video streams will be completed by the video card produced by the manufacturer 2.
And if the decoding time of the next decoding mode exceeds the second preset time, the decoding efficiency which represents the next decoding mode is also lower than the standard decoding efficiency, at this time, if the decoding is not finished, the next decoding mode is continuously determined according to the preset rule, whether the decoding time of the next decoding mode exceeds the second preset time is continuously judged, and the cyclic execution is carried out until the decoding mode with the decoding time lower than the second preset time is found, the decoding mode with the decoding time lower than the second preset time is utilized for decoding, or the decoding of the video stream is finished, or the next decoding mode is the last decoding mode, namely when the next decoding mode is the soft decoding mode, the decoding ending cycle of the video stream is completed by utilizing the soft decoding mode.
As described in the above example, if the decoding time for decoding 10 frames of video streams of the display card produced by the manufacturer 2 is 15ms, the decoding time for decoding the display card produced by the manufacturer 2 exceeds a second preset time, if the video streams of 20 frames are decoded by using the third decoding mode and the next decoding mode (the display card produced by the manufacturer 2) at this time and the remaining 15 frames of video streams are not decoded, the next decoding mode is determined according to a preset rule at this time, that is, whether corresponding display cards are configured in the electronic device is sequentially detected from the display card produced by the manufacturer 3, and if the corresponding display cards are detected when the display cards produced by the manufacturer 3 are detected, the remaining 15 frames of video streams are decoded by using the display cards produced by the manufacturer 3.
If the decoding time length of the display card produced by the manufacturer 3 is not higher than the second preset time length, the display card produced by the manufacturer 3 is used for completing the decoding of the remaining 15 frames of video streams.
If the decoding time length of the graphics card produced by the manufacturer 3 is longer than the second preset time length, 10 frames of video streams are decoded, and 5 frames of video streams remain, and if the graphics card produced by the manufacturer 3 is the graphics card of the last graphics card type at this time, the remaining 5 frames of video streams are decoded by using a soft decoding mode, and the decoding is finished.
If the display card produced by the manufacturer 3 is not the display card of the last display card type, it will be continuously detected whether the display card of the next display card type is configured, if so, the display card of the next display card type will be used to decode the remaining 5 frames of video stream, if the next display card type has completed decoding of the remaining 5 frames of video stream before judging whether the decoding duration corresponding to the next display card type exceeds the second preset duration, the step of continuously searching for the next display card type will be also ended at this time, and decoding is completed.
Based on the above embodiments, the embodiments of the present application provide an example to explain a process of automatically matching video decoding, with reference to fig. 2, fig. 2 is a flowchart of automatically matching video decoding, and the types of the display cards in the preset rule are, according to a decoding sequence, a display card produced by manufacturer 1, a display card produced by manufacturer 2, and a display card produced by manufacturer 3, respectively in sequence; when the electronic equipment receives a video stream for the first time, the decoder does not know whether a display card exists in the current electronic equipment, at the moment, the decoder sequentially detects whether the display card exists in the electronic equipment according to a decoding sequence, namely, whether the display card produced by a manufacturer 1 exists or not is detected, if the display card exists, the display card produced by the manufacturer 1 is decoded, if the decoding fails, whether the display card produced by a manufacturer 2 exists or not is continuously detected, or if no display card produced by the manufacturer 1 exists, the display card produced by the manufacturer 2 is continuously detected; similarly, when the display card produced by the manufacturer 2 or the display card produced by the application manufacturer 2 fails to be decoded, whether the display card produced by the manufacturer 3 exists or not is continuously judged, and if the display card produced by the manufacturer 3 or the display card produced by the application manufacturer 3 fails to be decoded, a soft decoding mode is applied for decoding; when the electronic equipment receives a preset number of video streams, the representation decoder realizes decoding of partial types of video streams, according to the condition of historical video streams, the decoder determines at least one decoding mode corresponding to each format of video stream, then, decoding configuration information is set according to the corresponding relation between the video stream formats and the decoding modes, the decoding configuration information comprises the decoding modes corresponding to the video stream formats, when a plurality of decoding modes are provided, the decoding mode with the highest decoding speed is preferentially selected, the decoding mode with the highest decoding speed is updated to the unique decoding mode corresponding to the video stream format in the decoding configuration information, and when the video streams are received again, the decoding mode corresponding to the decoding configuration information is determined to be decoded according to the video stream formats of the video streams; on the basis of decoding all electronic equipment, a hard decoding mode can be adopted for decoding as much as possible, the quality effect of the decoded video stream is improved, and further the user experience can be enhanced.
The above embodiments introduce a method for automatic matching video decoding from the perspective of method flow, and the following embodiments introduce an apparatus for automatic matching video decoding from the perspective of virtual modules or virtual units, which are described in detail in the following embodiments.
Referring to fig. 3, an automatic matching video decoding apparatus 300 includes:
a configuration detection module 301, configured to detect whether decoding configuration information exists when it is detected that the electronic device receives a video stream, where the decoding configuration information is used to represent a set decoding manner;
a first decoding module 302, configured to decode the video stream according to a preset rule when the decoding configuration information does not exist;
the preset rule comprises a hard decoding mode, a soft decoding mode, a matching sequence of the hard decoding mode and the soft decoding mode; the hard decoding method includes: at least two types of the display cards utilized by the hard decoding and the decoding sequence corresponding to the at least two types of the display cards.
Specifically, when the configuration detection module 301 detects that the electronic device receives a video stream, when the electronic device does not have decoding configuration information, that is, when the electronic device does not have a set decoding mode currently, the first decoding module 302 performs decoding matching on the video stream one by one according to a decoding mode corresponding to each graphics card in the hard decoding mode and a decoding sequence between the soft decoding modes to match out a mode for decoding the video stream, so that each electronic device can achieve an effect of decoding the same video stream according to the matching mode.
In a possible implementation manner of the embodiment of the present application, the apparatus 300 further includes:
and the second decoding module is used for decoding the video stream based on the decoding configuration information when the decoding configuration information exists.
In a possible implementation manner of this embodiment of this application, the apparatus 300 further includes a configuration determining module, where the configuration determining module is configured to determine a manner of decoding the configuration information, where the configuration determining module includes any one of a first determining unit, a second determining unit, and a third determining unit, where:
the first determining unit is used for receiving decoding configuration information input by a user and determining the decoding configuration information input by the user as decoding configuration information;
the second determining unit is used for acquiring the corresponding relation between the historical video stream and the decoding mode, determining the corresponding relation between the video stream format and the decoding mode based on the corresponding relation, and determining the decoding configuration information based on the corresponding relation between the video stream format and the decoding mode;
the third determining unit is used for acquiring a decoding mode used by the electronic device corresponding to the decoder for decoding the historical video stream, and determining the decoding configuration information corresponding to the electronic device based on the decoding mode used for decoding the historical video stream.
In a possible implementation manner of the embodiment of the present application, when any video stream format corresponds to at least two decoding manners, the second determining unit is specifically configured to, when determining, based on a correspondence between any video stream format and a decoding manner, decoding configuration information corresponding to any video stream format:
acquiring decoding efficiencies corresponding to various decoding modes respectively, wherein the decoding efficiency corresponding to any decoding mode is obtained by decoding the historical video stream based on any decoding mode;
and determining decoding configuration information corresponding to any video stream format based on the decoding efficiency respectively corresponding to each decoding mode.
In a possible implementation manner of the embodiment of the present application, the third determining unit includes a frequency determining subunit or an efficiency determining subunit, where:
the frequency determining subunit is configured to determine a first decoding mode as decoding configuration information corresponding to the electronic device, where the first decoding mode is a decoding mode with a highest frequency utilized for decoding the historical video stream;
the efficiency determining subunit is configured to determine, when a decoding manner used for decoding the historical video stream includes a hard decoding manner, a decoding efficiency corresponding to the hard decoding manner, determine, based on the decoding efficiency corresponding to the hard decoding manner, a second decoding manner, and determine the second decoding manner as decoding configuration information corresponding to the electronic device;
when the decoding efficiency corresponding to the hard decoding mode is lower than a preset efficiency threshold, the second decoding mode is a soft decoding mode; and when the decoding efficiency corresponding to the hard decoding mode is not lower than the preset efficiency threshold, the second decoding mode is determined from the hard decoding mode.
In a possible implementation manner of the embodiment of the present application, the apparatus 300 further includes:
the result acquisition module is used for acquiring a decoding result of the electronic equipment for decoding based on the decoding configuration information;
and the third decoding module is used for decoding the video stream according to a preset rule when the decoding result represents that the decoding fails.
In a possible implementation manner of the embodiment of the present application, when the third decoding module decodes the video stream according to the preset rule, the third decoding module is specifically configured to:
deleting the decoding mode corresponding to the decoding configuration information from the preset rule to form a deleted preset rule;
and decoding the video stream according to the deleted preset rule.
In a possible implementation manner of the embodiment of the present application, when the first decoding module 302 decodes a video stream according to a preset rule, the first decoding module is specifically configured to:
determining a third decoding mode according to a preset rule, and decoding the video stream based on the third decoding mode, wherein the third decoding mode is a first decoding mode capable of decoding the video stream according to a decoding sequence;
when the decoding time length exceeds a first preset time length and the decoding is not finished, determining a next decoding mode based on a preset rule, and continuously decoding the video stream based on the next decoding mode, wherein the first preset time length is a standard decoding time length corresponding to the video stream with a first preset frame number;
when the decoding time length of the next decoding mode exceeds a second preset time length and the decoding is not finished, determining the next decoding mode based on a preset rule in a circulating mode, and continuously decoding the video stream based on the next decoding mode until a preset condition is met, wherein the second preset time length is a standard decoding time length corresponding to the decoding of the video stream with a second preset frame number;
wherein the preset condition comprises at least one of the following conditions:
the video stream decoding is completed;
the decoding mode used by the current decoding is a soft decoding mode;
the decoding duration of the decoding mode used by the current decoding is not more than a second preset duration.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The embodiment of the present application also introduces a decoder from the perspective of a physical device, as shown in fig. 4, the decoder 400 shown in fig. 4 includes: a processor 401 and a memory 403. Wherein the processor 401 is coupled to the memory 403, such as via a bus 402. Optionally, the decoder 400 may further include a transceiver 404. It should be noted that, in practical applications, the transceiver 404 is not limited to one, and the structure of the decoder 400 does not constitute a limitation to the embodiment of the present application.
The Processor 401 may be a CPU (Central Processing Unit), a general purpose Processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other Programmable logic device, a transistor logic device, a hardware component, or any combination thereof. Which may implement or execute the various illustrative logical blocks, modules, and circuits described in connection with the disclosure herein. The processor 401 may also be a combination of computing functions, e.g., comprising one or more microprocessors in combination, a DSP and a microprocessor in combination, or the like.
Bus 402 may include a path that transfers information between the above components. The bus 402 may be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus 402 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 4, but that does not indicate only one bus or one type of bus.
The Memory 403 may be a ROM (Read Only Memory) or other type of static storage device that can store static information and instructions, a RAM (Random Access Memory) or other type of dynamic storage device that can store information and instructions, an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical Disc storage, optical Disc storage (including Compact Disc, laser Disc, optical Disc, digital versatile Disc, blu-ray Disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to these.
The memory 403 is used for storing application program codes for executing the scheme of the application, and the execution is controlled by the processor 401. Processor 401 is configured to execute application program code stored in memory 403 to implement the aspects illustrated in the foregoing method embodiments.
The present application provides a computer-readable storage medium, on which a computer program is stored, which, when running on a computer, enables the computer to execute the corresponding content in the foregoing method embodiments. In this embodiment of the present application, when the decoder detects that the electronic device receives a video stream, if the electronic device does not have decoding configuration information, that is, it is characterized that the electronic device does not currently have a set decoding manner, at this time, the video streams are decoded and matched one by one according to the decoding order between the decoding manner and the soft decoding manner respectively corresponding to each graphics card in the hard decoding manner, so as to match out the manner in which the video streams are decoded, and thus each electronic device can achieve the effect of decoding the same video stream according to the matching manner.
It will be clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be performed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to perform all or part of the above described functions. For the specific working processes of the system, the apparatus and the unit described above, reference may be made to the corresponding processes in the foregoing method embodiments, and details are not described here again.
In the embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one position, or may be distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit may be implemented in the form of hardware, or may also be implemented in the form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: u disk, removable hard disk, read only memory, random access memory, magnetic disk or optical disk, etc. for storing program codes.
The above embodiments are only used to describe the technical solutions of the present application in detail, but the above embodiments are only used to help understanding the method and the core idea of the present application, and should not be construed as limiting the present application. Those skilled in the art should also appreciate that various modifications and substitutions can be made without departing from the scope of the present disclosure.

Claims (11)

1. An auto-match video decoding method, performed by a decoder, comprising:
when detecting that the electronic equipment receives the video stream, detecting whether decoding configuration information exists or not, wherein the decoding configuration information is used for representing a set decoding mode;
if the decoding configuration information does not exist, decoding the video stream according to a preset rule;
the preset rule comprises a hard decoding mode, a soft decoding mode and a matching sequence of the hard decoding mode and the soft decoding mode;
the hard decoding mode comprises the following steps: at least two types of the display cards utilized by hard decoding and decoding sequences corresponding to the at least two types of the display cards.
2. The method of claim 1, further comprising:
and if the decoding configuration information exists, decoding the video stream based on the decoding configuration information.
3. The method of claim 2, wherein determining the decoding configuration information comprises any one of:
receiving decoding configuration information input by a user, and determining the decoding configuration information input by the user as the decoding configuration information;
acquiring the corresponding relation between a historical video stream and a decoding mode, determining the corresponding relation between a video stream format and the decoding mode based on the corresponding relation, and determining the decoding configuration information based on the corresponding relation between the video stream format and the decoding mode;
and acquiring a decoding mode used by the electronic equipment corresponding to the decoder for decoding the historical video stream, and determining decoding configuration information corresponding to the electronic equipment based on the decoding mode used for decoding the historical video stream.
4. The method of claim 3, wherein if any video stream format corresponds to at least two decoding modes,
determining decoding configuration information corresponding to any video stream format based on the corresponding relationship between any video stream format and the decoding mode, including:
acquiring decoding efficiencies corresponding to various decoding modes respectively, wherein the decoding efficiency corresponding to any decoding mode is obtained by decoding the historical video stream based on any decoding mode;
and determining decoding configuration information corresponding to any video stream format based on the decoding efficiency respectively corresponding to the various decoding modes.
5. The method according to claim 3 or 4, wherein the determining the decoding configuration information corresponding to the electronic device based on the decoding manner used for decoding the historical video stream includes any one of:
determining a first decoding mode as decoding configuration information corresponding to the electronic device, wherein the first decoding mode is a decoding mode with the most frequency used for decoding the historical video stream;
if the decoding mode used for decoding the historical video stream comprises a hard decoding mode, determining the decoding efficiency corresponding to the hard decoding mode, determining a second decoding mode based on the decoding efficiency corresponding to the hard decoding mode, and determining the second decoding mode as the decoding configuration information corresponding to the electronic equipment;
if the decoding efficiency corresponding to the hard decoding mode is lower than a preset efficiency threshold value, the second decoding mode is a soft decoding mode; and if the decoding efficiency corresponding to the hard decoding mode is not lower than the preset efficiency threshold, determining the second decoding mode from the hard decoding modes.
6. The method of claim 2, wherein the decoding the video stream based on the decoding configuration information further comprises:
acquiring a decoding result of the electronic equipment for decoding based on the decoding configuration information;
and if the decoding result represents that the decoding fails, decoding the video stream according to the preset rule.
7. The method according to claim 6, wherein said decoding the video stream according to the preset rule comprises:
deleting the decoding mode corresponding to the decoding configuration information from the preset rule to form a deleted preset rule;
and decoding the video stream according to the deleted preset rule.
8. The method according to claim 1, wherein said decoding the video stream according to the preset rule comprises:
determining a third decoding mode according to a preset rule, and decoding the video stream based on the third decoding mode, wherein the third decoding mode is a first decoding mode capable of decoding the video stream according to a decoding sequence;
when the decoding duration exceeds a first preset duration and the decoding is not finished, determining a next decoding mode based on the preset rule, and continuously decoding the video stream based on the next decoding mode, wherein the first preset duration is a standard decoding duration corresponding to the decoding of the video stream with a first preset frame number;
when the decoding time length of the next decoding mode exceeds a second preset time length and the decoding is not finished, determining the next decoding mode based on the preset rule in a circulating mode, and continuously decoding the video stream based on the next decoding mode until a preset condition is met, wherein the second preset time length is a standard decoding time length corresponding to the decoding of the video stream with a second preset frame number;
wherein the preset condition comprises at least one of the following:
the video stream decoding is complete;
the decoding mode used by the current decoding is a soft decoding mode;
the decoding duration of the decoding mode used by the current decoding is not more than a second preset duration.
9. An apparatus for auto-match video decoding, comprising:
the device comprises a configuration detection module, a decoding module and a decoding module, wherein the configuration detection module is used for detecting whether decoding configuration information exists when detecting that the electronic equipment receives a video stream, and the decoding configuration information is used for representing a set decoding mode;
the first decoding module is used for decoding the video stream according to a preset rule when the decoding configuration information does not exist;
the preset rule comprises a hard decoding mode, a soft decoding mode and a matching sequence of the hard decoding mode and the soft decoding mode;
the hard decoding mode comprises the following steps: at least two types of display cards utilized by hard decoding and a decoding sequence corresponding to the at least two types of display cards.
10. A decoder, characterized in that the decoder comprises:
at least one processor;
a memory;
at least one application, wherein the at least one application is stored in the memory and configured to be executed by the at least one processor, the at least one application configured to: performing the auto-matching video decoding method of any one of claims 1 to 8.
11. A computer-readable storage medium on which a computer program is stored, which, when executed in a computer, causes the computer to perform the auto-matching video decoding method of any one of claims 1 to 8.
CN202210960189.3A 2022-08-11 2022-08-11 Automatic matching video decoding method, device, decoder and storage medium Pending CN115334352A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210960189.3A CN115334352A (en) 2022-08-11 2022-08-11 Automatic matching video decoding method, device, decoder and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210960189.3A CN115334352A (en) 2022-08-11 2022-08-11 Automatic matching video decoding method, device, decoder and storage medium

Publications (1)

Publication Number Publication Date
CN115334352A true CN115334352A (en) 2022-11-11

Family

ID=83922364

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210960189.3A Pending CN115334352A (en) 2022-08-11 2022-08-11 Automatic matching video decoding method, device, decoder and storage medium

Country Status (1)

Country Link
CN (1) CN115334352A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102761736A (en) * 2011-04-29 2012-10-31 腾讯科技(深圳)有限公司 Video decoding method and device
CN104980788A (en) * 2015-02-11 2015-10-14 腾讯科技(深圳)有限公司 Video decoding method and device
CN107172432A (en) * 2017-03-23 2017-09-15 杰发科技(合肥)有限公司 A kind of method for processing video frequency, device and terminal
CN108632667A (en) * 2017-03-21 2018-10-09 腾讯科技(深圳)有限公司 A kind of coding/decoding method and terminal of multimedia file
CN110572622A (en) * 2019-09-30 2019-12-13 威创集团股份有限公司 Video decoding method and device
CN113856204A (en) * 2021-09-28 2021-12-31 北京奇艺世纪科技有限公司 Cloud game data decoding method and device, electronic equipment and storage medium
CN114339257A (en) * 2022-01-26 2022-04-12 稿定(厦门)科技有限公司 Method and apparatus for decoding video file

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102761736A (en) * 2011-04-29 2012-10-31 腾讯科技(深圳)有限公司 Video decoding method and device
CN104980788A (en) * 2015-02-11 2015-10-14 腾讯科技(深圳)有限公司 Video decoding method and device
CN108632667A (en) * 2017-03-21 2018-10-09 腾讯科技(深圳)有限公司 A kind of coding/decoding method and terminal of multimedia file
CN107172432A (en) * 2017-03-23 2017-09-15 杰发科技(合肥)有限公司 A kind of method for processing video frequency, device and terminal
CN110572622A (en) * 2019-09-30 2019-12-13 威创集团股份有限公司 Video decoding method and device
CN113856204A (en) * 2021-09-28 2021-12-31 北京奇艺世纪科技有限公司 Cloud game data decoding method and device, electronic equipment and storage medium
CN114339257A (en) * 2022-01-26 2022-04-12 稿定(厦门)科技有限公司 Method and apparatus for decoding video file

Similar Documents

Publication Publication Date Title
US20170163992A1 (en) Video compressing and playing method and device
US20120183040A1 (en) Dynamic Video Switching
CN112087633A (en) Video decoding method, device and storage medium
CN104837052A (en) Playing method of multimedia data and device
US11128879B2 (en) Hybrid decoding
CN111836076B (en) Video resolution switching method and device and electronic equipment
CN110740313A (en) Hardware coding capability detection method and device
CN111669577A (en) Hardware decoding detection method and device, electronic equipment and storage medium
CN105208406A (en) Video data providing method and apparatus, video playing method and apparatuses, and video playing system
CN112532998B (en) Method, device and equipment for extracting video frame and readable storage medium
CN107613302B (en) Decoding method and device, storage medium and processor
CN114422799B (en) Decoding method and device for video file, electronic equipment and program product
CN105681893A (en) Method and device for decoding stream media video data
CN115334352A (en) Automatic matching video decoding method, device, decoder and storage medium
CN112672154A (en) Live video playing method and device, server and computer readable storage medium
CN115941972A (en) Image transmission method, device, equipment and storage medium
US20120183234A1 (en) Methods for parallelizing fixed-length bitstream codecs
CN114578962A (en) Data storage, data display method, device, equipment, medium and program product
CN114143595A (en) Video wallpaper playing method and device, electronic equipment and readable storage medium
US20100076944A1 (en) Multiprocessor systems for processing multimedia data and methods thereof
CN113301290A (en) Video data processing method and video conference terminal
CN113157226A (en) Remote data display method, device, equipment and machine-readable storage medium
JP2004354677A (en) Information processing device, method therefor, program therefor, recording medium recorded with he program, and reproducing device
CN115955597B (en) Multi-format video self-adaptive switching method, system and storage medium
CN112135142B (en) Picture decoding method and related product

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