[go: up one dir, main page]

CN111526404B - Single frame playing method, video playing device, monitoring equipment and storage medium - Google Patents

Single frame playing method, video playing device, monitoring equipment and storage medium Download PDF

Info

Publication number
CN111526404B
CN111526404B CN202010345676.XA CN202010345676A CN111526404B CN 111526404 B CN111526404 B CN 111526404B CN 202010345676 A CN202010345676 A CN 202010345676A CN 111526404 B CN111526404 B CN 111526404B
Authority
CN
China
Prior art keywords
playing
frame
cache
player instance
player
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.)
Active
Application number
CN202010345676.XA
Other languages
Chinese (zh)
Other versions
CN111526404A (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 System Technology Co Ltd
Original Assignee
Hangzhou Hikvision System 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 System Technology Co Ltd filed Critical Hangzhou Hikvision System Technology Co Ltd
Priority to CN202010345676.XA priority Critical patent/CN111526404B/en
Publication of CN111526404A publication Critical patent/CN111526404A/en
Application granted granted Critical
Publication of CN111526404B publication Critical patent/CN111526404B/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/41Structure of client; Structure of client peripherals
    • H04N21/426Internal components of the client ; Characteristics thereof
    • H04N21/42607Internal components of the client ; Characteristics thereof for processing the incoming bitstream
    • 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/44004Processing 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 buffer management, e.g. video decoder buffer or video display buffer

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Television Signal Processing For Recording (AREA)

Abstract

The application provides a single frame playing method, a single frame playing device and a single frame playing storage medium. The method responds to a received single-frame playing instruction, determines a target player example according to the single-frame playing instruction and the current playing state, performs single-frame playing through the target player example, and avoids the problem of data loss caused by sharing a cache region because only one player example is used for playing by selecting the target player example corresponding to the single-frame playing instruction and the current playing state.

Description

Single frame playing method, video playing device, monitoring equipment and storage medium
Technical Field
The present application relates to the field of video processing technologies, and in particular, to a method, an apparatus, a device, and a storage medium for playing a single frame.
Background
With the continuous development of monitoring equipment, users expect that image content can be better observed and more image details can be obtained through the monitoring equipment.
Currently, when a monitoring device plays a monitoring screen, a single frame is often played to help a user to confirm image details. In the single-frame playing process, a single-frame forward playing and a single-frame reverse playing both use a player example, share a buffer area of the player example, store decoded and rendered data streams, when the single-frame reverse playing is switched to the single-frame forward playing, the buffer area in the player example needs to be emptied, and the data streams are obtained by repositioning in a data source according to the pause position of the original single-frame forward playing, and the single-frame forward playing is performed.
Because there is a positioning error in the process of positioning and acquiring the data stream in the data source, the frame loss will occur when the acquired data stream is compared with the pause position of the original single frame forward playing.
Disclosure of Invention
The application provides a single frame playing method, a device, equipment and a storage medium, when different playing modes are switched or single frame forward playing and single frame reverse playing are switched, one of a stream player or a cache player is selected to play the single frame, and the condition of frame loss or frame overlapping can be avoided.
In a first aspect, an embodiment of the present application provides a single frame playing method, including:
responding to a received single-frame playing instruction, and determining a target player instance according to the single-frame playing instruction and the current playing state; the target player instance comprises a stream player instance or a cache player instance, the stream player instance is used for playing cache data in the stream player instance, and the cache player instance is used for playing backup data in a first cache region which is created in advance;
and performing single-frame playing through the target player instance.
In a second aspect, an embodiment of the present application provides a video playing apparatus, including:
the processing module is used for responding to the received single-frame playing instruction and determining a target player example according to the single-frame playing instruction and the current playing state; the target player instance comprises a stream player instance or a cache player instance, the stream player instance is used for playing cache data in the stream player instance, and the cache player instance is used for playing backup data in a first cache region which is created in advance;
and the playing module is used for performing single-frame playing through the target player instance.
In a third aspect, an embodiment of the present application provides a monitoring device, including: a memory and a processor;
the memory stores computer-executable instructions;
the processor executes the computer-executable instructions stored by the memory, so that the processor executes the single frame playing method according to the first aspect.
In a fourth aspect, an embodiment of the present application provides a storage medium, including: a readable storage medium and a computer program for implementing the single frame playback method according to the first aspect.
According to the single-frame playing method, the single-frame playing device, the single-frame playing equipment and the storage medium, a target player example is determined according to a single-frame playing instruction and a current playing state in response to a received single-frame playing instruction, single-frame playing is carried out through the target player example, and the problem of data loss caused by the fact that only one player example is used for playing and a shared cache region is solved by selecting the target player example corresponding to the single-frame playing instruction and the current playing state.
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 introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to these drawings without inventive exercise.
Fig. 1 is a schematic view of an application scenario provided in an embodiment of the present application;
fig. 2 is a schematic flowchart of a single frame playing method according to an embodiment of the present application;
fig. 3 is a schematic flowchart of another single frame playing method according to an embodiment of the present application;
fig. 4 is a schematic flowchart of another single frame playing method according to an embodiment of the present application;
fig. 5 is a schematic flowchart of another single frame playing method according to an embodiment of the present application;
fig. 6 is a schematic flowchart of another single frame playing method according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a video playing apparatus according to an embodiment of the present application;
fig. 8 is a schematic hardware structure diagram of a monitoring device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without making any creative effort belong to the protection scope of the present application.
In order to better view the content of the video to obtain more image details from the video, each frame of image in the video is often played frame by frame through a single frame playing, so that a user can obtain the image details in the video by viewing the content of the video frame by frame.
It should be understood by those skilled in the art that, when the terminal device plays a video, it needs to acquire a video data stream from a data source in real time, pre-process the video data stream, for example, decode and/or render, and display the pre-processed data stream on a display screen of the terminal device, where the terminal device may be any device with a video playing function, such as a mobile phone, a tablet, a computer, a monitoring device, an industrial control device, a medical device, and the like, and the data source may be a server for storing the video data stream, or may be an image acquisition device, or may be a terminal device or a server with an image acquisition device. Generally, to ensure display fluency, when video playing starts, a video data stream is preprocessed, and the processed video data stream is stored in a buffer area of a player instance, so that the player instance plays the video data stream stored in the buffer area, and in the playing process, the video data stream is continuously obtained to be preprocessed, and the preprocessed video data stream is continuously placed in the buffer area of the player instance, so that the player instance performs stream playing, that is, "playing while downloading", and hereinafter, the player instance that performs real-time playing on the video data stream obtained from a data source is referred to as a stream player instance.
Based on the video playing technology of the current stream player example, if single frame playing is to be performed, single frame playing needs to be performed according to the cache data in the cache region in the stream player example, including single frame forward playing (also referred to as single frame forward playing) and single frame reverse playing (also referred to as single frame reverse playing or single frame back), the cache region of the stream player example is shared by both single frame forward playing and single frame reverse playing, then, when single frame reverse playing is required, the pause position of the video played by the stream player example is recorded, single frame reverse playing is performed according to the cache data in the cache region of the stream player example, after the single frame reverse playing is completed, the cache region of the stream player example is emptied, video data stream is obtained from the data source by positioning again according to the recorded pause position, video playing is performed again or single frame forward playing is performed, due to positioning errors, inevitably resulting in frame loss or acquisition of already played frames, resulting in repeated playback. If the stream player performs high-speed playing, in order to achieve the high-speed playing effect, the video data stream stored in the buffer area of the stream player example is a video data stream subjected to frame extraction processing, and if the playback is switched to single-frame reverse playback at this time, single-frame reverse playback is performed based on the buffer data in the buffer area of the stream player example, and frame loss may occur.
The embodiment of the application is applied to the scene of the single-frame playing, by setting a dual player, including a stream player and a cache player, selecting a target player to be used from the dual player according to a single-frame playing instruction and a current playing state, and performing corresponding single-frame playing through the target player, such as single-frame forward playing or single-frame reverse playing, when different playing modes are switched, or when switching is performed between single-frame forward playing and single-frame reverse playing, the integrity of a video data stream is ensured, and the loss of video information caused by frame loss is avoided.
The embodiment of the application provides a possible application scenario by taking the monitoring device as an example.
Fig. 1 is a schematic view of an application scenario provided in an embodiment of the present application, and as shown in fig. 1, a monitoring device 001 includes a preprocessing device 01, a cache 02, a data backup device 04, and a playing device 03. The monitoring device 001 obtains the video data stream from the data source 002, and optionally, the data source 002 may be deployed independently or may be deployed in the monitoring device 001.
The preprocessing device 01 is configured to perform preprocessing on the acquired video data stream, such as at least one of decoding, rendering, and frame extraction, and the preprocessing device 01 sends the preprocessed video data stream to the buffer 02 for data buffering.
The playing device 03 obtains the video data stream to be played from the cache 02 to play, at least two player instances are deployed in the playing device 03, each player instance has a corresponding cache area in the cache 02, and when different player instances are used for playing, cache data in the corresponding cache area is read.
The data backup device 04 is configured to backup the video data stream acquired by the preprocessing device 01, and for example, the data backup device 04 applies for a first buffer area in the buffer 02 to store the backed-up video data stream, which is also referred to as backup data.
Illustratively, when the monitoring device 001 needs to perform single-frame reverse playback according to a single-frame reverse playback instruction input by a user, the playing device 03 obtains backup data from the first cache region in the cache 02, and performs single-frame reverse playback according to the backup data by using a cache player instance deployed in the playing device 03 after preprocessing the backup data.
The following describes a single frame playing method provided in the present application by using several embodiments.
In order to avoid the problem of frame loss when the single player instance performs mode switching in different playing modes, for example, mode switching between normal playing and single frame playing, or mode switching between single frame reverse playing and single frame forward playing, in the embodiment of the present application, a target player instance is determined according to a single frame playing instruction and a current playing state in response to a received single frame playing instruction, and single frame playing is performed through the target player instance.
The single frame playing instruction may be a single frame playing instruction input by a user or a single frame playing instruction received from another device, for example, a single frame forward playing instruction or a single frame reverse playing instruction.
Illustratively, one of the stream player instance and the cache player instance is determined as the target player instance according to the single frame playing instruction and the current playing state. For example, in the process of forward playing, the forward playing includes forward video playing or single-frame forward playing or any double-speed playing, if a single-frame reverse playing instruction input by a user is received, it is determined that the target player example is a cache player example, a stream player example is switched to the cache player example, and single-frame reverse playing is performed through the cache player example; for another example, a single-frame reverse playing is performed through a cache player instance, after all backup data in the first cache region are played, if a single-frame forward playing instruction input by a user is received, the target player instance is determined to be a stream player instance, the cache player instance is switched to be the stream player instance, the single-frame reverse playing and the single-frame forward playing are performed through different player instances respectively, different player instances use different caches to store video data streams to be played during playing, and the problem of frame loss or frame repetition caused by the fact that cache data is cleared during playing mode switching due to the fact that the same player instance is used to share the cache region is solved.
The embodiment of the application is provided with two different player examples, so that the problem of data loss caused by switching of the play modes is solved, and the reliability of data required to be played in each play mode is improved.
Fig. 2 is a schematic flowchart of a single frame playing method provided in the embodiment of the present application, and a process of switching from forward playing to single frame reverse playing in the embodiment of the present application is described with reference to the content shown in fig. 2.
First, during forward play by a stream player instance, a video data stream needs to be acquired from a data source in real time. Further, on one hand, the acquired video data stream is preprocessed in real time, for example, decoding processing and/or rendering processing before playing are performed, the processed video data stream is stored in a cache region corresponding to the stream player instance, and the stream player instance performs forward playing on the cache data by reading the cache data in the corresponding cache; on the other hand, the video data stream acquired from the data source is backed up in the first cache region to obtain backup data.
It should be understood that, during the playing process of the stream player, the video data stream is continuously acquired from the data source, and is stored in the first buffer area, when the first buffer area is full, the newly acquired video data stream is stored over the old video data stream, and the newly acquired video data stream is ensured to be stored in the first buffer area in a rolling storage manner.
Illustratively, if a positioning jump instruction is received in the process of forward playing, for example, the positioning jump instruction triggered by a user changing a playing position by operating a progress bar, the backup data in the first cache region is deleted, and after the stream player starts playing from the playing position indicated by the positioning jump instruction, the acquired video data stream is stored in the first cache region.
Further, in the process of forward playing through the stream player instance, if a single-frame reverse playing instruction input by a user is received, the stream player instance is controlled to pause playing, and the playing position when the playing is paused is recorded as the first playing position, at this time, the stream player instance is switched to the cache player instance, and single-frame reverse playing is performed through the cache player instance. Optionally, the playing position may be recorded by a time point of a video frame corresponding to the playing position.
In a specific implementation manner, the stream player instance is controlled to be switched to the cache player instance, registration of the current play handle to the stream player instance can be cancelled, the cache player instance is applied, the play handle is registered to the cache player instance, and then rendering and playing of the decoded cache data in the cache player instance can be performed through a window corresponding to the play handle. The process of switching the cache player instance to the stream player instance is similar to this, and is not described again.
And the buffer player example performs single-frame reverse play from the first play position according to the backup data stored in the first buffer area. Illustratively, when the cache player instance starts to play back a single frame, the cache player instance preprocesses the backup data in the first cache region, for example, decodes and/or renders the backup data, and sends the preprocessed backup data to the cache region of the cache player instance for storage, and the cache player instance locates a first playing position in the cache data stored in the cache region and starts to play back the single frame from the first playing position.
In the embodiment of the application, the backup data is obtained by adopting the cache player example, the preprocessed backup data is stored in the cache region of the cache player, the single-frame reverse playing is performed according to the cache data of the cache player, the single-frame reverse playing and the cache space of the streaming player used for forward playing are mutually independent, and the cache data played in the forward direction cannot be influenced.
On the basis of the embodiment shown in fig. 2, in the process of playing back a single frame by caching a player instance, if a single frame forward playing instruction input by a user is received, a target player instance still needs to be determined for fluency of mode switching and no frame loss.
Fig. 3 is a schematic flowchart of another single frame playing method provided in an embodiment of the present application, and as shown in fig. 3, in a process of performing single frame reverse playing by a cache player instance, if a single frame forward playing instruction input by a user is received, when the single frame forward playing instruction is received, a playing position of the cache player instance is recorded as a second playing position, and it is determined that a target player instance is still a cache player instance, and the single frame forward playing is performed from the second playing position according to backup data stored in a first cache region by the cache player instance.
Illustratively, after single-frame forward playing is performed through the cache player instance until all the backup data stored in the first cache region are played, assuming that the playing position corresponding to the time point t1 is a frame corresponding to the time point when the backup data are played, the cache player instance is controlled to be switched to the stream player instance, and single-frame forward playing is continued from the time point t1 through the stream player instance, and illustratively, the backup data in the first cache region are updated while the single frame is being played.
On the basis of the above embodiment, it is assumed that in the forward playing process, high-speed playing is performed, the playing speed of the high-speed playing is greater than or equal to a preset speed, for example, 8-speed playing, and in order to implement the high-speed playing, in the preprocessing process of the video data stream, frame extraction processing is performed on the video data stream. Therefore, when the monitoring device switches from the high-speed playing state to the single-frame playing state, the problem of frame missing inevitably exists.
In order to solve the above problem, in the embodiment of the present application, for switching from the high speed playing state to the single frame playing, by switching between the two players and creating the backup buffer area for the first buffer area, the buffer data to be played in different playing modes are not interfered with each other.
For example, after receiving a single frame play instruction, before determining a target player instance according to the single frame play instruction and a current play state, it is necessary to determine whether the current play state is a high speed play state, and if the current play state is the high speed play state, the single frame play method provided in the following embodiments is executed.
Fig. 4 is a schematic flow chart of another single frame playing method provided in this embodiment, and a description is given, with reference to the content shown in fig. 4, of a process of switching from a high speed playing state to a single frame forward playing state in this embodiment of the present application, it should be understood that the high speed playing state is forward playing.
Similarly, during high speed playback by a streaming player instance, a video data stream needs to be acquired from a data source in real time. Further, the acquired video data stream is preprocessed in real time, the preprocessing includes frame extraction processing, decoding processing and/or rendering processing before playing, the processed video data stream is stored in a buffer area corresponding to the stream player instance, as shown in fig. 4, and a frame indicated by a dotted line is a frame discarded in the frame extraction processing.
And performing high-speed playing by the stream player example according to the cache data in the cache region of the stream player example. Illustratively, in the process of playing by the stream player instance, the original video data stream corresponding to the cache data cached by the stream player is backed up in the first cache region, so as to obtain backup data.
In the process of high-speed playing through the stream player example, if a single-frame forward playing instruction input by a user is received, the stream player example is controlled to pause playing, the current playing position is recorded as a third playing position, and the target player example is determined to be the stream player example.
Because the video data stream after frame extraction is cached in the cache region of the stream player instance in the high-speed playing state, if the high-speed playing state is directly switched to the single-frame normal playing state through the stream player instance, the problem of frame missing exists. Therefore, the stream player embodiment obtains the video data stream from the data source again for caching according to the third playing position to obtain new cache data, and then the stream player embodiment performs single-frame normal playing from the third playing position according to the cache data.
Illustratively, in the process of playing a single frame forward through the stream player, the video data stream acquired when the single frame is played forward is backed up to the first buffer area. Since the video data stream is obtained by repositioning the video data stream during the single frame being played after the high-speed playing, the start position of the video data stream obtained by repositioning the single frame during the single frame being played may be before the third playing position during the pause of the high-speed playing due to unavoidable positioning errors, and thus, when the video data stream obtained during the single frame being played is continuously stored in the first buffer area, the backup data in the first buffer area may have frame overlapping. In contrast, in the embodiment of the present application, in the process of switching from the high speed playing state to the single frame normal playing state, the first buffer area is switched, for example, the original first buffer area is used as the backup buffer area, a new buffer area with the same size as the original first buffer area is used as the new first buffer area, and the original video data stream acquired when the single frame is normal playing is backed up to the new first buffer area. The situation that the frames are overlapped when the cache player plays according to the backup data in the first cache region can be avoided.
After a new first buffer area is created, the video data stream corresponding to the buffer data played by the stream player is stored in the new first buffer area, and when the new first buffer area is full, the newly acquired video data stream is stored in a manner of rolling storage to cover the old video data stream.
Illustratively, if a positioning jump instruction is received in the forward playing process, for example, the positioning jump instruction triggered by a user changing the playing position by operating a progress bar, the backup data stored in the first cache region is deleted, and the backup cache region is deleted; and after the stream player example starts playing from the playing position indicated by the positioning jump instruction, storing the acquired video data stream to the first cache region.
Based on the embodiment shown in fig. 4, fig. 5 is a schematic flowchart of another single frame playing method provided in the embodiment of the present application, and a process of switching from a high speed playing state to a single frame reverse playing state in the embodiment of the present application is described with reference to the content shown in fig. 5.
In the process of performing high-speed playing through the stream player instance, if a single-frame reverse playing instruction input by a user is received, the stream player instance is controlled to pause playing, the current playing position is recorded as a fourth playing position, and the target player instance is determined to be a cache player instance. Illustratively, during the high-speed playing process, the video data stream corresponding to the cache data cached by the stream player is backed up in the first cache region in real time.
Further, the example of the control stream player is switched to the example of the cache player, and the switching method is similar to that in the above embodiment, and is not described here again.
And performing single-frame reverse playing from the fourth playing position according to the backup data in the first buffer area by the buffer player example. Illustratively, the backup data in the first buffer area is preprocessed by the buffer player instance, for example, decoding and/or rendering before playing, the preprocessed backup data is buffered in the buffer area of the buffer player, and single-frame reverse playing is performed from the fourth playing position of the backup data by the buffer player instance.
In the embodiment of the application, when the high-speed playing state is switched to the single-frame reverse playing, the stream player example is switched to the cache player example, the cache player example performs the single-frame reverse playing according to the backup data in the first cache region, and the frame missing situation does not occur.
Based on the embodiments shown in fig. 4 and fig. 5, fig. 6 is a schematic flowchart of another single frame playing method provided in the embodiment of the present application, and the embodiment of the present application describes a process of switching from a high speed playing state to a single frame forward playing state and then switching to a single frame reverse playing state.
The process of switching from the high-speed playing state to the single-frame normal playing in the embodiment of the present application is already described in the embodiment shown in fig. 4, and is not described herein again.
The process of switching from the single-frame forward playing to the single-frame reverse playing in the embodiment of the present application is described with reference to fig. 6. In the process of carrying out single-frame forward playing according to the cache data from the third playing position through the stream player, if a single-frame reverse playing instruction input by a user is received, the stream player example is controlled to pause playing, the current playing position is recorded as a fourth playing position, and the target player example is determined to be the cache player example.
Furthermore, the backup data is preprocessed through the cache player example according to the backup data in the first cache region, then the single-frame reverse playing is carried out from the fourth playing position, and when the backup data is played to the third playing position, the backup data in the first cache region is completely played.
Further, whether a backup cache region exists is determined, and if the backup cache region exists, single-frame reverse playing is performed according to backup data in the backup cache region through a cache player example; if the backup cache region does not exist, ending the process of single-frame reverse playing after the backup data in the first cache region is played.
It should be understood that in the embodiment shown in fig. 5, if the high-speed playing state is directly switched to the single-frame reverse playing state, there is no backup buffer area. In the embodiment shown in fig. 6, because the high-speed playing state is switched to the single-frame normal playing state first and then to the single-frame reverse playing state, a backup cache region exists, and therefore in this embodiment of the present application, when the high-speed playing state is played to the third playing position by the cache player instance, the backup data is continuously acquired from the backup cache region, and after the backup data is preprocessed, the single-frame reverse playing is performed from the third playing position by the cache player instance until the backup data in the backup cache region is played completely.
On the basis of the embodiment shown in fig. 5 or fig. 6, in the process of playing back a single frame by using the buffer player instance, if a single frame forward playing instruction input by a user is received, the buffer player instance is controlled to pause playing, and the current playing position is recorded as a fifth playing position, and the target player instance is determined to be the buffer player instance.
Further, the buffer player instance is controlled to play the single frame from the fifth play position of the backup data in the first buffer area or the backup buffer area. And if the playing of the backup data in the first buffer area and/or the backup buffer area is finished, controlling the buffer player example to be switched into the streaming player example, and then carrying out single-frame normal playing through the streaming player example.
The process of the embodiment of the present application is similar to that of the embodiment shown in fig. 3, and is not described herein again.
On the basis of the embodiments shown in fig. 1 to 6, in the embodiments of the present application, the size of the first buffer area is dynamically determined, so that the size of the first buffer area can be adaptively adjusted according to the resolution of the video data stream to be played, and a fixed size is avoided for the first buffer area, so that when the resolution of the video data stream to be played is higher, a smaller buffer area cannot be applied to buffer enough data, or when the resolution of the video data stream to be played is lower, a larger buffer area is applied to cause resource waste.
Illustratively, when a video playing instruction is received for the first time, a video data stream is acquired from a data source and stored in a default cache area in real time, wherein the size of the default cache area is a preset fixed value, for example, 5 MB. And when the stream player plays, determining the size of a first cache region according to the resolution of a video data stream to be played, applying for the first cache region according to the determined size of the first cache region, sending the cache data in the default cache region to the first cache region, enabling the first cache region to replace the default cache region to continue caching the data played by the stream player, and deleting the default cache region.
The embodiment of the application provides a possible implementation manner for determining the size of the first buffer area according to the resolution of the video data stream to be played. Illustratively, the resolution of the cache data in the stream player example is obtained, and the size of the first cache region is determined according to the resolution, the corresponding relationship between the preset resolution and the code rate, and the preset cache duration.
The corresponding relationship between the resolution and the code rate may be a pre-established index table, the corresponding relationship between the resolution and the code rate may be adjusted according to different practical application scenarios, and the corresponding relationship between the resolution and the code rate may be that a resolution interval corresponds to one code rate, or each resolution corresponds to one code rate, which is not required by the present solution.
The buffer duration is the duration of storing the video data stream set according to the actual application scene.
For example, the resolution of the cache data obtained from the stream player example is 1920 × 1080, it is determined through the index table that the code rate corresponding to 1920 × 1080 is 4Mbps, and if the preset cache duration is 20s, the size Buffer of the first cache region is calculated as: buffer is 4Mbit/s × 20s ÷ 8bit/Byte is 10 MB. Accordingly, a segment of cache region with the size of 10MB is applied as a first cache region to replace the default cache region.
Fig. 7 is a schematic structural diagram of a video playback device according to an embodiment of the present application, and as shown in fig. 7, the video playback device 10 includes:
the processing module 11 is configured to respond to a received single frame playing instruction, and determine a target player instance according to the single frame playing instruction and a current playing state; the target player instance comprises a stream player instance or a cache player instance, the stream player instance is used for playing cache data in the stream player instance, and the cache player instance is used for playing backup data in a first cache region which is created in advance;
and the playing module 12 is configured to perform single frame playing through the target player instance.
The video playing device 10 provided in the embodiment of the present application includes a processing module 11 and a playing module 12, and in response to a received single frame playing instruction, according to the single frame playing instruction and a current playing state, determines an example of a target player, and performs single frame playing through the example of the target player, and by selecting the example of the target player corresponding to the single frame playing instruction and the current playing state, it is avoided that only one player example is used for playing, which results in a problem of data loss due to a shared buffer area.
In one possible design, the processing module 11 is further configured to: determining whether the current playing state is a high-speed playing state, wherein the playing speed of the high-speed playing state is greater than or equal to a preset speed.
In one possible design, the processing module 11 is specifically configured to:
in the process of forward playing through the stream player example, in response to a single-frame reverse playing instruction input by a user, controlling the stream player example to pause playing and recording the current playing position as a first playing position; wherein the single frame playing instruction comprises the single frame reverse playing instruction;
determining that the target player instance is the cache player instance.
In one possible design, the playing module 12 is specifically configured to:
controlling the stream player instance to be switched to the cache player instance;
and performing single-frame reverse play from the first play position through the cache player instance according to the backup data in the first cache region.
In one possible design, the processing module 11 is specifically configured to: in the process of single-frame reverse playing through the cache player example, responding to a single-frame forward playing instruction input by a user, controlling the cache player example to pause playing, and recording the current playing position as a second playing position; wherein the single-frame playing instruction comprises the single-frame forward playing instruction;
determining that the target player instance is a cached player instance.
In one possible design, the playing module 12 is specifically configured to: and controlling the buffer player instance to perform single-frame forward playing from the second playing position of the backup data.
In one possible design, the playing module 12 is further configured to:
if the backup data in the first cache region is played completely, controlling the cache player example to be switched to the stream player example;
a single frame is played through the streaming player instance.
In one possible design, the processing module 11 is further configured to:
when a video playing instruction is received, determining the size of the first cache area according to the resolution of a video data stream to be played;
applying for the first cache region according to the size of the first cache region;
and sending the cache data in the default cache region to the first cache region, and deleting the default cache region.
In one possible design, the processing module 11 is specifically configured to:
acquiring the resolution of the cache data in the stream player example;
and determining the size of the first cache region according to the corresponding relation among the resolution, the preset resolution and the code rate and the preset cache duration.
In one possible design, the processing module 11 is specifically configured to:
in the process of high-speed playing through the stream player example, in response to a single-frame forward playing instruction input by a user, controlling the stream player example to pause playing and recording the current playing position as a third playing position; wherein the single-frame playing instruction comprises the single-frame forward playing instruction;
determining that the target player instance is a streaming player instance.
In one possible design, the playing module 12 is specifically configured to:
obtaining a video data stream from a data source for caching by the stream player instance according to the third playing position to obtain cache data, and backing up the cache data to the first cache region;
and carrying out single-frame forward playing from the third playing position through the stream player instance according to the cache data.
In one possible design, the processing module 11 is specifically configured to:
in the process of high-speed playing through the stream player example, in response to a single-frame reverse playing instruction input by a user, controlling the stream player example to pause playing and recording the current playing position as a fourth playing position; wherein the single frame playing instruction comprises the single frame reverse playing instruction;
determining that the target player instance is a cached player instance.
In one possible design, the playing module 12 is specifically configured to:
controlling the stream player instance to be switched to the cache player instance;
and performing single-frame reverse playing from the fourth playing position according to the backup data in the first buffer area by the buffer player example.
In one possible design, the playing module 12 is further configured to:
determining whether a backup cache area exists;
if so, after the backup data in the first cache region is played, performing single-frame reverse playing according to the backup data in the backup cache region through the cache player example;
otherwise, after the backup data in the first cache region is played, ending the process of single frame reverse playing.
In one possible design, the processing module 11 is specifically configured to:
in the process of single-frame reverse playing through the cache player example, responding to a single-frame forward playing instruction input by a user, controlling the cache player example to pause playing, and recording the current playing position as a fifth playing position;
determining that the target player instance is a cached player instance.
In one possible design, the playing module 12 is specifically configured to:
and controlling the cache player instance to perform single-frame normal playing from the fifth playing position of the backup data in the first cache region or the backup cache region.
In one possible design, the playing module 12 is further configured to:
if the playing of the backup data in the first cache region and/or the backup cache region is finished, controlling the cache player instance to be switched to the stream player instance;
a single frame is played through the streaming player instance.
In one possible design, the processing module 11 is further configured to:
when a video playing instruction is received, video data streams in a data source are acquired in real time;
saving the data stream to the first cache region;
and after preprocessing the data stream, storing the data stream to a cache area in the stream player example.
The video playing apparatus provided in the foregoing embodiment may implement the technical solutions of the foregoing method embodiments, and the implementation principle and technical effects are similar, which are not described herein again.
Referring to fig. 8, the embodiment of the present application is only described with reference to fig. 8 as an example, and does not mean that the present application is limited thereto.
Fig. 8 is a schematic hardware structure diagram of a monitoring device according to an embodiment of the present application. As shown in fig. 8, in general, the monitoring apparatus 600 includes: a processor 601 and a memory 602.
The processor 601 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and so on. The processor 601 may be implemented in at least one hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), and a PLA (Programmable Logic Array). The processor 601 may also include a main processor and a coprocessor, where the main processor is a processor for Processing data in an awake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 601 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed on the display screen. In some embodiments, processor 601 may also include an AI (Artificial Intelligence) processor for processing computational operations related to machine learning.
Memory 602 may include one or more computer-readable storage media, which may be non-transitory. The memory 602 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in memory 602 is used to store at least one instruction for execution by processor 601 to implement the single frame playback method provided by the method embodiments herein.
In some embodiments, the monitoring device 600 may further optionally include: a peripheral interface 603 and at least one peripheral. The processor 601, memory 602, and peripheral interface 603 may be connected by buses or signal lines. Various peripheral devices may be connected to the peripheral interface 603 via a bus, signal line, or circuit board. Specifically, the peripheral device includes: at least one of an image acquisition device 604 and a display 605.
The peripheral interface 603 may be used to connect at least one peripheral related to I/O (Input/Output) to the processor 601 and the memory 602. In some embodiments, the processor 601, memory 602, and peripheral interface 603 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 601, the memory 602, and the peripheral interface 603 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.
The image capturing device 604 is used for capturing video data and providing video data stream for the monitoring device. The image capture device 604 may be a camera or a camera assembly. In some embodiments, the number of the cameras in the camera assembly may be multiple, and each of the cameras is any one of a main camera, a depth-of-field camera, a wide-angle camera, and a telephoto camera, so as to implement that the main camera and the depth-of-field camera are fused to implement a background blurring function, and the main camera and the wide-angle camera are fused to implement a panoramic shooting function and a VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, the camera assembly may further include a flash. The flash lamp can be a monochrome temperature flash lamp or a bicolor temperature flash lamp. The double-color-temperature flash lamp is a combination of a warm-light flash lamp and a cold-light flash lamp, and can be used for light compensation at different color temperatures.
The display 605 is used to display a UI (User Interface). The UI may include graphics, text, icons, video, and any combination thereof. When the display screen 605 is a touch display screen, the display screen 605 also has the ability to capture touch signals on or over the surface of the display screen 605. The touch signal may be input to the processor 601 as a control signal for processing. At this point, the display 605 may also be used to provide virtual buttons and/or a virtual keyboard, also referred to as soft buttons and/or a soft keyboard. In some embodiments, the display 605 may be one, providing the front panel of the monitoring device 600; in other embodiments, the display screen 605 may be at least two, respectively disposed on different surfaces of the monitoring device 600 or in a folded design; in still other embodiments, the display 605 may be a flexible display disposed on a curved surface or on a folded surface of the monitoring device 600. Even more, the display 605 may be arranged in a non-rectangular irregular pattern, i.e., a shaped screen. The Display 605 may be made of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), and the like.
Those skilled in the art will appreciate that the configuration shown in FIG. 8 is not intended to be limiting of monitoring device 600, and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components may be used.
The embodiment of the present application further provides a non-transitory computer-readable storage medium, and when instructions in the storage medium are executed by a processor of a mobile terminal, the terminal is enabled to execute the single frame playing method provided by the foregoing embodiment.
The computer-readable storage medium in this embodiment may 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 is integrated with one or more available media, and the available media may be magnetic media (e.g., a floppy disk, a hard disk, a magnetic tape), optical media (e.g., a DVD), or semiconductor media (e.g., an SSD).
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
The embodiment of the present application further provides a computer program product containing instructions, which when run on a computer, causes the computer to execute the single frame playing method provided by the foregoing embodiment.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (10)

1. A method for playing a single frame, comprising:
responding to a received single-frame playing instruction, and determining a target player instance according to the single-frame playing instruction and the current playing state; the target player instance comprises a stream player instance or a cache player instance, the stream player instance is used for playing cache data in the stream player instance, and the cache player instance is used for playing backup data in a first cache region which is created in advance;
performing single-frame playing through the target player instance;
and when the playing state is forward playing and the single-frame playing instruction comprises a single-frame reverse playing instruction, the target player instance is the cache player instance, and single-frame reverse playing is carried out through the cache player instance.
2. The method of claim 1, wherein determining the target player instance according to the single frame play instruction and the current play state in response to the single frame play instruction comprises:
in the process of forward playing through the stream player example, in response to a single-frame reverse playing instruction input by a user, controlling the stream player example to pause playing and recording the current playing position as a first playing position; wherein the single frame playing instruction comprises the single frame reverse playing instruction;
determining that the target player instance is the cache player instance;
the performing single frame play by the target player instance includes:
controlling the stream player instance to be switched to the cache player instance;
and performing single-frame reverse playing from the first playing position through the cache player instance according to the backup data in the first cache region.
3. The method of claim 1, wherein determining the target player instance according to the single frame play instruction and the current play state in response to the single frame play instruction comprises:
in the process of single-frame reverse playing through the cache player example, responding to a single-frame forward playing instruction input by a user, controlling the cache player example to pause playing, and recording the current playing position as a second playing position; wherein the single-frame playing instruction comprises the single-frame forward playing instruction;
determining that the target player instance is a cache player instance;
the performing single frame play by the target player instance includes:
controlling the cache player instance to perform single-frame forward playing from the second playing position of the backup data;
when the backup data in the first cache region is played, controlling the cache player example to be switched to the stream player example;
a single frame is played through the streaming player instance.
4. The method of claim 1, wherein determining the target player instance according to the single frame play instruction and the current play state in response to the single frame play instruction comprises:
in the process of high-speed playing through the stream player example, in response to a single-frame forward playing instruction input by a user, controlling the stream player example to pause playing and recording the current playing position as a third playing position; the playing speed of the high-speed playing is greater than or equal to a preset speed, and the single-frame playing instruction comprises the single-frame forward playing instruction;
determining that the target player instance is a stream player instance;
the performing single frame play by the target player instance includes:
obtaining a video data stream from a data source for caching by the stream player instance according to the third playing position to obtain cache data, and backing up the cache data to the first cache region;
and carrying out single-frame forward playing from the third playing position through the stream player instance according to the cache data.
5. The method of claim 4, wherein prior to the backing up the cached data to the first cache region, the method further comprises:
and taking the first cache region as a backup cache region, and applying for a new cache region with the same size as the first cache region.
6. The method of claim 2, wherein after the single frame rewind from the first play position according to the backup data in the first buffer area by the buffer player instance, the method further comprises:
determining whether a backup cache area exists;
if so, after the backup data in the first cache region is played, performing single-frame reverse playing according to the backup data in the backup cache region through the cache player example;
otherwise, after the backup data in the first cache region is played, ending the process of single frame reverse playing.
7. The method of any of claims 1 to 6, wherein prior to said determining a target player instance in response to a single frame play instruction based on the single frame play instruction and a current play state, the method further comprises:
acquiring the resolution of cache data in the stream player example;
determining the size of the first cache region according to the corresponding relation between the resolution ratio and the preset resolution ratio and the code rate and the preset cache duration;
creating the first cache region according to the size of the first cache region;
and sending the cache data in the default cache region to the first cache region, and deleting the default cache region.
8. A video playback apparatus, comprising:
the processing module is used for responding to the received single-frame playing instruction and determining a target player example according to the single-frame playing instruction and the current playing state; the target player instance comprises a stream player instance or a cache player instance, the stream player instance is used for playing cache data in the stream player instance, and the cache player instance is used for playing backup data in a first cache region which is created in advance;
the playing module is used for playing the single frame through the target player example;
and when the playing state is forward playing and the single-frame playing instruction comprises a single-frame reverse playing instruction, the target player instance is the cache player instance, and single-frame reverse playing is carried out through the cache player instance.
9. A monitoring device, comprising: a memory and a processor;
the memory stores computer-executable instructions;
the processor executes the computer-executable instructions stored by the memory, causing the processor to perform the single frame playback method of any one of claims 1 to 7.
10. A storage medium, comprising: a readable storage medium and a computer program for implementing the single frame playback method of any one of claims 1 to 7.
CN202010345676.XA 2020-04-27 2020-04-27 Single frame playing method, video playing device, monitoring equipment and storage medium Active CN111526404B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010345676.XA CN111526404B (en) 2020-04-27 2020-04-27 Single frame playing method, video playing device, monitoring equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010345676.XA CN111526404B (en) 2020-04-27 2020-04-27 Single frame playing method, video playing device, monitoring equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111526404A CN111526404A (en) 2020-08-11
CN111526404B true CN111526404B (en) 2022-07-08

Family

ID=71905385

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010345676.XA Active CN111526404B (en) 2020-04-27 2020-04-27 Single frame playing method, video playing device, monitoring equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111526404B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112040274A (en) * 2020-09-10 2020-12-04 杭州叙简科技股份有限公司 Web page video single-frame playing method based on webrtc
CN114302180B (en) * 2021-12-31 2024-02-06 深圳市创维软件有限公司 Video single-frame playing method, device, server, system and storage medium
CN114385109B (en) * 2022-01-12 2024-01-09 北京达佳互联信息技术有限公司 Audio playing processing method and device, electronic equipment and storage medium
CN117891377B (en) * 2024-03-14 2024-07-26 荣耀终端有限公司 Display method and electronic device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106231372A (en) * 2016-08-30 2016-12-14 北京奇艺世纪科技有限公司 The synchronous broadcast method of a kind of Online Video and device
CN108810572A (en) * 2018-06-14 2018-11-13 深圳市茁壮网络股份有限公司 A kind of video broadcasting method and device
CN109963185A (en) * 2017-12-26 2019-07-02 杭州海康威视数字技术股份有限公司 Video data transmitting method, image display method, device, system and equipment
CN110334246A (en) * 2019-07-08 2019-10-15 北京字节跳动网络技术有限公司 A kind of data request processing method, apparatus, terminal device and storage medium

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4556195B2 (en) * 2008-02-15 2010-10-06 カシオ計算機株式会社 Imaging device, moving image playback device, and program
CN102789804B (en) * 2011-05-17 2016-03-02 华为软件技术有限公司 Video broadcasting method, player, monitor supervision platform and audio/video player system
US9344755B2 (en) * 2013-09-30 2016-05-17 Sonos, Inc. Fast-resume audio playback
US9338486B2 (en) * 2014-09-02 2016-05-10 Ericsson Ab Optimizing ABR segment sizes for mobile video outage coverage in an ABR streaming network
CN105898625B (en) * 2016-04-29 2020-03-17 腾讯科技(深圳)有限公司 Playing processing method and terminal equipment
CN107426603B (en) * 2016-05-24 2020-01-17 杭州海康威视数字技术股份有限公司 Video playing method and device
CN110351553B (en) * 2018-04-08 2023-09-22 腾讯科技(深圳)有限公司 Video back-playing and video back-playing data processing method and device and computer equipment
CN110366033B (en) * 2019-07-17 2021-10-22 腾讯科技(深圳)有限公司 Video playing method, device, equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106231372A (en) * 2016-08-30 2016-12-14 北京奇艺世纪科技有限公司 The synchronous broadcast method of a kind of Online Video and device
CN109963185A (en) * 2017-12-26 2019-07-02 杭州海康威视数字技术股份有限公司 Video data transmitting method, image display method, device, system and equipment
CN108810572A (en) * 2018-06-14 2018-11-13 深圳市茁壮网络股份有限公司 A kind of video broadcasting method and device
CN110334246A (en) * 2019-07-08 2019-10-15 北京字节跳动网络技术有限公司 A kind of data request processing method, apparatus, terminal device and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
嵌入式视频监控系统研究与客户端播放器开发;费克玲;《中国优秀硕士硕士学位论文全文数据库(电子期刊)信息科技辑》;20070315;全文 *

Also Published As

Publication number Publication date
CN111526404A (en) 2020-08-11

Similar Documents

Publication Publication Date Title
CN111526404B (en) Single frame playing method, video playing device, monitoring equipment and storage medium
US8787726B2 (en) Streaming video navigation systems and methods
US10032478B2 (en) Video replay systems and methods
US10531149B2 (en) Method and system for managing buffers
JP2008046672A (en) Electronic equipment and starting method
US10715785B2 (en) Electronic device and method for controlling the same
US12003884B2 (en) Video processing method and apparatus, device, storage medium and computer program product
US9055272B2 (en) Moving image reproduction apparatus, information processing apparatus, and moving image reproduction method
JP6137980B2 (en) Recording apparatus and control method thereof
CN116457067A (en) Rendering and editing recent content in a window during execution of a content application
WO2024109701A1 (en) Video encoding/decoding method and apparatus, electronic device, and medium
US10645306B2 (en) Method for producing media file and electronic device thereof
JP2015029231A (en) Recording apparatus and control method therefor
CN115002335B (en) Video processing method, apparatus, electronic device, and computer-readable storage medium
CN111314777B (en) Video generation method and device, computer storage medium and electronic equipment
WO2018094261A1 (en) Method and system for managing buffers
CN115361579B (en) Video transmission and display method and device, electronic equipment and storage medium
EP2166536A1 (en) Video data processor with frame buffer size adapted to the type of processing
CN113691756B (en) Video playback method, device and electronic equipment
CN116095250A (en) Method and device for video cropping
KR20200107289A (en) Apparatus and method for displaying augmented reality contents
JP2007174195A (en) Electronic equipment, and automatic scene skipping method, and program
JPH10191257A (en) Digital video decoding apparatus and digital video decoding method
JP2018195946A (en) Recording device
JP5188209B2 (en) Display control apparatus, method, and program

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