Timeline fast drawing method, device and readable storage medium
By combining the initial video recording information of the video recording device in timeline, the merged video recording information that does not overlap each other, and drawing the playback timeline based on this information, the problem of slow drawing of the video recording device timeline is solved and efficiency is improved.
Patent Information
- Application Number
- CN202411876206.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2044-12-19
AI Technical Summary
When video recording equipment performs video playback, it needs to quickly locate and jump through the playback timeline, resulting in the drawing process that needs to be repeated tens of thousands of times, which brings great time and space overhead, resulting in slow drawing speed and low efficiency.
By acquiring a plurality of initial recording information sorted by the start times of a plurality of videos to be played in the first information queue, the timeline merging is performed, and the second information queue is generated. The combined recording information does not overlap each other on the timeline, and the playback timeline is drawn based on the start time and end time of the combined recording information, and the pre-acquisition timeline coordinates.
The number of video recording information that needs to be drawn in the timeline is reduced, the timeline is repeatedly drawn for each video to be played is avoided, the timeline drawing efficiency is improved, and the timeline drawing problem is solved.
Smart Images

Figure CN119324964B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of security monitoring technology, and in particular to a timeline rapid drawing method, device and readable storage medium. Background Art
[0002] Video recording devices can receive digital video streams transmitted by IPC (network camera) devices or encoders through the network, store and manage them, and users can browse videos in real time, retrieve videos and play them back through video recording devices. Each video recording device may generate thousands or tens of thousands of videos a day. When playing back videos, it is generally necessary to quickly locate and jump to a certain moment through the playback timeline. The drawing process of the playback timeline usually first searches for all videos within the time range, and then draws and renders rectangular areas one by one according to the start and end time of each video file. When there are a large number of videos, the drawing process needs to be repeated tens of thousands of times, which brings huge time and space overhead, resulting in slow drawing speed and low efficiency.
[0003] Currently, no effective solution has been proposed to the problem of slow timeline drawing speed of video recording devices. Summary of the invention
[0004] In this embodiment, a timeline fast drawing method, device and readable storage medium are provided to solve the problem of slow timeline drawing speed of video recording equipment.
[0005] In a first aspect, a timeline fast drawing method is provided in this embodiment, and the method includes:
[0006] Acquire a first information queue, wherein the first information queue includes a plurality of initial recording information sorted according to the start time of the plurality of recordings to be played, and the initial recording information includes the start time and the end time of the recordings to be played;
[0007] Merging the multiple initial video information on a time axis to generate a second information queue, wherein the second information queue includes one or more merged video information, and the multiple merged video information do not overlap each other on the time axis;
[0008] Based on the start time and end time of each of the combined video information and the pre-acquired time axis coordinates, a playback time axis corresponding to each of the combined video information is drawn.
[0009] In some embodiments, the timeline merging of the plurality of initial video recording information to generate a second information queue includes:
[0010] Based on the order of each initial video information in the first information queue, taking each initial video information as the reference video information in turn;
[0011] sequentially determining whether each initial video information sequenced after the reference video information has a temporal overlap with the reference video information;
[0012] In the case of time overlap, updating the reference video information based on the corresponding initial video information and deleting the initial video information;
[0013] The second information queue is generated based on each updated reference video recording information.
[0014] In some embodiments, the step of sequentially determining whether each initial video information sequenced after the reference video information has a temporal overlap with the reference video information comprises:
[0015] Determine whether the start time or the end time of the reference video information is within the time range of the initial video information, the time range being determined based on the start time and the end time of the initial video information;
[0016] If within the time range, it is determined that the initial video information and the reference video information have a time overlap.
[0017] In some embodiments, the step of sequentially determining whether each initial video information sequenced after the reference video information overlaps with the reference video information in time further includes:
[0018] Based on the preset minimum length of the playback time axis and the time axis coordinates, obtaining the minimum pixel time accuracy;
[0019] If it is not within the time range of the initial video information, determining whether the time difference between the end time of the reference video information and the start time of the initial video information is less than or equal to the minimum pixel time accuracy;
[0020] When the time difference is less than or equal to the minimum pixel time precision, it is determined that there is a time overlap between the initial video recording information and the reference video recording information.
[0021] In some embodiments, drawing the playback time axis corresponding to each of the merged video information based on the start time, the end time, and the pre-acquired time axis coordinates of each of the merged video information includes:
[0022] Determine the corresponding playback pixel time accuracy based on the start time, end time and time axis coordinates of the merged video information;
[0023] Based on the playback pixel time accuracy and the time axis coordinates, converting the playback time of the merged video information into corresponding pixel points on the playback time axis, and performing loop rendering on the corresponding pixel points;
[0024] Repeat the above steps for each of the merged video information in the second information queue in sequence.
[0025] In some embodiments, determining the corresponding playback pixel time accuracy based on the start time, end time and time axis coordinates of the merged video information includes:
[0026] Determine the duration of the playback time axis based on the start time, the end time and the time axis coordinates;
[0027] Based on the duration, the playback pixel time accuracy of the playback timeline is obtained.
[0028] In some embodiments, converting the playback time of the merged video information into a corresponding pixel point on the playback time axis based on the playback pixel time accuracy and the time axis coordinate includes:
[0029] Based on the playback pixel time accuracy and the playback time of the merged video information, obtaining the number of pixels corresponding to the merged video information;
[0030] Based on the start time of the combined video information, the number of pixels and the time axis coordinates, the start pixel coordinates and the end pixel coordinates of the combined video information are acquired.
[0031] In some embodiments, before drawing the playback time axis corresponding to each of the combined video information based on the start time, the end time, and the pre-acquired time axis coordinates of each of the combined video information, the method further includes:
[0032] Based on the preset minimum length of the playback time axis and the time axis coordinates, obtaining the minimum pixel time accuracy;
[0033] The combined video information whose playback time is less than the minimum pixel time accuracy is eliminated from the multiple combined video information.
[0034] In a second aspect, a timeline fast drawing device is provided in this embodiment, and the device includes:
[0035] An acquisition module, configured to acquire a first information queue, wherein the first information queue includes a plurality of initial video information sorted according to the start time of the plurality of videos to be played, wherein the initial video information includes the start time and the end time of the videos to be played;
[0036] A merging module, used for merging the multiple initial video information in time axis to generate a second information queue, wherein the second information queue includes one or more merged video information, and the multiple merged video information do not overlap each other in time axis;
[0037] The drawing module is used to draw the playback time axis corresponding to each of the combined video information based on the start time, end time and pre-acquired time axis coordinates of each of the combined video information.
[0038] In a third aspect, a readable storage medium is provided in this embodiment, on which a program is stored, and when the program is executed by a processor, the steps of the timeline fast drawing method described in the first aspect are implemented.
[0039] Compared with the related art, the timeline fast drawing method provided in this embodiment obtains the start time and end time of each video to be played by obtaining multiple initial video information in the first information queue sorted according to the start time of multiple videos to be played; generates a second information queue by merging the multiple initial video information on the timeline, merges the multiple initial video information with overlapping time into one merged video information, and reduces the number of video information that need to draw the timeline; draws the playback timeline corresponding to each merged video information based on the start time and end time of each merged video information and the timeline coordinates obtained in advance, so that multiple videos to be played with overlapping time share the same timeline, avoids repeatedly drawing the timeline for each video to be played, and solves the problem of slow timeline drawing speed of video recording equipment.
[0040] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0042] Figure 1 is a computer hardware structure block diagram of a timeline fast drawing method in some embodiments of the present application;
[0043] Figure 2 is a flowchart of a timeline fast drawing method according to some embodiments of the present application;
[0044] Figure 3 is a flow chart of merging the time axis of initial video information in some embodiments of the present application;
[0045] Figure 4is a flow chart of time overlap determination in some embodiments of the present application;
[0046] Figure 5 is a flowchart of time overlap determination of other embodiments of the present application;
[0047] Figure 6 is a flow chart of drawing a playback time axis for merging video information in some embodiments of the present application;
[0048] Figure 7 is a flow chart of determining the playback pixel time accuracy of a time axis in some embodiments of the present application;
[0049] Figure 8 is a flow chart of converting playback time into pixel points in some embodiments of the present application;
[0050] Fig. 9 is a flowchart of removing and merging video information in some embodiments of the present application;
[0051] Fig.10 is a flowchart of a timeline fast drawing method of some preferred embodiments of the present application;
[0052] Fig.11 It is a structural block diagram of a timeline fast drawing device in some embodiments of the present application. DETAILED DESCRIPTION
[0053] In order to more clearly understand the purpose, technical solutions and advantages of the present application, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0054] Unless otherwise defined, the technical terms or scientific terms involved in this application shall have the general meaning understood by people with general skills in the technical field to which this application belongs. The words "one", "a", "the", "these" and the like in this application do not indicate a quantitative limitation, and they may be singular or plural. The terms "include", "comprise", "have" and any variants thereof involved in this application are intended to cover non-exclusive inclusions; for example, a process, method and system, product or device comprising a series of steps or modules (units) is not limited to the listed steps or modules (units), but may include unlisted steps or modules (units), or may include other steps or modules (units) inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there may be three relationships, for example, "A and / or B" may mean: A exists alone, A and B exist at the same time, and B exists alone. Generally, the character " / " indicates that the objects associated with each other are in an "or" relationship. The terms "first", "second", "third", etc. in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.
[0055] The timeline fast drawing method provided in the embodiment of the present application can be executed in a video recording device such as an NVR (network video recorder), an XVR (extended video recorder), etc., or in a computer, server or terminal with a video playback function. When the method is applied to a computer, Figure 1 1 is a hardware structure diagram of a computer for a timeline fast drawing method in some embodiments of the present application. Figure 1 As shown, the computer may include one or more ( Figure 1 Only one is shown in the figure) processor 102 and memory 104 for storing data, wherein the processor 102 may include but is not limited to a processing device of a central processing unit CPU. The number of CPUs may be one or more, and this embodiment does not limit it. The above-mentioned computer may also include a transmission device 106 and an input and output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above-mentioned computer. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0056] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the timeline fast drawing method in the present embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some embodiments, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0057] The transmission device 106 is used to receive or send data via a network. The above network includes a wireless network provided by a communication provider of the computer. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.
[0058] In this embodiment, a timeline fast drawing method is provided. Figure 2 is a flowchart of a timeline fast drawing method of some embodiments of the present application, such as Figure 2 As shown, the process includes the following steps:
[0059] Step S201, obtaining a first information queue, wherein the first information queue includes a plurality of initial recording information sorted according to the start time of the plurality of recordings to be played, and the initial recording information includes the start time and the end time of the recordings to be played.
[0060] In actual applications, based on the video playback demand, the user can input the video playback request and playback time through the video recording device or computer (hereinafter collectively referred to as the video recording device) that executes the method of this embodiment. The playback time can be a certain historical moment or historical period. The video recording device queries according to the playback time to obtain a first information queue, which includes multiple initial video recording information corresponding to the playback time, and each initial video recording information includes the start time and end time of the corresponding video to be played. The initial video recording information in the first information queue is arranged in the time order of the start time.
[0061] The multiple initial video recording information may belong to a single video channel or multiple video channels of the video recording device.
[0062] Step S202: Merge multiple initial video recording information on a time axis to generate a second information queue, where the second information queue includes one or more merged video recording information, and the multiple merged video recording information do not overlap each other on the time axis.
[0063] When the play time intervals (start time, end time) of two initial recording information overlap on the time axis, the two initial recording information can be merged on the time axis. The overlap on the time axis can include endpoint overlap and time period overlap. Endpoint overlap means that the end time of one initial recording information is equal to the start time of another initial recording information. Time period overlap means that there is an overlapping area in the play time intervals of the two initial recording information.
[0064] Timeline merging refers to merging multiple overlapping initial recording information on the timeline into one merged recording information, where the start time of the merged recording information is the minimum value of the start times of the multiple initial recording information, and the end time of the merged recording information is the maximum value of the end times of the multiple initial recording information.
[0065] All the initial video information in the first information queue is merged on a time axis to generate a second information queue, which includes one or more merged video information. If there are multiple merged video information, the multiple merged video information do not overlap each other on the time axis. Each merged video information is arranged in chronological order according to the start time.
[0066] Step S203: based on the start time and end time of each merged video information and the pre-acquired time axis coordinates, draw the playback time axis corresponding to each merged video information.
[0067] The time axis coordinates refer to the coordinates of the start and end points of the time axis on the display screen. The time length and start and end times of the play time axis can be preset, or set based on the total start time and total end time of the second information queue.
[0068] In a specific embodiment, the time length of the playback time axis may include multiple time lengths, such as two hours, one day, two days, four days, seven days, etc. The video recording device may automatically determine the time length and start and end time of the corresponding playback time axis based on the time length of the merged video information.
[0069] When the time length and start and end time of the time axis are determined, the time period corresponding to the merged video information on the time axis can be determined according to the start time and end time of each merged video information. Each merged video information corresponds to a time axis drawing process, the start time and end time of the merged video information are converted into the start point coordinates and the end point coordinates on the time axis, and loop rendering is performed on each pixel point between the start point and the end point, so as to draw the playback time axis corresponding to the merged video information. This process is repeated until the playback time axis of all merged video information in the second information queue is drawn.
[0070] Through steps S201 to S203, the start time and end time of each video to be played are obtained by obtaining multiple initial video information in the first information queue sorted according to the start time of multiple videos to be played; the second information queue is generated by merging the multiple initial video information on the time axis, and the multiple initial video information with overlapping time are merged into one merged video information, thereby reducing the number of video information that need to draw the time axis; based on the start time and end time of each merged video information and the pre-acquired time axis coordinates, the playback time axis corresponding to each merged video information is drawn, so that multiple videos to be played with overlapping time share the same time axis, thereby avoiding repeated drawing of the time axis for each video to be played, and solving the problem of slow time axis drawing speed of video recording equipment.
[0071] In some embodiments, Figure 3 is a flowchart of merging the time axis of initial video information in some embodiments of the present application, such as Figure 3 As shown, the process includes the following steps:
[0072] Step S301: Based on the order of each initial video recording information in the first information queue, each initial video recording information is used as the reference video recording information in turn.
[0073] The initial recording information in the first information queue is arranged according to the starting time, and the initial recording information ranked first is first used as the benchmark recording information. After the benchmark recording information and other initial recording information ranked after the benchmark recording information in the first information queue complete the time axis merger, the initial recording information ranked second in the first information queue is used as the benchmark recording information, and so on, until all the initial recording information in the first information queue completes the time axis merger as the benchmark recording information. It should be noted that some initial recording information may be deleted during the time axis merger process, and the deleted initial recording information will not be used as the benchmark recording information.
[0074] Step S302 , determining in sequence whether each of the initial video information sequenced after the reference video information has a temporal overlap with the reference video information.
[0075] After the reference video information is determined, each initial video information arranged after the reference video information is sequentially compared with the reference video information to determine whether there is time overlap between the two, including endpoint overlap and time period overlap.
[0076] Step S303: if there is time overlap, update the reference video information based on the corresponding initial video information, and delete the initial video information.
[0077] If a certain initial recording information in the first information queue overlaps with the baseline recording information in time, the time axes of the two are merged according to the start time and end time of the initial recording information and the start time and end time of the baseline recording information, and the merged start time and end time are used as the start time and end time of the updated baseline recording information, and the initial recording information in the first information queue is deleted.
[0078] Specifically, the timeline merging can determine the start time of the updated baseline recording information based on the minimum value of the start time of the initial recording information and the start time of the baseline recording information; and determine the end time of the updated baseline recording information based on the maximum value of the end time of the initial recording information and the end time of the baseline recording information.
[0079] If there is no time overlap, the process continues, and the subsequent initial video information in the first information queue is compared with the reference video information until the last initial video information in the first information queue is compared with the reference video information.
[0080] At this time, the start time and end time of the reference video information in the first information queue have been updated, and the number of initial video information may be reduced. Based on the updated first information queue, the initial video information arranged after the current reference video information is used as the new reference video information, and steps S302 and S303 are repeated until all the initial video information in the first information queue are used as the reference video information to complete the timeline merging.
[0081] In a specific embodiment, the first information queue includes 4 initial recording information: (a1, a2), (b1, b2), (c1, c2), (d1, d2), the first value in each bracket is the start time of the initial recording information, and the second value is the end time of the initial recording information. Then (a1, a2) is first used as the reference recording information, and then (b1, b2), (c1, c2), (d1, d2) are compared with (a1, a2) in turn to determine whether there is a time overlap with (a1, a2). In the case that (b1, b2) and (a1, a2) overlap in time, the reference recording information (a1, a2) is updated according to (b1, b2), and the updated reference recording information is named (a1b1, a2b2), and then (b1, b2) is deleted. At this time, the first information queue is updated to (a1b1, a2b2), (c1, c2), (d1, d2). Then, (c1, c2), (d1, d2) and (a1b1, a2b2) are compared to determine whether there is a time overlap with (a1b1, a2b2). If (c1, c2), (d1, d2) and (a1b1, a2b2) do not have a time overlap, the time axis merging process of the reference video information (a1b1, a2b2) is completed.
[0082] Then, (c1, c2) is used as the reference video information to determine whether (d1, d2) following the reference video information overlaps with (c1, c2). If (d1, d2) overlaps with (c1, c2), the reference video information (c1, c2) is updated according to (d1, d2). The updated reference video information is named (c1d1, c2d2), and then (d1, d2) is deleted. At this time, the first information queue is updated to (a1b1, a2b2) and (c1d1, c2d2). At this time, all the initial video information in the first information queue has been merged into the time axis as the reference video information, and the merging process is completed.
[0083] If (d1, d2) and (c1, c2) do not overlap in time, the first information queue is still (a1b1, a2b2), (c1, c2), (d1, d2). Then (d1, d2) is used as the reference video information. Since (d1, d2) is the last one in the first information queue, there is no need to perform time overlap judgment. The first information queue is still (a1b1, a2b2), (c1, c2), (d1, d2).
[0084] Step S304: Generate a second information queue based on the updated reference video information.
[0085] When all the initial video information in the first information queue is used as the reference video information to complete the time axis merging, the first information queue that is finally updated is the second information queue.
[0086] Through steps S301 to S304, each initial recording information in the first information queue is taken as the benchmark recording information in turn, and compared with each initial recording information sorted after the benchmark recording information to determine whether there is a time overlap. In the case of time overlap, the benchmark recording information is updated based on the corresponding initial recording information, and the initial recording information is deleted, and finally the second information queue is obtained, and the time axis of multiple initial recording information is merged, which reduces the number of recording information that needs to draw the time axis and improves the time axis drawing efficiency.
[0087] In some embodiments, Figure 4 is a flowchart of time overlap determination in some embodiments of the present application, such as Figure 4 As shown, the process includes the following steps:
[0088] Step S401, determining whether the start time or the end time of the reference video information is within the time range of the initial video information, where the time range is determined based on the start time and the end time of the initial video information.
[0089] When the starting time of the reference recording information is S1 and the ending time is E1, and the starting time of the initial recording information is S2 and the ending time is E2, it is determined whether S1 or E1 is within the time range [S2, E2], which includes the endpoints S2 and E2.
[0090] Step S402: If within the time range, it is determined that the initial video recording information and the reference video recording information have a time overlap.
[0091] If any one or both of S1 or E1 are within the time range of [S2, E2], it is determined that there is a time overlap between the initial video information and the reference video information.
[0092] Through steps S401~S402, by determining whether the start time or end time of the benchmark video information is within the time range of the initial video information, it is determined whether the initial video information and the benchmark video information have time overlaps. This provides a method for determining whether two video information have time overlaps, and provides an effective determination means for merging the time axis of the initial video information.
[0093] In some embodiments, Figure 5 is a flowchart of time overlap determination in some other embodiments of the present application, such as Figure 5 As shown, the process includes the following steps:
[0094] Step S501, based on the preset minimum length of the playback time axis and the time axis coordinates, obtain the minimum pixel time accuracy.
[0095] The time length of the playback time axis can be preset. Specifically, it can include multiple time lengths such as two hours, one day, two days, four days, seven days, etc. According to the minimum time length and the time axis coordinates, the minimum pixel time accuracy of the time axis can be calculated.
[0096] Specifically, let the time axis start point coordinates be (80, 1000) and the time axis end point coordinates be (1080, 1000), then the time axis length on the display screen is 1000 pixels. Assuming the minimum time axis length is two hours, the minimum pixel time accuracy = 2 × 3600 / 1000 = 7.2 seconds / pixel, that is, the time length corresponding to each pixel is 7.2 seconds.
[0097] Step S502: If it is not within the time range of the initial recording information, determine whether the time difference between the end time of the reference recording information and the start time of the initial recording information is less than or equal to the minimum pixel time accuracy.
[0098] If the start time and the end time of the reference recording information are both outside the time range of the initial recording information, it is determined that the reference recording information and the initial recording information do not overlap in physical time. However, if the time difference between the reference recording information and the initial recording information is very small, so that the time difference cannot be reflected on the playback time axis, it can be treated as a case of time overlap.
[0099] By judging whether the time difference between the end time of the reference video information and the start time of the initial video information is less than or equal to the minimum pixel time accuracy, it is determined whether the time difference can be reflected in the playback time axis.
[0100] Step S503: When the time difference is less than or equal to the minimum pixel time accuracy, it is determined that there is a time overlap between the initial video recording information and the reference video recording information.
[0101] If the time difference is less than or equal to the minimum pixel time accuracy, it means that it cannot be reflected in the playback time axis. It can be regarded that there is a time overlap between the reference recording information and the initial recording information, and the time axis can be merged.
[0102] Through steps S501 to S503, the minimum pixel time accuracy is obtained based on the preset minimum length of the playback time axis and the time axis coordinates, which is used as a criterion for determining the time difference between the end time of the reference recording information and the start time of the initial recording information; in the case where the reference recording information and the initial recording information do not overlap in physical time, if the time difference between the end time of the reference recording information and the start time of the initial recording information is less than or equal to the minimum pixel time accuracy, the reference recording information and the initial recording information are deemed to overlap in time, and a time axis merge is performed, thereby further reducing the amount of recording information that needs to draw the time axis and improving the time axis drawing efficiency.
[0103] In some embodiments, Figure 6 is a flow chart of drawing a playback time axis for merging video information in some embodiments of the present application, such as Figure 6 As shown, the process includes the following steps:
[0104] Step S601, determining the corresponding playback pixel time accuracy based on the start time, end time and time axis coordinates of the merged video information.
[0105] The time length of the merged video information is determined according to the start time and end time of the merged video information. According to the time length of each merged video information, different time lengths of the playback time axis can be selected, and the corresponding playback pixel time accuracy can be determined in combination with the time axis coordinates. In the case where the time length of the merged video information is long, the time length of the selected playback time axis is also long, and vice versa, to ensure the playback pixel time accuracy of the time axis.
[0106] Step S602: based on the playback pixel time accuracy and the time axis coordinates, the playback time of the merged video information is converted into corresponding pixel points on the playback time axis, and the corresponding pixel points are cyclically rendered.
[0107] After determining the playback pixel time accuracy corresponding to the merged video information, calculate the corresponding number of pixels according to the time length of the merged video information, and convert the position of the playback time of the merged video information in the time interval of the time axis into the coordinates of the corresponding pixel points on the time axis, and select the appropriate color to render the rectangular range of the screen pixels according to the video type, and repeat this cycle to complete the drawing of the playback time axis corresponding to the merged video information.
[0108] Step S603, repeat the above steps for each merged video information in the second information queue in sequence.
[0109] Repeat the above steps for each merged video information in the second information queue until the time axis of all merged video information is drawn.
[0110] Through steps S601 to S603, the corresponding playback pixel time accuracy is determined based on the start time, end time and time axis coordinates of the merged video information, and the time length corresponding to each pixel point on the playback time axis is determined; based on the playback pixel time accuracy and time axis coordinates, the playback time of the merged video information is converted into corresponding pixel points on the playback time axis, and the corresponding pixel points are cyclically rendered, and the playback time axis is drawn using the merged video information as a unit, thereby avoiding repeated drawing of the time axis for each video to be played, and improving drawing efficiency.
[0111] In some embodiments, Figure 7 is a flowchart of determining the playback pixel time accuracy of the time axis in some embodiments of the present application, such as Figure 7 As shown, the process includes the following steps:
[0112] Step S701, determining the duration of the playback time axis based on the start time, end time and time axis coordinates.
[0113] The time length of the merged video information is calculated according to the start time and the end time of the merged video information, and the corresponding time length option is automatically selected according to the preset multiple time length options of the time axis. In a specific embodiment, the time length options include two hours, one day, two days, four days, and seven days. When the time length of the merged video information is greater than seven days, a time length of seven days can be selected; and so on, when the time length of the merged video information is less than one day or less than two hours, a time length of two hours can be selected.
[0114] In other embodiments, there may be other ways to determine the time length of the time axis, which is not limited in this embodiment.
[0115] Step S702: Based on the duration, obtain the playback pixel time accuracy of the playback time axis.
[0116] According to the pre-acquired time axis coordinates and the determined time axis time length, the corresponding pixel time accuracy can be calculated. Specifically, when the time axis length is 1000 pixels calculated according to the time axis coordinate length, the pixel time accuracy for the time lengths of two hours, one day, two days, four days, and seven days is 7.2 seconds, 86.4 seconds, 172.8 seconds, 5.76 minutes, and 10.08 minutes, respectively.
[0117] Through steps S701~S702, the duration of the playback timeline is determined based on the start time, end time and timeline coordinates, and based on the duration, the playback pixel time accuracy of the playback timeline is obtained, and the corresponding playback pixel time accuracy is determined for the merged recording information of different time lengths, thereby avoiding the problem of inaccurate time switching during playback caused by too low playback pixel time accuracy.
[0118] In some embodiments, Figure 8 is a flowchart of converting the playback time into pixel points in some embodiments of the present application, such as Figure 8 As shown, the process includes the following steps:
[0119] Step S801, based on the playback pixel time accuracy and the playback time of the merged video information, the number of pixels corresponding to the merged video information is obtained.
[0120] In a specific embodiment, the length of the playback time axis is two hours, the coordinates of the time axis start point are (80, 1000), and the coordinates of the time axis end point are (1080, 1000), that is, the length of the time axis is 1000 pixels, and the corresponding time period is from 9 o'clock to 11 o'clock. The playback time of the merged video information is from 10 o'clock to 11 o'clock, then the playback pixel time accuracy = (11-9) × 3600 / 1000 = 7.2 seconds / pixel, and the number of pixels corresponding to the merged video information is: (11-10) × 3600 / 7.2 = 500.
[0121] Step S802: based on the start time, the number of pixels and the time axis coordinates of the merged video information, the start pixel coordinates and the end pixel coordinates of the merged video information are obtained.
[0122] The offset of the starting pixel point of the merged video information relative to the time axis is (10-9)×3600 / 7.2=500, and the starting point coordinate of the time axis is (80, 1000). Therefore, the starting pixel point coordinate of the merged video information is (500+80, 1000), and the ending pixel point coordinate is (500+80+500, 1000).
[0123] Through steps S801~S802, the number of pixels corresponding to the merged video information is obtained based on the playback pixel time accuracy and the playback time of the merged video information, and the starting pixel coordinates and the ending pixel coordinates of the merged video information are obtained based on the starting time, the number of pixels and the time axis coordinates of the merged video information, thereby realizing the conversion of the merged video information from the playback time to the corresponding pixel coordinates, and providing accurate screen coordinates for drawing the time axis.
[0124] In some embodiments, a method for removing part of the merged video information is provided before drawing a playback time axis corresponding to each merged video information. Fig. 9 is a flowchart of removing and merging video information in some embodiments of the present application, such as Fig. 9 As shown, the process includes the following steps:
[0125] Step S901, based on the preset minimum length of the playback time axis and the time axis coordinates, obtain the minimum pixel time accuracy.
[0126] This step may be calculated in the same manner as step S501. In a specific embodiment, the minimum pixel time accuracy is 7.2 seconds / pixel.
[0127] Step S902: Eliminate the combined video information whose playback time is less than the minimum pixel time accuracy from the multiple combined video information.
[0128] If the playback duration of the merged video information in the second information queue is less than the minimum pixel time accuracy, it can be determined that the merged video information cannot be played normally. At this time, the merged video information can be removed from the second information queue to further reduce the amount of merged video information and improve the timeline drawing efficiency.
[0129] The timeline fast drawing method of the present application is described and illustrated below through a preferred embodiment. Fig.10 is a flowchart of a timeline fast drawing method of some preferred embodiments of the present application, such as Fig.10 As shown, the process includes the following steps:
[0130] Step S1001, obtaining a pixel time accuracy correspondence table according to different time axis screen lengths Len and different time axis duration T options, where pixel time accuracy = T / Len;
[0131] Step S1002, obtaining the current pixel time accuracy and the minimum pixel time accuracy according to the pixel and time accuracy correspondence table, the current screen coordinates, and the currently selected time axis duration option;
[0132] Step S1003, obtaining a first information queue, wherein the first information queue includes a plurality of initial recording information sorted according to the start time of the plurality of recordings to be played, wherein the initial recording information includes the start time and the end time of the recordings to be played;
[0133] Step S1004, taking the i-th element from the first information queue as a reference element, where the initial value of i is 0;
[0134] Step S1005, taking the P+1th element from the first information queue as a comparison element, where the initial value of P is equal to i;
[0135] Step S1006, determine the starting time S of the i-th element i or end time E i Is the [S P+1 , E P+1 ] time range; if within the time range, proceed to step S1007; if not within the time range, proceed to step S1010;
[0136] Step S1007, determining whether the i-th element and the P+1-th element have time overlap;
[0137] Step S1008, deleting the P+1th element from the first information queue;
[0138] Step S1009, update the reference element i, the updated S i is min(S i , S P+1 ), the updated E i is max(E i , E P+1 );and return to step S1005;
[0139] Step S1010, determining that there is no time overlap between the i-th element and the P+1-th element, P=P+1;
[0140] Step S1011, determine whether the P+1th element is the last element of the first information queue, if yes, proceed to step S1012, if not, proceed to step S1005;
[0141] Step S1012, i=i+1, P=i;
[0142] Step S1013, determining whether the i-th element is the last element of the first information queue, if so, completing the timeline merging of the first information queue, obtaining one or more merged video information, and proceeding to step S1014, if not, proceeding to step S1004;
[0143] Step S1014, eliminating the merged video information whose duration is less than the minimum pixel time accuracy;
[0144] Step S1015, based on the current pixel time accuracy and the time axis coordinates, converting the playback time of the merged video information into a corresponding pixel point on the playback time axis;
[0145] Step S1016, loop rendering the rectangular area corresponding to the pixel points.
[0146] Through steps S1001 to S1016, by judging whether the initial video information in the first information queue overlaps with the reference video information in time, the time axis merging of multiple initial video information is realized, thereby reducing the number of video information that need to draw the time axis, and drawing the playback time axis is realized in units of merged video information, thereby avoiding repeated drawing of the time axis for each video to be played, solving the problem of slow time axis drawing speed of video recording equipment, and improving time axis drawing efficiency; the merged video information whose playback time is less than the minimum pixel time accuracy is removed from the second information queue to further reduce the number of merged video information; by converting the merged video information from the playback time to the corresponding pixel point coordinates, accurate screen coordinates are provided for drawing the time axis.
[0147] It should be noted that the steps shown in the above process or the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0148] In some embodiments, the present application also provides a timeline fast drawing device, which is used to implement the above embodiments and preferred implementations, and will not be repeated for what has been described. The terms "module", "unit", "sub-unit", etc. used below can be a combination of software and / or hardware that implements a predetermined function. In some embodiments, Fig.11 is a structural block diagram of the time axis fast drawing device of this embodiment, such as Fig.11 As shown, the device comprises:
[0149] The acquisition module 1101 is used to acquire a first information queue, wherein the first information queue includes a plurality of initial recording information sorted according to the start time of the plurality of recordings to be played, and the initial recording information includes the start time and the end time of the recordings to be played;
[0150] The merging module 1102 is used to merge the multiple initial video information in time axis to generate a second information queue, wherein the second information queue includes one or more merged video information, and the multiple merged video information do not overlap each other in time axis;
[0151] The drawing module 1103 is used to draw the playback time axis corresponding to each merged video information based on the start time and end time of each merged video information and the pre-acquired time axis coordinates.
[0152] The timeline fast drawing device of this embodiment obtains multiple initial video information in the first information queue sorted according to the start time of multiple videos to be played through the acquisition module 1101, and obtains the start time and end time of each video to be played; the timeline is merged on the multiple initial video information through the merging module 1102 to generate a second information queue, and the multiple initial video information with overlapping time is merged into one merged video information, thereby reducing the number of video information that needs to draw the timeline; the drawing module 1103 draws the playback timeline corresponding to each merged video information based on the start time and end time of each merged video information and the timeline coordinates obtained in advance, so that multiple videos to be played with overlapping time share the same timeline, avoiding repeated drawing of the timeline for each video to be played, and solving the problem of slow timeline drawing speed of video recording equipment.
[0153] In addition, in combination with the timeline fast drawing method provided in the above embodiments, a readable storage medium may be provided in this embodiment to implement the method. The readable storage medium stores a program; when the program is executed by a processor, any of the timeline fast drawing methods in the above embodiments is implemented.
[0154] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and will not be repeated in this embodiment.
[0155] It should be understood that the specific embodiments described herein are only used to explain the application, rather than to limit it. Based on the embodiments provided in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the protection scope of this application.
[0156] Obviously, the drawings are only some examples or embodiments of the present application. For ordinary technicians in the field, the present application can also be applied to other similar situations based on these drawings without creative work. In addition, it is understandable that although the work done in this development process may be complicated and lengthy, for ordinary technicians in the field, certain changes in design, manufacturing or production based on the technical content disclosed in this application are only conventional technical means and should not be regarded as insufficient content disclosed in this application.
[0157] The term "embodiment" in this application refers to a specific feature, structure or characteristic described in conjunction with the embodiment that can be included in at least one embodiment of the present application. The appearance of this phrase in various locations in the specification does not necessarily mean the same embodiment, nor does it mean that it is mutually exclusive with other embodiments and is independent or optional. It is clearly or implicitly understood by those of ordinary skill in the art that the embodiments described in this application can be combined with other embodiments without conflict.
[0158] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of patent protection. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the scope of protection of the present application. Therefore, the scope of protection of the present application shall be subject to the attached claims.
Claims
1. A timeline fast drawing method, characterized in that: The method comprises: Acquire a first information queue, wherein the first information queue includes a plurality of initial recording information sorted according to the start time of the plurality of recordings to be played, and the initial recording information includes the start time and the end time of the recordings to be played; Merging the multiple initial video information on a time axis to generate a second information queue, wherein the second information queue includes one or more merged video information, and the multiple merged video information do not overlap each other on the time axis; Based on the start time and end time of each of the combined video information and the pre-acquired time axis coordinates, drawing the playback time axis corresponding to each of the combined video information; The time axis merging of the plurality of initial video recording information to generate a second information queue comprises: Based on the order of each initial video information in the first information queue, taking each initial video information as the reference video information in turn; sequentially determining whether each initial video information sequenced after the reference video information has a temporal overlap with the reference video information; In the case of time overlap, updating the reference video information based on the corresponding initial video information and deleting the initial video information; generating the second information queue based on each updated reference video information; The step of sequentially determining whether each of the initial video information sequenced after the reference video information overlaps with the reference video information in time comprises: Determine whether the start time or the end time of the reference video information is within the time range of the initial video information, wherein the time range is determined based on the start time and the end time of the initial video information; Based on the preset minimum length of the playback time axis and the time axis coordinates, obtaining the minimum pixel time accuracy; If it is not within the time range of the initial video information, determining whether the time difference between the end time of the reference video information and the start time of the initial video information is less than or equal to the minimum pixel time accuracy; When the time difference is less than or equal to the minimum pixel time precision, it is determined that there is a time overlap between the initial video recording information and the reference video recording information.
2. The method according to claim 1, characterized in that The step of sequentially determining whether each of the initial video information sequenced after the reference video information overlaps with the reference video information in time comprises: If within the time range, it is determined that the initial video information and the reference video information have a time overlap.
3. The method according to claim 1, characterized in that Drawing the playback time axis corresponding to each of the combined video information based on the start time, the end time, and the pre-acquired time axis coordinates of each of the combined video information includes: Determine the corresponding playback pixel time accuracy based on the start time, end time and time axis coordinates of the merged video information; Based on the playback pixel time accuracy and the time axis coordinates, converting the playback time of the merged video information into corresponding pixel points on the playback time axis, and performing loop rendering on the corresponding pixel points; Repeat the above steps for each of the merged video information in the second information queue in sequence.
4. The method according to claim 3, characterized in that The determining of the corresponding playback pixel time accuracy based on the start time, the end time and the time axis coordinates of the merged video information includes: Determine the duration of the playback time axis based on the start time, the end time and the time axis coordinates; Based on the duration, the playback pixel time accuracy of the playback timeline is obtained.
5. The method according to claim 3, characterized in that: The converting the playback time of the merged video information into a corresponding pixel point on the playback time axis based on the playback pixel time accuracy and the time axis coordinates includes: Based on the playback pixel time accuracy and the playback time of the merged video information, obtaining the number of pixels corresponding to the merged video information; Based on the start time of the combined video information, the number of pixels and the time axis coordinates, the start pixel coordinates and the end pixel coordinates of the combined video information are acquired.
6. The method according to claim 1, characterized in that Before drawing the playback time axis corresponding to each of the combined video information based on the start time, the end time of each of the combined video information, and the pre-acquired time axis coordinates, the method further includes: Based on the preset minimum length of the playback time axis and the time axis coordinates, obtaining the minimum pixel time accuracy; The combined video information whose playback time is less than the minimum pixel time accuracy is eliminated from the multiple combined video information.
7. A timeline fast drawing device, characterized in that: The device comprises: An acquisition module, configured to acquire a first information queue, wherein the first information queue includes a plurality of initial video information sorted according to the start time of the plurality of videos to be played, wherein the initial video information includes the start time and the end time of the videos to be played; A merging module, used for merging the multiple initial video information in time axis to generate a second information queue, wherein the second information queue includes one or more merged video information, and the multiple merged video information do not overlap each other in time axis; A drawing module, used for drawing a playback time axis corresponding to each of the combined video information based on the start time, end time and pre-acquired time axis coordinates of each of the combined video information; The time axis merging of the plurality of initial video recording information to generate a second information queue comprises: Based on the order of each initial video information in the first information queue, taking each initial video information as the reference video information in turn; sequentially determining whether each initial video information sequenced after the reference video information has a temporal overlap with the reference video information; In the case of time overlap, updating the reference video information based on the corresponding initial video information and deleting the initial video information; generating the second information queue based on each updated reference video information; The step of sequentially determining whether each of the initial video information sequenced after the reference video information overlaps with the reference video information in time comprises: Determine whether the start time or the end time of the reference video information is within the time range of the initial video information, wherein the time range is determined based on the start time and the end time of the initial video information; Based on the preset minimum length of the playback time axis and the time axis coordinates, obtaining the minimum pixel time accuracy; If it is not within the time range of the initial video information, determining whether the time difference between the end time of the reference video information and the start time of the initial video information is less than or equal to the minimum pixel time accuracy; When the time difference is less than or equal to the minimum pixel time precision, it is determined that there is a time overlap between the initial video recording information and the reference video recording information.
8. A readable storage medium having a program stored thereon, characterized in that: When the program is executed by a processor, the steps of the time axis fast drawing method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Method and system for controlling multichannel video content display
CN105530474A
Video abstract generating method, video abstract generating device, and computer readable storage medium
CN108419145A
Video playing method, device and system, electronic equipment and medium
CN113055612A