Video reverse playback method, device and electronic equipment

By decoding and extracting sub-sequences in the video code stream for video reversal playback, the video reversal frame skipping caused by insufficient memory in the prior art is solved, and efficient video reversal playback with fewer memory resources is achieved.

CN113923452BActive Publication Date: 2025-03-25ZHEJIANG DAHUA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111082910.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-15
Publication Date
2025-03-25
Estimated Expiration
2041-09-15

AI Technical Summary

Technical Problem

In the process of video stream reversal, due to insufficient memory applied in advance, the problem of frame skipping occurs during video reversal playback, especially when the number of video frames contained in the GOP is long.

Method used

By determining the to-processed picture group GOP in the video code stream, decoding it to generate a frame sequence, calculating the first frame number according to the video reversal conditions, extracting a subsequence of continuous images corresponding to the first frame number for video reversal, and using the system's surplus decoding memory to reduce the use of memory resources.

Benefits of technology

It realizes video reversal of GOP code streams containing more image frames when using fewer memory resources, avoids frame skipping and saves system memory.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113923452B_ABST
    Figure CN113923452B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device and electronic device for reverse video playback, the method comprising: determining a group of pictures GOP to be processed in a video code stream, and decoding the GOP to be processed to generate a frame sequence representing N consecutive frames of images; calculating the first frame number for reverse video playback in the frame sequence according to a video reverse playback condition; extracting a first subsequence of consecutive images corresponding to the first frame number in the frame sequence; and performing reverse video playback according to the first subsequence. Based on the above method, it is possible to utilize the system's surplus decoding memory to perform reverse video playback on a GOP code stream containing a large number of image frames while occupying less memory resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of video processing, and in particular to a video reverse playback method, device and electronic equipment. Background Art

[0002] In scenarios such as shopping mall management and investigation and evidence collection, the video captured by the device is usually played back in reverse to facilitate the discovery of details in the video. During the reverse playback of the video stream, it is necessary to decode the video stream frame sequence in forward order based on the picture group GOP (Group of Pictures) as the basic unit, output the YUV frame sequence, and then display the YUV frame sequence in reverse order to achieve video reverse playback.

[0003] In the above process, the system needs to pre-apply a certain amount of memory space to store the decoded output YUV frame sequence. However, the number of video frames contained in the GOP of different video streams is different. The existing technology generally pre-applies a specific amount of memory according to empirical values ​​to store the decoded output YUV frame sequence. When the number of video frames contained in the GOP is long, the pre-applied memory is not enough to store the encoded YUV frame sequence, which will cause frame skipping when the video is played back. Summary of the invention

[0004] The present application provides a video reverse playback method, device and electronic device, which can utilize the system's surplus decoding memory to perform video reverse playback on a GOP code stream containing a large number of image frames while using fewer memory resources.

[0005] In a first aspect, the present application provides a video reverse playback method, the method comprising:

[0006] Determine a group of pictures GOP to be processed in the video code stream, and decode the GOP to be processed to generate a frame sequence representing N consecutive frames of images, where N is an integer greater than or equal to 1;

[0007] Calculating the first frame number for video reverse playback in the frame sequence according to the video reverse playback condition;

[0008] Extracting a first subsequence of continuous images corresponding to the first number of frames from the frame sequence;

[0009] The video is played back in reverse according to the first subsequence.

[0010] Through the above-mentioned video reverse playback method, it is possible to utilize the system's surplus decoding memory and perform video reverse playback on a GOP code stream containing a large number of image frames while using fewer memory resources.

[0011] In a possible design, determining a group of pictures GOP to be processed in a video bitstream, decoding the GOP to be processed, and generating a frame sequence representing N consecutive frames of images includes:

[0012] Parse the acquired video bitstream to generate a GOP sequence including M consecutive GOPs, where M is an integer greater than or equal to 1;

[0013] Reversely acquiring the GOP to be processed in the GOP sequence;

[0014] The GOP to be processed is decoded to generate a frame sequence representing N consecutive image frames.

[0015] Through the above method, a frame sequence including a plurality of continuous images can be obtained, and the images in the frame sequence are used for reverse playback of the video.

[0016] In a possible design, the calculating, according to the video reverse playback condition, the first frame number for video reverse playback in the frame sequence includes:

[0017] According to the video reverse playback multiple, determine the memory used for video reverse playback;

[0018] According to the memory and all the images in the GOP to be processed, the first frame number for video reverse playback in the frame sequence is determined.

[0019] Through the above method, it is possible to determine the number of images used for reverse playback of the video in the frame sequence generated after decoding the GOP to be processed.

[0020] In a possible design, extracting a first subsequence of continuous images corresponding to the first number of frames from the frame sequence includes:

[0021] Determining the last frame image that is not played back in the frame sequence as the starting frame image;

[0022] Determine an end frame image according to the first frame number;

[0023] A first subsequence of continuous images corresponding to the first number of frames is extracted from the frame sequence according to the start frame image and the end frame image.

[0024] In the above manner, in the frame sequence generated after decoding the GOP to be processed, the starting frame image and the ending frame image for the reverse playback of the video are determined, thereby realizing the extraction of the subsequence for the reverse playback of the video.

[0025] In a possible design, after playing back the video according to the first subsequence, the method further includes:

[0026] Deleting the first subsequence;

[0027] Calculating a first number of decoding times required to complete reverse playback of the video in the GOP to be processed according to the first number of frames and the number of image frames included in the GOP to be processed;

[0028] Detecting a second number of decoding times that the GOP to be processed has been completed;

[0029] If the second decoding number is less than the first decoding number, continue decoding the GOP to be processed to generate the frame sequence, and extract a second subsequence from the frame sequence for video reverse playback, wherein the second subsequence has a next frame of the last extracted end frame image as a starting frame image and corresponds to the first number of continuous images;

[0030] If the second decoding number is equal to the first decoding number, then continue to obtain in reverse order a single GOP in the GOP sequence that has not completed video reverse playback for video reverse playback until the reverse playback of the video code stream is completed.

[0031] Through the above method, the entire acquired video code stream file can be played back in reverse.

[0032] In a second aspect, the present application provides a video reverse playback device, the device comprising:

[0033] A decoding module, used for determining a group of pictures GOP to be processed in a video bitstream, and decoding the GOP to be processed to generate a frame sequence representing N consecutive frames of images, wherein N is an integer greater than or equal to 1;

[0034] A first calculation module, used for calculating a first frame number for video reverse playback in the frame sequence according to a video reverse playback condition;

[0035] An extraction module, configured to extract a first subsequence of continuous images corresponding to the first number of frames from the frame sequence;

[0036] The display module is used to play the video in reverse according to the first subsequence.

[0037] In a possible design, the decoding module is specifically used to:

[0038] Parse the acquired video bitstream to generate a GOP sequence including M consecutive GOPs, where M is an integer greater than or equal to 1;

[0039] Reversely acquiring the GOP to be processed in the GOP sequence;

[0040] The GOP to be processed is decoded to generate a frame sequence representing N consecutive image frames.

[0041] In a possible design, the first computing module is specifically configured to:

[0042] According to the video reverse playback multiple, determine the memory used for video reverse playback;

[0043] According to the memory and all the images in the GOP to be processed, the first frame number for video reverse playback in the frame sequence is determined.

[0044] In a possible design, the extraction module is specifically used to:

[0045] Determining the last frame image that is not played back in the frame sequence as the starting frame image;

[0046] Determine an end frame image according to the first frame number;

[0047] A first subsequence of continuous images corresponding to the first number of frames is extracted from the frame sequence according to the start frame image and the end frame image.

[0048] In one possible design, the device further includes:

[0049] A deleting module, used for deleting the first subsequence;

[0050] A second calculation module is used to calculate a first decoding number required for decoding to complete reverse playback of the GOP to be processed according to the first frame number and the number of image frames included in the GOP to be processed;

[0051] A detection module, used for detecting the second decoding times of the GOP to be processed that has been completed;

[0052] A processing module is used to continue decoding the GOP to be processed to generate the frame sequence, and extract a second subsequence from the frame sequence for video reverse playback if the second decoding number is less than the first decoding number, wherein the second subsequence has the next frame of the end frame image extracted last time as the starting frame image and corresponds to the first number of continuous frames; if the second decoding number is equal to the first decoding number, continue to obtain in reverse order a single GOP in the GOP sequence that has not completed video reverse playback for video reverse playback processing until the reverse playback of the video code stream is completed.

[0053] In a third aspect, the present application provides an electronic device, including:

[0054] Memory, used to store computer programs;

[0055] The processor is used to implement the above-mentioned method steps for reverse playback of the video when executing the computer program stored in the memory.

[0056] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned video reversal method steps are implemented.

[0057] Based on the video reversal method provided by the present application, the GOP to be processed is decoded to generate a frame sequence containing multiple continuous images, and then based on the video reversal condition, a subsequence of continuous images corresponding to the first number of frames is extracted in reverse order from the frame sequence for video reversal. After the video reversal is completed, the GOP to be processed continues to be decoded, and the subsequence that has not been reversaled is continued to be extracted from the generated frame sequence for video reversal, until the video reversal of the GOP to be processed is completed, and then the next GOP is processed, and the video reversal of the acquired video stream is completed. Through the above method, it is possible to utilize the system's surplus memory and perform video reversal on a GOP stream containing a large number of image frames while using fewer memory resources, thereby avoiding the problem of video reversal frame skipping caused by insufficient memory space applied in the prior art, and saving system memory.

[0058] The technical effects that can be achieved in each of the above-mentioned second to fourth aspects and each of the above-mentioned aspects refer to the technical effects that can be achieved in the above-mentioned first aspect or various possible schemes in the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] Figure 1 A flowchart of a video reversal method provided by this application;

[0060] Figure 2 A schematic diagram of a video reverse playback method provided by the present application;

[0061] Figure 3 A schematic diagram of the structure of a video reversing device provided in this application;

[0062] Figure 4 A schematic diagram of the structure of an electronic device provided in this application. DETAILED DESCRIPTION

[0063] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The specific operating methods in the method embodiments can also be applied to device embodiments or system embodiments. It should be noted that in the description of the present application, "multiple" is understood as "at least two". "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. A is connected to B, which can represent: A is directly connected to B and A is connected to B through C. In addition, in the description of the present application, words such as "first" and "second" are only used to distinguish the purpose of description, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying order.

[0064] The embodiments of the present application are described in detail below in conjunction with the accompanying drawings.

[0065] When playing the video backward, the system needs to pre-apply a certain amount of memory space to store the decoded output YUV frame sequence. However, the number of video frames contained in the GOP of different video streams is different. The existing technology generally pre-applies a specific amount of memory according to empirical values ​​to store the decoded output YUV frame sequence. When the number of video frames contained in the GOP is long, the pre-applied memory is not enough to store the encoded YUV frame sequence, which will cause frame skipping when the video is played backward.

[0066] Based on the above problems, the embodiments of the present application provide a video reverse playback method, which is used to utilize the system's surplus decoding memory, and to reverse the video of a GOP code stream containing a large number of image frames while using less memory resources, thereby avoiding the problem of video reverse playback frame skipping due to insufficient memory space applied for, and also saving system memory. Among them, the method and device described in the embodiments of the present application are based on the same technical concept. Since the principles of the problems solved by the method and the device are similar, the embodiments of the device and the method can refer to each other, and the repeated parts will not be repeated.

[0067] like Figure 1 FIG. 1 is a flowchart of a video playback method provided in an embodiment of the present application, which specifically includes the following steps:

[0068] S11, determining a group of pictures GOP to be processed in the video code stream, and decoding the GOP to be processed to generate a frame sequence representing N consecutive frames of images;

[0069] In an embodiment of the present application, N is an integer greater than or equal to 1, the frame sequence may be a YUV sequence, and the generation of the frame sequence is achieved by decoding the GOP to be processed, specifically comprising: parsing the acquired video code stream to generate a GOP sequence comprising M consecutive GOPs, wherein M is an integer greater than or equal to 1, and the number of image frames contained in each GOP is not necessarily the same; next, acquiring the GOP to be processed in the GOP sequence in reverse order, and decoding the GOP to be processed to generate a frame sequence representing N consecutive image frames.

[0070] Through the above method, a frame sequence including a plurality of continuous images can be obtained, and the images in the frame sequence are used for reverse playback of the video.

[0071] For example, if the GOP sequence generated by decoding the video code stream file contains 3 GOPs, which are recorded as GOP1, GOP2, and GOP3, where GOP1 contains 10 frames of images, GOP2 contains 20 frames of images, and GOP3 contains 30 frames of images, then when obtaining the GOP to be processed, GOP3 is first obtained and decoded to generate a YUV frame sequence containing 30 frames of continuous images, which are recorded as the 1st frame, the 2nd frame, ..., the 30th frame.

[0072] The images in the YUV frame sequence are used for reverse video playback. When GOP3 completes the reverse video playback process, GOP2 and GOP1 are processed in sequence.

[0073] S12, calculating the first frame number for video reverse playback in the frame sequence according to the video reverse playback condition;

[0074] In the embodiment of the present application, the video reverse playback condition indicates parameters such as the video reverse playback multiple and system memory. The first frame number indicates the number of image frames that can be used for video reverse playback in the frame sequence generated by each decoding, and the first frame number is mainly calculated based on the video reverse playback condition. Specifically, it can be: according to the video reverse playback multiple, the memory used for video reverse playback is determined, and then according to the memory and all images in the GOP to be processed, the first frame number used for video reverse playback in the frame sequence is determined.

[0075] In the above process, since the system memory required for different video reverse playback multiples is different, under the preset video reverse playback multiple, the system memory K that can meet the video reverse playback multiple requirements is determined. Assuming that the data size of each frame image in the GOP to be processed is P, it can be further determined that the first number of frames that the system memory can meet for video reverse playback is K / P.

[0076] S13, extracting a first subsequence of continuous images corresponding to the first number of frames from the frame sequence;

[0077] In the embodiment of the present application, a first subsequence of continuous images having a first number of frames is extracted from the frame sequence for video reverse playback, which can avoid the problem of frame skipping during video reverse playback due to insufficient system memory when the frame sequence is long. The specific method of extracting the first subsequence is:

[0078] Determining the last frame image that is not played back in the frame sequence as the starting frame image;

[0079] Determine an end frame image according to the first frame number;

[0080] A first subsequence of continuous images corresponding to the first number of frames is extracted from the frame sequence according to the start frame image and the end frame image.

[0081] Through the above method, it is possible to extract the first subsequence for reverse playback of the video from the frame sequence.

[0082] For example, if the frame sequence generated after decoding the GOP to be processed contains a frame sequence of 10 continuous frames, and the 10 frames are respectively recorded as the 1st frame, the 2nd frame, ..., the 10th frame, and the first frame number is 3, then when the GOP to be processed is decoded for the first time, the starting frame image of the first subsequence extracted from the generated frame sequence containing 10 continuous frames is the 10th frame, and the ending frame is the 8th frame, that is, the images contained in the first subsequence are the 10th frame, the 9th frame, and the 8th frame. When the GOP to be processed is decoded for the second time, the images contained in the extracted first subsequence are the 7th frame, the 6th frame, and the 5th frame. And so on, until the GOP video to be processed is played back in reverse.

[0083] S14: Play the video in reverse according to the first subsequence.

[0084] In the embodiment of the present application, after the video is played back according to the first subsequence, the first subsequence needs to be further deleted, and the images in the to-be-processed GOP that have not completed the video playback are played back. When the to-be-processed GOP completes the video playback, the next to-be-processed GOP is obtained for the video playback. The specific method is as follows:

[0085] Calculating a first number of decoding times required to complete reverse playback of the video in the GOP to be processed according to the first number of frames and the number of image frames included in the GOP to be processed;

[0086] Detecting a second number of decoding times that the GOP to be processed has been completed;

[0087] If the second decoding number is less than the first decoding number, continue decoding the GOP to be processed to generate the frame sequence, and extract a second subsequence from the frame sequence for video reverse playback, wherein the second subsequence has a next frame of the last extracted end frame image as a starting frame image and corresponds to the first number of continuous images;

[0088] If the second decoding number is equal to the first decoding number, then continue to obtain in reverse order a single GOP in the GOP sequence that has not completed video reverse playback for video reverse playback until the reverse playback of the video code stream is completed.

[0089] Through the above method, the video reverse playback of the entire acquired video code stream file can be achieved.

[0090] For example, if the first frame number is 2, the GOP to be processed is GOP3, wherein the number of image frames contained in GOP3 is 30, then the first number of decoding times required to complete the reverse playback of the video of GOP3 is 30 / 2=15 times.

[0091] If the GOP3 has completed 10 decodings, it indicates that the GOP3 has not completed the video reverse playback, and further decoding and video reverse playback processing are required; if the GOP3 has completed 30 decodings and displayed, it indicates that the GOP3 has completed the video reverse playback, and it is necessary to obtain GOP2 and GOP1 in sequence for video reverse playback processing.

[0092] Based on the video reverse playback method provided by the present application, the GOP to be processed is decoded to generate a frame sequence containing multiple continuous images, and then based on the video reverse playback condition, a subsequence of continuous images containing a first number of frames is extracted in reverse order from the frame sequence for video reverse playback. This can utilize the system's surplus memory and, while using fewer memory resources, perform video reverse playback on a GOP code stream containing a large number of image frames, thereby avoiding the problem of video reverse frame skipping caused by insufficient applied memory space in the prior art, and can save system memory.

[0093] Furthermore, in order to explain in more detail a video reversal method provided by the present application, the method provided by the present application is described in detail through a specific application scenario below.

[0094] like Figure 2 As shown, it is a schematic diagram of a video reverse playback method provided by the present application. Specifically, the video code stream file to be reversed is first obtained, and then the video code stream file is analyzed to obtain a forward GOP sequence, and then the GOP to be processed is obtained in reverse order, and the number of image frames N in the GOP to be processed is parsed.

[0095] Next, according to the parameters such as the reverse playback multiple set by the user, the number of image frames L for each video reverse playback is calculated, and the number of decoding times C required for the GOP sequence to be processed to complete the video reverse playback is further calculated, where C = (N + L-1) / L. Then, the GOP to be processed is decoded to generate a YUV sequence with N frames of images, where the images in the YUV sequence are recorded as the 1st frame, the 2nd frame, the 3rd frame, ..., the Nth frame.

[0096] A subsequence having L continuous frame images is extracted from the YUV frame sequence. When the GOP to be processed is decoded for the first time, the starting frame image of the extracted subsequence is the Nth frame, and the ending frame image is the (N-L+1)th frame. The subsequence is then sent for display and then deleted.

[0097] After the above-mentioned subsequence deletion, continue to decode the GOP sequence to be processed, and extract a subsequence with continuous L frame images in the generated YUV sequence, and the starting frame image of the extracted subsequence is the next frame image of the end frame image extracted after the previous decoding as the starting frame image, wherein, during the i-th decoding, the starting frame image of the extracted subsequence is the [N-(i-1)L]th frame, and the end frame is the [N-iL+1]th frame, until the GOP to be processed is repeatedly decoded for C times, after the GOP to be processed completes the video reverse playback, further reversely obtain the next GOP to be processed for video reverse playback processing until the obtained video stream file completes the video reverse playback.

[0098] In the above application scenario, the GOP to be processed is decoded to generate a frame sequence containing multiple continuous images, and then based on the video reverse playback multiple, a subsequence of continuous images containing the first number of frames is extracted in reverse order from the frame sequence for video reverse playback. When the video reverse playback is completed, the GOP to be processed continues to be decoded, and the subsequence that has not been reversed is continued to be extracted from the generated frame sequence for video reverse playback, until the video reverse playback of the GOP to be processed is completed, and then the next GOP is processed to complete the video reverse playback of the acquired video stream.

[0099] Through the above method, it is possible to utilize the system's surplus memory and perform video reverse playback of a GOP code stream containing a large number of image frames while using fewer memory resources, thereby avoiding the problem of video reverse playback frame skipping caused by insufficient applied memory space in the prior art and saving system memory.

[0100] Based on the same inventive concept, the present application also provides a video reversing device, such as Figure 3 FIG. 1 is a schematic diagram of a structure of a video reversing device in the present application, and the device includes:

[0101] A decoding module 31 is used to determine a group of pictures GOP to be processed in a video code stream, and decode the GOP to be processed to generate a frame sequence representing N consecutive frames of images, where N is an integer greater than or equal to 1;

[0102] A first calculation module 32, configured to calculate a first frame number for video reverse playback in the frame sequence according to a video reverse playback condition;

[0103] An extraction module 33, configured to extract a first subsequence of continuous images corresponding to the first number of frames from the frame sequence;

[0104] The display module 34 is used to play the video in reverse according to the first subsequence.

[0105] In a possible design, the decoding module 31 is specifically configured to:

[0106] Parse the acquired video bitstream to generate a GOP sequence including M consecutive GOPs, where M is an integer greater than or equal to 1;

[0107] Reversely acquiring the GOP to be processed in the GOP sequence;

[0108] The GOP to be processed is decoded to generate a frame sequence representing N consecutive image frames.

[0109] In a possible design, the first calculation module 32 is specifically configured to:

[0110] According to the video reverse playback multiple, determine the memory used for video reverse playback;

[0111] According to the memory and all the images in the GOP to be processed, the first frame number for video reverse playback in the frame sequence is determined.

[0112] In a possible design, the extraction module 33 is specifically used to:

[0113] Determining the last frame image that is not played back in the frame sequence as the starting frame image;

[0114] Determine an end frame image according to the first frame number;

[0115] A first subsequence of continuous images corresponding to the first number of frames is extracted from the frame sequence according to the start frame image and the end frame image.

[0116] In one possible design, the device further includes:

[0117] A deleting module, used for deleting the first subsequence;

[0118] A second calculation module is used to calculate a first decoding number required for decoding to complete reverse playback of the GOP to be processed according to the first frame number and the number of image frames included in the GOP to be processed;

[0119] A detection module, used for detecting the second decoding times of the GOP to be processed that has been completed;

[0120] A processing module is used to continue decoding the GOP to be processed to generate the frame sequence, and extract a second subsequence from the frame sequence for video reverse playback if the second decoding number is less than the first decoding number, wherein the second subsequence has the next frame of the end frame image extracted last time as the starting frame image and corresponds to the first number of continuous frames; if the second decoding number is equal to the first decoding number, continue to obtain in reverse order a single GOP in the GOP sequence that has not completed video reverse playback for video reverse playback processing until the reverse playback of the video code stream is completed.

[0121] Based on the above video reversal device, the GOP to be processed is decoded to generate a frame sequence containing multiple continuous images, and then based on the video reversal multiple, a subsequence of continuous images corresponding to the first number of frames is extracted in reverse order in the frame sequence for video reversal. After the video reversal is completed, the GOP to be processed continues to be decoded, and the subsequence that has not been reversing is continued to be extracted from the generated frame sequence for video reversal, until the video reversal of the GOP to be processed is completed, and then the next GOP is processed, and the video reversal of the acquired video stream is completed. Through the above method, it is possible to utilize the system's surplus memory and perform video reversal on a GOP stream containing a large number of image frames while using fewer memory resources, thereby avoiding the problem of video reversal frame skipping caused by insufficient memory space applied in the prior art, and saving system memory.

[0122] Based on the same inventive concept, an electronic device is also provided in the embodiment of the present application, and the electronic device can realize the functions of the aforementioned video reverse playback method and device, referring to Figure 4 , the electronic device comprises:

[0123] At least one processor 41, and a memory 42 connected to the at least one processor 41. The specific connection medium between the processor 41 and the memory 42 is not limited in the embodiment of the present application. Figure 4 In the example, the processor 41 and the memory 42 are connected via the bus 40. The bus 40 is Figure 4 The connection between other components is shown by bold lines, and is not intended to be limiting. The bus 40 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4Only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. Alternatively, the processor 41 can also be called a controller, and there is no limitation on the name.

[0124] In the embodiment of the present application, the memory 42 stores instructions that can be executed by at least one processor 41. The at least one processor 41 can execute the video reverse playback method discussed above by executing the instructions stored in the memory 42. The processor 41 can implement Figure 3 The functions of each module in the device shown.

[0125] Among them, the processor 41 is the control center of the device, and can use various interfaces and lines to connect the various parts of the entire control device. By running or executing instructions stored in the memory 42 and calling data stored in the memory 42, the various functions of the device and processing data, the device can be monitored as a whole.

[0126] In a possible design, the processor 41 may include one or more processing units, and the processor 41 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the modem processor may not be integrated into the processor 41. In some embodiments, the processor 41 and the memory 42 may be implemented on the same chip, and in some embodiments, they may also be implemented separately on separate chips.

[0127] The processor 41 may be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, and may implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the video playback method disclosed in the embodiments of the present application may be directly embodied as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.

[0128] The memory 42 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory 42 may include at least one type of storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (Random Access Memory, RAM), a static random access memory (Static Random Access Memory, SRAM), a programmable read-only memory (Programmable Read Only Memory, PROM), a read-only memory (Read Only Memory, ROM), an electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a magnetic memory, a disk, an optical disk, etc. The memory 42 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 42 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.

[0129] By programming the processor 41, the code corresponding to the video playback method described in the above embodiment can be fixed into the chip, so that the chip can execute the video playback method when running. Figure 1 The steps of the video reversal method of the embodiment shown are as follows: How to design and program the processor 41 is a technique well known to those skilled in the art and will not be described in detail here.

[0130] Based on the same inventive concept, an embodiment of the present application further provides a storage medium, which stores computer instructions. When the computer instructions are executed on a computer, the computer executes the video reverse playback method discussed above.

[0131] In some possible implementations, various aspects of the video playback method provided by the present application may also be implemented in the form of a program product, which includes a program code. When the program product is run on a device, the program code is used to enable the control device to execute the steps of the video playback method according to various exemplary implementations of the present application described above in this specification.

[0132] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0133] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0134] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0135] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0136] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A video reverse playback method, characterized in that: include: Determine a group of pictures GOP to be processed in the video code stream, and decode the GOP to be processed to generate a frame sequence representing N consecutive frames of images, where N is an integer greater than or equal to 1; Calculating the first frame number for video reverse playback in the frame sequence according to the video reverse playback condition; Determining the last frame image that is not played back in the frame sequence as the starting frame image; Determine an end frame image according to the first frame number; Extracting a first subsequence of continuous images corresponding to the first number of frames from the frame sequence according to the starting frame image and the ending frame image; Play the video in reverse according to the first subsequence; Deleting the first subsequence; Calculating a first number of decryption times required for completing reverse playback of the video in the GOP to be processed according to the first number of frames and the number of image frames included in the GOP to be processed; Detecting a second number of decoding times that the GOP to be processed has been completed; If the second decoding number is less than the first decoding number, continue decoding the GOP to be processed to generate the frame sequence, and extract a second subsequence from the frame sequence for video reverse playback, wherein the second subsequence has a next frame of the last extracted end frame image as a starting frame image and corresponds to the first number of continuous images; If the second decoding number is equal to the first decoding number, then continue to obtain in reverse order a single GOP in the GOP sequence that has not completed video reverse playback for video reverse playback until the reverse playback of the video code stream is completed.

2. The method according to claim 1, characterized in that The step of determining a group of pictures GOP to be processed in the video code stream, decoding the GOP to be processed, and generating a frame sequence representing N consecutive frames of images includes: Parse the acquired video bitstream to generate a GOP sequence including M consecutive GOPs, where M is an integer greater than or equal to 1; Reversely acquiring the GOP to be processed in the GOP sequence; The GOP to be processed is decoded to generate a frame sequence having N consecutive image frames.

3. The method according to claim 1, characterized in that The calculating, according to the video reverse playback condition, the first frame number for video reverse playback in the frame sequence comprises: According to the video reverse playback multiple, determine the memory used for video reverse playback; According to the memory and all the images in the GOP to be processed, the first frame number for video reverse playback in the frame sequence is determined.

4. A video reversing device, characterized in that: The device comprises: A decoding module, used for determining a group of pictures GOP to be processed in a video bitstream, and decoding the GOP to be processed to generate a frame sequence representing N consecutive frames of images, wherein N is an integer greater than or equal to 1; A first calculation module, used for calculating a first frame number for video reverse playback in the frame sequence according to a video reverse playback condition; An extraction module, used for determining the last frame image without video reverse playback in the frame sequence as the starting frame image; Determine an end frame image according to the first frame number; Extracting a first subsequence of continuous images corresponding to the first number of frames from the frame sequence according to the starting frame image and the ending frame image; A display module, used for playing the video in reverse according to the first subsequence; A deleting module, used for deleting the first subsequence; A second calculation module is used to calculate a first decoding number required for decoding to complete reverse playback of the GOP to be processed according to the first frame number and the number of image frames included in the GOP to be processed; A detection module, used for detecting the second decoding times of the GOP to be processed that has been completed; A processing module is used to continue decoding the GOP to be processed to generate the frame sequence, and extract a second subsequence from the frame sequence for video reverse playback if the second decoding number is less than the first decoding number, wherein the second subsequence has the next frame of the end frame image extracted last time as the starting frame image and corresponds to the first number of continuous frames; if the second decoding number is equal to the first decoding number, continue to obtain in reverse order a single GOP in the GOP sequence that has not completed video reverse playback for video reverse playback processing until the reverse playback of the video code stream is completed.

5. The device according to claim 4, characterized in that The decoding module is specifically used for: Parse the acquired video bitstream to generate a GOP sequence including M consecutive GOPs, where M is an integer greater than or equal to 1; Reversely acquiring the GOP to be processed in the GOP sequence; The GOP to be processed is decoded to generate a frame sequence representing N consecutive image frames.

6. The device according to claim 4, characterized in that The first calculation module is specifically used for: According to the video reverse playback multiple, determine the memory used for video reverse playback; According to the memory and all the images in the GOP to be processed, the first frame number for video reverse playback in the frame sequence is determined.

7. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to implement the method steps of any one of claims 1 to 3 when executing a computer program stored in the memory.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps of any one of claims 1 to 3 are implemented.

Citation Information

Patent Citations

  • A method and apparatus for secure high-definition video rewind

    CN109005447A

  • Video processing method and device, terminal and storage medium

    CN109819317A