CN115623282A - Fixed-point playing method and device of encrypted video, electronic equipment and storage medium - Google Patents

Fixed-point playing method and device of encrypted video, electronic equipment and storage medium Download PDF

Info

Publication number
CN115623282A
CN115623282A CN202211533292.6A CN202211533292A CN115623282A CN 115623282 A CN115623282 A CN 115623282A CN 202211533292 A CN202211533292 A CN 202211533292A CN 115623282 A CN115623282 A CN 115623282A
Authority
CN
China
Prior art keywords
encrypted video
playing
video
encrypted
block
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.)
Granted
Application number
CN202211533292.6A
Other languages
Chinese (zh)
Other versions
CN115623282B (en
Inventor
王滨
隋森
傅彩利
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Hikvision Digital Technology Co Ltd
Original Assignee
Hangzhou Hikvision Digital Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Priority to CN202211533292.6A priority Critical patent/CN115623282B/en
Publication of CN115623282A publication Critical patent/CN115623282A/en
Application granted granted Critical
Publication of CN115623282B publication Critical patent/CN115623282B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/4405Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving video stream decryption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/472End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content
    • H04N21/47217End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content for controlling playback functions for recorded or on-demand content, e.g. using progress bars, mode or play-point indicators or bookmarks

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Human Computer Interaction (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The embodiment of the application provides a fixed-point playing method and device of an encrypted video, an electronic device and a storage medium, wherein the electronic device can acquire a playing position indicated by a fixed-point playing instruction sent by a user based on a progress bar in a packet encrypted video playing process; determining a target block encrypted video indicated by the playing position based on the data volume corresponding to the playing position and the data volume of each block encrypted video included in the block encrypted video; and decrypting and playing the target packet encrypted video. Because the playing position range corresponding to the progress bar is determined based on the total data volume of the video, the target block encrypted video indicated by the playing position can be determined based on the data volume corresponding to the playing position indicated by the fixed point playing instruction and the data volume of each block encrypted video included in the block encrypted video, so that the target block encrypted video is decrypted and played, the encrypted video does not need to be completely decrypted and then played at a fixed point, and the fixed point playing effect of the encrypted video is improved.

Description

Fixed-point playing method and device of encrypted video, electronic equipment and storage medium
Technical Field
The present application relates to the field of video playing technologies, and in particular, to a fixed-point playing method and apparatus for an encrypted video, an electronic device, and a storage medium.
Background
Information security is increasingly emphasized by society, and video security is widely applied as an important mode for information security guarantee. The video safety guarantee mode is mainly to encrypt the video, and compared with the conventional plaintext video playing, the encrypted video playing has the problem that the conventional playing control function is difficult to realize, wherein the more serious problem is the fixed point playing function of the encrypted video, and the fixed point playing of the video is the progress bar for dragging the video to control the playing position of the video.
At present, in a fixed-point playing mode of an encrypted video, after a packet-encrypted video is completely decrypted, the total duration of the video and a mapping index of a video code stream and a time scale are acquired. Therefore, when the user drags the progress bar to a certain moment, the corresponding video frame can be determined based on the moment and the corresponding relation, and then the video is played at a fixed point.
By adopting the fixed-point playing mode of the encrypted video, because the video cache space is limited, the video which is encrypted in groups is usually played while being decrypted, and because all code streams of the encrypted video cannot be analyzed at one time, even if the corresponding relation between the total time length and the time scale of the video and the video code streams is obtained, the fixed-point playing cannot be realized because the plaintext is not decrypted by the code stream ciphertext. If the encrypted video is completely decrypted, the waiting time is long, and the encrypted video is decrypted at one time, so that the safety of the video is reduced. Therefore, the fixed-point playing effect of the current encrypted video is not ideal.
Disclosure of Invention
The embodiment of the application aims to provide a fixed-point playing method and device of an encrypted video, an electronic device and a storage medium, so as to improve the fixed-point playing effect of the encrypted video. The specific technical scheme is as follows:
in a first aspect, a fixed-point playing method for encrypted video includes:
in the process of playing the block encrypted video, acquiring a playing position indicated by a fixed point playing instruction sent by a user based on a progress bar, wherein the playing position range corresponding to the progress bar is determined based on the total data volume of the block encrypted video;
determining a target packet encrypted video indicated by the playing position based on the data volume corresponding to the playing position and the data volume of each packet encrypted video included in the packet encrypted video;
and decrypting and playing the target packet encrypted video.
Optionally, the step of determining the target block encrypted video indicated by the play position based on the data amount corresponding to the play position and the data amount of each block encrypted video included in the block encrypted video includes:
determining the data volume corresponding to the playing position based on the total data volume of the grouped encrypted video, the total length of the progress bar and the length of the progress bar corresponding to the playing position;
calculating a quotient value between the data volume corresponding to the playing position and the data volume of each packet encrypted video included in the packet encrypted video;
rounding up the quotient to obtain a value N, determining the Nth group of encrypted videos as the target group of encrypted videos indicated by the playing position, or,
and rounding the quotient downwards to obtain a numerical value N, and determining the (N + 1) th group of encrypted videos as the target group of encrypted videos indicated by the playing position.
Optionally, the step of determining the data size corresponding to the playing position based on the total data size of the block-encrypted video, the total length of the progress bar, and the length of the progress bar corresponding to the playing position includes:
calculating a ratio between a total data amount of the block-encrypted video and a total length of the progress bar;
and determining the product of the length of the progress bar corresponding to the playing position and the proportion as the data volume corresponding to the playing position.
Optionally, before the step of obtaining the play position indicated by the fixed-point play instruction sent by the user based on the progress bar, the method further includes:
acquiring the total data volume of the block encrypted video;
determining a playing position range corresponding to a progress bar corresponding to the grouped encrypted video based on the total data volume of the grouped encrypted video;
and displaying a progress bar based on the playing position range in the playing process of the grouped encrypted video.
Optionally, before the step of obtaining the play position indicated by the fixed-point play instruction sent by the user based on the progress bar, the method further includes:
acquiring a packet encryption video;
sequentially decrypting and playing each group encrypted video included in the group encrypted videos, and caching a code stream obtained by decoding in the decryption playing process;
before the step of decrypting the target packet-encrypted video for playing, the method further comprises:
and clearing the current cached code stream.
Optionally, the step of decrypting and playing the target packet-encrypted video includes:
acquiring a decryption key corresponding to the target block encrypted video, wherein the decryption key is a decryption key corresponding to an encryption key adopted when the block encryption processing is performed on video data to be encrypted to obtain the target block encrypted video;
decrypting the target block encrypted video by using the decryption key to obtain a decrypted video code stream;
and decoding and playing the video code stream.
Optionally, the obtaining mode of the decryption key does not depend on decryption of other packet-encrypted videos;
the step of decrypting the target block encrypted video by using the decryption key to obtain a decrypted video code stream comprises the following steps:
and directly decrypting the target block encrypted video by only adopting the decryption key to obtain a decrypted video code stream.
In a second aspect, a fixed-point playback device for encrypted video, the device comprising:
the playing control module is used for acquiring a playing position indicated by a fixed-point playing instruction sent by a user based on a progress bar in the playing process of the grouped encrypted video, wherein the playing position range corresponding to the progress bar is determined based on the total data volume of the grouped encrypted video;
the code stream decryption module is used for determining a target block encrypted video indicated by the playing position based on the data volume corresponding to the playing position and the data volume of each block encrypted video included in the block encrypted video;
and the code stream decryption module is also used for decrypting and playing the target packet encrypted video.
In a third aspect, an electronic device includes:
a memory for storing a computer program;
a processor for implementing the method of any one of the first aspect when executing a program stored in a memory.
In a fourth aspect, a computer-readable storage medium has stored therein a computer program which, when executed by a processor, implements the method of any of the first aspects described above.
The embodiment of the application has the following beneficial effects:
in the scheme provided by the embodiment of the application, the electronic device can acquire a playing position indicated by a fixed-point playing instruction sent by a user based on a progress bar in the playing process of the block encrypted video, wherein the playing position range corresponding to the progress bar is determined based on the total data volume of the block encrypted video; determining a target packet encrypted video indicated by the playing position based on the data volume corresponding to the playing position and the data volume of each packet encrypted video included in the packet encrypted video; and decrypting and playing the target packet encrypted video. In the scheme, the playing position range corresponding to the progress bar is determined based on the total data volume of the grouped encrypted videos, so that after the fixed-point playing instruction is obtained, the target grouped encrypted video indicated by the playing position can be determined based on the data volume corresponding to the playing position indicated by the fixed-point playing instruction and the data volume of each grouped encrypted video included in the grouped encrypted videos, the target grouped encrypted video is decrypted and played, the fixed-point playing is not required to be performed after all encrypted videos are decrypted, and the fixed-point playing effect of the encrypted videos is improved.
Of course, not all advantages described above need to be achieved at the same time in the practice of any one product or method of the present application.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be 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 some embodiments of the present application, and it is also obvious for a person skilled in the art to obtain other embodiments according to the drawings.
Fig. 1 is a flowchart of a fixed-point playing method of an encrypted video according to an embodiment of the present application;
FIG. 2 is a flow chart of a method for determining a target block encrypted video according to the embodiment shown in FIG. 1;
FIG. 3 is a flow chart illustrating a method for determining the data size corresponding to the playing position according to the embodiment shown in FIG. 2;
fig. 4 is a flowchart of a progress bar display manner provided in the embodiment of the present application;
fig. 5 is a flowchart of a processing method of a code stream obtained by decoding according to an embodiment of the present application;
fig. 6 is a flowchart of a video stream decoding and playing manner provided in the embodiment of the present application;
FIG. 7 (a) is a schematic diagram of an electronic codebook mode for encrypting a video to be processed;
FIG. 7 (b) is a schematic diagram of the decryption process for block-encrypted video using the electronic codebook mode;
FIG. 8 (a) is a schematic diagram of an encryption process for a video to be processed in a cipher block chaining mode;
FIG. 8 (b) is a schematic diagram of a process for decrypting block-encrypted video using a cryptographic block-chaining mode;
fig. 9 (a) is a schematic diagram of an encryption process performed on a video to be processed in a ciphertext feedback mode;
FIG. 9 (b) is a diagram illustrating a process for decrypting a block-encrypted video using a ciphertext feedback mode;
fig. 10 (a) is a schematic diagram of an encryption process performed on a video to be processed in an output feedback mode;
fig. 10 (b) is a schematic diagram of a process for decrypting a packet-encrypted video in output feedback mode;
fig. 11 (a) is a schematic diagram of an encryption process performed on a video to be processed by using a counter mode;
fig. 11 (b) is a diagram illustrating a process of decrypting a block-encrypted video using a counter mode;
fig. 12 is another flowchart of a fixed-point playing method for encrypted video according to an embodiment of the present application;
fig. 13 is a schematic structural diagram of a fixed-point playing device for encrypted video according to an embodiment of the present application;
fig. 14 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments that can be derived by one of ordinary skill in the art from the description herein are intended to be within the scope of the present disclosure.
To enhance the security of the video, the video may be encrypted. In the related art, an Encryption method based on a symmetric block Encryption algorithm is commonly used to encrypt a video, for example, a symmetric Encryption algorithm such as SM4.0 and DES (Data Encryption Standard). But compared with the conventional plaintext video, the encrypted video has the problem of difficult fixed-point playing.
In the fixed-point playing mode of the encrypted video, after the packet encrypted video is required to be completely decrypted, the total duration of the video and the mapping index of the code stream and the time scale are obtained. In this way, when the user drags the progress bar to a certain moment, the video frame corresponding to the moment can be determined based on the moment and the mapping index, and then the video is played at a fixed point from the video frame.
The encrypted video is played at fixed points by adopting the above mode, and the total duration of the encrypted video, the code stream plaintext of the encrypted video and the mapping index of the code stream and the time scale need to be obtained. If the cipher text of the encrypted video code stream is too large, the packet encrypted video is usually required to be decrypted and played due to the limited video cache space. Therefore, all code streams of the encrypted video cannot be analyzed at one time, and fixed-point playing cannot be realized because plaintext is not decrypted before a code stream ciphertext even if the total time length of the video and the corresponding relation between the time scale and the video code stream are obtained.
For fixed-point playing of the encrypted video, if the video player is waited to decrypt all the plaintext code streams, the required waiting time depends on the size of the data volume of the video code streams and the decryption efficiency, and the waiting time may be long. The security of the video is reduced by completely decrypting the encrypted video, and the buffer pressure brought to the video player by completely decrypting the encrypted video is large due to the limited buffer space, and the playing fails. Therefore, the fixed-point playing effect of the current encrypted video is not ideal.
In order to solve the problem that the fixed-point playing effect of the encrypted video is not ideal, embodiments of the present application provide a fixed-point playing method and apparatus for the encrypted video, an electronic device, and a storage medium. First, a fixed-point playing method for an encrypted video provided in an embodiment of the present application is described below.
As shown in fig. 1, a fixed-point playing method of an encrypted video includes:
s101, in the process of playing the grouped encrypted video, acquiring a playing position indicated by a fixed-point playing instruction sent by a user based on a progress bar;
the playing position range corresponding to the progress bar is determined based on the total data volume of the grouped encrypted video;
s102, determining a target block encrypted video indicated by the playing position based on the data volume corresponding to the playing position and the data volume of each block encrypted video included in the block encrypted video;
s103, decrypting and playing the target block encrypted video.
As can be seen, in the scheme provided in the embodiment of the present application, in the process of playing the packet encrypted video, the electronic device may acquire a play position indicated by a fixed-point play instruction sent by a user based on a progress bar, where a play position range corresponding to the progress bar is determined based on a total data amount of the packet encrypted video; determining a target packet encrypted video indicated by the playing position based on the data volume corresponding to the playing position and the data volume of each packet encrypted video included in the packet encrypted video; and decrypting and playing the target block encrypted video. Because the playing position range corresponding to the progress bar is determined based on the total data volume of the packet encrypted videos, after the fixed point playing instruction is obtained, the target packet encrypted video indicated by the playing position can be determined based on the data volume corresponding to the playing position indicated by the fixed point playing instruction and the data volume of each packet encrypted video included in the packet encrypted video, and then the target packet encrypted video is decrypted and played without performing fixed point playing after the encrypted video is completely decrypted, so that the fixed point playing effect of the encrypted video is improved.
The fixed-point playing method of the encrypted video is applied to the technical field of video playing, and particularly can be applied to fixed-point playing of the grouped encrypted video.
In the process of playing the block encrypted video, the electronic device may obtain a playing position indicated by a fixed-point playing instruction sent by the user based on the progress bar. Since the playing position range corresponding to the progress bar is determined based on the total data volume of the packet encrypted video, the user is the position of the data volume corresponding to the playing position in the total data volume of the encrypted video based on the playing position indicated by the fixed point playing instruction sent by the progress bar.
For example, the total data amount of the packet-encrypted video is 750MB, then the playing position range corresponding to the progress bar is 0 to 750MB, the electronic device may obtain the playing position indicated by the fixed-point playing instruction issued by the user based on the progress bar, and the data amount corresponding to the playing position may be 340MB, 730MB, and the like.
Because the block encryption video is encrypted by adopting a block encryption algorithm, in the block encryption algorithm, video plaintext needs to be grouped according to a fixed data volume, and then video included in each group is encrypted. Therefore, the packet-encrypted video includes the same amount of data for each packet-encrypted video.
Since the play position range corresponding to the progress bar is determined based on the total data amount of the packet encrypted video, not based on the total duration of the encrypted video, the electronic device may determine the target packet encrypted video indicated by the play position based on the data amount corresponding to the play position and the data amount of each packet encrypted video included in the packet encrypted video, that is, perform step S102.
For example, if the data amount corresponding to the play position is 351MB and the data amount of each packet-encrypted video included in the packet-encrypted video is 2MB, the electronic device may determine the target packet-encrypted video indicated by the play position based on the data amount corresponding to the play position 351MB and the data amount of each packet-encrypted video 2 MB.
Because the data volume corresponding to the playing position belongs to the data volume corresponding to the target block encrypted video on the progress bar, the electronic equipment can decrypt and play the target block encrypted video, and fixed-point playing of the block encrypted video is realized.
It can be seen that, in the embodiment of the present application, since the play position range corresponding to the progress bar is determined based on the total data volume of the packet encrypted videos, after the fixed-point play instruction is obtained, the target packet encrypted video indicated by the play position can be determined based on the data volume corresponding to the play position indicated by the fixed-point play instruction and the data volume of each packet encrypted video included in the packet encrypted video, and then the target packet encrypted video is decrypted and played, without performing fixed-point play after all encrypted videos are decrypted, and without obtaining a mapping index between a video code stream of the encrypted video and a time scale, the fixed-point play effect of the encrypted video is improved, the conditions required for realizing the fixed-point play of the encrypted video are reduced, and the security of performing the fixed-point play of the encrypted video is improved.
As an implementation manner of the embodiment of the present application, as shown in fig. 2, the step of determining the target packet-encrypted video indicated by the playing position based on the data amount corresponding to the playing position and the data amount of each packet-encrypted video included in the packet-encrypted video may include:
s201, determining the data size corresponding to the playing position based on the total data size of the grouped encrypted video, the total length of the progress bar and the length of the progress bar corresponding to the playing position;
the total length of the progress bar and the total data volume of the packet-encrypted video can reflect the data volume represented by the unit length of the progress bar, and then the data volume corresponding to the playing position can be determined based on the total data volume of the packet-encrypted video, the total length of the progress bar and the length of the progress bar corresponding to the playing position.
For example, if the total data amount of the packet-encrypted video is 750MB, the total length of the progress bar is 50cm, and the length of the progress bar corresponding to the playing position is 32cm, the data amount corresponding to the playing position may be determined to be 480MB based on the above three amounts.
S202, calculating a quotient value between the data volume corresponding to the playing position and the data volume of each packet encrypted video included in the packet encrypted video;
since the data volume of each block encrypted video is the same, the electronic device may calculate a quotient between the data volume corresponding to the playing position and the data volume of each block encrypted video included in the block encrypted video, and then determine the target block encrypted video in the manner in step S203 or step S204.
For example, if the data amount corresponding to the play position is 251MB and the data amount of each packet of encrypted video is 2MB, the quotient of 251MB and 2MB can be calculated, and the result is 125.5.
And S203, rounding up the quotient to obtain a numerical value N, determining the Nth group of encrypted videos as the target block encrypted video indicated by the playing position, or rounding down the quotient to obtain a numerical value N, and determining the (N + 1) th group of encrypted videos as the target block encrypted video indicated by the playing position.
In an embodiment, the electronic device may take an upward value from the quotient to obtain a value N, and since the value N is obtained by rounding up the quotient, the nth group of encrypted videos is a target block encrypted video indicated by the playing position, and the electronic device may determine the nth group of encrypted videos as the target block encrypted video indicated by the playing position.
Taking the example in step S202, the electronic device may perform a rounding-up operation on the quotient 125.5, and the result is 126, that is, the value N is 126, then the electronic device may determine the 126 th group of encrypted videos as the target group of encrypted videos indicated by the playing position.
In another embodiment, the electronic device may round the quotient down to obtain a value N, and since the value N is round down the quotient, the next group of the nth group is the target block encrypted video indicated by the play position, and the electronic device may determine the N +1 th group of encrypted videos as the target block encrypted video indicated by the play position.
Taking over the example in step S202, the electronic device may perform a rounding-down operation on the quotient 125.5, and the result is 125, that is, the value N is 125, then the electronic device may determine the 126 th group of encrypted videos as the target group of encrypted videos indicated by the playing position.
It should be noted that, in the above embodiment, the playing position indicated by the pointing playing instruction issued by the user may be at a position in the middle of the target packet-encrypted video, but the electronic device will also perform decryption playing on the target packet-encrypted video, that is, perform decryption playing from a position starting from the target packet-encrypted video. Since the data amount of each block of encrypted video is small, the corresponding time duration is usually about 2 seconds. Therefore, even if the decrypted play is not started from the play position indicated by the fixed point play instruction but is performed from the position where the target packet-encrypted video starts, the fixed point play effect of the encrypted video is the same since this difference is imperceptible to the user.
Furthermore, since the target packetized encrypted video may start with a P-frame, portions of the P-frame will not be able to decode the picture, resulting in a brief loss of picture. Based on the above reasons, that is, the data volume of each block encrypted video is small, so even if the target block encrypted video starts playing with a short picture missing, the duration of the picture missing is of the order of microseconds, and the user cannot perceive the picture missing, so that the effect of fixed-point playing of the encrypted video cannot be affected.
As can be seen, in this embodiment of the present application, the electronic device may determine, based on the total data amount of the block encrypted video, the total length of the progress bar, and the length of the progress bar corresponding to the play position, the data amount corresponding to the play position; calculating a quotient value between the data volume corresponding to the playing position and the data volume of each packet encrypted video included in the packet encrypted video; and rounding up the quotient value to obtain a numerical value N, determining the Nth group of encrypted videos as the target block encrypted video indicated by the playing position, or rounding down the quotient value to obtain a numerical value N, and determining the (N + 1) th group of encrypted videos as the target block encrypted video indicated by the playing position. Since the total length of the progress bar and the total data amount of the packet encrypted video can reflect the data amount represented by the unit length on the progress bar, the data amount corresponding to the playing position can be determined based on the total data amount of the packet encrypted video, the total length of the progress bar and the length of the progress bar corresponding to the playing position. Since the quotient between the data amount corresponding to the playing position and the data amount of each packet encrypted video included in the packet encrypted video may represent the target packet encrypted video indicated by the playing position, the quotient may be calculated to obtain a value N, the value N is rounded up or rounded down, and accordingly, the nth group or the N +1 th group of encrypted videos is determined as the target packet encrypted video indicated by the playing position. Therefore, the target grouping encrypted video indicated by the playing position can be accurately determined, and the fixed-point playing effect of the encrypted video is improved.
As an implementation manner of the embodiment of the present application, as shown in fig. 3, the step of determining the data size corresponding to the playing position based on the total data size of the block-encrypted video, the total length of the progress bar, and the length of the progress bar corresponding to the playing position may include:
s301, calculating the proportion between the total data volume of the grouped encrypted video and the total length of the progress bar;
since the size of the playing window of the encrypted video can be different, correspondingly, the total length of the progress bar can also be changed along with the different size of the playing window. For example, if the encrypted video is played full screen on the display, the total length of the progress bar may be 40cm, 50cm, etc. If the encrypted video is played on the mobile device, the total length of the progress bar may be 7cm, 10cm, etc. Therefore, in order to establish a mapping relationship between the length of the progress bar and the amount of data in the case where the total length of the progress bar is different, the electronic device calculates a ratio between the total amount of data of the block-encrypted video and the total length of the progress bar.
For example, the total data amount of the packet-encrypted video is 750MB, and if the total length of the progress bar is 50cm, the ratio between the total data amount of the packet-encrypted video and the total length of the progress bar is 15MB/cm, that is, the data amount represented by the progress bar per cm is 15MB. If the total length of the progress bar is 10cm, the above ratio is 75MB/cm, i.e. the amount of data represented by the progress bar per cm is 75MB.
S302, determining the product of the length of the progress bar corresponding to the playing position and the proportion as the data volume corresponding to the playing position.
Since the ratio may represent the data amount corresponding to the progress bar of the unit length, the electronic device may multiply the length of the progress bar corresponding to the playing position by the ratio, and use the multiplication result as the data amount corresponding to the playing position.
In step S301, if the total length of the progress bar is 50cm and the ratio is 15MB/cm, if the length of the progress bar corresponding to the playing position is 20cm, the product of the ratio 15MB/cm and the length of the progress bar corresponding to the playing position is 20cm may be calculated to obtain 300MB, and then 300MB is determined as the data size when the length of the progress bar corresponding to the playing position is 20 cm.
As can be seen, in the embodiment of the present application, the electronic device may calculate a ratio between a total data amount of the packet encrypted video and a total length of the progress bar; and determining the product of the length of the progress bar corresponding to the playing position and the proportion as the data volume corresponding to the playing position. Since the ratio between the total data amount of the packet-encrypted video and the total length of the progress bar may represent a mapping relationship between the data amount of the packet-encrypted video and the length of the progress bar in the case that the total length of the progress bar is different, the electronic device may determine the product between the length of the progress bar corresponding to the play position and the ratio as the data amount corresponding to the play position. Therefore, under the condition that the total length of the progress bar is different, the data volume corresponding to the playing position can be determined based on the proportion, and the accuracy rate of calculating the data volume corresponding to the playing position is improved.
As an implementation manner of the embodiment of the present application, as shown in fig. 4, before the step of acquiring the play position indicated by the fixed-point play instruction issued by the user based on the progress bar, the method may further include:
s401, acquiring the total data volume of the block encrypted video;
since the playing position range corresponding to the progress bar is determined based on the total data volume of the packet encrypted video in the embodiment of the application, the electronic device can acquire the total data volume of the packet encrypted video.
For example, if the total data amount of the packet-encrypted video is 750MB, the total data amount of the packet-encrypted video acquired by the electronic device is 750MB.
S402, determining a playing position range corresponding to a progress bar corresponding to the grouped encrypted video based on the total data volume of the grouped encrypted video;
the electronic device may determine, based on the total data amount of the packet-encrypted video, a playing position range corresponding to the progress bar corresponding to the packet-encrypted video. For example, if the total length of the progress bar in the playing window is 50cm and the total data amount of the packet-encrypted video is 750MB, the electronic device may determine that the playing position range corresponding to the progress bar is 0 to 750MB based on the total data amount of the packet-encrypted video being 750MB, that is, the length of the progress bar from 0 to 50cm corresponds to the data amount from 0 to 750MB.
S403, in the playing process of the block encrypted video, displaying a progress bar based on the playing position range.
In the playing process of the block encrypted video, the progress bar is displayed based on the playing position range, so that a user can conveniently and accurately drag the progress bar to the playing position. Therefore, the electronic equipment can display the progress bar based on the playing position range in the playing process of the packet encryption video.
Taking the example in step S402, during playing of the packet-encrypted video, the electronic device may display a progress bar based on the total data amount 750MB of the packet-encrypted video. When the user hovers the mouse at a certain position on the progress bar, the data amount corresponding to the position can be displayed, and if the user hovers the mouse at a position two thirds of the total length of the progress bar, the data amount corresponding to the position can be displayed by 500MB.
Therefore, in the embodiment of the application, the electronic device can acquire the total data volume of the block encrypted video; determining a playing position range corresponding to a progress bar corresponding to the grouped encrypted video based on the total data volume of the grouped encrypted video; and displaying a progress bar based on the playing position range in the playing process of the block encrypted video. In the playing process of the block encrypted video, the progress bar is displayed based on the playing position range, so that a user can conveniently and accurately drag the progress bar to the playing position. Therefore, the electronic equipment can display the progress bar based on the playing position range in the playing process of the packet encryption video. Therefore, the user can send a fixed-point playing instruction based on the progress bar, so that the user can accurately select a playing position to be watched, and the fixed-point playing effect of the encrypted video is improved.
As an implementation manner of the embodiment of the present application, as shown in fig. 5, before the step of acquiring the play position indicated by the fixed-point play instruction issued by the user based on the progress bar, the method may further include:
s501, acquiring a block encrypted video;
the electronic device may acquire the packet-encrypted video to perform the operation in step S502 on the packet-encrypted video.
S502, sequentially decrypting and playing each group encrypted video included in the group encrypted videos, and caching a code stream obtained by decoding in the decryption playing process;
the method comprises the steps that all grouped encrypted videos included in the grouped encrypted videos are decrypted and played in sequence, if a fixed-point playing instruction sent by a user is not obtained in the playing process of the grouped encrypted videos, the electronic equipment can start decryption, decoding and caching from the 1 st group of encrypted videos, and then the cached code stream is read for display. If the electronic device does not always obtain the fixed-point playing instruction sent by the user in the playing process of the encrypted video, the electronic device can decrypt, decode and cache the packet-encrypted video in sequence until all the packet-encrypted videos are played.
Because the decoding progress of each block encrypted video is often faster than the video playing progress, the electronic device can cache the decoded code stream in the decryption playing process. Therefore, when the user does not send a fixed-point playing instruction, the cached code streams can be played in sequence, and the smoothness of playing the encrypted video is improved.
For example, the total data volume of the packet-encrypted video is 600MB, and the electronic device can sequentially decrypt and play each packet-encrypted video included in the packet-encrypted video. When the electronic device plays the packet encrypted video with the data volume of 200MB, if the electronic device has decoded the packet encrypted video with the data volume of 205MB, the electronic device may cache the code stream with the data volume ranging from 200MB to 205 MB.
Before the step of decrypting and playing the target packet-encrypted video, the method may further include:
and clearing the current cached code stream.
In the decryption playing process, the electronic equipment caches the code stream obtained by decoding and plays the cached code stream. In order to avoid that the electronic device decrypts and plays the target block encrypted video after the user sends the fixed-point play instruction, instead of directly decrypting and playing the target block encrypted video, the electronic device can empty the currently cached code stream before decrypting and playing the target block encrypted video.
In the example in the adapting step S502, when the electronic device plays the packet-encrypted video with the data volume of 200MB, the user issues a fixed-point playing instruction, and the data volume corresponding to the playing position indicated by the fixed-point playing instruction is 300MB. Since the electronic device has already decoded and cached the code stream corresponding to the data volume range of 200MB to 205MB, in order to avoid that the electronic device first plays the cached code stream and then decrypts and plays the target packet encrypted video indicated by the playing position, the electronic device may clear the currently cached code stream corresponding to the data volume range of 200MB to 205MB before decrypting and playing the target packet encrypted video.
Therefore, in the embodiment of the application, the electronic equipment can acquire the packet encrypted video; and sequentially decrypting and playing each group of encrypted video included in the group of encrypted videos, and caching a code stream obtained by decoding in the decryption and playing process. Because the decoding progress of each block encrypted video is often greater than the video playing progress, the electronic device can cache the decoded code stream in the decryption playing process. Therefore, when the user does not send a fixed-point playing instruction, the cached code stream can be played in sequence, and the smoothness of playing the encrypted video is improved. The electronic device can clear the currently cached code stream. Because the electronic equipment plays the cached code stream and then decrypts and plays the packet-encrypted video, the currently cached code stream can be emptied before the step of decrypting and playing the target packet-encrypted video. Therefore, after the fixed point playing instruction is obtained, the electronic equipment can directly decrypt and play the target block encrypted video indicated by the playing position indicated by the fixed point playing instruction without playing the cached code stream first, and the fixed point playing effect of the block encrypted video is improved.
As an implementation manner of the embodiment of the present application, as shown in fig. 6, the step of decrypting and playing the target block-encrypted video may include:
s601, acquiring a decryption key corresponding to the target block encrypted video, wherein the decryption key is a decryption key corresponding to an encryption key adopted when block encryption processing is performed on video data to be encrypted to obtain the target block encrypted video;
and performing packet encryption processing on the video to be encrypted to obtain a packet encrypted video. Because the video to be encrypted is encrypted by adopting the block cipher algorithm, the block cipher algorithm can only encrypt the packets with fixed length, namely the block cipher algorithm can only encrypt the packets with fixed data volume. But the length of the video to be encrypted may exceed the packet length of the block cipher and so the block cipher algorithm may be iterated. Therefore, the video to be encrypted with longer length, namely larger data volume can be completely encrypted.
When the block cipher algorithm is used for encryption, the block cipher algorithm may need to be iterated. In this case, the encryption key used for encrypting the video in each packet may be different, and correspondingly, the decryption key corresponding to the encryption key used for encrypting the video in each packet may be different. Therefore, a decryption key corresponding to the target block encrypted video can be obtained, wherein the decryption key is a decryption key corresponding to an encryption key adopted when the block encryption processing is performed on the video data to be encrypted to obtain the target block encrypted video.
S602, decrypting the target block encrypted video by using the decryption key to obtain a decrypted video code stream;
because the target encrypted video is obtained by performing block encryption on the video to be encrypted, the electronic device can decrypt the target block encrypted video by using the decryption key after obtaining the decryption key corresponding to the target block encrypted video, so as to obtain a decrypted video code stream.
S603, decoding and playing the video code stream.
After the electronic device obtains the decrypted video code stream, the video code stream can be decoded and played.
Therefore, in the embodiment of the application, the electronic device can obtain the decryption key corresponding to the target block encrypted video, wherein the decryption key is a decryption key corresponding to an encryption key adopted when the block encryption processing is performed on the video data to be encrypted to obtain the target block encrypted video; decrypting the target block encrypted video by using the decryption key to obtain a decrypted video code stream; and decoding and playing the video code stream. Because the target encrypted video is obtained by performing block encryption on the video to be encrypted, the electronic device can decrypt the target block encrypted video by using the decryption key after obtaining the decryption key corresponding to the target block encrypted video to obtain a decrypted video code stream, and further can decode and play the video code stream. Therefore, the target block encrypted video can be directly decrypted, decoded and played without decrypting all encrypted videos, and the safety of fixed-point playing of the block encrypted video can be improved.
As an implementation manner of the embodiment of the present application, the above-mentioned decryption key is obtained without depending on decryption of other block-encrypted videos;
the decryption key is obtained in a manner independent of decryption of other packet-encrypted videos, that is, when the decryption key of the target packet-encrypted video is obtained, there is no need to decrypt any other packet-encrypted video.
The step of decrypting the target block encrypted video by using the decryption key to obtain a decrypted video code stream may include:
and directly decrypting the target block encrypted video by only adopting the decryption key to obtain a decrypted video code stream.
To improve the security of video, it is necessary to encrypt the video. For the block encrypted video, when the requirement on playing real-time performance is high, that is, when playing needs to be performed while decrypting, the playing mode of the block encrypted video in the related art at present cannot be realized. That is, the current playing method of the encrypted video in the related art cannot simultaneously consider the security, real-time performance and fixed-point playing of the encrypted video.
In the scheme of the embodiment of the application, as the target grouped video is not required to be decrypted when being decrypted, the electronic device can directly decrypt the target grouped encrypted video by only adopting the decryption key, so that the decrypted video code stream can be obtained, and the fixed-point playing of the grouped encrypted video can be realized.
In order to simultaneously give consideration to security, real-time performance and fixed-point playing of the encrypted video, in the embodiment of the application, when the electronic device performs block encryption on the video to be encrypted, an encryption mode which does not need to decrypt any other block encrypted video when decrypting the target block encrypted video can be selected. Therefore, the target block encrypted video can be decrypted only, and any other block encrypted video does not need to be decrypted, so that the fixed-point playing of the encrypted video can be realized. Because other packet-encrypted videos except the target packet-encrypted video are still in an encrypted state, the security of the encrypted video can be met. Meanwhile, only the target block encrypted video can be decrypted without depending on other block encrypted videos, so that the purpose of playing and decrypting the target block encrypted video can be realized, and the real-time property of the block encrypted video can be met.
And performing packet encryption processing on the video to be encrypted to obtain a packet encrypted video. The block encryption process is performed based on a block cipher algorithm. In the process of encrypting the video to be encrypted, the video plaintext of the video to be encrypted can be grouped according to a fixed data amount to obtain plaintext groups. Under the condition that the plaintext length is long, each plaintext block can be encrypted in a block cipher algorithm iteration mode to obtain a ciphertext block corresponding to each plaintext block, the ciphertext block is a block encrypted video, and the block cipher algorithm iteration mode is a block cipher mode.
The block cipher modes used in the present application that satisfy the above conditions will be described below with reference to the accompanying drawings, and it should be noted that the block cipher modes used in the present application may be, but are not limited to, the following five types.
The first block cipher mode is an ECB (Electronic Codebook) mode. In this mode, during encryption, the result of encrypting a plaintext block can be directly used as a ciphertext block, as shown in fig. 7 (a), the electronic device can group the video to be encrypted according to a fixed length, that is, a fixed data size, to obtain plaintext blocks 1-4, where the data size of each plaintext block is the same. Next, the electronic device may encrypt the plaintext blocks 1 to 4 by using the encryption key, respectively, to obtain ciphertext blocks 1 to 4 corresponding to the plaintext blocks 1 to 4, where the ciphertext blocks 1 to 4 are each block encrypted video included in the block encrypted video described in this application, and correspond to the 1 st to 4 th block encrypted video.
Corresponding to the above encryption process, in this mode, when decrypting, as shown in fig. 7 (b), the electronic device may decrypt the ciphertext blocks 1 to 4 respectively by using the decryption key corresponding to the encryption key, so as to obtain corresponding plaintext blocks 1 to 4. The ECB mode is suitable for this application since only the decryption key of the target block-encrypted video is needed in the decryption process. For example, if the target block encrypted video indicated by the play position indicated by the fixed-point play instruction is the ciphertext block 2, the electronic device may decrypt the ciphertext block 2 by using the decryption key corresponding to the encryption key used for encrypting the plaintext block 2 to obtain the plaintext block 2, and then decode and play the plaintext block 2.
The second Block Cipher mode is CBC (Cipher Block Chaining) mode. In this mode, in encryption, as shown in fig. 8 (a), the electronic device performs an exclusive OR (XOR) operation on a plaintext block and a previous ciphertext block, and then performs an encryption operation on the result of the XOR operation. For example, when encrypting the plaintext block 2, the electronic device performs an XOR operation with the plaintext block 2 using the previous ciphertext block, i.e., ciphertext block 1, and then encrypts the result of the XOR operation using the encryption key to obtain ciphertext block 2, i.e., the 2 nd block encrypted video. However, since there is no previous ciphertext block in plaintext block 1, a bit sequence with a length of one block is needed as the previous ciphertext block in plaintext block 1, and the bit sequence is an Initialization Vector, IV (Initialization Vector).
Corresponding to the above encryption process, in this mode, during decryption, as shown in fig. 8 (b), after the encrypted packets, i.e., the block-encrypted video, are decrypted by using the decryption key, an XOR operation is performed on the encrypted packets and the previous group of encrypted packets, and the result of the XOR operation is the plaintext packet corresponding to the encrypted packet. In the mode, when in decryption, the decryption key of the target block encrypted video and the previous group of target block encrypted video are required, and other block encrypted videos except the target block encrypted video do not need to be decrypted, so that fixed-point playing of the encrypted video can be realized.
For example, in fig. 8 (b), the target block encrypted video is a 2 nd block encrypted video, that is, a ciphertext block 2, because in the encryption process, the ciphertext block 2 is obtained by performing an XOR operation on a plaintext block 2 and a ciphertext block 1, and encrypting the operation result. Therefore, after the electronic device obtains the decryption key of the target block encrypted video, the electronic device performs XOR operation on the decrypted code stream and the ciphertext block of the previous group, namely the 1 st group of block encrypted video, namely the ciphertext block 1 in the figure, so as to obtain a plaintext block 2, and the electronic device can decode and play the plaintext block 2.
The third block Cipher mode is a CFB (Cipher FeedBack) mode. In the mode, during encryption, XOR operation is carried out on the plaintext block and the result of the previous group of ciphertext blocks after encryption processing, and then the ciphertext block corresponding to the plaintext block is obtained. As shown in fig. 9 (a), the plaintext blocks 1-4 are XOR-operated with the result of the encryption processing performed on the preceding ciphertext block, so as to obtain ciphertext blocks 1-4 corresponding to the plaintext blocks 1-4. Since the plaintext block 1 does not have the previous group of ciphertext blocks, a bit sequence with a length of one block is required as the previous ciphertext block of the plaintext block 1, and the bit sequence is an Initialization Vector, IV (Initialization Vector).
Corresponding to the above encryption process, in this mode, at the time of decryption, the obtained decryption key is the result of the encryption process performed on the group of block-encrypted videos before the target block-encrypted video. As shown in fig. 9 (b), for example, the target block encrypted video is ciphertext block 2, and the previous group of ciphertext blocks, i.e., ciphertext block 1, encrypts the video for group 1. Since the plaintext block 2 is encrypted, and the ciphertext block 2 is obtained by performing XOR operation on the plaintext block 2 and the ciphertext block 1 after encryption, when decrypting, the obtained decryption key is the ciphertext block 1 after encryption, and the ciphertext block 2 and the ciphertext block 1 after encryption need to be subjected to XOR operation to obtain the plaintext block 2, so as to decode and play the plaintext block 2.
The fourth block cipher mode is an OFB (Output Feedback) mode. In this mode, as shown in fig. 10 (a), in encryption, an Initialization Vector IV (Initialization Vector) is a bit sequence having a length of one packet. And in the encryption process, the plaintext blocks 1-4 and the result of 1-4 times of encryption of the initialization vector are subjected to XOR operation respectively to obtain ciphertext blocks 1-4 corresponding to the plaintext blocks 1-4.
The decryption process in this mode corresponds to the above encryption process, as shown in fig. 10 (b). And in the decryption process, the encrypted text groups 1 to 4 are respectively subjected to XOR operation with the initialization vector after being encrypted for 1 to 4 times to obtain the plaintext groups 1 to 4 corresponding to the encrypted text groups 1 to 4. When the nth group of packet encrypted video is decrypted, the decryption key which needs to be obtained is a result obtained by performing encryption processing on the initialization vector for N times. For example, the target block encrypted video is ciphertext block 2, that is, the 2 nd block encrypted video, the decryption key obtained by the electronic device is the initialization vector after 2 times of encryption, and the initialization vector after 2 times of encryption is subjected to XOR operation with the ciphertext block 2 to obtain plaintext block 2, so as to decode and play the plaintext block 2.
The fifth packet cipher mode is CTR (Counter) mode. In this mode, during encryption, as shown in fig. 11 (a), each packet corresponds to a counter that is sequentially incremented, a key stream is obtained by encrypting the counter, and an XOR operation is performed on the key stream corresponding to each packet and the plaintext of the packet, thereby obtaining the ciphertext of the packet. That is, the ciphertext block is obtained by xoring the bit sequence encrypted by the counter with the plaintext block.
Corresponding to the above encryption process, as shown in fig. 11 (b), the decryption process in this mode is to correspond to one counter that is sequentially accumulated for each packet, and encrypt the counter corresponding to the packet to obtain a decryption key. And then, carrying out XOR operation on the decryption key and the group of ciphertext to obtain a plaintext corresponding to the group of ciphertext. For example, if the target block-encrypted video is ciphertext block 2, the decryption key obtained by the electronic device is the result of the encryption process performed by the counter CTR + 2. Then, the electronic device performs XOR operation on the decryption key and the ciphertext block 2 to obtain a plaintext block 2, and further performs decoding and playing on the plaintext block 2.
Therefore, in the embodiment of the application, the acquiring mode of the decryption key does not depend on the decryption of other block encrypted videos; the electronic device can directly decrypt the target block encrypted video by only adopting the decryption key to obtain a decrypted video code stream. Since only the decryption key of the target block encrypted video needs to be obtained, and any other block encrypted video does not need to be decrypted, fixed-point playing of the encrypted video can be realized. Because other packet encrypted videos are all in an encrypted state, the security of the encrypted video can be improved. Because only the target block encrypted video can be decrypted, the occupied cache space is small, the decryption can be realized while playing, and the real-time property of the block encrypted video is met.
As an implementation manner of this embodiment, a flowchart of a fixed point playing method of a block encrypted video may be as shown in fig. 12. The playing control module, the code stream decoding module and the code stream decryption module can form a decryption player, and the decryption player can realize fixed-point playing of the grouped encrypted video based on an instruction sent by a user.
S1201, a user imports an encrypted video file and inputs a decryption key;
the user can introduce the packet encrypted video and a decryption key required for decrypting the packet encrypted video into the play control module.
S1202, the playing control module sends the absolute path of the file and the decryption key to the code stream decoding module;
the playing control module can send the received absolute path of the file stored in the packet-encrypted video and the decryption key to the code stream decryption module.
S1203, the code stream decryption module decrypts the cipher text in a segmented mode;
the code stream decryption module can decrypt the code stream ciphertext of the block encrypted video in a segmented mode.
S1204, the code stream decipher module sets progress bar as the size R of the encrypted video code stream ciphertext;
after the code stream decryption module acquires the block encrypted video, the total data volume of the block encrypted video can be acquired, the total data volume is R, a progress bar is set to be the encrypted video code stream ciphertext size R, and the range of the progress bar is
Figure 123113DEST_PATH_IMAGE001
That is, the play position range corresponding to the progress bar is set as the total data amount R of the block encrypted video.
S1205, the code stream decryption module sends the decrypted code stream plaintext to the code stream decoding module;
the code stream decryption module can send the decrypted code stream plaintext to the code stream decoding module so that the code stream decoding module can decode the decrypted video code stream.
S1206, the playing control module displays the playing decoding picture;
the code stream decoding module can send the decoded video to the playing control module so that the playing control module can display the played decoded picture.
S1207, the user drags the progress bar to a designated position P;
in the process of playing the group encrypted video, the user can drag the progress bar to a specified position P, that is, the play position indicated by the fixed-point play instruction sent by the user is P, wherein,
Figure 315060DEST_PATH_IMAGE002
s1208, the playing control module feeds back the progress bar P to the code stream decryption module;
the playing control module can feed back the corresponding scale on the progress bar where the P is located to the code stream decryption module, wherein the P is the data volume corresponding to the playing position.
S1209, the code stream decryption module calculates a group G, and the decryption progress is positioned at the initial position of the group G;
the code stream decryption module can calculate the target group encrypted video indicated by the playing position P as the G-th group encrypted video. Specifically, the codestream decryption module may obtain a data amount L of each of the packet-encrypted videos included in the packet-encrypted video, wherein,
Figure 863853DEST_PATH_IMAGE003
. Next, the stream decryption module may calculate the group G to which the target block-encrypted video belongs in two ways.
The first way is to calculate the quotient between the data amount P corresponding to the playing position and the data amount L of each block encrypted video, and rounding up the quotient to obtain the value N, i.e. the value N
Figure 778326DEST_PATH_IMAGE004
And further determining that the obtained rounded-up quotient value is the number of groups to which the target packet encrypted data belongs, namely G = N.
The second way is to calculate the quotient between the data volume P corresponding to the playing position and the data volume L of each block encrypted video, and to round the quotient down to obtain the value N, i.e. the value N
Figure 842097DEST_PATH_IMAGE005
. And further determining that the obtained rounded-down quotient value is added by one to the group number of the target packet encrypted data, namely G = N +1.
After the code stream decryption module determines that the target group-encrypted video is the G-th group-encrypted video, the decryption progress can be positioned to the initial position of the G-th group.
S1210, clearing the decoding cache by the code stream decoding module;
the code stream decryption module may send an instruction to the code stream decoding module to cause the code stream decoding module to clear the decoding cache.
S1211, the code stream decryption module sends the code stream plaintext decrypted from the group G to the code stream decoding module;
the code stream decryption module can send the code stream plaintext decrypted from the group G to the code stream decoding module.
S1212, the playing control module displays the playing decoded picture.
The code stream decoding module can send the decoded video to the playing control module so that the playing control module can display the played decoded picture.
Corresponding to the fixed-point playing method of the encrypted video, an embodiment of the present application further provides a fixed-point playing device of the encrypted video, and the fixed-point playing device of the encrypted video provided in the embodiment of the present application is introduced below.
As shown in fig. 13, a fixed point playback apparatus for encrypted video, the apparatus comprising:
the play control module 1301 is configured to, in a process of playing the packet encrypted video, acquire a play position indicated by a fixed-point play instruction sent by a user based on a progress bar, where a play position range corresponding to the progress bar is determined based on a total data amount of the packet encrypted video;
a code stream decryption module 1302, configured to determine, based on the data amount corresponding to the playing position and the data amount of each packet encrypted video included in the packet encrypted video, a target packet encrypted video indicated by the playing position;
the code stream decryption module 1302 is further configured to decrypt and play the target packet encrypted video.
As can be seen, in the scheme provided in the embodiment of the present application, in the process of playing the packet encrypted video, the electronic device may acquire a play position indicated by a fixed-point play instruction sent by a user based on a progress bar, where a play position range corresponding to the progress bar is determined based on a total data amount of the packet encrypted video; determining a target packet encrypted video indicated by the playing position based on the data volume corresponding to the playing position and the data volume of each packet encrypted video included in the packet encrypted video; and decrypting and playing the target block encrypted video. Because the playing position range corresponding to the progress bar is determined based on the total data volume of the packet encrypted videos, after the fixed point playing instruction is obtained, the target packet encrypted video indicated by the playing position can be determined based on the data volume corresponding to the playing position indicated by the fixed point playing instruction and the data volume of each packet encrypted video included in the packet encrypted video, and then the target packet encrypted video is decrypted and played without performing fixed point playing after the encrypted video is completely decrypted, so that the fixed point playing effect of the encrypted video is improved.
As an implementation manner of this embodiment, the code stream decryption module 1302 may be specifically configured to determine, based on a total data amount of the block-encrypted video, a total length of the progress bar, and a length of the progress bar corresponding to the play position, a data amount corresponding to the play position; calculating a quotient value between the data volume corresponding to the playing position and the data volume of each packet encrypted video included in the packet encrypted video; and rounding up the quotient value to obtain a numerical value N, determining the Nth group of encrypted videos as the target block encrypted video indicated by the playing position, or rounding down the quotient value to obtain a numerical value N, and determining the (N + 1) th group of encrypted videos as the target block encrypted video indicated by the playing position.
As an implementation manner of the embodiment of the present application, the code stream decryption module 1302 may be specifically configured to calculate a ratio between a total data amount of the block-encrypted video and a total length of the progress bar; and determining the product of the length of the progress bar corresponding to the playing position and the proportion as the data volume corresponding to the playing position.
As an implementation manner of the embodiment of the present application, the play control module 1301 may be further configured to obtain a total data amount of the packet-encrypted video; determining a playing position range corresponding to a progress bar corresponding to the grouped encrypted video based on the total data volume of the grouped encrypted video; and displaying a progress bar based on the playing position range in the playing process of the block encrypted video.
As an implementation manner of the embodiment of the present application, the play control module 1301 may be further configured to obtain a packet encrypted video;
the code stream decryption module 1302 may also be configured to sequentially decrypt and play each group encrypted video included in the group encrypted video, and cache a code stream obtained by decoding in a decryption playing process;
the device may further include a code stream decoding module, and the code stream decoding module may be configured to empty the currently cached code stream.
As an implementation manner of the embodiment of the present application, the code stream decryption module 1302 may be configured to obtain a decryption key corresponding to the target block-encrypted video, where the decryption key is a decryption key corresponding to an encryption key used when performing block encryption processing on video data to be encrypted to obtain the target block-encrypted video; decrypting the target block encrypted video by using the decryption key to obtain a decrypted video code stream;
the device can also comprise a code stream decoding module, and the code stream decoding module can be used for decoding and playing the video code stream.
As an implementation manner of the embodiment of the present application, the code stream decryption module 1302 may be configured to directly decrypt the target block encrypted video only by using the decryption key, so as to obtain a decrypted video code stream.
An embodiment of the present application further provides an electronic device, as shown in fig. 14, including:
a memory 1401 for storing a computer program;
the processor 1402 is configured to implement the steps of the fixed-point playing method of the encrypted video according to any of the embodiments described above when executing the program stored in the memory 1401.
The electronic device may further include a communication bus and/or a communication interface, and the processor 1402, the communication interface, and the memory 1401 complete communication with each other through the communication bus.
Therefore, in the scheme provided by the embodiment of the application, the electronic device may obtain, in the process of playing the packet encrypted video, a playing position indicated by a fixed-point playing instruction sent by a user based on a progress bar, where a playing position range corresponding to the progress bar is determined based on a total data volume of the packet encrypted video; determining a target packet encrypted video indicated by the playing position based on the data volume corresponding to the playing position and the data volume of each packet encrypted video included in the packet encrypted video; and decrypting and playing the target block encrypted video. Because the playing position range corresponding to the progress bar is determined based on the total data volume of the packet encrypted videos, after the fixed point playing instruction is obtained, the target packet encrypted video indicated by the playing position can be determined based on the data volume corresponding to the playing position indicated by the fixed point playing instruction and the data volume of each packet encrypted video included in the packet encrypted video, and then the target packet encrypted video is decrypted and played without performing fixed point playing after the encrypted video is completely decrypted, so that the fixed point playing effect of the encrypted video is improved.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this is not intended to represent only one bus or type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), application Specific Integrated Circuits (ASICs), field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
In another embodiment provided by the present application, a computer-readable storage medium is further provided, in which a computer program is stored, and the computer program, when executed by a processor, implements the steps of any one of the above-mentioned methods for fixed-point playing of encrypted video.
In another embodiment provided by the present application, there is also provided a computer program product containing instructions, which when run on a computer, cause the computer to execute the fixed-point playing method of any one of the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a Solid State Disk (SSD), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a … …" does not exclude the presence of another identical element in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the system embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and reference may be made to the partial description of the method embodiment for relevant points.
The above description is only for the preferred embodiment of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims (10)

1. A fixed-point playback method for encrypted video, the method comprising:
in the process of playing the block encrypted video, acquiring a playing position indicated by a fixed point playing instruction sent by a user based on a progress bar, wherein the playing position range corresponding to the progress bar is determined based on the total data volume of the block encrypted video;
determining a target packet encrypted video indicated by the playing position based on the data volume corresponding to the playing position and the data volume of each packet encrypted video included in the packet encrypted video;
and decrypting and playing the target block encrypted video.
2. The method according to claim 1, wherein the step of determining the target block encrypted video indicated by the playing position based on the data amount corresponding to the playing position and the data amount of each block encrypted video included in the block encrypted video comprises:
determining the data volume corresponding to the playing position based on the total data volume of the grouped encrypted video, the total length of the progress bar and the length of the progress bar corresponding to the playing position;
calculating a quotient value between the data volume corresponding to the playing position and the data volume of each packet encrypted video included in the packet encrypted video;
rounding up the quotient to obtain a value N, determining the Nth group of encrypted videos as the target group of encrypted videos indicated by the playing position, or,
and rounding the quotient downwards to obtain a numerical value N, and determining the (N + 1) th group of encrypted videos as the target grouped encrypted video indicated by the playing position.
3. The method according to claim 2, wherein the step of determining the data amount corresponding to the playing position based on the total data amount of the block-encrypted video, the total length of the progress bar, and the length of the progress bar corresponding to the playing position comprises:
calculating a ratio between a total data amount of the packetized encrypted video and a total length of the progress bar;
and determining the product of the length of the progress bar corresponding to the playing position and the proportion as the data volume corresponding to the playing position.
4. The method according to any one of claims 1 to 3, wherein before the step of obtaining the playing position indicated by the pointing playing instruction issued by the user based on the progress bar, the method further comprises:
acquiring the total data volume of the block encrypted video;
determining a playing position range corresponding to a progress bar corresponding to the grouped encrypted video based on the total data volume of the grouped encrypted video;
and displaying a progress bar based on the playing position range in the playing process of the block encrypted video.
5. The method according to any one of claims 1 to 3, wherein before the step of obtaining the playing position indicated by the pointing playing instruction issued by the user based on the progress bar, the method further comprises:
acquiring a packet encryption video;
sequentially decrypting and playing each group encrypted video included in the group encrypted videos, and caching a code stream obtained by decoding in the decryption playing process;
before the step of decrypting and playing the target packet-encrypted video, the method further comprises:
and clearing the current cached code stream.
6. The method according to any one of claims 1-3, wherein the step of playing the target packetized encrypted video by decrypting comprises:
acquiring a decryption key corresponding to the target block encrypted video, wherein the decryption key is a decryption key corresponding to an encryption key adopted when the block encryption processing is performed on video data to be encrypted to obtain the target block encrypted video;
decrypting the target block encrypted video by adopting the decryption key to obtain a decrypted video code stream;
and decoding and playing the video code stream.
7. The method according to claim 6, wherein the decryption key is obtained independently of decryption of other block-encrypted video;
the step of decrypting the target block encrypted video by using the decryption key to obtain a decrypted video code stream comprises the following steps:
and directly decrypting the target block encrypted video only by using the decryption key to obtain a decrypted video code stream.
8. A fixed-point playback apparatus for encrypted video, the apparatus comprising:
the playing control module is used for acquiring a playing position indicated by a fixed-point playing instruction sent by a user based on a progress bar in the playing process of the grouped encrypted video, wherein the playing position range corresponding to the progress bar is determined based on the total data volume of the grouped encrypted video;
the code stream decryption module is used for determining a target block encrypted video indicated by the playing position based on the data volume corresponding to the playing position and the data volume of each block encrypted video included in the block encrypted video;
and the code stream decryption module is also used for decrypting and playing the target packet encrypted video.
9. An electronic device, comprising:
a memory for storing a computer program;
a processor for implementing the method of any one of claims 1 to 7 when executing a program stored in the memory.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method of any one of claims 1 to 7.
CN202211533292.6A 2022-12-02 2022-12-02 Fixed-point playing method and device of encrypted video, electronic equipment and storage medium Active CN115623282B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211533292.6A CN115623282B (en) 2022-12-02 2022-12-02 Fixed-point playing method and device of encrypted video, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211533292.6A CN115623282B (en) 2022-12-02 2022-12-02 Fixed-point playing method and device of encrypted video, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN115623282A true CN115623282A (en) 2023-01-17
CN115623282B CN115623282B (en) 2023-04-07

Family

ID=84880118

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211533292.6A Active CN115623282B (en) 2022-12-02 2022-12-02 Fixed-point playing method and device of encrypted video, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115623282B (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060218607A1 (en) * 2005-03-09 2006-09-28 Vvond, Inc. System and method for trick play of highly compressed video data
CN101027909A (en) * 2004-09-23 2007-08-29 汤姆森许可公司 Inserting metadata for trick play in video transport stream
CN106791923A (en) * 2016-12-30 2017-05-31 中广热点云科技有限公司 A kind of stream of video frames processing method, video server and terminal device
US20170185240A1 (en) * 2015-12-28 2017-06-29 The Directv Group, Inc. Circular video player controls
CN109286820A (en) * 2018-11-29 2019-01-29 无锡华云数据技术服务有限公司 Stream media ordering method and system based on distributed memory system
CN109862424A (en) * 2019-03-29 2019-06-07 北京金山安全软件有限公司 Video playing method and device and electronic equipment
CN110234020A (en) * 2018-03-06 2019-09-13 优酷网络技术(北京)有限公司 Video broadcasting method and device
CN110909371A (en) * 2019-11-21 2020-03-24 广东美的厨房电器制造有限公司 Data encryption method, electronic device and medium
CN112822518A (en) * 2021-04-19 2021-05-18 浙江华创视讯科技有限公司 Video playing method, device, system, electronic equipment and storage medium
US20220207454A1 (en) * 2019-04-30 2022-06-30 Pfizer Inc. Real-time tracking and management of standard workflows
CN114996747A (en) * 2022-08-03 2022-09-02 中科雨辰科技有限公司 Method and system for off-line playing of encrypted file

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101027909A (en) * 2004-09-23 2007-08-29 汤姆森许可公司 Inserting metadata for trick play in video transport stream
US20060218607A1 (en) * 2005-03-09 2006-09-28 Vvond, Inc. System and method for trick play of highly compressed video data
US20170185240A1 (en) * 2015-12-28 2017-06-29 The Directv Group, Inc. Circular video player controls
CN106791923A (en) * 2016-12-30 2017-05-31 中广热点云科技有限公司 A kind of stream of video frames processing method, video server and terminal device
CN110234020A (en) * 2018-03-06 2019-09-13 优酷网络技术(北京)有限公司 Video broadcasting method and device
CN109286820A (en) * 2018-11-29 2019-01-29 无锡华云数据技术服务有限公司 Stream media ordering method and system based on distributed memory system
CN109862424A (en) * 2019-03-29 2019-06-07 北京金山安全软件有限公司 Video playing method and device and electronic equipment
US20220207454A1 (en) * 2019-04-30 2022-06-30 Pfizer Inc. Real-time tracking and management of standard workflows
CN110909371A (en) * 2019-11-21 2020-03-24 广东美的厨房电器制造有限公司 Data encryption method, electronic device and medium
CN112822518A (en) * 2021-04-19 2021-05-18 浙江华创视讯科技有限公司 Video playing method, device, system, electronic equipment and storage medium
CN114996747A (en) * 2022-08-03 2022-09-02 中科雨辰科技有限公司 Method and system for off-line playing of encrypted file

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
谢欣;: "个性化定制手机媒体播放器策划与研发" *

Also Published As

Publication number Publication date
CN115623282B (en) 2023-04-07

Similar Documents

Publication Publication Date Title
US11658814B2 (en) System and method for encryption and decryption based on quantum key distribution
US20120269340A1 (en) Hierarchical encryption/decryption device and method thereof
EP2352251A1 (en) Content decoding apparatus, content decoding method and integrated circuit
CN101272238B (en) Performing AES encryption or decryption in multiple modes with a single instruction
CN105897406B (en) A kind of device for the AES encryption and decryption that bright ciphertext is isometric
CN107222759B (en) Method, system, device and medium for encrypting and decrypting media file
CN110401677B (en) Method and device for acquiring digital copyright key, storage medium and electronic equipment
TWI410104B (en) Method and module for renewing the code of a cryptographic algorithm, method and module for generating a seed, security processor and recording carrier for these methods
CN111698576B (en) Information encryption method, decryption method, server, client, and medium
KR20200115408A (en) Apparatus for performing quorum design on secret key and method thereof
WO2018017168A2 (en) System and method for encryption and decryption based on quantum key distribution
CN104966525A (en) File encryption method and apparatus, and file decryption method and apparatus
JP5080908B2 (en) Confidential information processing apparatus, confidential information processing apparatus, and confidential information processing method
CN109981551A (en) A kind of data transmission system based on block chain, method and relevant device
JP2010165275A (en) Data storage system, information transmission device and server device
KR100773388B1 (en) content combination providing system and method thereof
CN115623282B (en) Fixed-point playing method and device of encrypted video, electronic equipment and storage medium
CN114143576B (en) Video-audio encryption protection on-demand method and device and electronic equipment
CN109271800A (en) A kind of document handling method and device
KR102160294B1 (en) Apparatus for performing quorum design on secret key and method thereof
CN113515773A (en) Image content protection module and method applied to single chip microcomputer system
CN114398656A (en) File encryption method, file decryption method, file encryption device, file decryption device, computer equipment and storage medium
TW201233148A (en) Cascading dynamic crypto periods
US9882960B2 (en) Security framework for media playback
JP2004135005A (en) Data management system, data management method, client terminal, server apparatus, data decoding apparatus, data decoding method, and recording medium

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
GR01 Patent grant
GR01 Patent grant