CN114257878A - Method for playing video at double speed, computer device and storage medium - Google Patents
Method for playing video at double speed, computer device and storage medium Download PDFInfo
- Publication number
- CN114257878A CN114257878A CN202010997137.4A CN202010997137A CN114257878A CN 114257878 A CN114257878 A CN 114257878A CN 202010997137 A CN202010997137 A CN 202010997137A CN 114257878 A CN114257878 A CN 114257878A
- Authority
- CN
- China
- Prior art keywords
- playing
- video
- decoding rate
- mode
- target
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 35
- 230000006835 compression Effects 0.000 claims abstract description 29
- 238000007906 compression Methods 0.000 claims abstract description 29
- 102100037812 Medium-wave-sensitive opsin 1 Human genes 0.000 claims description 13
- 230000006870 function Effects 0.000 description 11
- 238000010586 diagram Methods 0.000 description 4
- 238000004364 calculation method Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 102100027731 Endogenous retrovirus group K member 16 Rec protein Human genes 0.000 description 1
- 101000580913 Homo sapiens Endogenous retrovirus group K member 16 Rec protein Proteins 0.000 description 1
- 230000002457 bidirectional effect Effects 0.000 description 1
- 230000000295 complement effect Effects 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000007599 discharging Methods 0.000 description 1
- 230000010365 information processing Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/80—Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
- H04N21/83—Generation or processing of protective or descriptive data associated with content; Content structuring
- H04N21/845—Structuring of content, e.g. decomposing content into time segments
- H04N21/8456—Structuring of content, e.g. decomposing content into time segments by decomposing the content in the time domain, e.g. in time segments
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/234—Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
- H04N21/2343—Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
- H04N21/234381—Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements by altering the temporal resolution, e.g. decreasing the frame rate by frame skipping
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/238—Interfacing the downstream path of the transmission network, e.g. adapting the transmission rate of a video stream to network bandwidth; Processing of multiplex streams
- H04N21/2387—Stream processing in response to a playback request from an end-user, e.g. for trick-play
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
- H04N21/439—Processing of audio elementary streams
- H04N21/4394—Processing of audio elementary streams involving operations for analysing the audio stream, e.g. detecting features or characteristics in audio streams
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Television Signal Processing For Recording (AREA)
Abstract
The invention provides a method for playing video at double speed, which comprises the steps of determining the video playing double speed N and obtaining the compression ratio of a video file; determining a target playing mode for playing the video file and a target decoding rate Vt of a decoder according to the video playing speed N and the compression ratio of the video file; controlling the decoder to decode the video file based on the target playback mode and a target decoding rate Vt; and outputting the decoded video frame according to the target play mode. The invention also provides a computer device and a storage medium for realizing the method for playing the video at double speed. The invention can realize video quick-playing.
Description
Technical Field
The invention relates to the technical field of video playing, in particular to a method for playing videos at double speed, a computer device and a storage medium.
Background
In the field of video playing technology, multiple playing technology for Fast forwarding (Fast Forward) and Fast rewinding (Rewind) of video is generally involved. The inventor finds in the course of implementing the present invention that in some fast forward algorithms, the actual playing speed is affected by the media compression format, and it is likely that the same fast forward method will produce different playing effects for different compression formats.
Disclosure of Invention
In view of the foregoing, there is a need for a method, a computer device and a storage medium for playing a video at a double speed, which can fulfill a double-speed playing request of a user based on a compression ratio of a video file.
The method for playing the video at double speed comprises the following steps: determining the video playing speed N and obtaining the compression ratio of a video file; determining a target playing mode for playing the video file and a target decoding rate Vt of a decoder according to the video playing speed N and the compression ratio of the video file; controlling the decoder to decode the video file based on the target playback mode and a target decoding rate Vt; and outputting the decoded video frame according to the target play mode.
Preferably, the compression ratio of the video file is I: P: B, wherein I represents the total number of I frames included in each group of video frame GOP of the video file, P represents the total number of P frames included in each group of video frame GOP of the video file, and B represents the total number of B frames included in each group of video frame GOP of the video file.
Preferably, the target play mode is one of preset four play modes, where the four play modes include: the video playing method comprises a first playing mode, a second playing mode, a third playing mode and a fourth playing mode, wherein the first playing mode is to play I frames, P frames and B frames of each group video frame GOP; the second playing mode is that I frames and P frames of each group video frame GOP are played; the third playing mode is that I frames of each group video frame GOP are played; the fourth play mode is to play an I frame of a GOP in every M GOPs of the group video frames.
Preferably, the method further comprises: presetting the decoding rate of the decoder in the first play mode to be in a first decoding rate range; presetting the decoding rate of the decoder in the second play mode to be in a second decoding rate range; and presetting the decoding rate of the decoder in the third play mode and the fourth play mode to be within a third decoding rate range.
Preferably, the determining the target playing mode for playing the video file and the target decoding rate Vt of the decoder according to the video playing double speed N and the compression ratio of the video file includes: calculating a decoding rate V1 of the decoder in the first play mode based on the video playback speed N and a compression ratio of a video file and a normal decoding rate V0 of the decoder, wherein V1 ═ N × V0 ((I + P + B)/(I + P + B)); determining whether V1 is within the first decoding rate range, determining the target playback mode as the first playback mode when V1 is within the first decoding rate range, and determining that the target decoding rate Vt is equal to V1; calculating a decoding rate V2 of the decoder in the second play mode when V1 is not within the first decoding rate range, wherein V2 ═ ((I + P)/(I + P + B)) × N × V0; determining whether V2 is within the second decoding rate range, determining the target playback mode as the second playback mode when V2 is within the second decoding rate range, and determining that the target decoding rate Vt is equal to V2; when V2 is not within the second decoding rate range, calculating a decoding rate V3 of the decoder in the third playback mode, wherein V3 is (I/(I + P + B)) × N × V0; determining whether V3 is within the third decoding rate range, determining the target playback mode as the third playback mode when V3 is within the third decoding rate range, and determining that the target decoding rate Vt is equal to V3; and when V3 is not within the third decoding rate range, determining the target playback mode as the fourth playback mode, and calculating a value of M, where M ═ ((I/(I + P + B)) × N × V0)/Vmax, where Vmax represents a maximum decoding rate corresponding to the fourth decoding rate range, and M is rounded up in decimal places; and calculating a decoding rate V4 of the decoder in the fourth play mode, wherein V4 ═ ((I/(I + P + B)) × N × V0)/M, and V4 is taken as a target decoding rate Vt of the decoder.
The computer device comprises a memory for storing at least one instruction and a processor for implementing the method for playing video at double speed when executing the at least one instruction.
The computer-readable storage medium stores at least one instruction that, when executed by a processor, implements the method of playing video at a double speed.
Compared with the prior art, the method for playing the video at double speed, the computer device and the storage medium provided by the invention can achieve the double-speed playing request of the user based on the compression ratio of the video file.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a flow chart of a method for playing video at double speed according to a preferred embodiment of the present invention
Fig. 2 is a flowchart of step S2 in fig. 1 according to a preferred embodiment of the present invention.
Fig. 3 is a functional block diagram of a system for playing video at double speed according to a preferred embodiment of the present invention.
FIG. 4 is a block diagram of a computer device according to a preferred embodiment of the present invention.
Description of the main elements
Computer device | 3 |
System for playing video at |
311 |
Video files | 312 |
Acquisition module | 301 |
|
302 |
Memory device | 31 |
Processor with a memory having a plurality of memory cells | 32 |
Decoder | 33 |
The following detailed description will further illustrate the invention in conjunction with the above-described figures.
Detailed Description
In order that the above objects, features and advantages of the present invention can be more clearly understood, a detailed description of the present invention will be given below with reference to the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present invention and features of the embodiments may be combined with each other without conflict.
In the following description, numerous specific details are set forth to provide a thorough understanding of the present invention, and the described embodiments are merely a subset of the embodiments of the present invention, rather than a complete embodiment. 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 invention.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention.
Fig. 1 is a flowchart of a method for playing a video at a double speed according to a preferred embodiment of the present invention.
In this embodiment, the method for playing video at double speed may be applied to a computer device, and for a computer device that needs to play video at double speed, the function provided by the method for playing video at double speed may be directly integrated on the computer device, or may be run on the computer device in the form of Software Development Kit (SDK).
As shown in fig. 1, the method for playing a video at double speed specifically includes the following steps, and the order of the steps in the flowchart may be changed and some steps may be omitted according to different requirements.
And step S1, determining the video playing speed N and obtaining the compression ratio of the video file.
Specifically, when a request signal for a user to request a fast play of a video file is received, the value of the video play double speed N may be determined. The request signal carries the video playback speed N. The request signal requesting fast play of the video file may be a signal requesting fast forward or a signal requesting fast rewind.
In one embodiment, the compression ratio of the video file is I: P: B, wherein I represents the total number of I frames (i.e. intra Pictures) included in each Group of video frames (GOP) of the video file, P represents the total number of P frames (i.e. prediction Pictures) included in each Group of video frames (GOP) of the video file, and B represents the total number of B frames (i.e. poor complement Pictures, i.e. bidirectional prediction Pictures) included in each Group of video frames (GOP) of the video file.
It should be noted that each group of video frames GOP refers to a sequence of video frames from one I frame to the next I frame.
In one embodiment, the compression ratio of the video file may be statistically obtained when the video file is recorded and recorded in the video file. Thereby, the compression ratio of the video file can be obtained from the video file.
And step S2, determining the target playing mode for playing the video file and the target decoding rate of the decoder according to the video playing double speed N and the compression ratio of the video file.
In one embodiment, the target play mode is one of four preset play modes, where the four preset play modes include: the video playing method comprises a first playing mode, a second playing mode, a third playing mode and a fourth playing mode, wherein the first playing mode is to play I frames, P frames and B frames of each group video frame GOP; the second playing mode is that I frames and P frames of each group video frame GOP are played; the third playing mode is that I frames of each group video frame GOP are played; the fourth play mode is that an I frame of a GOP is played in every M video frame GOP of the group, namely M-1 video frame GOP is skipped over, and the M-1 video frame of the group is not played.
In one embodiment, the decoding rate of the decoder in the first play mode may be preset to be in a first decoding rate range; presetting the decoding rate of the decoder in the second play mode to be in a second decoding rate range; and presetting the decoding rate of the decoder in the third play mode and the fourth play mode to be within a third decoding rate range.
For example, a first decoding rate range corresponding to the decoder in the first play mode is preset to be [ -100, 200 ]; presetting a second decoding rate range corresponding to the decoder in the second play mode as [ -50,150 ]; and presetting a second decoding rate range corresponding to the decoder in the third play mode and the fourth play mode as [0,70 ]. That is, the decoding rate range corresponding to the decoder in the third playback mode is the same as the decoding rate range corresponding to the decoder in the fourth playback mode.
In one embodiment, the step of determining the target playback mode for playing back the video file and the target decoding rate Vt of the decoder according to the video playback speed N and the compression ratio of the video file is described with reference to fig. 2.
And step S3, controlling the decoder to decode the video file based on the target play mode and the target decoding rate.
Specifically, when the target playback mode is the first playback mode, the decoder decodes the I frame, the P frame, and the B frame of each GOP at the target decoding rate. When the target play mode is the second play mode, the decoder decodes the I frame and the P frame of each GOP at the target decoding rate, but does not decode the B frame. When the target play mode is the third play mode, the decoder decodes the I-frame of each GOP at the target decoding rate without decoding P-frames and B-frames. When the target play mode is the fourth play mode, the decoder decodes the I frame of the appointed GOP in each M GOP at the target decoding rate, and does not decode other M-1 GOPs and does not decode the P frame and the B frame of the appointed GOP. The designated GOP may be a GOP corresponding to the earliest time among the M GOPs.
And step S4, outputting the decoded video frame according to the target playing mode, thereby obtaining the playing effect of the playing double speed N.
Specifically, when the target play mode is the first play mode, playing an I frame, a P frame, and a B frame of each decoded group of video frames GOP; when the target play mode is the second play mode, playing I frames and P frames of each group of video frame GOP obtained by decoding; when the target play mode is the third play mode, playing the I frame of each group of video frame GOP obtained by decoding; and when the target play mode is the fourth play mode, playing the I frame of the appointed GOP in each M decoded group video frame GOP, namely skipping M-1 group video frame GOP, not playing the M-1 group video frame GOP and not playing the P frame and the B frame of the appointed GOP. As described above, the specified GOP may be a GOP corresponding to the earliest time in the time axis among the M GOPs.
Fig. 2 is a flow chart of determining a target playback mode for playing back a video file and a target decoding rate Vt of a decoder according to the video playback speed N and the compression ratio of the video file according to the preferred embodiment of the present invention. The order of the steps in the flow chart may be changed and some steps may be omitted according to different needs.
Step S21, calculating a decoding rate V1 of the decoder in the first playback mode based on the video playback speed N and the compression ratio of the video file and a normal decoding rate V0 of the decoder, wherein V1 ═ N ═ V0 ((I + P + B)/(I + P + B)).
In this embodiment, the normal decoding rate VO is a decoding rate of the decoder when the video file is normally played. It will be understood by those skilled in the art that normal play is relative to fast forward and fast reverse.
For example, assuming that the compression ratio I: P: B of a video file is 1:4:12, the normal decoding rate VO of the decoder is 100, and the video playback speed N is 5, V1 can be calculated as 500.
Step S22, determine whether V1 is within the first decoding rate range. Step S23 is performed when V1 is within the first decoding rate range. Step S24 is performed when V1 is not within the first decoding rate range.
Taking the example of V1 being 500 and the first decoding rate range being [ -100, 200] calculated in step S21, step S24 is performed since V1 is not within the first decoding rate range.
In step S23, when V1 is within the first decoding rate range, the target playback mode is determined to be the first playback mode, and the target decoding rate Vt is determined to be equal to V1.
In step S24, when V1 is not within the first decoding rate range, the decoding rate V2 of the decoder in the second playback mode is calculated, wherein V2 ═ N × (I + P)/(I + P + B)) V0.
Step S25, determine whether V2 is within the second decoding rate range. Step S26 is performed when V2 is within the second decoding rate range. Step S27 is performed when V2 is not within the second decoding rate range.
In step S26, when V2 is in the second decoding rate range, the target playback mode is determined to be the second playback mode, and the target decoding rate Vt is determined to be equal to V2.
In step S27, when V2 is not within the second decoding rate range, the decoding rate V3 of the decoder in the third playback mode is calculated, where V3 is (I/(I + P + B)) × N × V0.
Step S28, determine whether V3 is within the third decoding rate range. When V3 is within the third decoding rate range, step S29 is performed. When V3 is not within the third decoding rate range, step S30 is performed.
Step S29, determining the target playback mode as the third playback mode, and determining the target decoding rate Vt to be equal to V3.
Step S30, when V3 is not within the third decoding rate range, determining that the target playback mode is the fourth playback mode, and calculating a value of M, where M ═ ((I/(I + P + B)) × N × V0)/Vmax, where Vmax represents a maximum decoding rate corresponding to the fourth decoding rate range, and M is rounded up in decimal places; and calculating a decoding rate V4 of the decoder in the fourth play mode, wherein V4 ═ ((I/(I + P + B)) × N × V0)/M, and V4 is taken as a target decoding rate Vt of the decoder.
It should be noted that rounding up M in decimal places means rounding up when M is not an integer, i.e., M includes decimal places. For example, assuming that M is 3.02, the integer is 4. If the calculation result is M3.8, the integer is 4. Fig. 1 and fig. 2 describe the method for playing a video at double speed in detail, and a functional module of a software system for implementing the method for playing a video at double speed and a hardware device architecture for implementing the method for playing a video at double speed are described below with reference to fig. 3 and fig. 4.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
Fig. 3 is a block diagram of a system for playing video at double speed according to a preferred embodiment of the present invention.
In some embodiments, the system 311 for playing video at double speed runs in the computer device 3. The system 311 for playing video at double speed may comprise a plurality of functional modules composed of program code segments. The program codes of the program segments in the system 311 for playing video at double speed can be stored in the memory 31 of the computer device 3 and executed by the at least one processor 32 to implement the function of playing video at double speed (see fig. 2 for details).
In this embodiment, the system 311 for playing video at double speed may be divided into a plurality of functional modules according to the functions performed by the system. The functional module may include: an acquisition module 301 and an execution module 302. The module referred to herein is a series of computer program segments capable of being executed by at least one processor and capable of performing a fixed function and is stored in memory. In the present embodiment, the functions of the modules will be described in detail in the following embodiments.
Specifically, the obtaining module 301 may be configured to determine a video playing double speed N and obtain a compression ratio of the video file. The execution module 302 may be configured to determine a target playback mode for playing back the video file and a target decoding rate Vt of a decoder according to the video playback speed N and the compression ratio of the video file. The execution module 302 may be further configured to control the decoder to decode the video file based on the target playback mode and a target decoding rate Vt; and outputting the decoded video frame according to the target play mode.
In one embodiment, the executing module 302 may further be configured to preset one of four play modes, where the four play modes include: the video playing method comprises a first playing mode, a second playing mode, a third playing mode and a fourth playing mode, wherein the first playing mode is to play I frames, P frames and B frames of each group video frame GOP; the second playing mode is that I frames and P frames of each group video frame GOP are played; the third playing mode is that I frames of each group video frame GOP are played; the fourth play mode is to play an I frame of a GOP in every M GOPs of the group video frames.
In one embodiment, the executing module 302 may be further configured to preset a decoding rate of the decoder in the first play mode to be in a first decoding rate range; presetting the decoding rate of the decoder in the second play mode to be in a second decoding rate range; and presetting the decoding rate of the decoder in the third play mode and the fourth play mode to be within a third decoding rate range.
In one embodiment, the determining, by the executing module 302, a target playing mode for playing the video file and a target decoding rate Vt of the decoder according to the video playing double speed N and the compression ratio of the video file includes: calculating a decoding rate V1 of the decoder in the first play mode based on the video playback speed N and a compression ratio of a video file and a normal decoding rate V0 of the decoder, wherein V1 ═ N × V0 ((I + P + B)/(I + P + B)); determining whether V1 is within the first decoding rate range, determining the target playback mode as the first playback mode when V1 is within the first decoding rate range, and determining that the target decoding rate Vt is equal to V1; calculating a decoding rate V2 of the decoder in the second play mode when V1 is not within the first decoding rate range, wherein V2 ═ ((I + P)/(I + P + B)) × N × V0; determining whether V2 is within the second decoding rate range, determining the target playback mode as the second playback mode when V2 is within the second decoding rate range, and determining that the target decoding rate Vt is equal to V2; when V2 is not within the second decoding rate range, calculating a decoding rate V3 of the decoder in the third playback mode, wherein V3 is (I/(I + P + B)) × N × V0; determining whether V3 is within the third decoding rate range, determining the target playback mode as the third playback mode when V3 is within the third decoding rate range, and determining that the target decoding rate Vt is equal to V3; and when V3 is not within the third decoding rate range, determining the target playback mode as the fourth playback mode, and calculating a value of M, where M ═ ((I/(I + P + B)) × N × V0)/Vmax, where Vmax represents a maximum decoding rate corresponding to the fourth decoding rate range, and M is rounded up in decimal places; and calculating a decoding rate V4 of the decoder in the fourth play mode, wherein V4 ═ ((I/(I + P + B)) × N × V0)/M, and V4 is taken as a target decoding rate Vt of the decoder.
Fig. 4 is a schematic structural diagram of a computer device according to a preferred embodiment of the invention. In the preferred embodiment of the present invention, the computer device 3 comprises a memory 31, at least one processor 32, and a decoder 33. It will be appreciated by those skilled in the art that the configuration of the computer apparatus shown in fig. 4 does not constitute a limitation of the embodiments of the present invention, and may be a bus-type configuration or a star-type configuration, and that the computer apparatus 3 may include more or less hardware or software than those shown, or a different arrangement of components. The computer device 3 may be a computer, a mobile phone, a tablet computer, a server, or the like.
In some embodiments, the computer device 3 includes a terminal capable of automatically performing numerical calculation and/or information processing according to preset or stored instructions, and the hardware includes but is not limited to a microprocessor, an application specific integrated circuit, a programmable gate array, a digital processor, an embedded device, and the like.
It should be noted that the computer device 3 is only an example, and other electronic products that are currently available or may come into existence in the future, such as electronic products that can be adapted to the present invention, should also be included in the scope of the present invention, and are included herein by reference.
In some embodiments, the memory 31 is used for storing program codes and various data, such as a double-speed video playing system 311 installed in the computer device 3, a video file 312, and realizing high-speed and automatic access to programs or data during the operation of the computer device 3. The Memory 31 includes a Read-Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), a One-time Programmable Read-Only Memory (OTPROM), an Electrically Erasable rewritable Read-Only Memory (EEPROM), an EEPROM), a Compact Disc Read-Only Memory (CD-ROM) or other optical Disc Memory, a magnetic disk Memory, a tape Memory, or any other computer-readable storage medium capable of carrying or storing data.
In some embodiments, the video file 312 may be an avi file, an MPEG file, or the like.
In some embodiments, the at least one processor 32 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same or different functions, including one or more Central Processing Units (CPUs), microprocessors, digital Processing chips, graphics processors, and combinations of various control chips. The at least one processor 32 is a Control Unit (Control Unit) of the computer apparatus 3, connects various components of the entire computer apparatus 3 by using various interfaces and lines, and executes various functions of the computer apparatus 3 and processes data, for example, a function of playing a video at a double speed, by running or executing programs or modules stored in the memory 31 and calling data stored in the memory 31.
Although not shown, the computer device 3 may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor 32 through a power management device, so as to implement functions of managing charging, discharging, and power consumption through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The computer device 3 may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
The integrated unit implemented in the form of a software functional module may be stored in a computer-readable storage medium. The software functional module is stored in a storage medium and includes instructions for causing a computer device (which may be a server, a personal computer, etc.) or a processor (processor) to perform parts of the methods according to the embodiments of the present invention.
In a further embodiment, in conjunction with fig. 3, the at least one processor 32 may execute the operating device of the computer device 3 and various installed applications (such as the system 311 for playing video at double speed), program codes, and the like, for example, the above modules.
The memory 31 has program code stored therein, and the at least one processor 32 can call the program code stored in the memory 31 to perform related functions. For example, the modules illustrated in fig. 3 are program codes stored in the memory 31 and executed by the at least one processor 32, so as to implement the functions of the modules for the purpose of playing video at double speed.
In one embodiment of the present invention, the memory 31 stores one or more instructions (i.e., at least one instruction) that are executed by the at least one processor 32 for the purpose of playing video at a double speed as shown in fig. 1 and 2.
In the embodiments provided in the present invention, it should be understood that the disclosed 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 is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention 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 can be realized in a form of hardware, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned. Furthermore, it is obvious that the word "comprising" does not exclude other elements or that the singular does not exclude the plural. A plurality of units or means recited in the apparatus claims may also be implemented by one unit or means in software or hardware. The terms first, second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.
Claims (7)
1. A method for playing video at a double speed, the method comprising:
determining the video playing speed N and obtaining the compression ratio of a video file;
determining a target playing mode for playing the video file and a target decoding rate Vt of a decoder according to the video playing speed N and the compression ratio of the video file;
controlling the decoder to decode the video file based on the target playback mode and a target decoding rate Vt; and
and outputting the decoded video frame according to the target play mode.
2. The method for playing video at double speed according to claim 1, wherein the compression ratio of the video file is I: P: B, where I represents the total number of I frames included in each group of video frames GOP of the video file, P represents the total number of P frames included in each group of video frames GOP of the video file, and B represents the total number of B frames included in each group of video frames GOP of the video file.
3. The method for playing video at double speed according to claim 2, wherein the target playing mode is one of four preset playing modes, the four playing modes comprising: the video playing method comprises a first playing mode, a second playing mode, a third playing mode and a fourth playing mode, wherein the first playing mode is to play I frames, P frames and B frames of each group video frame GOP; the second playing mode is that I frames and P frames of each group video frame GOP are played; the third playing mode is that I frames of each group video frame GOP are played; the fourth play mode is to play an I frame of a GOP in every M GOPs of the group video frames.
4. A method for playing back video at double speed according to any of claims 1 to 3, further comprising:
presetting the decoding rate of the decoder in the first play mode to be in a first decoding rate range; presetting the decoding rate of the decoder in the second play mode to be in a second decoding rate range; and presetting the decoding rate of the decoder in the third play mode and the fourth play mode to be within a third decoding rate range.
5. The method for playing video at double speed according to claim 4, wherein said determining the target playing mode for playing the video file and the target decoding rate Vt of the decoder according to the video playing double speed N and the compression ratio of the video file comprises:
calculating a decoding rate V1 of the decoder in the first play mode based on the video playback speed N and a compression ratio of a video file and a normal decoding rate V0 of the decoder, wherein V1 ═ N × V0 ((I + P + B)/(I + P + B));
determining whether V1 is within the first decoding rate range, determining the target playback mode as the first playback mode when V1 is within the first decoding rate range, and determining that the target decoding rate Vt is equal to V1;
calculating a decoding rate V2 of the decoder in the second play mode when V1 is not within the first decoding rate range, wherein V2 ═ ((I + P)/(I + P + B)) × N × V0;
determining whether V2 is within the second decoding rate range, determining the target playback mode as the second playback mode when V2 is within the second decoding rate range, and determining that the target decoding rate Vt is equal to V2;
when V2 is not within the second decoding rate range, calculating a decoding rate V3 of the decoder in the third playback mode, wherein V3 is (I/(I + P + B)) × N × V0;
determining whether V3 is within the third decoding rate range, determining the target playback mode as the third playback mode when V3 is within the third decoding rate range, and determining that the target decoding rate Vt is equal to V3; and
when V3 is not within the third decoding rate range, determining the target playback mode as the fourth playback mode, and calculating a value of M, where M ═ ((I/(I + P + B)) × N × V0)/Vmax, where Vmax represents a maximum decoding rate corresponding to the fourth decoding rate range, and M is rounded up in decimal places; and calculating a decoding rate V4 of the decoder in the fourth play mode, wherein V4 ═ ((I/(I + P + B)) × N × V0)/M, and V4 is taken as a target decoding rate Vt of the decoder.
6. A computer device, comprising a memory for storing at least one instruction and a processor for implementing a method for playing a video at a double speed according to any one of claims 1 to 5 when executing the at least one instruction.
7. A computer-readable storage medium storing at least one instruction which, when executed by a processor, implements a method for double-speed playing video according to any one of claims 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010997137.4A CN114257878A (en) | 2020-09-21 | 2020-09-21 | Method for playing video at double speed, computer device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010997137.4A CN114257878A (en) | 2020-09-21 | 2020-09-21 | Method for playing video at double speed, computer device and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114257878A true CN114257878A (en) | 2022-03-29 |
Family
ID=80789098
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010997137.4A Pending CN114257878A (en) | 2020-09-21 | 2020-09-21 | Method for playing video at double speed, computer device and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114257878A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114666603A (en) * | 2022-05-06 | 2022-06-24 | 厦门美图之家科技有限公司 | Video decoding method and device, electronic equipment and storage medium |
Citations (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR19980059946A (en) * | 1996-12-31 | 1998-10-07 | 구자홍 | How to reallocate memory in MPEG decoder |
EP1034656A2 (en) * | 1998-06-11 | 2000-09-13 | Koninklijke Philips Electronics N.V. | Trick play signal generation for a digital video recorder |
US20060117357A1 (en) * | 2004-11-30 | 2006-06-01 | Surline Jack E | Methods and systems for controlling trick mode play speeds |
US20060280431A1 (en) * | 2005-06-03 | 2006-12-14 | Kirk Blattman | Supporting trick modes in a streaming digital video environment using a root trick mode stream |
JP2008092364A (en) * | 2006-10-03 | 2008-04-17 | Sanyo Electric Co Ltd | Data processing device |
CN102447868A (en) * | 2010-10-11 | 2012-05-09 | 扬智电子(上海)有限公司 | Video stream fast playing method |
US20130019273A1 (en) * | 2011-07-11 | 2013-01-17 | Azuki Systems, Inc. | Method and system for trick play in over-the-top video delivery |
CN103581711A (en) * | 2013-10-31 | 2014-02-12 | 广州西维尔计算机系统有限公司 | Method for achieving video data playing in fast forward and fast backward mode based on low-speed file |
CN104602117A (en) * | 2015-01-31 | 2015-05-06 | 华为技术有限公司 | Double-speed video playing method and device |
KR20150049647A (en) * | 2013-10-30 | 2015-05-08 | 에스케이텔레콤 주식회사 | Method for Multiple-Speed Playback and Apparatus Therefor |
CN104683882A (en) * | 2015-02-13 | 2015-06-03 | 北京数码视讯科技股份有限公司 | Generation and play method and device for multiple speed file of stream medium |
CN104869430A (en) * | 2015-05-18 | 2015-08-26 | 北京中熙正保远程教育技术有限公司 | Video speed multiplication playing method and apparatus |
WO2017123474A1 (en) * | 2016-01-15 | 2017-07-20 | Vid Scale, Inc. | System and method for operating a video player displaying trick play videos |
CN107613365A (en) * | 2017-09-04 | 2018-01-19 | 浙江大华技术股份有限公司 | A kind of video broadcasting method and device |
US20200145701A1 (en) * | 2016-12-30 | 2020-05-07 | Tivo Solutions Inc. | Advanced trick-play modes for streaming video |
-
2020
- 2020-09-21 CN CN202010997137.4A patent/CN114257878A/en active Pending
Patent Citations (16)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR19980059946A (en) * | 1996-12-31 | 1998-10-07 | 구자홍 | How to reallocate memory in MPEG decoder |
EP1034656A2 (en) * | 1998-06-11 | 2000-09-13 | Koninklijke Philips Electronics N.V. | Trick play signal generation for a digital video recorder |
CN1311958A (en) * | 1998-06-11 | 2001-09-05 | 皇家菲利浦电子有限公司 | Trick play signal generation for a digital video recorder |
US20060117357A1 (en) * | 2004-11-30 | 2006-06-01 | Surline Jack E | Methods and systems for controlling trick mode play speeds |
US20060280431A1 (en) * | 2005-06-03 | 2006-12-14 | Kirk Blattman | Supporting trick modes in a streaming digital video environment using a root trick mode stream |
JP2008092364A (en) * | 2006-10-03 | 2008-04-17 | Sanyo Electric Co Ltd | Data processing device |
CN102447868A (en) * | 2010-10-11 | 2012-05-09 | 扬智电子(上海)有限公司 | Video stream fast playing method |
US20130019273A1 (en) * | 2011-07-11 | 2013-01-17 | Azuki Systems, Inc. | Method and system for trick play in over-the-top video delivery |
KR20150049647A (en) * | 2013-10-30 | 2015-05-08 | 에스케이텔레콤 주식회사 | Method for Multiple-Speed Playback and Apparatus Therefor |
CN103581711A (en) * | 2013-10-31 | 2014-02-12 | 广州西维尔计算机系统有限公司 | Method for achieving video data playing in fast forward and fast backward mode based on low-speed file |
CN104602117A (en) * | 2015-01-31 | 2015-05-06 | 华为技术有限公司 | Double-speed video playing method and device |
CN104683882A (en) * | 2015-02-13 | 2015-06-03 | 北京数码视讯科技股份有限公司 | Generation and play method and device for multiple speed file of stream medium |
CN104869430A (en) * | 2015-05-18 | 2015-08-26 | 北京中熙正保远程教育技术有限公司 | Video speed multiplication playing method and apparatus |
WO2017123474A1 (en) * | 2016-01-15 | 2017-07-20 | Vid Scale, Inc. | System and method for operating a video player displaying trick play videos |
US20200145701A1 (en) * | 2016-12-30 | 2020-05-07 | Tivo Solutions Inc. | Advanced trick-play modes for streaming video |
CN107613365A (en) * | 2017-09-04 | 2018-01-19 | 浙江大华技术股份有限公司 | A kind of video broadcasting method and device |
Non-Patent Citations (2)
Title |
---|
周军;李俊;朱明;: "基于GOP取帧与变帧率的VCR实现方法", 电子学报, no. 08 * |
程维佳等: ""基于TS流文件的倍速文件的生成方法"", 《网络新媒体技术》, vol. 5, no. 01 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114666603A (en) * | 2022-05-06 | 2022-06-24 | 厦门美图之家科技有限公司 | Video decoding method and device, electronic equipment and storage medium |
CN114666603B (en) * | 2022-05-06 | 2024-05-03 | 厦门美图之家科技有限公司 | Video decoding method and device, electronic equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8225112B2 (en) | Using historic load profiles to dynamically adjust operating frequency and available power to a handheld multimedia device processor core | |
US8437408B2 (en) | Decoding with reference image stored in image memory for random playback | |
US10509588B2 (en) | System and method for controlling memory frequency using feed-forward compression statistics | |
US7146513B2 (en) | System for adjusting a clock frequency based on comparing a required process times and a worst case execution times and adjusting a voltage and clock frequency based on a number of ready state application tasks | |
CN102568435A (en) | Method and apparatus for low power refresh of a display device | |
KR20110022653A (en) | Uniform video decoding and display | |
US8665966B2 (en) | Video coding apparatus, method of controlling video coding and program of controlling video coding | |
US11922972B2 (en) | Method and apparatus for video coding | |
TW201331749A (en) | Power management of display controller | |
US20130007005A1 (en) | Method and playing device for realizing fast response in multimedia file control process | |
CN114257878A (en) | Method for playing video at double speed, computer device and storage medium | |
US20150036997A1 (en) | Recording apparatus and recording method | |
JP2015029228A (en) | Recording apparatus and control method therefor | |
CN111669599A (en) | Video decoding method, video decoding device and terminal equipment | |
CN112911390B (en) | Video data playing method and terminal equipment | |
CN112291611A (en) | Video playing method, computer device and readable storage medium | |
JP2000078526A (en) | Picture reproducing device | |
CN114827724A (en) | Video playing method and related equipment | |
CN111315001A (en) | Audio and video intelligent adjusting method, device, equipment and medium | |
CN112288837A (en) | SVG path animation playing method, device and storage medium | |
US10908975B2 (en) | Computer system architecture | |
CN111352555A (en) | List sliding performance optimization method and device | |
CN117289776A (en) | Control method and electronic equipment | |
CN112463335A (en) | Application program running method and device and storage medium | |
KR101280227B1 (en) | multimedia data decoding apparatus and the method thereof |
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 | ||
WD01 | Invention patent application deemed withdrawn after publication | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20220329 |