Disclosure of Invention
An object of the embodiments of the present application is to provide a video playing method and an electronic device, so as to reduce consumption of computing resources when determining a motion route of a target object in a scene according to a multi-path scene video. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present application provides a video playing method, where the method includes:
acquiring multiple paths of videos obtained by shooting a preset scene respectively by a plurality of acquisition devices arranged for the preset scene; each acquisition device is used for shooting one sub-scene in the preset scene, each acquisition device acquires one path of video, and shooting view fields of different acquisition devices are not completely overlapped;
identifying a target object in the multi-path video to obtain N paths of video fragments containing the target object; wherein N is an integer greater than or equal to 1;
setting a playing window for displaying each video clip in the N video clips;
Playing the N paths of video clips in the N set playing windows;
the positions of the N playing windows are distributed and arranged along the direction of the movement route of the target object in the preset scene; and the time periods of the appearance of the target object displayed in the N playing windows are continuous, and in any two adjacent playing windows, the final position of the appearance of the target object displayed in the previous playing window is included in each position of the appearance of the target object displayed in the next playing window, so that the movement routes of the target object displayed in the N playing windows form a continuous movement route.
Optionally, in a specific implementation manner, playing the N paths of video clips in the set N playing windows includes:
in the set N playing windows, simultaneously starting to play the N paths of video clips and simultaneously ending to play the N paths of video clips;
the starting time of the N paths of video clips is the same, and the ending time of the N paths of video clips is the same.
Optionally, in a specific implementation manner, playing the N paths of video clips in the set N playing windows includes:
In the N set playing windows, the N paths of video clips are sequentially and independently played according to the sequence from the early to the late of the starting time of the N paths of video clips;
the starting time of each path of video clips is as follows: the target object starts to appear in the video of the path of video fragments, and the termination time of each path of video fragments is as follows: the target object stops appearing in the video of the path of video clips; and in any two paths of video clips which are played adjacently, the ending time of the front path of video clip is the starting time of the rear path of video clip.
Optionally, in a specific implementation manner, the method further includes:
before each path of video clips starts to play, displaying a first appointed video frame in a play window of the path of video clips;
wherein the first specified video frame comprises: a first preset video frame, or a first video frame of the video clip.
Optionally, in a specific implementation manner, playing the N paths of video clips in the set N playing windows includes:
in the set N playing windows, simultaneously starting to play the N paths of video clips, and stopping playing each path of video clip when the playing reaches the termination time of the video clip;
The starting time of the N paths of video clips is the same, and the ending time of each path of video clip is the time when the target object stops appearing in the video to which the path of video clip belongs.
Optionally, in a specific implementation manner, the method further includes:
when the playing of each path of video clips is stopped, displaying a second designated video frame in a playing window of the path of video clips;
wherein the second designated video frame comprises: a second preset video frame, or the last video frame of the video clip.
Optionally, in a specific implementation manner, the maximum number of play windows that can be displayed in the display interface where the play window is located is smaller than N;
before the N video clips are played in the set N playing windows, the method further includes:
dividing the N paths of video clips into a plurality of video clip groups according to the maximum number and the sequence from the early to the late of the appearance time of the target object in the N paths of video clips;
the playing the N paths of video clips in the set N playing windows includes:
determining the playing sequence of each video clip group according to the sequence from the early to the late of the appearance time of the target object in the video clip groups;
According to the playing sequence, aiming at each video clip group except for the last video clip group in the playing sequence, displaying a playing window of each video clip in the video clip group in the display interface, and playing each video clip in the video clip group in the displayed playing window; switching to the next video clip group when the video clip playing with the latest termination moment in the video clip group is finished;
when switching to the last video clip group, displaying a playing window of each video clip in the last video clip group in the display interface, and playing each video clip in the last video clip group in the displayed playing window; and when the playing of the video clips with the latest termination time in the last video clip group is finished, the playing of the N video clips is finished.
Optionally, in a specific implementation manner, before the playing the N video clips in the set N playing windows, the method further includes:
dividing the time range between the starting time and the ending time of the N paths of video clips into a plurality of sub-time ranges according to a preset time interval;
For each sub-time range, determining sub-video fragments of the target object in the sub-time range in the N paths of video fragments;
the playing the N paths of video clips in the set N playing windows includes:
and displaying a playing window of the video clip belonging to each sub-video clip in the sub-time range in a display interface according to the sequence from early to late of the starting time of each sub-time range, and playing each sub-video clip in the sub-time range in the displayed playing window.
Optionally, in a specific implementation manner, the method further includes:
storing the object identification of the target object and the video information of the N paths of video clips in a specified storage space in an associated mode; wherein the video information includes: the method comprises the steps of starting time, ending time and equipment identification of acquisition equipment for acquiring each path of video clips;
or,
extracting the N paths of video fragments from the multi-path video, and storing the object identification of the target object and the N paths of video fragments in a specified storage space in an associated manner;
or,
and splicing the N paths of video clips according to the sequence from the early to the late when the target object starts to appear in the N paths of video clips, so as to obtain scene videos about the target object.
In a second aspect, an embodiment of the present application provides a video playing device, where the device includes:
the video acquisition module is used for acquiring multiple paths of videos obtained by shooting the preset scene respectively by a plurality of acquisition devices arranged for the preset scene; each acquisition device is used for shooting one sub-scene in the preset scene, each acquisition device acquires one path of video, and shooting view fields of different acquisition devices are not completely overlapped;
the object identification module is used for identifying target objects in the multi-path video to obtain N paths of video fragments containing the target objects; wherein N is an integer greater than or equal to 1;
the window setting module is used for setting a playing window for displaying each video clip in the N video clips;
the video playing module is used for playing the N paths of video clips in the N set playing windows;
the positions of the N playing windows are distributed and arranged along the direction of the movement route of the target object in the preset scene; and the time periods of the appearance of the target object displayed in the N playing windows are continuous, and in any two adjacent playing windows, the final position of the appearance of the target object displayed in the previous playing window is included in each position of the appearance of the target object displayed in the next playing window, so that the movement routes of the target object displayed in the N playing windows form a continuous movement route.
Optionally, in a specific implementation manner, the video playing module is specifically configured to:
in the set N playing windows, simultaneously starting to play the N paths of video clips and simultaneously ending to play the N paths of video clips;
the starting time of the N paths of video clips is the same, and the ending time of the N paths of video clips is the same.
Optionally, in a specific implementation manner, the video playing module is specifically configured to:
in the N set playing windows, the N paths of video clips are sequentially and independently played according to the sequence from the early to the late of the starting time of the N paths of video clips;
the starting time of each path of video clips is as follows: the target object starts to appear in the video of the path of video fragments, and the termination time of each path of video fragments is as follows: the target object stops appearing in the video of the path of video clips; and in any two paths of video clips which are played adjacently, the ending time of the front path of video clip is the starting time of the rear path of video clip.
Optionally, in a specific implementation manner, the apparatus further includes:
the first video frame display module is used for displaying a first appointed video frame in a play window of each path of video clips before each path of video clips starts to play;
Wherein the first specified video frame comprises: a first preset video frame, or a first video frame of the video clip.
Optionally, in a specific implementation manner, the video playing module is specifically configured to:
in the set N playing windows, simultaneously starting to play the N paths of video clips, and stopping playing each path of video clip when the playing reaches the termination time of the video clip;
the starting time of the N paths of video clips is the same, and the ending time of each path of video clip is the time when the target object stops appearing in the video to which the path of video clip belongs.
Optionally, in a specific implementation manner, the apparatus further includes:
the second video frame display module is used for displaying a second designated video frame in a play window of each video clip when the play of each video clip is stopped;
wherein the second designated video frame comprises: a second preset video frame, or the last video frame of the video clip.
Optionally, in a specific implementation manner, the maximum number of play windows that can be displayed in the display interface where the play window is located is smaller than N; the apparatus further comprises:
The video dividing module is used for dividing the N paths of video fragments into a plurality of video fragment groups according to the maximum number and the sequence from the early to the late of the appearance time of the target object in the N paths of video fragments;
the video playing module is specifically used for:
determining the playing sequence of each video clip group according to the sequence from the early to the late of the appearance time of the target object in the video clip groups;
according to the playing sequence, aiming at each video clip group except for the last video clip group in the playing sequence, displaying a playing window of each video clip in the video clip group in the display interface, and playing each video clip in the video clip group in the displayed playing window; switching to the next video clip group when the video clip playing with the latest termination moment in the video clip group is finished;
when switching to the last video clip group, displaying a playing window of each video clip in the last video clip group in the display interface, and playing each video clip in the last video clip group in the displayed playing window; and when the playing of the video clips with the latest termination time in the last video clip group is finished, the playing of the N video clips is finished.
Optionally, in a specific implementation manner, the apparatus further includes:
the time dividing module is used for dividing the time range between the starting time and the ending time of the N paths of video clips into a plurality of sub-time ranges according to a preset time interval;
the segment determining module is used for determining sub-video segments of the target object in the sub-time range in the N paths of video segments according to each sub-time range;
the video playing module is specifically used for:
and displaying a playing window of the video clip belonging to each sub-video clip in the sub-time range in a display interface according to the sequence from early to late of the starting time of each sub-time range, and playing each sub-video clip in the sub-time range in the displayed playing window.
Optionally, in a specific implementation manner, the apparatus further includes:
the first storage module is used for storing the object identification of the target object and the video information of the N paths of video clips in a specified storage space in an associated mode; wherein the video information includes: the method comprises the steps of starting time, ending time and equipment identification of acquisition equipment for acquiring each path of video clips;
Or,
the second storage module is used for extracting the N paths of video fragments from the multi-path video, and storing the object identification of the target object and the N paths of video fragments in a specified storage space in an associated manner;
or,
and the third storage module is used for splicing the N paths of video clips according to the sequence from the early to the late when the target object starts to appear in the N paths of video clips, so as to obtain scene videos about the target object.
In a third aspect, an embodiment of the present application provides an electronic device, including:
a memory for storing a computer program;
and the processor is used for realizing any video playing method when executing the program stored in the memory.
In a fourth aspect, embodiments of the present application provide a computer readable storage medium having a computer program stored therein, the computer program implementing any one of the video playing methods described above when executed by a processor.
Embodiments of the present application also provide a computer program product comprising instructions that, when executed on a computer, cause the computer to perform any of the video playback methods described above.
The beneficial effects of the embodiment of the application are that:
it can be seen that, by applying the scheme provided by the embodiment of the application, aiming at a preset scene, a plurality of acquisition devices can be arranged to shoot the preset scene, each acquisition device is used for shooting one sub-scene in the preset scene, each acquisition device acquires one path of video, and the shooting field of view ranges of different acquisition devices are not completely coincident.
When determining a motion route of a target object in a preset scene, multiple paths of videos obtained by shooting the preset scene by a plurality of acquisition devices arranged for the preset scene can be acquired first. And then, identifying target objects in the multi-path video to obtain N paths of video fragments containing the target objects, wherein N is an integer greater than or equal to 1. And then, respectively setting a playing window for displaying each video clip in the N video clips. The positions of the N playing windows are distributed and arranged along the direction of a moving route of the target object in a preset scene; the time periods of the appearance of the target objects displayed in the N playing windows are continuous, and in any two adjacent playing windows, the final position of the appearance of the target object displayed in the previous playing window is included in each position of the appearance of the target object displayed in the next playing window, so that the movement routes of the target objects displayed in the N playing windows form a continuous movement route. And finally, playing N paths of video clips in the set N playing windows.
Based on the above, by applying the scheme provided by the embodiment of the application, the positions of the playing windows can be distributed, so that each playing window can present a complete preset scene when playing the video clip, and present the motion route of the target object in the preset scene. Therefore, compared with the prior art that when determining the motion route of the target object in the scene, video splicing is required to be performed on each path of video through re-encoding and decoding, video playing can be performed by applying the scheme provided by the embodiment of the application, and the re-encoding and decoding of the video can be omitted, so that the consumption of computing resources is reduced when determining the motion route of the target object in the scene according to the multi-path scene video.
Moreover, because the scheme provided by the embodiment of the application has lower consumption of computing resources, the scheme provided by the embodiment of the application can be applied to electronic equipment with lower configuration, so that the video playing cost when the moving route of the target object in the preset scene is determined is reduced.
Of course, not all of the above-described advantages need be achieved simultaneously in practicing any one of the products or methods of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. Based on the embodiments herein, a person of ordinary skill in the art would be able to obtain all other embodiments based on the disclosure herein, which are within the scope of the disclosure herein.
In the related art, in order to determine a motion route of a target object in a scene, multiple paths of videos acquired by multiple cameras need to be spliced through recoding and decoding, and therefore consumption of computing resources is high.
In order to solve the above problems, embodiments of the present application provide a video playing method.
The method is suitable for various application scenes for playing the motion route of the target object in the shooting scene, for example, playing the motion route of the high-altitude parabolic target in a high-altitude parabolic event of a certain building; playing the moving route of the vehicle driven on a certain road on the certain road, and the like. For the application scenario of the embodiment of the present application, the embodiment of the present application is not specifically limited.
Also, the execution subject of the method may be various electronic devices that can acquire video data and can play the video data. The electronic device may be a mobile phone, a notebook computer, a desktop computer, or the like, or may be an embedded device that is communicatively connected to or has a display function, such as a digital video recorder (Digital Video Recorder, DVR), a network video recorder (Network Video Recorder, NVR), or the like. The electronic device may be a stand-alone electronic device or a device cluster including a plurality of electronic devices. In this regard, the embodiment of the present application is not specifically limited, and is hereinafter referred to as an electronic device.
The video playing method provided by the embodiment of the application can include the following steps:
acquiring multiple paths of videos obtained by shooting a preset scene respectively by a plurality of acquisition devices arranged for the preset scene; each acquisition device is used for shooting one sub-scene in the preset scene, each acquisition device acquires one path of video, and shooting view fields of different acquisition devices are not completely overlapped;
identifying a target object in the multi-path video to obtain N paths of video fragments containing the target object; wherein N is an integer greater than or equal to 1;
setting a playing window for displaying each video clip in the N video clips;
playing the N paths of video clips in the N set playing windows;
the positions of the N playing windows are distributed and arranged along the direction of the movement route of the target object in the preset scene; and the time periods of the appearance of the target object displayed in the N playing windows are continuous, and in any two adjacent playing windows, the final position of the appearance of the target object displayed in the previous playing window is included in each position of the appearance of the target object displayed in the next playing window, so that the movement routes of the target object displayed in the N playing windows form a continuous movement route.
It can be seen that, by applying the scheme provided by the embodiment of the application, aiming at a preset scene, a plurality of acquisition devices can be arranged to shoot the preset scene, each acquisition device is used for shooting one sub-scene in the preset scene, each acquisition device acquires one path of video, and the shooting field of view ranges of different acquisition devices are not completely coincident.
When determining a motion route of a target object in a preset scene, multiple paths of videos obtained by shooting the preset scene by a plurality of acquisition devices arranged for the preset scene can be acquired first. And then, identifying target objects in the multi-path video to obtain N paths of video fragments containing the target objects, wherein N is an integer greater than or equal to 1. And then, respectively setting a playing window for displaying each video clip in the N video clips. The positions of the N playing windows are distributed and arranged along the direction of a moving route of the target object in a preset scene; the time periods of the appearance of the target objects displayed in the N playing windows are continuous, and in any two adjacent playing windows, the final position of the appearance of the target object displayed in the previous playing window is included in each position of the appearance of the target object displayed in the next playing window, so that the movement routes of the target objects displayed in the N playing windows form a continuous movement route. And finally, playing N paths of video clips in the set N playing windows.
Based on the above, by applying the scheme provided by the embodiment of the application, the positions of the playing windows can be distributed, so that each playing window can present a complete preset scene when playing the video clip, and present the motion route of the target object in the preset scene. Therefore, compared with the prior art that when determining the motion route of the target object in the scene, video splicing is required to be performed on each path of video through re-encoding and decoding, video playing can be performed by applying the scheme provided by the embodiment of the application, and the re-encoding and decoding of the video can be omitted, so that the consumption of computing resources is reduced when determining the motion route of the target object in the scene according to the multi-path scene video.
Moreover, because the scheme provided by the embodiment of the application has lower consumption of computing resources, the scheme provided by the embodiment of the application can be applied to electronic equipment with lower configuration, so that the video playing cost when the moving route of the target object in the preset scene is determined is reduced.
Next, a specific description is given of a video playing method provided in the embodiment of the present application with reference to the accompanying drawings.
Fig. 1 is a schematic flow chart of a video playing method according to an embodiment of the present application, as shown in fig. 1, the method may include the following steps S101 to S104.
S101: and acquiring multiple paths of videos obtained by shooting the preset scene by a plurality of acquisition devices arranged for the preset scene.
Each acquisition device is used for shooting one sub-scene in a preset scene, each acquisition device acquires one path of video, and shooting view fields of different acquisition devices are not completely overlapped.
In the video playing method provided by the embodiment of the application, for the same preset scene, a plurality of acquisition devices can be arranged to shoot the preset scene, each acquisition device is used for shooting one sub-scene in the preset scene, each acquisition device acquires one path of video, and shooting field of view ranges of different acquisition devices are not completely overlapped.
In order to be able to shoot the entire preset scene, the shooting field of view range of the plurality of acquisition devices arranged within the preset scene may cover the entire preset scene. The shooting field of view ranges of different acquisition devices arranged in a preset scene can be just adjacent and not coincident, and a partial coincident region can also exist.
Furthermore, when determining the motion route of the target object in the preset scene, multiple paths of videos obtained by shooting the preset scene by a plurality of acquisition devices arranged for the preset scene can be acquired first.
Optionally, the user may determine the application scenario according to a specific application situation, and determine, as a video group, multiple paths of videos obtained by respectively shooting the preset scenario by using multiple acquisition devices arranged for the preset scenario, and further, by obtaining videos in the video group, multiple paths of videos obtained by respectively shooting the preset scenario by using multiple acquisition devices arranged for the preset scenario may be obtained.
For example, when it is desired to determine a movement route of a target object on the 1 st-20 th floor of a building, the preset scene may be the 1 st-20 th floor of the building, and the preset group may include videos acquired by cameras installed on the 1 st-20 th floor of the building.
S102: and identifying target objects in the multi-path video to obtain N paths of video fragments containing the target objects.
Wherein N is an integer greater than or equal to 1.
After obtaining multiple paths of videos shot by a plurality of acquisition devices arranged for a preset scene, identifying target objects in the multiple paths of videos to obtain N paths of video clips containing the target objects, wherein N is an integer greater than or equal to 1.
The target object may be a high-altitude parabolic target, a specified vehicle, etc., and the method for identifying the target object in the video by the electronic device may include, but is not limited to: and identifying the target object in the video according to the appearance characteristics, the movement speed characteristics, the movement route characteristics and other attributes of the target object. In practical applications, the target object and the method for identifying the target object may be set according to practical application conditions, and the embodiments of the present application are not limited specifically.
For example, the user may send a detection instruction regarding the target object to the electronic device, and the electronic device may respond to the detection instruction to identify the target object in the video.
For example, a detection algorithm about the target object, for example, an object detection model, etc., may be preset in the electronic device, so that when the electronic device acquires the video, the electronic device may detect the video frame by using the detection algorithm to identify the target object in the video.
S103: and respectively setting a playing window for displaying each video clip in the N video clips.
S104: and playing N paths of video clips in the set N playing windows.
The positions of the N playing windows are distributed and arranged along the direction of a moving route of the target object in a preset scene; the time periods of the appearance of the target objects displayed in the N playing windows are continuous, and in any two adjacent playing windows, the final position of the appearance of the target object displayed in the previous playing window is included in each position of the appearance of the target object displayed in the next playing window, so that the movement routes of the target objects displayed in the N playing windows form a continuous movement route.
After obtaining the N video clips, a playing window for displaying the N video clips may be set for each video clip in the N video clips.
The positions of the N play windows may be distributed along the direction of the moving route of the target object in the preset scene, for example, when the direction of the moving route of the target object in the preset scene is longitudinal, the N play windows may be longitudinally arranged; when the direction of the moving route of the target object in the preset scene is transverse, the N playing windows may be arranged transversely. As shown in fig. 2 (a) and fig. 2 (b), when the N play windows are displayed in the display interface in the above arrangement manner, the N play windows may present a complete preset scene.
Furthermore, the time periods of the appearance of the target objects displayed in the N playing windows are continuous, and in any two adjacent playing windows, the movement routes of the target objects displayed in the N playing windows can form a continuous movement route in all positions of the appearance of the target objects displayed in the next playing window, including the final position of the appearance of the target objects displayed in the previous playing window.
Optionally, when playing N video clips in the N playing windows, the user may send a multiple speed playing instruction to the electronic device, and the electronic device may respond to the multiple speed playing instruction and play the N video clips according to the multiple speed of the instruction included in the multiple speed playing instruction, so as to speed up or slow down the display speed of the moving route of the target object.
Optionally, when playing N video clips in the N playing windows, the user may send an amplifying instruction about at least one video clip to the electronic device, and the electronic device may respond to the amplifying instruction and amplify the picture of the video clip indicated by the amplifying instruction according to the amplifying magnification included in the amplifying instruction, so that the target object in the video clip may be displayed more clearly under the condition that the target object is smaller.
Optionally, when playing N video clips in the set N playing windows, the user may send a zoom-out instruction about at least one video clip to the electronic device, and the electronic device may respond to the zoom-out instruction and zoom out the frame of the video clip indicated by the zoom-out instruction according to a zoom-out multiple included in the zoom-out instruction.
Based on the above, by applying the scheme provided by the embodiment of the application, the positions of the playing windows can be distributed, so that each playing window can present a complete preset scene when playing the video clip, and present the motion route of the target object in the preset scene. Therefore, compared with the prior art that when determining the motion route of the target object in the scene, video splicing is required to be performed on each path of video through re-encoding and decoding, video playing can be performed by applying the scheme provided by the embodiment of the application, and the re-encoding and decoding of the video can be omitted, so that the consumption of computing resources is reduced when determining the motion route of the target object in the scene according to the multi-path scene video.
Moreover, because the scheme provided by the embodiment of the application has lower consumption of computing resources, the scheme provided by the embodiment of the application can be applied to electronic equipment with lower configuration, so that the video playing cost when the moving route of the target object in the preset scene is determined is reduced.
For example, as shown in fig. 2 (a), when the preset scene c is a building of 12 floors, 3 cameras may be arranged to photograph the building, and the preset scene c may be divided into 3 sub-scenes of the lower 4 floors, the middle 4 floors, and the upper 4 floors according to the photographing field of view of the 3 cameras. The camera 1 can be used for shooting video of a sub-scene comprising the lower 4 layers of the building to obtain a path of video; the camera 2 can be used for shooting video of a sub-scene comprising the middle 4 layers of the building to obtain a path b video; the camera 3 can be used for shooting video of a sub-scene comprising the upper 4 layers of the building, so as to obtain a c-path video.
Furthermore, after the high-altitude parabolic event occurs in the preset scene c, when the throwing route of the high-altitude parabolic target is determined, an a-path video, a b-path video and a c-path video can be acquired first. And then, identifying the high-altitude parabolic objects in the a-path video, the b-path video and the c-path video, and obtaining a-path video fragments, b-path video fragments and c-path video fragments containing the high-altitude parabolic objects.
Since the high-altitude parabolic object is longitudinally arranged in the direction of the moving route in the preset scene c, the shooting view fields of the camera 1, the camera 2 and the camera 3 are longitudinally aligned. Therefore, for the a-path video clip, the b-path video clip, and the c-path video clip, 3 play windows as shown in fig. 2 (b) may be set, so that the positions of the set 3 play windows are distributed along the direction of the movement route of the high-altitude parabolic target in the preset scene c. And then, playing the a-path video clip, the b-path video clip and the c-path video clip in the set 3 play windows, so that the 3 play windows can present a complete preset scene c in the display interface.
And when the a-path video clip, the b-path video clip and the c-path video clip are played in the 3 play windows, the time period of the high-altitude parabolic target shown in the 3 play windows can be continuous, and the final position of the high-altitude parabolic target shown in the previous play window is included in each position of the high-altitude parabolic target shown in the next play window in any two adjacent play windows, so that the motion route of the high-altitude parabolic target shown in the 3 play windows forms a continuous motion route.
However, in some cases, when the movement route of the target object within the preset scene is a certain target direction, unlike the case where the field of view ranges of the respective acquisition devices installed within the preset scene shown in fig. 2 (a) are aligned in the target direction, the field of view ranges of the respective acquisition devices installed within the preset scene may not be aligned in the target direction but may be offset in the perpendicular direction to the target direction, as shown in fig. 3 (a).
In this case, in order to make the spatial positions of the target objects displayed in the N play windows continuous, optionally, in a specific implementation manner, when play windows for displaying the N video clips are respectively provided for each video clip in the N video clips, the positions of the N play windows are distributed and arranged along the target direction, and meanwhile, the positional offset relationship of the N play windows in the vertical direction may also be the same as the positional offset relationship in the vertical direction of the shooting field of view range of the capturing device for capturing the N video clips.
For example, as shown in fig. 3 (a), when the preset scene d is a building of 12 floors, 3 cameras may be arranged to photograph the building, and the preset scene c may be divided into 3 sub-scenes of the lower 4 floors, the middle 4 floors, and the upper 4 floors according to the photographing field of view range of the 3 cameras. The camera 4 can be used for shooting video of a sub-scene comprising the lower 4 layers of the building to obtain d paths of video; the camera 5 can be used for shooting video of a sub-scene comprising the middle 4 layers of the building to obtain e paths of video; the camera 6 can be used for shooting video of the sub-scene of the upper 4 layers of the building to obtain f paths of video.
And after the high-altitude parabolic event occurs in the preset scene d, d paths of videos, e paths of videos and f paths of videos can be acquired first when the parabolic route of the high-altitude parabolic target is determined. And then, identifying high-altitude parabolic objects in the d-path video, the e-path video and the f-path video, and obtaining d-path video fragments, e-path video fragments and f-path video fragments containing the high-altitude parabolic objects.
Since the direction of the moving route of the high-altitude parabolic target within the preset scene d is longitudinal, the shooting field ranges of the cameras 4, 5 and 6 are longitudinally arranged but not aligned, and there is a positional shift in the horizontal direction in the shooting field ranges of the cameras 4, 5 and 6. Therefore, for the d-path video clip, the e-path video clip, and the f-path video clip, 3 play windows as shown in fig. 3 (b) may be set, so that the positions of the set 3 play windows are distributed and arranged along the direction of the moving route of the high-altitude parabolic target in the preset scene c, and the positional offset relationship of the set 3 play windows in the horizontal direction is the same as the positional offset relationship of the shooting field ranges of the cameras 4, 5, and 6 in the horizontal direction. And then, playing d paths of video clips, e paths of video clips and f paths of video clips in the set 3 playing windows, so that the 3 playing windows can present a complete preset scene d in the display interface.
And when the d path video clips, the e path video clips and the f path video clips are played in the 3 play windows, the time period of the high-altitude parabolic targets displayed in the 3 play windows can be continuous, and the final position of the high-altitude parabolic targets displayed in the previous play window is included in each position of the high-altitude parabolic targets displayed in any two adjacent play windows, wherein the positions of the high-altitude parabolic targets displayed in the next play window are included in the final position of the high-altitude parabolic targets displayed in the previous play window, so that the motion routes of the high-altitude parabolic targets displayed in the 3 play windows form a continuous motion route.
In some specific implementations, by identifying the target object in the multiple paths of video, the starting time of the obtained N paths of video segments containing the target object may be the same, and the ending time of the N paths of video segments may be the same.
Optionally, in a specific implementation manner, the electronic device may first determine, by identifying the target object in the multiple paths of videos, an earliest occurrence time and a latest occurrence time of the target object in one path of reference video in the multiple paths of videos.
For example, the electronic device may acquire multiple paths of videos captured by multiple acquisition devices arranged for a preset scene in real time, and perform target object detection on each path of acquired videos, so as to identify a target object in each path of videos. When detecting that a target object appears in a preset scene according to a certain path of video, the electronic equipment can trigger an alarm signal and determine the path of video as a reference video comprising the target object. And the electronic equipment can determine the earliest appearance time and the latest appearance time of the target object in the standard video by carrying out target object detection on the standard video.
After determining the earliest appearance time and the latest appearance time of the target object in the standard video, assuming that the earliest appearance time of the target object in the standard video is a first time and the latest appearance time of the target object in the standard video is a second time, the electronic device may determine a time which is not later than the first time and has a time interval with the first time as a first duration as a first starting time, and determine a time which is not earlier than the second time and has a time interval with the second time as a second duration as a first ending time.
For example, when the first time is time a, the second time is time B, the first time is 5 seconds, and the second time is 10 seconds, the electronic device may determine time (a-5) as the first start time, and determine time (b+10) as the first end time.
Furthermore, the electronic device may determine a video segment located between the first start time and the first end time in the multiple paths of video as a video segment containing the target object, so as to obtain N paths of video segments containing the target object.
The electronic device may also use the video segments located between the first start time and the first end time in each video as video segments to be selected, and then continue to identify the target object for each video segment to be selected, and determine the video segment to be selected with the identified target object as N video segments including the target object.
It can be seen that the starting time and the ending time of the N video clips obtained by the specific implementation manner are the same.
The first duration and the second duration may be set according to actual application conditions, and embodiments of the present application are not specifically limited.
Optionally, the user may determine the first duration and the second duration according to a speed feature of the movement of the target object in the preset scene, so that the first start time determined based on the first duration may be located before the occurrence time of the target object in the preset scene, and the first end time determined based on the second duration may be located after the disappearance time of the target object in the preset scene, so that the determined N-path video clip may include a complete movement route of the target object in the preset scene.
When the target object is an aerial parabolic target, the user may determine the first duration and the second duration according to a speed feature of movement of the aerial parabolic target, so that the determined N video clips may include a complete movement route of the aerial parabolic target in a preset scene.
Optionally, in a specific implementation manner, the electronic device may determine the earliest and latest appearance time of the target object in the multiple videos by identifying the target object in the multiple videos.
After determining the earliest appearance time and the latest appearance time of the target object in the multi-path video, assuming that the earliest appearance time of the target object in the multi-path video is the third time and the latest appearance time of the target object in the multi-path video is the fourth time, the electronic device may determine the time which is not later than the third time and has the time interval of the third time as the third duration as the second starting time, and determine the time which is not earlier than the fourth time and has the time interval of the fourth time as the fourth duration as the second ending time. And finally, determining the video segments positioned between the second starting time and the second ending time in each video as the video segments containing the target object, thereby obtaining N paths of video segments containing the target object.
It can be seen that the starting time and the ending time of the N video clips obtained by the specific implementation manner are the same.
The third duration and the fourth duration are not limited in this application, and when the third duration and the fourth duration are both 0, the second start time is the earliest appearance time of the target object in the multi-path video, and the second end time is the latest appearance time of the target object in the multi-path video.
Optionally, when the starting time of the N video clips is the same and the ending time of the N video clips is the same, step S103 is described above: playing the N paths of video clips in the set N playing windows may include the following step 11.
Step 11: and in the N set playing windows, simultaneously starting to play N paths of video clips and simultaneously ending to play N paths of video clips.
In order to make the time periods of the target objects displayed in the N play windows continuous, the collection time of the video frames of each path of video clips played by the N play windows at the same time may be the same. Therefore, when the starting time of the N video clips is the same and the ending time of the N video clips is the same, the N video clips can be simultaneously started to be played in the set N playing windows, and the N video clips can be simultaneously ended to be played.
By way of example, the electronic device may determine, by identifying a high-altitude parabolic target in the multiple paths of videos, that the earliest occurrence time of the high-altitude parabolic target in the preset scene is time a, and that the latest occurrence time is time B, and then determine, as a video segment including a target object, a video segment located between time a and time B in each path of video of the multiple paths of videos, so as to obtain video segment 1, video segment 2, and video segment 3. Furthermore, after the electronic device sets the playing windows for the video clip 1, the video clip 2 and the video clip 3, the electronic device can start playing the video clip 1, the video clip 2 and the video clip 3 in the set 3 playing windows at the same time, and end playing the video clip 1, the video clip 2 and the video clip 3 at the same time.
In some specific implementations, the starting time of each video clip may be: the time when the target object starts to appear in the video to which the video segment belongs, and the termination time of each video segment may be: the target object stops appearing in the video of the video clip.
By way of example, by identifying a target object in multiple videos, the time at which the target object begins to appear and the time at which it stops appearing in each video may be determined. Then, for each video, determining the video segment between the starting time and the stopping time of the target object in the video as the video segment containing the target object, so as to obtain N video segments containing the target object. Furthermore, in the obtained N paths of video clips, the starting time of each path of video clip may be: the starting time of the target object in the video of the video segment can be: the target object stops appearing in the video of the video clip.
Optionally, when the starting time of each video clip is: the moment when the target object starts to appear in the video of the path of video fragments, and the termination moment of each path of video fragments is as follows: when the target object stops appearing in the video to which the video clip belongs, step S103 is described above: playing the N paths of video clips in the set N playing windows may include the following step 21.
Step 21: and in the N set playing windows, the N paths of video clips are sequentially and independently played according to the sequence from the early to the late of the starting time of the N paths of video clips.
And the termination time of the front video segment is the starting time of the rear video segment in the two video segments which are arbitrarily and adjacently played.
In order to make the time periods of the appearance of the target objects displayed in the N playing windows continuous, when the starting time of each video segment is: the moment when the target object starts to appear in the video of the path of video fragments, the termination moment of each path of video fragments is as follows: when the target object stops appearing in the video to which the video segment belongs, the N video segments can be played independently in sequence in the N play windows according to the sequence from early to late of the starting time of the N video segments. And in two paths of video clips which are arbitrarily and adjacently played, the ending time of the front path of video clip is the starting time of the rear path of video clip.
Taking the high-altitude parabolic object as an example, the starting time of moving the high-altitude parabolic object from the 15 th floor to the 10 th floor may be time 1, the ending time may be time 2, the starting time of moving the high-altitude parabolic object from the 10 th floor to the 5 th floor may be time 2, the ending time may be time 3, the starting time of moving the high-altitude parabolic object from the 5 th floor to the 1 th floor may be time 3, and the ending time may be time 4. Further, the N-way video clip may include: video segment 1 between time 3 and time 4, video segment 2 between time 2 and time 3, and video segment 3 between time 1 and time 2. It can be seen that the acquisition time of video clip 1 is the latest, the acquisition time of video clip 3 is the earliest, and the acquisition time of video clip 2 is between the acquisition times of video clip 1 and video clip 3.
Furthermore, when playing video clip 1, video clip 2 and video clip 3, video clip 3 may be played in the playing window for displaying video clip 3, that is, the uppermost window of the 3 windows arranged longitudinally; then playing the video clip 2 in a playing window for displaying the video clip 2, namely, in the middle window in the 3 windows which are longitudinally arranged; finally, playing the video clip 1 in the playing window for displaying the video clip 1, namely the lowest window in the 3 windows which are longitudinally arranged, so that a coherent movement route of the high-altitude parabolic target falling from the 15 th floor to the 1 th floor is displayed in the display interface where each playing window is positioned.
Optionally, in a specific implementation manner, a video playing method provided in the embodiment of the present application may further include the following step 31 and step 32.
Step 31: before each video clip begins to play, a first designated video frame is displayed in a play window of the video clip.
Wherein the first specified video frame comprises: a first preset video frame, or a first video frame of the video clip.
Step 32: and when the playing of each path of video clips is stopped, displaying a second designated video frame in a playing window of the path of video clips.
Wherein the second designated video frame comprises: a second preset video frame, or the last video frame of the video clip.
When the starting time of each video clip is: the moment when the target object starts to appear in the video of the path of video fragments, and the termination moment of each path of video fragments is as follows: when the target object stops appearing in the video to which the video clip belongs, before each video clip begins to play, a first appointed video frame can be displayed in a play window of the video clip; and when the playing of each path of video clips is stopped, displaying a second designated video frame in a playing window of the path of video clips.
Wherein, the first video frame may be: a first preset video frame, or a first video frame of the video clip; the second specified video frame may be: a second preset video frame, or the last video frame of the video clip.
The first preset video frame and the second preset video frame may be set according to actual application conditions, and the embodiment of the application is not specifically limited. For example, the first preset video frame and the second preset video frame may be one video frame that is obtained by shooting the shooting duration range of the image acquisition device and does not include the target object.
Based on the method, the motion route of the target object presented by each play window in the presentation interface can be smoother.
In some specific implementations, the starting moments of the N video segments are the same, and the ending moment of each video segment is the moment when the target object stops appearing in the video to which the video segment belongs.
By way of example, by identifying a target object in a multi-path video, the earliest time of occurrence of the target object in the multi-path video, and the time at which the target object stops occurring in each path of video, may be determined. Then, for each path of video, a time which is not later than the earliest appearance time and has a time interval of a third duration with the earliest appearance time is determined as a starting time of the path of video fragments, and the video fragments between the determined starting time and the time when the target object stops appearing in the path of video are determined as video fragments containing the target object, so that N paths of video fragments containing the target object are obtained. Furthermore, the starting time of the N video clips may be the same, and the ending time of each video clip may be the time when the target object stops appearing in the video to which the video clip belongs.
The third duration is not limited in this application, and when the third duration is 0, the starting time of the N video segments is the earliest appearance time of the target object in the multiple video.
Optionally, when the starting time of the N video clips is the same and the ending time of each video clip is the time when the target object stops appearing in the video to which the video clip belongs, step S103 is described above: playing the N video clips in the set N playing windows may include the following step 41.
Step 41: and in the set N playing windows, simultaneously starting to play N paths of video clips, and stopping playing each path of video clip when the playing reaches the termination time of the video clip.
In order to make the time periods of the appearance of the target objects displayed in the N playing windows continuous, when the starting time of the N paths of video clips is the same and the ending time of each path of video clip is the time when the target object stops appearing in the video to which the N paths of video clips belong, the N paths of video clips can be simultaneously played in the N playing windows, and when the N paths of video clips are played to the ending time of each path of video clip, the playing of the N paths of video clips is stopped.
Taking the high-altitude parabolic object as an example, the starting time of moving the high-altitude parabolic object from the 15 th floor to the 10 th floor may be time 1, the ending time may be time 2, the starting time of moving the high-altitude parabolic object from the 10 th floor to the 5 th floor may be time 2, the ending time may be time 3, the starting time of moving the high-altitude parabolic object from the 5 th floor to the 1 th floor may be time 3, and the ending time may be time 4. Further, the N-way video clip may include: video clip 1 located between time 1 and time 4, video clip 2 located between time 1 and time 3, and video clip 3 located between time 1 and time 2.
Furthermore, after the electronic device sets the playing windows for the video clip 1, the video clip 2 and the video clip 3, the electronic device can start playing the video clip 1, the video clip 2 and the video clip 3 in the set 3 playing windows at the same time, and stop playing each path of video clip when the playing is stopped at the termination time of the video clip. Furthermore, the display interface where each playing window is located can present a coherent movement route of the high-altitude parabolic target falling from the 15 th floor to the 1 st floor.
Optionally, in a specific implementation manner, a video playing method provided in the embodiment of the present application may further include the following step 51.
Step 51: and when the playing of each path of video clips is stopped, displaying a second designated video frame in a playing window of the path of video clips.
Wherein the second designated video frame comprises: a second preset video frame, or the last video frame of the video clip.
When the starting time of the N paths of video clips is the same and the ending time of each path of video clip is the time when the target object stops appearing in the video to which the path of video clip belongs, when the playing of each path of video clip stops, the second designated video frame can be displayed in the playing window of the path of video clip.
Wherein, the second specified video frame may be: a second preset video frame, or the last video frame of the video clip.
Based on the method, the motion route of the target object presented by each play window in the presentation interface can be smoother.
In some cases, the maximum number of play windows that can be presented in the presentation interface where the play window is located may be less than N. For example, for a building F of 20 floors, 4 cameras may be used to collect videos related to the building F, and the camera 1 for collecting a-path videos may have a shooting field of view ranging from 1 to 5 floors of the building F, the camera 2 for collecting b-path videos may have a shooting field of view ranging from 6 to 10 floors of the building F, the camera 3 for collecting c-path videos may have a shooting field of view ranging from 10 to 15 floors of the building F, and the camera 4 for collecting d-path videos may have a shooting field of view ranging from 16 to 20 floors of the building F. If the high-altitude parabolic target is thrown from the 18 th floor of the floor F, when determining the motion route of the high-altitude parabolic target, the N may be 4, and if the number of play windows that can be longitudinally displayed by the display interface is 3, the display interface cannot simultaneously display the 4 paths of video clips.
Therefore, in an alternative embodiment, as shown in fig. 4, when the maximum number of play windows that can be shown in the display interface where the play windows are located is smaller than N, in step S104: before playing the N video clips in the N set playing windows, the video playing method provided in the embodiment of the present application may further include the following step S401.
S401: the N paths of video clips are divided into a plurality of video clip groups according to the maximum number and the sequence from the early to the late of the appearance time of the target object in the N paths of video clips.
Corresponding to the above step S401, the above step S104: playing the N video clips in the set N playing windows may include the following steps S402 to S404.
S402: and determining the playing sequence of each video clip group according to the sequence from the early to the late of the appearance time of the target object in the video clip groups.
S403: according to the playing sequence, aiming at each video clip group except the last video clip group in the playing sequence, displaying a playing window of each video clip in the video clip group in a display interface, and playing each video clip in the video clip group in the displayed playing window; and switching to the next video clip group when the video clip playing with the latest termination time in the video clip group is finished.
S404: when switching to the last video clip group, displaying a playing window of each video clip in the last video clip group in a display interface, and playing each video clip in the last video clip group in the displayed playing window; and when the playing of the video clips with the latest termination time in the last video clip group is finished, the playing of the N video clips is finished.
When the maximum number of play windows which can be displayed in the display interface where the play windows are located is smaller than N, before N paths of video clips are played in the N set play windows, the N paths of video clips can be divided into a plurality of video clip groups according to the maximum number and the sequence from early to late of the appearance time of the target object in the N paths of video clips.
When the N paths of video clips are played, the playing sequence of each video clip group can be determined according to the sequence from the early to the late of the appearance time of the target object in the video clip groups. And then, according to the playing sequence, firstly, displaying the playing window of each video clip in the first video clip group in the display interface, and playing each video clip in the first video clip group in the displayed playing window.
And when the playing of the video clips with the latest termination moment in the first video clip group is finished, switching to the second video clip group, displaying the playing window of each video clip in the second video clip group in the display interface, and playing each video clip in the second video clip group in the displayed playing window.
And when the video clips with the latest termination time in the second video clip group are finished, switching to a third video clip group, and so on, and when the video clips with the latest termination time in the penultimate video clip group are finished, switching to the last video clip group, displaying the playing window of each video clip in the last video clip group in the display interface, and playing each video clip in the last video clip group in the displayed playing window.
And when the playing of the video clips with the latest termination time in the last video clip group is finished, the playing of the N video clips is finished.
The switching manner of the video clip group may be automatic switching or may be manual switching by clicking a specified switching button by a user, which is not particularly limited in the embodiment of the present application.
Based on the above, when the maximum number of the play windows which can be displayed in the display interface where the play windows are located is smaller than N, the play of the N video clips can be realized in the display interface in a screen cutting mode, so that the dynamic display of a longer motion route is realized by fewer windows.
Optionally, in a specific implementation manner, as shown in fig. 5, when the maximum number of play windows that can be displayed in the display interface where the play windows are located is smaller than N, in step S104: before playing the N video clips in the N set playing windows, the video playing method provided in the embodiment of the present application may further include the following steps S501 and S502.
S501: and dividing the time range between the starting time and the ending time of the N paths of video clips into a plurality of sub-time ranges according to the preset time interval.
S502: for each sub-time range, determining sub-video fragments in which a target object appears in the sub-time range in N paths of video fragments.
Corresponding to the above steps S501 and S502, the above step S104: playing the N video clips in the set N playing windows may include the following step S503.
S503: and displaying a playing window of the video clip belonging to each sub-video clip in the sub-time range in a display interface according to the sequence from early to late of the starting time of each sub-time range, and playing each sub-video clip in the sub-time range in the displayed playing window.
The number of sub-video clips of the target object in each sub-time range is smaller than the preset number.
When the maximum number of play windows which can be displayed in the display interface where the play windows are located is smaller than N, before N paths of video clips are played in the N set play windows, the time range between the starting time and the ending time of the N paths of video clips can be divided into a plurality of sub-time ranges according to a preset time interval. Then, for each sub-time range, in the N paths of video clips, a sub-video clip in which the target object appears in the sub-time range is determined.
The preset time interval may be set by a user according to an actual application condition, so that the number of sub-video clips of the target object appearing in each sub-time range is smaller than a preset number.
When the N paths of video clips are played, according to the sequence from the early time to the late time of the starting time of each sub-time range, for each sub-time range, a playing window of the video clip to which each sub-video clip belongs in the sub-time range is displayed in a display interface, and each sub-video clip in the sub-time range is played in the displayed playing window.
For example, for the building F, if the start time of the video segment 1 in the d paths of video is time 1, the end time is time 2; the starting time of the video segment 2 in the video of the path c is time 2, and the ending time is time 3; the starting time of the video segment 3 in the path b video is time 3, and the ending time is time 4; the starting time of the video segment 4 in the path a video is time 4, and the ending time is time 5; and, time 1 is earliest and time 5 is latest; time t1 located after time 1 and having a time interval with time 1 being a preset time interval, and located between time 3 and time 4; time t2, which is located after time t1 and has a time interval from time t1 that is a preset time interval, is located after time 5.
Then, the start time of the video clip 1-4 may be time 1, the end time may be time 5, and the time range between time 1 and time 5 may be divided from time 1 to time t1 and from time t1 to time 5 according to the preset time interval.
Further, for the sub-time range from time 1 to time t1, a video segment located between time 1 and time t1 among the video segments 1-3 may be determined as a sub-video segment in which the target object appears in the sub-time range; for the sub-time range from time t1 to time 5, among the video clips 3-4, the video clip located between time t1 and time 5 may be determined as the sub-video clip in which the target object appears in the sub-time range. Further, when playing video segment 1-4, the sub-video segment in video segment 1-3 between time 1 and time t1 may be played first, and then the sub-video segment in video segment 3-4 between time t1 and time 5 may be played.
In addition, when the sub-video clips from time 1 to time t1 are played in advance, the sub-video clip in the video clip 1 can be played in the uppermost play window of the 3 play windows arranged longitudinally, then the sub-video clip in the video clip 2 is played in the middle play window, and then the sub-video clip in the video clip 3 is played in the lowermost play window. When the playing time t1 is reached, the uppermost playing window can be switched to play the sub-video clips in the video clip 3, and the middle playing window can be switched to play the sub-video clips in the video clip 4, so that when the playing time t1 is reached, the uppermost playing window can start to play the sub-video clips from the time t1 to the time 4 in the video clip 3, after the sub-video clips in the video clip 3 are played in the uppermost playing window, the middle playing window can continue to play the sub-video clips in the video clip 4, and thus, through video switching, the dynamic playing of multiple paths of videos related to the high-altitude parabolic target is realized with fewer playing windows, and the dynamic display of the moving route of the high-altitude parabolic target is realized more smoothly.
Based on the above, by applying the specific implementation manner, the video clips displayed by each playing window can be switched according to the preset time interval, so that the dynamic display of a longer movement route is realized by fewer windows.
Optionally, in a specific implementation manner, a video playing method provided in the embodiment of the present application may further include the following step 61.
Step 61: and storing the object identification of the target object and the video information of the N paths of video clips in a specified storage space in an associated mode.
Wherein the video information includes: a start time, a stop time and an equipment identification of an acquisition equipment for acquiring each path of video clips.
When the video playing method provided by the embodiment of the application is applied to determining the moving route of the target object, the object identification of the target object and the video information of the N paths of video clips can be stored in the designated storage space in an associated manner, and then, when a user views the video related to the moving route of the target object next time, the user can view the video of the moving route of the target object more quickly by accessing the object identification of the target object and the video information of the N paths of video clips stored in the designated storage space.
Optionally, in a specific implementation manner, a video playing method provided in the embodiment of the present application may further include the following step 62.
Step 62: and extracting N paths of video fragments from the multi-path video, and storing the object identification of the target object and the N paths of video fragments in a specified storage space in an associated manner.
When the video playing method provided by the embodiment of the application is applied to determine the motion route of the target object, the N paths of video fragments can be extracted from each path of video, and the object identification of the target object and the extracted N paths of video fragments are associated and stored in a designated storage space. Further, when the user views the video of the moving route of the target object next time, the user can view the video of the moving route of the target object more quickly by accessing the object identifier of the target object stored in the designated storage space and the N video clips.
Optionally, when tracing back an event about the target object, the object identifier of the target object and the N paths of video clips stored in the designated storage space may be used as related evidence, and packaged and sent to related personnel.
Optionally, in a specific implementation manner, a video playing method provided in the embodiment of the present application may further include the following step 63.
Step 63: and splicing the N paths of video fragments according to the sequence from the early to the late when the target object starts to appear in the N paths of video fragments, so as to obtain scene videos about the target object.
When the video playing method provided by the embodiment of the application is applied to determine the motion route of the target object, the N paths of video clips can be spliced through recoding and decoding according to the sequence from the early to the late when the target object starts to appear in the N paths of video clips, so that the scene video about the target object can be obtained.
Based on the above, when the user views the motion route of the target object in the preset scene, the user can directly view the obtained scene video about the target object.
The electronic device may also store the object identification of the target object and the resulting video association of the scene with respect to the target object to a specified storage space. Further, when tracing back an event about a target object, the object identification of the target object stored in the designated storage space and the obtained scene video about the target object may be packaged and transmitted to a related person as related evidence.
Corresponding to the video playing method provided by the embodiment of the application, the embodiment of the application also provides a video playing device.
Fig. 6 is a schematic structural diagram of a video playing device according to an embodiment of the present application, and as shown in fig. 6, the video playing device may include the following modules:
the video acquisition module 601 is configured to acquire multiple paths of videos obtained by respectively shooting a preset scene by a plurality of acquisition devices arranged for the preset scene; each acquisition device is used for shooting one sub-scene in the preset scene, each acquisition device acquires one path of video, and shooting view fields of different acquisition devices are not completely overlapped;
The object recognition module 602 is configured to recognize a target object in the multiple paths of videos, and obtain N paths of video segments including the target object; wherein N is an integer greater than or equal to 1;
a window setting module 603, configured to set a play window for displaying each video clip in the N video clips;
the video playing module 604 is configured to play the N paths of video clips in the set N playing windows;
the positions of the N playing windows are distributed and arranged along the direction of the movement route of the target object in the preset scene; and the time periods of the appearance of the target object displayed in the N playing windows are continuous, and in any two adjacent playing windows, the final position of the appearance of the target object displayed in the previous playing window is included in each position of the appearance of the target object displayed in the next playing window, so that the movement routes of the target object displayed in the N playing windows form a continuous movement route.
Based on the above, by applying the scheme provided by the embodiment of the application, the positions of the playing windows can be distributed, so that each playing window can present a complete preset scene when playing the video clip, and present the motion route of the target object in the preset scene. Therefore, compared with the prior art that when determining the motion route of the target object in the scene, video splicing is required to be performed on each path of video through re-encoding and decoding, video playing can be performed by applying the scheme provided by the embodiment of the application, and the re-encoding and decoding of the video can be omitted, so that the consumption of computing resources is reduced when determining the motion route of the target object in the scene according to the multi-path scene video.
Moreover, because the scheme provided by the embodiment of the application has lower consumption of computing resources, the scheme provided by the embodiment of the application can be applied to electronic equipment with lower configuration, so that the video playing cost when the moving route of the target object in the preset scene is determined is reduced.
Optionally, in a specific implementation manner, the video playing module is specifically configured to:
in the set N playing windows, simultaneously starting to play the N paths of video clips and simultaneously ending to play the N paths of video clips;
the starting time of the N paths of video clips is the same, and the ending time of the N paths of video clips is the same.
Optionally, in a specific implementation manner, the video playing module is specifically configured to:
in the N set playing windows, the N paths of video clips are sequentially and independently played according to the sequence from the early to the late of the starting time of the N paths of video clips;
the starting time of each path of video clips is as follows: the target object starts to appear in the video of the path of video fragments, and the termination time of each path of video fragments is as follows: the target object stops appearing in the video of the path of video clips; and in any two paths of video clips which are played adjacently, the ending time of the front path of video clip is the starting time of the rear path of video clip.
Optionally, in a specific implementation manner, the apparatus further includes:
the first video frame display module is used for displaying a first appointed video frame in a play window of each path of video clips before each path of video clips starts to play;
wherein the first specified video frame comprises: a first preset video frame, or a first video frame of the video clip.
Optionally, in a specific implementation manner, the video playing module is specifically configured to:
in the set N playing windows, simultaneously starting to play the N paths of video clips, and stopping playing each path of video clip when the playing reaches the termination time of the video clip;
the starting time of the N paths of video clips is the same, and the ending time of each path of video clip is the time when the target object stops appearing in the video to which the path of video clip belongs.
Optionally, in a specific implementation manner, the apparatus further includes:
the second video frame display module is used for displaying a second designated video frame in a play window of each video clip when the play of each video clip is stopped;
wherein the second designated video frame comprises: a second preset video frame, or the last video frame of the video clip.
Optionally, in a specific implementation manner, the maximum number of play windows that can be displayed in the display interface where the play window is located is smaller than N; the apparatus further comprises:
the video dividing module is used for dividing the N paths of video fragments into a plurality of video fragment groups according to the maximum number and the sequence from the early to the late of the appearance time of the target object in the N paths of video fragments;
the video playing module is specifically used for:
determining the playing sequence of each video clip group according to the sequence from the early to the late of the appearance time of the target object in the video clip groups;
according to the playing sequence, aiming at each video clip group except for the last video clip group in the playing sequence, displaying a playing window of each video clip in the video clip group in the display interface, and playing each video clip in the video clip group in the displayed playing window; switching to the next video clip group when the video clip playing with the latest termination moment in the video clip group is finished;
when switching to the last video clip group, displaying a playing window of each video clip in the last video clip group in the display interface, and playing each video clip in the last video clip group in the displayed playing window; and when the playing of the video clips with the latest termination time in the last video clip group is finished, the playing of the N video clips is finished.
Optionally, in a specific implementation manner, the apparatus further includes:
the time dividing module is used for dividing the time range between the starting time and the ending time of the N paths of video clips into a plurality of sub-time ranges according to a preset time interval;
the segment determining module is used for determining sub-video segments of the target object in the sub-time range in the N paths of video segments according to each sub-time range;
the video playing module is specifically used for:
and displaying a playing window of the video clip belonging to each sub-video clip in the sub-time range in a display interface according to the sequence from early to late of the starting time of each sub-time range, and playing each sub-video clip in the sub-time range in the displayed playing window.
Optionally, in a specific implementation manner, the apparatus further includes:
the first storage module is used for storing the object identification of the target object and the video information of the N paths of video clips in a specified storage space in an associated mode; wherein the video information includes: the method comprises the steps of starting time, ending time and equipment identification of acquisition equipment for acquiring each path of video clips;
Or,
the second storage module is used for extracting the N paths of video fragments from the multi-path video, and storing the object identification of the target object and the N paths of video fragments in a specified storage space in an associated manner;
or,
and the third storage module is used for splicing the N paths of video clips according to the sequence from the early to the late when the target object starts to appear in the N paths of video clips, so as to obtain scene videos about the target object.
The embodiment of the application also provides an electronic device, as shown in fig. 7, including:
a memory 701 for storing a computer program;
the processor 702 is configured to implement any video playing method provided in the embodiments of the present application when executing the program stored in the memory 701.
And the electronic device may further comprise a communication bus and/or a communication interface, through which the processor 702, the communication interface, and the memory 701 communicate with each other.
The communication bus mentioned above for the electronic devices may be a peripheral component interconnect standard (Peripheral Component Interconnect, PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, etc. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface is used for communication between the electronic device and other devices.
The Memory may include random access Memory (Random Access Memory, RAM) or may include 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 aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but also digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
In yet another embodiment provided herein, there is also provided a computer readable storage medium having stored therein a computer program which when executed by a processor implements the steps of any of the video playing methods described above.
In yet another embodiment provided herein, there is also provided a computer program product containing instructions that, when run on a computer, cause the computer to perform any of the video playback methods of the above embodiments.
In the above embodiments, it may be implemented in whole or in part 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, produces a flow or function in accordance with embodiments of the present application, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, for example, by wired (e.g., coaxial cable, optical fiber, digital Subscriber Line (DSL)), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., a floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a Solid State Disk (SSD), etc.
It is noted that relational terms such as first and second, and the like are 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. Moreover, 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 one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for the apparatus embodiments, the electronic device embodiments, the computer-readable storage medium embodiments, and the computer program product embodiments, the description is relatively simple, and reference should be made to the description of method embodiments in part, since they are substantially similar to the method embodiments.
The foregoing description is only of the preferred embodiments of the present application and is not intended to limit the scope of the present application. Any modifications, equivalent substitutions, improvements, etc. that are within the spirit and principles of the present application are intended to be included within the scope of the present application.