Generating compressed video from one or more encoded video sequences

By directly manipulating encoded video data and using metadata to identify object trajectories, compressed video is generated, solving the problem of high computational costs in existing technologies. This achieves efficient and low-resource compressed video generation, which is suitable for multi-camera video synthesis.

CN123164237APending Publication Date: 2026-11-24AXIS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610510934.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2025-05-23
Filing Date
2026-04-17
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

Existing methods for generating compressed video are computationally expensive and resource-intensive, making it difficult to efficiently generate compact and information-rich video summaries.

Method used

By utilizing the metadata of the encoded video sequence, regions of interest corresponding to the object's trajectory can be identified, and the encoded video data can be manipulated directly. Decodeable encoded blocks can be copied into compressed video frames, avoiding decoding and re-encoding steps.

Benefits of technology

It achieves compressed video generation with higher bit rate and processing efficiency, maintains spatial alignment and temporal coherence of visual content, and is suitable for multi-camera video compositing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123164237A_ABST
    Figure CN123164237A_ABST
Patent Text Reader

Abstract

This disclosure relates to a method and apparatus for generating compressed video from one or more encoded video sequences, the method and apparatus using techniques capable of efficiently generating compressed video without decoding the encoded video sequences, instead manipulating the encoded video data directly by using associated metadata that identifies regions of interest and object trajectories.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to video processing, and more specifically, to generating compressed video from one or more coded video sequences. Background Technology

[0002] Video surveillance and video monitoring systems typically generate massive amounts of video data, especially in public safety, security, and industrial applications. Reviewing such large volumes of video footage to identify critical events or anomalies is both time-consuming and resource-intensive. To alleviate this, compressed video, also known as summary video or summary video, has been introduced as a means of efficiently communicating relevant activities over long periods. These compressed videos are typically designed to present an overview of important or interesting events that occur within hours or even days of video in a much shorter playback duration.

[0003] A common feature of compressed videos is their ability to present multiple events simultaneously, even if the original events occurred at different times. By doing so, these compressed videos provide viewers with a compact and information-rich visual presentation, facilitating a faster and more intuitive understanding of the content.

[0004] Methods for generating such compressed videos are known in the art. Conventional methods typically involve: fully decoding the original encoded video, performing video processing on the decoded frames to extract and organize key events, generating a new video composite that simultaneously presents multiple events from the original encoded video, and, if necessary, re-encoding the final compressed video for storage or transmission. While these methods may be effective in achieving visual summarization, they are computationally expensive and resource-intensive.

[0005] Therefore, there is a need for improvement in this context. Summary of the Invention

[0006] In view of the foregoing, as set forth in the appended independent patent claims, it would be beneficial to resolve or at least reduce one or more of the disadvantages discussed above.

[0007] According to a first aspect of this disclosure, a method for generating compressed video is provided, the method comprising: obtaining a coded video sequence comprising a plurality of coded image frames; obtaining metadata associated with the coded video sequence, the metadata indicating one or more series regions throughout the plurality of coded image frames, each region being associated with a corresponding coded image frame in the plurality of coded image frames and corresponding to an object detected in the associated coded image, and each series corresponding to an object trajectory of the object detected in the coded video sequence; determining intra-coded frames of the compressed video; and determining a first inter-coded frame of the compressed video, the first inter-coded frame being encoded with reference to the intra-coded frames.

[0008] Determining the first inter-coded frame includes: for a first region in a first series of regions, identifying a first set of one or more coded blocks from a coded image frame associated with the first region, wherein each coded block in the identified first set is located within the first region and can be decoded using an intra-coded frame or can be decoded without reference to any other coded blocks; and copying the coded blocks of the identified first set from the coded image frame associated with the first region into the first inter-coded frame.

[0009] The method further includes: determining a second inter-frame coded frame for the compressed video, the second inter-frame coded frame being encoded with reference to a first inter-frame coded frame; determining includes: for a second region following the first region in a first series of regions, identifying a second set of one or more coded blocks from coded image frames associated with the second region, wherein each coded block in the identified second set is located within the second region and can be decoded using coded blocks from the first set or can be decoded without reference to any other coded blocks; and copying the coded blocks of the identified second set from the coded image frames associated with the second region into the second inter-frame coded frame.

[0010] In the context of this disclosure, "metadata" refers to auxiliary information associated with a encoded video sequence that indicates spatial regions corresponding to objects detected within multiple encoded image frames. Metadata defines one or more series of regions spanning multiple frames, where each series corresponds to an object trajectory, and each region within a series identifies the object's location within a particular frame. This may include, for example, bounding box coordinates, frame indices, and object identifiers that associate regions spanning frames with the same object.

[0011] In the context of this disclosure, a “coded block” refers to a unit of coded video data corresponding to a spatial portion of an image frame, as defined by the video compression standard used (e.g., a macroblock in H.264, a coding tree unit in HEVC, or a superblock in AV1). Each coded block contains data representing pixel values ​​independently (intra-coded) or by referencing other blocks (inter-coded), and serves as the basic unit for compression, motion estimation, and prediction.

[0012] Advantageously, a method is provided for generating compressed (summary) video in a manner that is more bit-rate efficient and processing-efficient than conventional methods. Unlike existing methods that require complete decoding of the original video, pixel-domain processing, and subsequent re-encoding of the synthesized frames, the proposed method avoids these computationally costly steps by directly manipulating the encoded video data. Specifically, the method utilizes metadata identifying regions of interest (ROIs) corresponding to object trajectories spanning multiple encoded image frames. The technique presented in this disclosure does not decode these ROIs, but rather involves analyzing the encoded structure, including motion vectors and intra-frame coded block information, to verify which regions can be directly reused. If a region is determined based on this encoded information to be decodeable from intra-frame data or from predicted data already present in previously defined inter-frame synthesized composite frames of the compressed video, the corresponding coded block is directly copied into the new inter-frame synthesized composite frame. This reuse of coded data across synthesized frames eliminates unnecessary decoding and re-encoding operations, ensuring efficient generation of compressed video with reduced computational overhead.

[0013] In some examples, determining an intra-coded frame involves obtaining the intra-coded frame from a coded video sequence, for which metadata does not indicate any region corresponding to the detected object.

[0014] Advantageously, this allows selected intra-frames to be used as clean background or template frames for compressed video, free of overlapping objects or motion-related content. Using such object-free I-frames can provide a visually neutral "background" onto which regions of interest from other time points can be composited. Furthermore, reusing existing I-frames from the original video eliminates the need to encode new intra-frames, thus reducing processing complexity and contributing to overall bitrate efficiency.

[0015] In some examples, determining an intra-coded frame includes: obtaining a predetermined intra-coded frame as an intra-coded frame.

[0016] Advantageously, this allows for the generation of consistent and predictable compressed video, as the same reference frame can be reused across multiple instances or devices. Furthermore, predefined intra-frames can be marked or specified based on the application context, for example, as a default background frame or a reference for a specific scene.

[0017] In some examples, copying the coded blocks of the first set into a first coded image frame includes: placing each coded block in the first set into a spatial position in the first inter-frame coded frame corresponding to the spatial position of the coded block in the coded image associated with the first region; and copying the coded blocks of the second set into a second coded image frame includes: placing each coded block in the second set into a spatial position in the second inter-frame coded frame corresponding to the spatial position of the coded block in the coded image associated with the second region.

[0018] Advantageously, this method preserves the spatial alignment of visual content between the original encoded video and the compressed video, allowing regions of interest to maintain their original spatial positioning within the synthesized frames of the compressed video. By maintaining this one-to-one spatial correspondence, the compressed video can preserve the geometry and contextual relationships of objects within the scene presented in the original video stream, even if those objects originate from different points in time. This spatial consistency can enhance the scene interpretability of the compressed video for both human operators and automated analysis systems, as object movement, interaction, and trajectories remain visually coherent.

[0019] In some examples, for each region, the metadata further includes location data indicating the real-world location of the detected object in the associated coded image; copying the coded blocks of the first set into the first coded image frame includes: placing each coded block in the first set into the first inter-frame coded frame at a spatial location determined by the spatial location of the coded block in the coded image associated with the first region and the location data of the first region; and copying the coded blocks of the second set into the second coded image frame includes: placing each coded block in the second set into the second inter-frame coded frame at a spatial location determined by the spatial location of the coded block in the coded image associated with the second region and the location data of the first region.

[0020] Advantageously, even in scenes where the camera capturing the original video of the encoded video sequence is moving, such as when using pan-tilt-zoom (PTZ), these examples can achieve accurate spatial placement of the region of interest. By incorporating real-world location data, this method compensates for camera motion and scene offset, ensuring that objects are synthesized in spatially meaningful locations within the compressed video regardless of changes in viewpoint in the source video.

[0021] In some examples, the steps of the method are performed for multiple encoded video sequences, each obtained from a corresponding camera, wherein each camera is associated with a real-world location, and wherein location data for each region defined in the metadata associated with each encoded video sequence is associated with the real-world location of the camera from which the encoded video sequence is obtained.

[0022] This implementation extends the method to operate across multiple encoded video sequences acquired from multiple cameras, each associated with a known real-world location (e.g., GPS location). Location data for each region in the metadata can then be derived relative to the physical location of the camera that captured the corresponding video sequence. This allows for spatial alignment of objects from different cameras based on their real-world locations when compressing the video.

[0023] Advantageously, this ensures the generation of multi-source compressed video, where regions of interest from multiple cameras can be integrated into a common spatial reference frame. If the predetermined intra-coded frame is, for example, a map or schematic diagram representing the layout of camera positions, it can serve as a unified visual background onto which object data from all cameras can be synthesized in a geospatial context. This can benefit a human operator viewing the compressed video with a global situational overview. It can also allow for cross-camera object tracking or the correlation of events between multiple video streams.

[0024] In some examples, identifying a first set of one or more coded blocks includes: for each coded block within a first region of a coded image frame associated with a first region, identifying the coded block according to one of the following: the coded block is an intra-coded coded block, and the coded block is encoded with reference to coded blocks included in intra-coded frames of a compressed video in a coded video sequence.

[0025] In this context, an intra-frame coded block (often called an I-block) is a block that is encoded using only information from within the same frame without referencing any other frames in the video sequence. I-blocks are self-contained and therefore can be decoded independently, making it possible to reuse them directly in compressed video.

[0026] In contrast, predictive coded blocks (often called P-blocks) are coded using inter-frame prediction, meaning they depend on reference blocks in the previous frame of the coded video sequence. Similarly, B-blocks are bi-directionally predictive, meaning they depend on reference blocks in both the previous and future frames of the coded video sequence. To ensure correct decoding in compressed video, the method requires that for the first inter-frame coded frame (P-frame or B-frame), all reference blocks used for prediction must exist in the intra-frame coded frames of the compressed video. In the case of P-blocks, this typically means that the intra-frame coded frames used in the compressed video should correspond to the frames in the coded video sequence immediately preceding the coded image frame from which the P-block originates. For B-blocks with backward and forward dependencies, additional reference frames—frames in the original sequence before and after the B-frame—may be required to meet the decoding requirements.

[0027] Importantly, if a coded block does not meet either of these two preconditions—that is, it is neither intra-coded nor predictively coded by referencing blocks already existing in the intra-frame of the compressed video—it will not be copied into the compressed video, even if it lies within a region of interest (ROI) as defined by metadata. However, the inventors have realized that even when some blocks within the ROI are omitted, the resulting compressed video often appears visually acceptable. This insight allows techniques for generating compressed video to avoid unnecessary processing (i.e., pixel-domain operations) while still achieving semantically meaningful compressed video.

[0028] In some examples, identifying a second set of one or more coded blocks includes: for each coded block within a second region of a coded image frame associated with a second region, identifying the coded block according to one of the following: the coded block is an intra-frame coded block (I block) and an inter-frame coded block (P block) encoded in the video sequence included in a first set of referenced one or more coded blocks.

[0029] This example is conceptually similar to the identification of coded blocks in the first P-frame (first inter-coded frame) of a compressed video, where blocks are selected based on the ability to decode independently (as I-blocks) or by referencing data already present in a previously defined frame. However, in this case, the method checks whether a reference block for a given P-block is already part of the first set of coded blocks, i.e., whether it has been copied into the first inter-coded frame of the compressed video.

[0030] In some examples, determining the first inter-coded frame of the compressed video includes: for a third region in a second series of regions, identifying a third set of one or more coded blocks from coded image frames associated with the third region, wherein each coded block in the identified third set is located within the third region and can be decoded using an intra-coded frame or can be decoded without reference to any other coded blocks; and copying the coded blocks of the identified third set from the coded image frames associated with the third region into the first inter-coded frame.

[0031] In these examples, determining the second inter-frame coded frame of the compressed video includes: for a fourth region following the third region in the second series of regions, identifying a fourth set of one or more coded blocks from the coded image frame associated with the fourth region, wherein each coded block in the identified fourth set is located within the fourth region and can be decoded using the coded blocks of the third set or can be decoded without reference to any other coded blocks; and copying the coded blocks of the identified fourth set from the coded image frame associated with the fourth region into the second inter-frame coded frame.

[0032] It should be noted that terms such as "first," "second," and "third," used herein in connection with regions, frames, sets of coded blocks, etc., are for the purpose of clear textual identification and distinction within the specification only. Unless explicitly stated otherwise, these terms do not imply any particular order, priority, or chronological sequence.

[0033] This example allows inter-frame coded frames in compressed video to include multiple objects (i.e., from first and second series regions). By selectively copying coded blocks associated with different object trajectories into the same inter-frame frame based on the decodeability and location of the coded blocks, this method enables temporal compression of events.

[0034] In some examples, the coded image frame associated with the first region and the coded image frame associated with the third region are different coded image frames within the coded video stream.

[0035] This example allows inter-frame coded frames in compressed video to include multiple objects that would not normally be visible in the same frame of the source video. As a result, the compressed video can provide a concise visual summary, where the simultaneous presentation of events (objects) that are separated in time facilitates quick viewing.

[0036] In some examples, arbitrary coded blocks in the first and second inter-frame coded frames of the compressed video that are not copied from the coded image frames of the coded video stream are set to one of the following: skipped blocks; and inter-frame coded blocks with zero residuals.

[0037] Functionally, both methods result in any uncopyable blocks in a P-frame of the compressed video being reconstructed from a reference frame (i.e., when decoded) without modification, and in this context, the reference frame is an intra-coded frame used in the compressed video. Thus, any portion of an inter-coded frame that does not contain object content will simply represent the content of an I-frame.

[0038] In some examples, the metadata includes multiple object detection metadata instances, each corresponding to a detected object and including one or more of the following: the bounding box of the detected object; the segmentation mask of the detected object; and the location and size of the detected object.

[0039] In some examples, the method further includes: encoding a video sequence into a coded video sequence, wherein the encoding includes: obtaining image frames indicating the video sequence and object tracking data of coded regions in which the tracked object is first detected in the image frames; and encoding all coded blocks within the coded regions of the images into intra-frame coded blocks.

[0040] Advantageously, this example facilitates encoding the initial appearance of a newly detected object in a self-contained manner in the video, i.e., without referencing any other frames. As a result, when constructing the compressed video, this first instance of the object is guaranteed to be independently decodeable. This increases the likelihood that the trajectory of the new object will be represented in the compressed video, enhancing the integrity and informativeness of the compressed video.

[0041] According to a second aspect of this disclosure, the above objective is achieved by a non-transitory computer-readable storage medium having instructions stored thereon for implementing the method according to the first aspect when executed on a processing-capable device.

[0042] According to a third aspect of this disclosure, the above objective is achieved by an apparatus for generating compressed video, wherein the apparatus is configured to: obtain a coded video sequence comprising a plurality of coded image frames; obtain metadata associated with the coded video sequence, the metadata indicating one or more series regions pervading the plurality of coded image frames, each region being associated with a corresponding coded image frame in the plurality of coded image frames and corresponding to an object detected in the associated coded image, and each series corresponding to an object trajectory of the object detected in the coded video sequence; determine intra-coded frames of the compressed video; and determine a first inter-coded frame of the compressed video, the first inter-coded frame being encoded with reference to the intra-coded frames.

[0043] Determining the first inter-coded frame includes: for a first region in a first series of regions, identifying a first set of one or more coded blocks from a coded image frame associated with the first region, wherein each coded block in the identified first set is located within the first region and can be decoded using an intra-coded frame or can be decoded without reference to any other coded blocks; and copying the coded blocks of the identified first set from the coded image frame associated with the first region into the first inter-coded frame.

[0044] The apparatus is configured to determine a second inter-frame coded frame for compressed video, the second inter-frame coded frame being encoded with reference to a first inter-frame coded frame, the determination comprising: for a second region following the first region in a first series of regions, identifying a second set of one or more coded blocks from coded image frames associated with the second region, wherein each coded block in the identified second set is located within the second region and can be decoded using coded blocks from the first set or can be decoded without reference to any other coded blocks; and copying the coded blocks of the identified second set from the coded image frames associated with the second region into the second inter-frame coded frame.

[0045] The second and third aspects can generally have the same features and advantages as the first aspect. It should be further noted that, unless otherwise stated, this disclosure relates to all possible combinations of features. Attached Figure Description

[0046] The above and other objects, features and advantages of this disclosure will be better understood through the following illustrative and non-limiting detailed description of embodiments thereof with reference to the accompanying drawings, wherein like reference numerals will be used for similar elements, wherein:

[0047] Figure 1 This illustrates the generation of compressed video from an encoded video sequence according to an implementation method;

[0048] Figure 2This illustrates a technique for identifying decodeable coded blocks from regions of interest in coded image frames, according to an embodiment.

[0049] Figure 3 This illustrates how compressed video is generated from multiple encoded video sequences according to an implementation method.

[0050] Figure 4 A flowchart illustrating a method for generating compressed video according to an embodiment is shown. Detailed Implementation

[0051] Conventional methods for generating compressed or summary videos typically require: decoding the original video stream, processing the video content in the pixel domain to generate compressed video, and re-encoding the resulting output from the processing. These steps are computationally intensive, especially when processing long-duration video content or high-resolution streams, and may be unsuitable for time-constrained or resource-limited environments where fast processing or reduced computational overhead is required.

[0052] This disclosure solves this problem by providing a method for efficiently generating compressed video, in which multiple events that would otherwise occur at different times can be presented simultaneously. This is achieved without decoding the input video, but by directly manipulating the encoded video data using relevant metadata that identifies regions of interest and object trajectories. This will now be combined with... Figures 1 to 4 Describe the technology used to achieve this.

[0053] Figure 1 The illustration provides a schematic overview of how compressed video 140 can be generated from an encoded video sequence 110 comprising a series of multiple encoded image frames 112 to 124. In this example, the encoded video sequence 110 includes two tracked objects. Figure 1 The first tracked object is represented by a white rectangle, and the second tracked object by a black rectangle. The first tracked object appears in frames 114-120, while the second tracked object appears in frames 118-124. Figure 1 In the encoded video sequence 110, the intra-coded frames (I-frames) are represented by solid-line rectangles, namely image frames 112 and 120, while the inter-coded frames (P-frames and B-frames) of the encoded video sequence 100 are represented by dashed-line rectangles, namely image frames 114, 116, 118, 122, and 124. For ease of description, inter-coded frames are exemplified as P-frames in the following text.

[0054] To enable the generation of compressed video 140, associated metadata 180 is obtained. In this illustrative example, metadata 180 identifies two series of regions 182 and 184, each series spanning multiple coded image frames. These series correspond to two tracked objects, and... Figure 1Square brackets are used to denote these. Each series 182, 184 is assigned an identifier, such as... Figure 1 The "1" and "2" in this context can correspond to a tracking ID or any other identifier that uniquely represents the tracked object. Figure 1 In the example, the first series 182 identifies the first tracked object (white rectangle) in the coded video sequence 110, and the second series 184 identifies the second tracked object (black rectangle).

[0055] Each region in the series is associated with a specific coded image frame and defines the spatial extent of the tracked object within that frame. These regions can also be called regions of interest (RoIs). Figure 1 In this context, this association is illustrated by frame numbers (1 through 7) and location markers labeled “X” and “Y”, which typically represent the pixel coordinates within the corresponding coded image frame where the tracked object is located. Metadata 180 can define each region using various formats (e.g., conforming to ONVIF profile M, or any other suitable standardized or proprietary metadata format), including but not limited to bounding boxes, segmentation masks, or coordinate pairs, as well as associated dimensions (e.g., location and size).

[0056] It should be noted that Figure 1 The metadata structure 180 illustrated in the diagram is merely one example of how such metadata 180 can be organized. Alternatively, a metadata frame can be provided for each image frame. The metadata 180 may include additional information such as object classification labels, confidence scores, timestamps, motion vectors, or real-world positioning data. Furthermore, the metadata 180 can be obtained directly from the object tracking component or derived from data generated by such a component.

[0057] When generating compressed video 140, the first step may be to determine the intra-coded frames (I-frames) 142 of compressed video 140. This can be done in several ways.

[0058] For example, determining intra-coded frame 142 may include obtaining 162 intra-coded frames 112 from the encoded video sequence 110, for which metadata 182 does not indicate any region corresponding to a detected object. Selecting such object-free frames provides a clean and unobstructed background, which helps maintain spatial coherence in the compressed video 140 when regions of interest from other time points are composited onto the compressed video 140.

[0059] In other examples, determining I-frame 142 includes: obtaining a predetermined I-frame 160 and using it as I-frame 142 of the compressed video 140. The predetermined I-frame 160 may, for example, include a label or visual overlay (in... Figure 1(represented by "@"), which will include maps such as camera locations (as will be combined below) Figure 3 Further descriptions, floor plans, or contextual information visualizations of scene layouts related to the monitored area. Labels or visual overlays can further illustrate company-specific information, such as logos, camera ownership details, or application-specific context, including site names, area designations, or operational areas (e.g., warehouse areas, transportation hubs, or retail departments).

[0060] Once I-frame 142 has been determined, the first inter-frame coded frame (P-frame) 144 referencing I-frame 142 can be determined.

[0061] This is accomplished by identifying a first set of one or more coded blocks from the coded image frame 114 associated with the first region, for the first region in the first series of regions 182 indicated by the metadata 180, which can be decoded either by themselves or using previously added frames in the compressed video 140 (in this case, I-frame 142).

[0062] To determine whether a coded block can be decoded and thus safely copied into a compressed video, the method may include a preliminary decoding step, sometimes referred to as "unpacking." This step is part of many standard video decoding processes, such as syntax element decoding and dependency analysis in HEVC, but unlike full decoding, it does not involve complete pixel reconstruction. Instead, unpacking involves parsing and interpreting the coding parameters associated with each block (e.g., prediction mode, reference index, motion vectors, and block partitioning) to assess its decoding dependencies.

[0063] For example, the unpacking process allows identification of whether:

[0064] The blocks are intra-frame coded (i.e., I-blocks), and therefore self-decoding;

[0065] The block is inter-frame coded (e.g., a P-block), and if so, whether its reference block is available, such as in another previously constructed frame in I-frame 142 or compressed video 140; and

[0066] A block depends on an unavailable predicted block (e.g., a reference to an encoded block not included in the compressed video 140), in which case it is excluded from copying to the compressed video, as described below.

[0067] Therefore, for Figure 1 In the example of the first P-frame 144, any coded block identified in the coded blocks of the first set must be an I-block or a P-block that refers to the coded blocks included in I-frame 142.

[0068] exist Figure 1In this context, the first region is associated with the first P-frame 114 of the encoded video sequence 110. If an I-frame 112 referenced by P-frame 114 in the original encoded video sequence 110 is also used as an I-frame 142 of the compressed video 140, then all coded blocks in P-frame 114 are generally considered decodable because any required reference data is available. However, if a predetermined I-frame 160 (or any other I-frame not corresponding to I-frame 112) is used as an I-frame 142 of the compressed video, then only intra-frame coded blocks (I-frames) in P-frame 114 can be safely copied into the compressed video. In this context, any P-block that depends on a reference from I-frame 112 that is not present in the compressed video 140 will be considered undecodable.

[0069] To address this issue, one implementation involves encoding the video sequence into a coded video sequence 110 in a manner that increases the decodability of newly emerging tracked objects. This is achieved by obtaining image frames indicating the video sequence and object tracking data for the coded region within that frame where the tracked object is first detected, and encoding all coded blocks within that region as intra-frame coded blocks (I-blocks). This ensures that the first appearance of the tracked object is encoded in a self-contained manner, independent of any other frame. As a result, the region corresponding to the first appearance is more likely to be considered decodable using the techniques described herein and can therefore be added to the compressed video 140 regardless of what image data was previously included in the compressed video 140, thereby increasing the inclusion rate of object trajectories and improving the visual integrity of the compressed video 140.

[0070] It should be noted that the custom coding, which selectively applies intra-frame coding to the region where the tracked object first appears, is performed by the encoder that generates the coded video sequence 110. This custom encoder is configured or adapted to use object tracking data during the encoding process to determine when and where to use intra-frame coding instead of the standard inter-frame prediction mechanism.

[0071] exist Figure 1 In the example, coded blocks from the coded image frame 114 associated with the first region are identified as decodable, and all coded blocks depicting the first tracked object in the coded image frame 114 can therefore be copied to the first P-frame 144, thus forming coded blocks 154 of the compressed image frame. Coded blocks 154 of the first P-frame 144 are therefore direct copies of a first set of one or more coded blocks from the coded image frame 114.

[0072] Next, a second P-frame 146 is determined, referencing the first P-frame 144. This is done in a similar manner to determining the first P-frame 144. From the first series of regions 182, in a second region following the first region, a second set of coded blocks from one or more coded image frames 116 associated with the second region is determined. The second region is therefore, for example, the bounding box of the first tracked object depicted in the second P-frame 116 of the coded video sequence 110.

[0073] A second set of one or more coded blocks from coded image frame 116 is determined, wherein each coded block in the identified second set is located within a second region and can be decoded using coded blocks from the first set (i.e., coded blocks depicting the first tracked object and from which the first P-frame 144 is copied to the compressed video) or can be decoded without referencing any other coded blocks. This process is in Figure 2 It is shown in more detail below.

[0074] Figure 2 Shown from Figure 1 The diagram shows cropped portions of two P-frames, 114 and 116, of the coded video sequence, both of which include the first tracked object. A first region 204 (i.e., the bounding box of the tracked object in P-frame 114) and a second region 208 (i.e., the bounding box of the tracked object in P-frame 116) are also shown. The coded blocks within the second region 208 are classified into three subsets: 210, 212, and 214. Figure 2 A subset 212, depicted in gray, consists of intra-coded blocks (I-blocks). A second subset 210 includes inter-coded blocks (P-blocks) referencing blocks located within the first region 204. A third subset 214 includes P-blocks referencing blocks outside the first region 204.

[0075] Assuming all coded blocks of the first region 204 have been included in the first P-frame 144 of the compressed video 140 (i.e., forming...), Figure 1 A portion of the reused coded block set 154 is then used to construct the second set of coded blocks for the second P-frame 146 in the compressed video (in... Figure 1 The code block 158 shown in the figure is defined as follows:

[0076] The coded blocks in subset 212 are intra-frame coded (I-blocks), meaning they are self-decoding and therefore can be safely reused in compressed video 140;

[0077] The coded blocks in subset 210 are inter-frame coded (P-blocks), and their reference blocks (in Figure 2 (Indicated by arrow 216) It is available in the first P frame 144 of the compressed video 140, and therefore can also be reused (i.e., copied into the compressed video).

[0078] The coded blocks in subset 214 depend on reference blocks that do not exist in the compressed video (in Figure 2 The inter-frame encoded (P-block) (indicated by arrow 218) is therefore not reusable (i.e., not copied into the compressed video).

[0079] Back Figure 1 As discussed above, the advantage of generating compressed video is that multiple events that originally occurred at different times in the encoded video sequence 110 can be presented simultaneously in the compressed video 140. Figure 1 This is illustrated by the following fact: with the second tracked object (in Figure 1 The corresponding coded image block (delineated by a black rectangle in the image) is also evaluated for decodeability, and when deemed decodeable, it is copied into the compressed video 140 in a manner similar to that described above for the first tracked object (white rectangle). The second tracked object is thus indicated in the metadata 180 of the second series of regions 184. For the first region of the second series of regions (referred to herein as the third region), a third set of coded blocks from one or more coded image frames 118 associated with the third region is identified, wherein each coded block in the identified third set is located within the third region and can be decoded using intra-frame coded frames 142 (i.e., P-blocks, referring to coded blocks in I-frames 142 of the compressed video 140) or can be decoded without reference to any other coded blocks (i.e., I-blocks). The coded blocks of the identified third set are then copied from the coded image frames 118 associated with the third region into the first P-frame 144 as reused coded blocks 152.

[0080] like Figure 1 As illustrated, the coded image frame 114 associated with the first region and the coded image frame 118 associated with the third region can be different coded image frames within the coded video stream 110, thus enabling multiple events that originally occurred at different times in the coded video sequence 110 to be presented simultaneously in the compressed video 140.

[0081] Then the same processing is performed on the second region (referred to herein as the fourth region) 184 in the second series regions, and all decodable coded blocks from this region are copied from the coded image frame 120 associated with the fourth region to the second P frame 146 as reused coded blocks 156.

[0082] Then, the above techniques can be applied to the remaining areas of the first series regions 182 and the second series regions 184 of the metadata 180, and reused coding blocks from multiple associated coded image frames are forming the third P-frame 148 and the fourth P-frame 150 of the compressed video 140.

[0083] In the example above, the spatial location of each copied (reused) coded block within the compressed video 140 is maintained to correspond to the spatial location occupied by that block in its associated coded image frame (i.e., the coded image frame from which it is copied). For example, copying coded blocks 154 of the first set into the first coded image frame (i.e., the first P-frame 144) includes placing each coded block of the first set in the first P-frame 144 at a spatial location corresponding to the spatial location of that coded block in the original coded image frame 114 associated with the first region. Figure 1 In this process, the same strategy is used for all reused encoded blocks copied from encoded video sequence 110 to compressed video 140.

[0084] The remaining coded blocks of P-frames 144 to 150 of the compressed video (i.e., the coded blocks not copied from coded image frames 112 to 124 of the coded video stream 110) can advantageously be set as either skip blocks or P-blocks with zero residuals. It should be noted that the term skip block can have different names in various video coding formats; for example, it might be called an empty block, or have other format-specific definitions indicating the absence of residual data.

[0085] like Figure 1 As illustrated, compressed video 140 is generated directly in the encoded format without first decoding the encoded video stream 110 and then re-encoding the compressed version constructed in the pixel domain. Instead, the technique described herein operates directly on the encoded data, selectively reusing decodeable encoded blocks from the original encoded video stream 110 to assemble compressed video 140. This method avoids the computational overhead of full decoding and re-encoding, thus providing a more efficient and lightweight process for generating compressed video representations.

[0086] In some examples, for each region, metadata 180 further includes location data indicating the real-world location (such as GPS location) of the detected object within the associated coded image frame. In these examples, the spatial locations of reused coded blocks 152, 154, 156, and 158 within compressed video frames 142 to 150 can be based not only on them as explained above but also... Figure 1 The original pixel coordinates in the source frames 114 to 124 visualized in the image are used to determine the location, and the location can also be determined based on the real-world location of the object indicated in the metadata.

[0087] This allows for compensation for camera motion during the recording of the encoded video stream 110, such as when using a pan-tilt-zoom (PTZ) camera or a moving platform. Instead of placing copied blocks strictly according to the moving camera view, the copied blocks can be positioned in the compressed video 140 to reflect a stable real-world spatial reference. As a result, the compressed video 140 maintains a coherent spatial position of the tracked object even if the field of view in the original encoded video sequence 110 changes over time.

[0088] In some implementations, two alternative methods can be considered for determining the location of blocks from video from a moving PTZ camera. One option is to use real-world locations from geographic metadata, which requires compensating for the PTZ camera's motion to project the real-world location of the object back into the image coordinate system. Alternatively, location information from metadata can directly indicate the image coordinates of the detected object. Since image classification is typically performed in the image coordinate domain, this method eliminates the need for backprojection from world coordinates. The real-world location metadata can still be used at later stages, for example, to place the copied blocks at their appropriate real-world-based locations during the compositing of compressed video.

[0089] Furthermore, if the I-frame 142 selected for the compressed video 140 represents a background view from a specific perspective (e.g., a specific direction or position of the camera), this implementation still allows a copy of the tracked object to be pasted in a natural and meaningful location within that background, even if the camera has moved since the I-frame was captured. This helps maintain an intuitive visual presentation, and the object appears in the compressed video 140 with the correct spatial relationship relative to the static scene background.

[0090] In another example, the use of real-world location data also makes it possible to determine compressed video from multiple video sequences captured from multiple cameras. In this case, objects tracked by different cameras can be placed within a common spatial reference in the compressed video based on their real-world locations rather than their positions relative to each individual camera view. This allows the compressed video to combine object data from different sources into a single, coherent layout. Figure 3 This implementation method will be further described.

[0091] Figure 3 The illustration shows a scene 300 captured from different perspectives by three cameras 302, 304, and 306. The scene includes two tracked objects 308 and 310, and a static background element represented by a tree 312. Each camera 302, 304, and 306 captures a corresponding coded video sequence of the scene from its specific perspective. Using the techniques described above, the three coded video sequences can be summarized into a single compressed video sequence.

[0092] For ease of explanation, Figure 3 Decoded frame 320 extracted from this compressed video is shown. However, it should be understood that the compressed video is generated directly from multiple encoded video sequences using the previously described techniques without complete decoding and re-encoding. In this case, the generation of the compressed video further considers that each camera 302, 304, 306 is associated with a specific real-world location, and the location data of each region (defined in the metadata associated with each encoded video sequence) is associated with the real-world location of the corresponding camera 302, 304, 306. This allows objects captured by different cameras 302, 304, 306 to be consistently placed within a common spatial reference in the compressed video, preserving the real-world layout of the scene.

[0093] In this example, the background of the encoded compressed video is a predetermined I-frame, composed of... Figure 3 The "@" character in the text indicates the location. Pre-defined I-frames can include, for example, maps such as building floor plans, site layouts, or diagrams of the monitored environment. By using pre-defined I-frames that reflect the real-world environment, compressed video can accurately place objects from different cameras onto a consistent and meaningful background, even if the source video comes from different perspectives. For example, each object captured by a camera can be pasted into the compressed video at a position corresponding to the location of the camera that captured the tracked object within the floor plan or map. This is... Figure 3 The diagram is shown schematically.

[0094] In decoded image frame 320, three regions 322, 324, and 326 are pasted onto a static background. In encoded compressed video, this can be achieved by determining P-frames as discussed above, wherein coded blocks determined to be decodeable according to the techniques described herein are copied into the P-frames. Each set of coded blocks copied from a region (e.g., the bounding box of a tracked object) in the source video is placed in the P-frame at a spatial location determined by the spatial position of that coded block in the coded image associated with that region and by the positional data of the region.

[0095] like Figure 3 As shown, copy regions 322, 324, and 326 from the corresponding encoded video sequences are placed at positions corresponding to the real-world positions of the corresponding cameras 302, 304, and 306 within scene 300. Specifically, copy region 322 represents a compressed version of the encoded video sequence captured by the lower-left camera 302, copy region 324 represents a compressed version of the encoded video sequence captured by the upper-left camera 304, and copy region 326 represents a compressed version of the encoded video sequence captured by the right camera 306. Here, the terms "lower-left," "upper-left," and "right" refer to the physical positions of the cameras within scene 300, reflecting their perspective relative to the overall layout of the environment.

[0096] The tracked object is schematically illustrated at a position corresponding to the actual tracked object 310, 308 as captured by each corresponding camera. Figure 3 In the diagram, the black rectangle represents the tracked object 308, located on the right side of scene 300, while the white rectangle represents the tracked object 310, located on the left side of the scene. As shown, each region 322, 324, and 326 illustrates a compressed version of the corresponding coded video sequence, where the tracked objects are positioned according to their appearance relative to the camera position. For example, the position of the black rectangle within region 326 is intended to indicate the moment when the tracked object 308 first enters the field of view of the right camera 306. Notably, this event occurs at a later point in time compared to when the tracked object 310 first enters the corresponding viewpoint. Therefore, compressed video can integrate spatial and temporal information from multiple video streams into a coherent and meaningful visualization. Of course, different cameras 302, 304, and 306 can also capture different tracked objects, which are represented in the compressed video using the techniques described herein.

[0097] Figure 4 The illustration shows an example process 600 for generating compressed video from an encoded video sequence. Process 600 can be implemented as a standalone routine or as part of a larger video analysis or encoding system. In some implementations, process 600 is executed by instructions executable by one or more processors, which may be embedded in a single device or distributed across multiple devices within a system. The instructions for performing the process can be stored on one or more non-transitory computer-readable media.

[0098] Suitable processors for executing instructions include, by way of example, general-purpose or special-purpose microprocessors, and can be implemented as single-core or multi-core processors, depending on the architecture of the device or system. Processors can operate individually or collaboratively to execute... Figure 4 The method steps described herein. In some implementations, the processor may be enhanced or fully implemented therein by an application-specific integrated circuit (ASIC), a digital signal processor (DSP), a field-programmable gate array (FPGA), or other dedicated hardware accelerators optimized for efficient video and metadata processing.

[0099] Process 600 includes obtaining an encoded video sequence comprising multiple encoded image frames in S602.

[0100] Process 600 further includes: obtaining S604 metadata associated with the encoded video sequence, the metadata indicating one or more series regions spanning multiple encoded image frames, each region being associated with a corresponding encoded image frame in the multiple encoded image frames and corresponding to an object detected in the associated encoded image, and each series corresponding to the object trajectory of the object detected in the encoded video sequence.

[0101] Process 600 further includes: determining the intra-coded frames of the S606 compressed video.

[0102] Process 600 further includes: determining the first inter-frame code of the S606 compressed video, and encoding the first inter-frame decoded frame with reference to the intra-frame coded frame.

[0103] In process 600, the determination step S606 includes: for a first region in a first series of regions, identifying S608 a first set of one or more coded blocks from the coded image frame associated with the first region, wherein each coded block in the identified first set is located within the first region and can be decoded using an intra-coded frame or without reference to any other coded blocks; and copying the coded blocks of the identified first set from the coded image frame associated with the first region into a first inter-coded frame in S610.

[0104] Process 600 further includes: determining a second inter-frame coded frame of the S612 compressed video, the second inter-frame coded frame being coded with reference to the first inter-frame coded frame.

[0105] In process 600, the determination step S612 includes: for a second region following the first region in the first series of regions, identifying S614 a second set of one or more coded blocks from the coded image frame associated with the second region, wherein each coded block in the identified second set is located within the second region and can be decoded using the coded blocks of the first set or can be decoded without reference to any other coded blocks; and copying S616 the coded blocks of the identified second set from the coded image frame associated with the second region to the second inter-frame coded frame.

[0106] The above embodiments should be understood as illustrative examples of this disclosure. Further embodiments of this disclosure are envisioned. It should be understood that any feature described with respect to any embodiment may be used alone or in combination with other described features, and may also be used in combination with one or more features of any other embodiment or any combination of any other embodiment. Furthermore, equivalents and modifications not described above may be employed without departing from the scope of this disclosure as defined in the appended claims.

Claims

1. A method for generating compressed video, the method comprising: Obtain a coded video sequence comprising multiple coded image frames; Obtain metadata associated with the encoded video sequence, the metadata indicating one or more series of regions throughout the plurality of encoded image frames, each region being associated with a corresponding encoded image frame in the plurality of encoded image frames and corresponding to an object detected in the associated encoded image, and each series corresponding to an object trajectory of an object detected in the encoded video sequence; Determine the intra-coded frames of the compressed video; Determining a first inter-frame coded frame of the compressed video, the first inter-frame coded frame being encoded with reference to the intra-frame coded frames, the determination comprising: for a first region in a first series of regions, identifying a first set of one or more coded blocks from coded image frames associated with the first region, wherein each coded block in the identified first set is located within the first region and can be decoded using the intra-frame coded frames or can be decoded without reference to any other coded blocks; and copying the coded blocks of the identified first set from the coded image frames associated with the first region into the first inter-frame coded frame; Determining a second inter-frame coded frame for the compressed video, the second inter-frame coded frame being encoded with reference to the first inter-frame coded frame, the determination comprising: for a second region following the first region in the first series of regions, identifying a second set of one or more coded blocks from coded image frames associated with the second region, wherein each coded block in the identified second set is located within the second region and can be decoded using the coded blocks of the first set or can be decoded without reference to any other coded blocks; and copying the coded blocks of the identified second set from the coded image frames associated with the second region into the second inter-frame coded frame.

2. The method according to claim 1, wherein, Determining an intra-coded frame includes: obtaining an intra-coded frame from the encoded video sequence, for which the metadata does not indicate any region corresponding to the detected object.

3. The method according to claim 1, wherein, Determining an intra-coded frame includes: obtaining a predetermined intra-coded frame as the intra-coded frame.

4. The method according to claim 1, in, Copying the coded blocks of the first set into the first coded image frame includes: placing each coded block from the first set at a spatial position in the first inter-frame coded frame corresponding to its spatial position in the coded image associated with the first region; and The process of copying the coded blocks of the second set into the second coded image frame includes placing each coded block in the second set at a spatial position in the second inter-frame coded frame that corresponds to the spatial position of the coded block in the coded image associated with the second region.

5. The method according to claim 1, in, For each region, the metadata further includes location data indicating the real-world location of the detected object in the associated encoded image; The process of copying the coded blocks of the first set into the first coded image frame includes: placing each coded block from the first set at a spatial position in the first inter-frame coded frame determined by the spatial position of the coded block in the coded image associated with the first region and by the position data of the first region; and The process of copying the coded blocks of the second set into the second coded image frame includes placing each coded block in the second set at a spatial location in the second inter-frame coded frame that is determined by the spatial location of the coded block in the coded image associated with the second region and by the location data of the first region.

6. The method according to claim 5, wherein, The steps of the method are performed for multiple encoded video sequences, each acquired from a corresponding camera, wherein each camera is associated with a real-world location, and wherein the location data of each region defined in the metadata associated with each encoded video sequence is associated with the real-world location of the camera from which the encoded video sequence is acquired.

7. The method according to claim 1, wherein, Identifying the first set of one or more coded blocks includes: for each coded block within the first region of the coded image frame associated with the first region, identifying the coded block according to one of the following: The coded block is an intra-frame coded block, and The coded block is encoded with reference to the coded blocks included in the intra-coded frames of the compressed video in the coded video sequence.

8. The method according to claim 1, wherein, The second set of identification of the one or more coded blocks includes: for each coded block within the second region of the coded image frame associated with the second region, identifying the coded block according to one of the following: The coded block is an intra-frame coded block, and The coded block is encoded with reference to the coded video sequence included in a first set of the one or more coded blocks.

9. The method according to claim 1, in, Determining the first inter-frame coded frame of the compressed video includes: for a third region in a second series of regions, identifying a third set of one or more coded blocks from coded image frames associated with the third region, wherein each coded block in the identified third set is located within the third region and can be decoded using the intra-frame coded frame or can be decoded without reference to any other coded blocks; and copying the coded blocks of the identified third set from the coded image frames associated with the third region into the first inter-frame coded frame; The determination of the second inter-frame coded frame of the compressed video includes: for a fourth region following the third region in the second series of regions, identifying a fourth set of one or more coded blocks from the coded image frame associated with the fourth region, wherein each coded block in the identified fourth set is located within the fourth region and can be decoded using coded blocks from the third set or can be decoded without reference to any other coded blocks; and copying the coded blocks of the identified fourth set from the coded image frame associated with the fourth region into the second inter-frame coded frame.

10. The method according to claim 9, wherein, The encoded image frame associated with the first region and the encoded image frame associated with the third region are different encoded image frames within the encoded video stream.

11. The method according to claim 1, wherein, Any coded block in the first and second inter-frame coded frames of the compressed video that is not copied from the coded image frames of the coded video stream is set to one of the following: Skip the block; as well as Inter-coded blocks with zero residuals.

12. The method according to claim 1, wherein, The metadata includes multiple object detection metadata instances, wherein each object detection metadata instance corresponds to a detected object and includes one or more of the following: The bounding box of the detected object; The segmentation mask of the detected object; and The location and size of the detected object.

13. The method of claim 1, further comprising: Encoding a video sequence into the encoded video sequence, wherein the encoding includes: Obtain object tracking data indicating the video sequence image frames and the encoded region of the tracked object first detected in the image frames; and All coded blocks within the coded region of the image are encoded as intra-frame coded blocks.

14. A non-transitory computer-readable storage medium storing instructions that, when executed on a processing device, perform the method according to any one of claims 1 to 13.

15. An apparatus for generating compressed video, wherein, The device is configured to: Obtain a coded video sequence comprising multiple coded image frames; Obtain metadata associated with the encoded video sequence, the metadata indicating one or more series of regions throughout the plurality of encoded image frames, each region being associated with a corresponding encoded image frame in the plurality of encoded image frames and corresponding to an object detected in the associated encoded image, and each series corresponding to an object trajectory of an object detected in the encoded video sequence; Determine the intra-coded frames of the compressed video; Determining a first inter-frame coded frame of the compressed video, the first inter-frame coded frame being encoded with reference to the intra-frame coded frames, the determination comprising: for a first region in a first series of regions, identifying a first set of one or more coded blocks from coded image frames associated with the first region, wherein each coded block in the identified first set is located within the first region and can be decoded using the intra-frame coded frames or can be decoded without reference to any other coded blocks; and copying the coded blocks of the identified first set from the coded image frames associated with the first region into the first inter-frame coded frame; Determining a second inter-frame coded frame for the compressed video, the second inter-frame coded frame being encoded with reference to the first inter-frame coded frame, the determination comprising: for a second region following the first region in the first series of regions, identifying a second set of one or more coded blocks from coded image frames associated with the second region, wherein each coded block in the identified second set is located within the second region and can be decoded using the coded blocks of the first set or can be decoded without reference to any other coded blocks; and copying the coded blocks of the identified second set from the coded image frames associated with the second region into the second inter-frame coded frame.