CN113099270B - File storage method, decoding method, device, storage medium and electronic device - Google Patents

File storage method, decoding method, device, storage medium and electronic device Download PDF

Info

Publication number
CN113099270B
CN113099270B CN202110373182.7A CN202110373182A CN113099270B CN 113099270 B CN113099270 B CN 113099270B CN 202110373182 A CN202110373182 A CN 202110373182A CN 113099270 B CN113099270 B CN 113099270B
Authority
CN
China
Prior art keywords
image file
dynamic image
coding
images
file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110373182.7A
Other languages
Chinese (zh)
Other versions
CN113099270A (en
Inventor
安鹏洲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN202110373182.7A priority Critical patent/CN113099270B/en
Publication of CN113099270A publication Critical patent/CN113099270A/en
Application granted granted Critical
Publication of CN113099270B publication Critical patent/CN113099270B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/2343Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/42Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The embodiment of the invention provides a file storage method, a decoding method, a device, a storage medium and an electronic device, wherein the method comprises the following steps: coding N frames of target images in the obtained M frames of images into a dynamic image file according to a preset first coding protocol; coding the key frame image in the M frame images into a static image file according to a preset second coding protocol; storing a dynamic image file and a static image file, wherein the label information in the static image file comprises: a flag as to whether a dynamic image file is associated, and addressing information of the associated dynamic image file. The invention solves the problem that the static and video files can not be managed at the same time in the related technology, and achieves the effects of saving storage space and clearly displaying image files.

Description

File storage method, decoding method, device, storage medium and electronic device
Technical Field
The embodiment of the invention relates to the field of file processing, in particular to a file storage method, a file decoding device, a storage medium and an electronic device.
Background
Most of the current image coding techniques are still image coding. For the fields of intelligent transportation and the like, a series of pictures or videos capable of recording the complete process of the law violation are needed. If video is used for recording, the generated recording file is small, but the definition is not high enough. If a series of pictures are used for recording, the definition can be guaranteed, but files are more, the files are inconvenient to archive in the later period, and more storage space is occupied.
In view of the above technical problems, no effective solution has been proposed in the related art.
Disclosure of Invention
The embodiment of the invention provides a file storage method, a decoding device, a storage medium and an electronic device, which at least solve the problem that static and video files cannot be managed at the same time in the related technology.
According to an embodiment of the present invention, there is provided a file storage method including: encoding N frames of target images in M frames of acquired images into a dynamic image file according to a preset first encoding protocol, wherein M is a natural number greater than 1, and N is less than or equal to M; encoding the key frame image in the M frame images into a static image file according to a preset second encoding protocol, wherein M is a natural number which is greater than or equal to 1; storing the moving image file and the static image file, wherein the tag information in the static image file includes: a flag indicating whether to associate the moving picture file with the moving picture file, and addressing information indicating whether to associate the moving picture file with the flag.
According to another embodiment of the present invention, there is provided a decoding method including: under the condition that label information of a static image file comprises a mark related to a dynamic image file, acquiring the dynamic image file according to addressing information related to the dynamic image file in the label information; and decoding the dynamic image file.
According to another embodiment of the present invention, there is provided a file storage apparatus including: the device comprises a first coding module, a second coding module and a third coding module, wherein the first coding module is used for coding N frames of target images in M frames of acquired images into a dynamic image file according to a preset first coding protocol, M is a natural number greater than 1, and N is less than or equal to M; a second encoding module, configured to encode a key frame image in the M frame images into a static image file according to a preset second encoding protocol, where M is a natural number greater than or equal to 1; a first storage module, configured to store the dynamic image file and the static image file, where tag information in the static image file includes: a flag indicating whether to associate the moving picture file with the moving picture file, and addressing information indicating whether to associate the moving picture file with the flag.
In an exemplary embodiment, the first encoding module includes: the first encoding unit is configured to encode an acquired N-frame target image in a preset format into a dynamic image file according to a preset first encoding protocol, where the N-frame target image is a static image, and the N-frame target image includes at least one of the following images: the method comprises the steps of obtaining a static image in advance, obtaining the static image in real time and obtaining the static image in a compressed file with a preset format.
In an exemplary embodiment, the tag information in the still image file further includes at least one of: protocol version information of the dynamic image file; coding and decoding protocol information of the dynamic image file; the description information of the above-mentioned moving picture file.
In an exemplary embodiment, the first encoding module includes: and a second encoding unit, configured to encode the data volume of the N-frame target image and the file end of the target image into a moving image file according to the first encoding protocol.
In an exemplary embodiment, the apparatus further includes: the first obtaining module is used for obtaining video information in a preset time period before the obtained N frames of target images in the preset format are coded into a dynamic image file according to a preset first coding protocol, wherein the video information comprises M frames of images, and M is greater than or equal to N; and the first determining module is used for determining the N frames of target images from the M frames of images.
In an exemplary embodiment, the first encoding module includes: a third encoding unit, configured to encode the key frame image in the M frame images into a still image file according to a preset second encoding protocol, including: when the key frame image is a start frame image of the M frame images, encoding the start frame image into the still image file according to a preset second encoding protocol; the fourth encoding unit is configured to encode the N target images in the acquired M frames of images into a dynamic image file according to a preset first encoding protocol, and includes: and coding the N frames of target images into the dynamic image file according to a preset second coding protocol by taking the initial frame image as a reference.
According to another embodiment of the present invention, there is provided a decoding apparatus including: a first obtaining module, configured to, when tag information of a static image file includes a tag associated with a dynamic image file, obtain the dynamic image file according to addressing information associated with the dynamic image file in the tag information; the first decoding module is used for decoding the dynamic image file.
In an exemplary embodiment, the first obtaining module includes: a first determining unit, configured to determine, when tag information of a still image file includes a flag associated with a moving image file, a storage space in which the moving image file is located according to addressing information associated with the moving image file in the tag information; a first obtaining unit, configured to obtain the moving image file from the storage space.
In an exemplary embodiment, the first decoding module includes: and a second determining unit, configured to decode the moving image file by using a decoding method corresponding to a first encoding protocol, so as to obtain a decoded moving image, where the first encoding protocol is used to encode the acquired target image into the moving image file.
In an exemplary embodiment, the first decoding module includes: a first decoding unit, configured to decode a start frame image from the still image file by using a second encoding protocol, where the still image file is encoded based on the start frame image; and the second decoding unit is used for decoding the dynamic image file by using the starting frame image as a reference and utilizing a decoding mode corresponding to a first coding protocol to obtain a decoded dynamic image, wherein the dynamic image file is obtained by coding by referring to the starting frame image.
In an exemplary embodiment, the apparatus further includes: and a second decoding module, configured to decode the still image file to obtain a start frame image when the tag information of the still image file does not include a tag associated with the moving image file, where the still image file is generated based on the start frame image.
According to a further embodiment of the present invention, there is also provided a computer-readable storage medium having a computer program stored thereon, wherein the computer program is arranged to perform the steps of any of the above method embodiments when executed.
According to yet another embodiment of the present invention, there is also provided an electronic device, including a memory in which a computer program is stored and a processor configured to execute the computer program to perform the steps in any of the above method embodiments.
According to the invention, N frame target images in the acquired M frame images are coded into dynamic image files according to a preset first coding protocol; coding the key frame image in the M frames of images into a static image file according to a preset second coding protocol; storing a dynamic image file and a static image file, wherein the label information in the static image file comprises: a flag whether to associate the moving picture file, and addressing information of the associated moving picture file. The purpose of processing the video file into the dynamic image is achieved. Therefore, the problem that management of static and video files cannot be carried out at the same time in the related art can be solved, and the effects of saving storage space and displaying image files clearly are achieved.
Drawings
Fig. 1 is a block diagram of a hardware structure of a mobile terminal of a file storage method according to an embodiment of the present invention;
FIG. 2 is a flow chart of a file storage method according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a JPEG format in accordance with an embodiment of the invention;
FIG. 4 is a flow chart of the conversion of a video image according to an embodiment of the present invention;
FIG. 5 is a flow chart of a decoding method according to an embodiment of the present invention;
FIG. 6 is a flow diagram of decoding of a video image according to an embodiment of the present invention;
FIG. 7 is a schematic illustration of an violation determination according to an embodiment of the present invention;
FIG. 8 is a flow chart of an illegal determination according to an embodiment of the present invention;
fig. 9 is a block diagram of a structure of a file storage apparatus according to an embodiment of the present invention;
fig. 10 is a block diagram of a decoding apparatus according to an embodiment of the present invention.
Detailed Description
Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings in conjunction with the embodiments.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
The method embodiments provided in the embodiments of the present application may be executed in a mobile terminal, a computer terminal, or a similar computing device. Taking an example of the operation on a mobile terminal, fig. 1 is a hardware structure block diagram of the mobile terminal of a file storage method according to an embodiment of the present invention. As shown in fig. 1, the mobile terminal may include one or more (only one shown in fig. 1) processors 102 (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA), and a memory 104 for storing data, wherein the mobile terminal may further include a transmission device 106 for communication functions and an input-output device 108. It will be understood by those of ordinary skill in the art that the structure shown in fig. 1 is only an illustration and is not intended to limit the structure of the mobile terminal. For example, the mobile terminal may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
The memory 104 may be used for storing computer programs, for example, software programs and modules of application software, such as computer programs corresponding to the file storage method in the embodiment of the present invention, and the processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, so as to implement the method described above. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory located remotely from the processor 102, which may be connected to the mobile terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used for receiving or transmitting data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a Network adapter (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 may be a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
In this embodiment, a file storage method is provided, and fig. 2 is a flowchart of a file storage method according to an embodiment of the present invention, where as shown in fig. 2, the flowchart includes the following steps:
step S202, encoding N frames of target images in M frames of acquired images into a dynamic image file according to a preset first encoding protocol, wherein M is a natural number larger than 1, and N is smaller than or equal to M;
step S204, encoding the key frame image in the M frame images into a static image file according to a preset second encoding protocol, wherein M is a natural number which is greater than or equal to 1;
step S206, storing the dynamic image file and the static image file, wherein the label information in the static image file comprises: a flag as to whether a dynamic image file is associated, and addressing information of the associated dynamic image file.
In the present embodiment, the moving image file includes a plurality of formats, for example: moving Pictures Experts Group (MPG), and Graphics Interchange Format (GIF).
The main body for executing the above steps may be a terminal (e.g., a mobile phone, a computer), etc., but is not limited thereto.
The present embodiment includes, but is not limited to, a scenario in which a video file is compressed.
In the present embodiment, the still image file includes, but is not limited to, an image in a video file of a preset time period, for example, an image in JPEG format.
In the present embodiment, the N-frame image may be a part of the image in the M-frame image. For example, a video clip of traffic violation contains 1, 2, 3, 4, 5 frames of images, the key frames are obtained for static file encoding, and then 12345 frames are encoded into dynamic files for storage; if the key frame 1 is a start frame, the start frame can be encoded into a static file, and the start frame is used as an I frame, and 2345 frames are encoded by using the I frame as a reference frame to obtain a dynamic file. During decoding, the static file is decoded to obtain an initial reference I frame, and the dynamic file is decoded subsequently by taking the I frame as a reference to obtain a dynamic image.
Through the steps, the N frames of target images in the acquired M frames of images are coded into the dynamic image file according to the preset first coding protocol; coding the key frame image in the M frame images into a static image file according to a preset second coding protocol; storing a dynamic image file and a static image file, wherein the label information in the static image file comprises: a flag as to whether a dynamic image file is associated, and addressing information of the associated dynamic image file. The purpose of processing the video file into the dynamic image is achieved. Therefore, the problem that management of static and video files cannot be carried out at the same time in the related art can be solved, and the effects of saving storage space and displaying image files clearly are achieved.
In an exemplary embodiment, encoding N target images of the acquired M frames of images into a dynamic image file according to a preset first encoding protocol includes:
s1, encoding N frames of acquired target images in a preset format into a dynamic image file according to a preset first encoding protocol, wherein the N frames of target images are static images, and the N frames of target images comprise at least one of the following images: the method comprises the steps of obtaining a static image in advance, obtaining the static image in real time and obtaining the static image in a compressed file with a preset format.
In this embodiment, as shown in fig. 3, the JPEG user tag is tag information, and the tag information in the still image file further includes at least one of the following:
protocol version information of the dynamic image file;
coding and decoding protocol information of the dynamic image file;
description information of a moving image file.
In an exemplary embodiment, encoding the acquired target image into a dynamic image file according to a preset first encoding protocol includes:
and coding the data body of the N frames of target images and the file tail of the target image into a dynamic image file according to a first coding protocol.
In the present embodiment, as shown in fig. 4, the conversion of the video image includes the steps of:
s401, receiving an image;
s402, when the dynamic image is determined to be enabled and the image is not the first frame image, carrying out dynamic image coding;
s403, writing the coded image into the motion picture data;
s404, generating motion picture information under the condition that the dynamic picture is determined to be enabled, and the picture is a first frame picture;
s405, JPEG coding is carried out on the motion picture information;
s406, writing the coded JPEG image into JPEG data;
s407, ending the encoding;
s408, writing an end mark.
In an exemplary embodiment, before encoding the acquired N frames of target images in the preset format into a dynamic image file according to a preset first encoding protocol, the method further includes:
s1, acquiring video information in a preset time period, wherein the video information comprises M frames of images, and M is greater than or equal to N;
and S2, determining N frames of target images from the M frames of images.
In an exemplary embodiment, encoding a key frame image of M frame images into a still image file according to a preset second encoding protocol includes: under the condition that the key frame image is a starting frame image in the M frame images, coding the starting frame image into a static image file according to a preset second coding protocol;
the method for coding N frame target images in the acquired M frame images into a dynamic image file according to a preset first coding protocol comprises the following steps: and coding the N frames of target images into a dynamic image file according to a preset second coding protocol by taking the initial frame image as a reference.
In this embodiment, a file storage method is provided, and fig. 5 is a flowchart of a decoding method according to an embodiment of the present invention, as shown in fig. 5, the flowchart includes the following steps:
step S502, under the condition that the label information of the static image file comprises a label of the associated dynamic image file, the dynamic image file is obtained according to the addressing information of the associated dynamic image file in the label information;
in step S504, the moving image file is decoded.
Through the steps, under the condition that the label information of the static image file comprises the label of the associated dynamic image file, the dynamic image file is obtained according to the addressing information of the associated dynamic image file in the label information; the moving picture file is decoded. The purpose of processing the video file into the dynamic image is achieved. Therefore, the problem that both static and video files cannot be managed in the related art can be solved, and the effects of saving storage space and clearly displaying image files are achieved.
In an exemplary embodiment, in a case where the tag information of the still image file includes a flag associated with the moving image file, acquiring the moving image file according to the addressing information of the associated moving image file in the tag information includes:
s1, under the condition that the label information of the static image file comprises a mark of an associated dynamic image file, determining a storage space where the dynamic image file is located according to addressing information of the associated dynamic image file in the label information;
and S2, acquiring the dynamic image file from the storage space.
In one exemplary embodiment, decoding a moving image file includes:
s1, decoding the dynamic image file by using a decoding mode corresponding to a first coding protocol to obtain a decoded dynamic image, wherein the first coding protocol is used for coding the acquired target image into the dynamic image file.
In one exemplary embodiment, decoding a moving image file includes:
s1, decoding a start frame image from a static image file by using a second coding protocol, wherein the static image file is obtained by coding based on the start frame image;
and S2, decoding the dynamic image file by using the starting frame image as a reference and utilizing a decoding mode corresponding to the first coding protocol to obtain a decoded dynamic image, wherein the dynamic image file is obtained by coding with reference to the starting frame image.
In one exemplary embodiment, the method further comprises:
s1, under the condition that the label information of the static image file does not include a mark related to the dynamic image file, the static image file is decoded to obtain a starting frame image, wherein the static image file is generated based on the starting frame image.
As shown in fig. 6, the decoding of the video image includes the steps of:
s601, receiving a compressed image;
s602, JPEG decoding is carried out on the compressed image;
s603, analyzing the dynamic picture protocol information under the condition that the decoder supports dynamic picture decoding;
s604, addressing the motion picture data according to the motion picture protocol information;
and S605, decoding the dynamic graph according to the addressing dynamic graph data.
In an exemplary embodiment, as shown in fig. 7 and 8, the present embodiment may be applied to a scene in which an illegal action is recorded by using a dynamic picture, and the illegal action may be clearly displayed by using the dynamic picture.
In summary, in the encoding and storage scheme combining the image and the video, the illegal process record can be stored by using a single dynamic picture file, and can be displayed as a static JPEG, so that the definition is ensured. The complete illegal process can be recorded as a dynamic picture. And the occupied space is less than that of a plurality of static pictures, and the single file is convenient for filing management.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
In this embodiment, a file storage device is further provided, and the file storage device is used to implement the foregoing embodiments and preferred embodiments, and the description of the file storage device is omitted for brevity. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Fig. 9 is a block diagram of a structure of a file storage apparatus according to an embodiment of the present invention, as shown in fig. 9, the apparatus including:
a first encoding module 92, configured to encode N target images of M acquired images into a dynamic image file according to a preset first encoding protocol, where M is a natural number greater than 1, and N is less than or equal to M;
a second encoding module 94, configured to encode a key frame image in the M frame images into a static image file according to a preset second encoding protocol, where M is a natural number greater than or equal to 1;
a first storage module 96, configured to store the dynamic image file and the static image file, where the tag information in the static image file includes: a flag indicating whether to associate the moving picture file with the address information of the moving picture file.
In an exemplary embodiment, the first encoding module includes:
the first encoding unit is configured to encode an acquired N-frame target image in a preset format into a dynamic image file according to a preset first encoding protocol, where the N-frame target image is a static image, and the N-frame target image includes at least one of the following images: the method comprises the steps of obtaining a static image in advance, obtaining the static image in real time and obtaining the static image in a compressed file with a preset format.
In an exemplary embodiment, the tag information in the still image file further includes at least one of:
protocol version information of the dynamic image file;
coding and decoding protocol information of the dynamic image file;
the description information of the above-mentioned moving image file.
In an exemplary embodiment, the first encoding module includes:
and a second encoding unit, configured to encode the data volume of the N-frame target image and the file end of the target image into a moving image file according to the first encoding protocol.
In an exemplary embodiment, the apparatus further includes:
the first obtaining module is used for obtaining video information in a preset time period before the obtained N frames of target images in the preset format are coded into a dynamic image file according to a preset first coding protocol, wherein the video information comprises M frames of images, and M is greater than or equal to N;
and the first determining module is used for determining the N frames of target images from the M frames of images.
In an exemplary embodiment, the first encoding module includes: a third encoding unit, configured to encode the key frame image in the M frame images into a static image file according to a preset second encoding protocol, including: when the key frame image is a start frame image of the M frame images, encoding the start frame image into the still image file according to a preset second encoding protocol;
the fourth encoding unit is configured to encode the N target images in the acquired M frames of images into a dynamic image file according to a preset first encoding protocol, and includes: and coding the N frames of target images into the dynamic image file according to a preset second coding protocol by taking the initial frame image as a reference.
Fig. 10 is a block diagram of a decoding apparatus according to an embodiment of the present invention, and as shown in fig. 10, the apparatus includes:
a first obtaining module 1002, configured to, when tag information of a static image file includes a tag associated with a dynamic image file, obtain the dynamic image file according to addressing information associated with the dynamic image file in the tag information;
the first decoding module 1004 is configured to decode the moving image file.
In an exemplary embodiment, the first obtaining module includes:
a first determining unit, configured to determine, when tag information of a still image file includes a flag associated with a moving image file, a storage space in which the moving image file is located according to addressing information associated with the moving image file in the tag information;
a first obtaining unit, configured to obtain the moving image file from the storage space.
In an exemplary embodiment, the first decoding module includes:
and a second determining unit, configured to decode the moving image file by using a decoding method corresponding to a first encoding protocol, so as to obtain a decoded moving image, where the first encoding protocol is used to encode the acquired target image into the moving image file.
In an exemplary embodiment, the first decoding module includes:
a first decoding unit, configured to decode a start frame image from the still image file by using a second encoding protocol, where the still image file is encoded based on the start frame image;
and the second decoding unit is used for decoding the dynamic image file by using the starting frame image as a reference and utilizing a decoding mode corresponding to a first coding protocol to obtain a decoded dynamic image, wherein the dynamic image file is obtained by coding by referring to the starting frame image.
In an exemplary embodiment, the apparatus further includes:
and a second decoding module, configured to decode the still image file to obtain a start frame image when the tag information of the still image file does not include a tag associated with the moving image file, where the still image file is generated based on the start frame image.
It should be noted that, the above modules may be implemented by software or hardware, and for the latter, the following may be implemented, but not limited to: the modules are all positioned in the same processor; alternatively, the modules are located in different processors in any combination.
Embodiments of the present invention also provide a computer-readable storage medium having a computer program stored thereon, wherein the computer program is arranged to perform the steps of any of the above-mentioned method embodiments when executed.
In the present embodiment, the above-described computer-readable storage medium may be configured to store a computer program for executing the above steps.
In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to: various media capable of storing computer programs, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
Embodiments of the present invention also provide an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the above method embodiments.
In an exemplary embodiment, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
In an exemplary embodiment, the processor may be configured to perform the above steps by a computer program.
For specific examples in this embodiment, reference may be made to the examples described in the foregoing embodiments and exemplary implementations, and details of this embodiment are not repeated herein.
It will be apparent to those skilled in the art that the various modules or steps of the invention described above may be implemented using a general purpose computing device, they may be centralized on a single computing device or distributed across a network of computing devices, and they may be implemented using program code executable by the computing devices, such that they may be stored in a memory device and executed by the computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into various integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the principle of the present invention should be included in the protection scope of the present invention.

Claims (15)

1. A file storage method, comprising:
encoding N frames of target images in M frames of acquired images into a dynamic image file according to a preset first encoding protocol, wherein M is a natural number greater than 1, and N is less than or equal to M;
encoding key frame images in the M frame images into a static image file according to a preset second encoding protocol, wherein M is a natural number greater than or equal to 1;
storing the dynamic image file and the static image file, wherein the tag information in the static image file comprises: a flag indicating whether or not to associate the moving picture file, and addressing information associated with the moving picture file; wherein, in a case where the tag information includes a flag associated with the dynamic image file, the addressing information included in the tag information is used for a decoder to acquire the dynamic image file.
2. The method according to claim 1, wherein encoding the N frames of target images in the acquired M frames of images into a dynamic image file according to a preset first encoding protocol comprises:
the N frames of target images in the acquired preset format are coded into a dynamic image file according to a preset first coding protocol, wherein the N frames of target images are static images, and the N frames of target images comprise at least one of the following images: the method comprises the steps of obtaining a static image in advance, obtaining the static image in real time and obtaining the static image in a compressed file with a preset format.
3. The method of claim 1, wherein the tag information in the still image file further comprises at least one of:
protocol version information of the dynamic image file;
coding and decoding protocol information of the dynamic image file;
description information of the dynamic image file.
4. The method according to claim 1, wherein encoding the N frames of target images in the acquired M frames of images into a dynamic image file according to a preset first encoding protocol comprises:
and coding the data body of the N frames of target images and the file tail of the target image into a dynamic image file according to the first coding protocol.
5. The method according to claim 2, wherein before the N frames of target images in the preset format are encoded into the dynamic image file according to the preset first encoding protocol, the method further comprises:
acquiring video information in a preset time period, wherein the video information comprises the M frames of images, and M is greater than or equal to N;
and determining the N frames of target images from the M frames of images.
6. The method of claim 1,
encoding the key frame image in the M frame images into a static image file according to a preset second encoding protocol, wherein the method comprises the following steps: under the condition that the key frame image is a starting frame image in the M frame images, coding the starting frame image into the static image file according to a preset second coding protocol;
the method for coding N frame target images in the acquired M frame images into a dynamic image file according to a preset first coding protocol comprises the following steps: and coding the N frames of target images into the dynamic image file according to a preset second coding protocol by taking the initial frame image as a reference.
7. A method of decoding, comprising:
under the condition that label information of a static image file comprises a mark associated with a dynamic image file, acquiring the dynamic image file according to addressing information associated with the dynamic image file in the label information;
decoding the dynamic image file; wherein, in a case where the tag information includes a flag associated with the dynamic image file, the addressing information included in the tag information is used for a decoder to acquire the dynamic image file.
8. The method according to claim 7, wherein, in a case where a flag associated with a moving image file is included in tag information of a still image file, acquiring the moving image file in accordance with addressing information associated with the moving image file in the tag information includes:
under the condition that label information of a static image file comprises a mark related to a dynamic image file, determining a storage space where the dynamic image file is located according to addressing information related to the dynamic image file in the label information;
and acquiring the dynamic image file from the storage space.
9. The method according to claim 7, wherein decoding the moving image file comprises:
and decoding the dynamic image file by utilizing a decoding mode corresponding to a first coding protocol to obtain a decoded dynamic image, wherein the first coding protocol is used for coding the acquired target image into the dynamic image file.
10. The method of claim 7, wherein decoding the dynamic image file comprises:
decoding a start frame image from the static image file by using a second coding protocol, wherein the static image file is obtained by coding based on the start frame image;
and decoding the dynamic image file by using the starting frame image as a reference and utilizing a decoding mode corresponding to a first coding protocol to obtain a decoded dynamic image, wherein the dynamic image file is obtained by coding by referring to the starting frame image.
11. The method of claim 7, further comprising:
and under the condition that the label information of the static image file does not comprise a mark of an associated dynamic image file, decoding the static image file to obtain a starting frame image, wherein the static image file is generated based on the starting frame image.
12. A file storage device, comprising:
the first coding module is used for coding N frames of target images in the obtained M frames of images into a dynamic image file according to a preset first coding protocol, wherein M is a natural number greater than 1, and N is less than or equal to M;
the second coding module is used for coding the key frame image in the M frame images into a static image file according to a preset second coding protocol, wherein M is a natural number which is greater than or equal to 1;
a first storage module, configured to store the dynamic image file and the static image file, where tag information in the static image file includes: a flag indicating whether or not to associate the moving picture file, and addressing information associated with the moving picture file; wherein, in a case where the tag information includes a flag associated with the dynamic image file, the addressing information included in the tag information is used for a decoder to acquire the dynamic image file.
13. A decoding apparatus, comprising:
the first acquisition module is used for acquiring the dynamic image file according to the addressing information related to the dynamic image file in the label information under the condition that the label information of the static image file comprises a mark related to the dynamic image file;
a first decoding module for decoding the dynamic image file; wherein, in a case where the tag information includes a flag associated with the dynamic image file, the addressing information included in the tag information is used for a decoder to acquire the dynamic image file.
14. A computer-readable storage medium, in which a computer program is stored, wherein the computer program is arranged to perform the method of any of claims 1 to 6 when executed, or to perform the method of any of claims 7 to 11 when executed.
15. An electronic apparatus comprising a memory and a processor, wherein the memory has stored therein a computer program, and the processor is configured to execute the computer program to perform the method of any one of claims 1 to 6, or to execute the computer program to perform the method of any one of claims 7 to 11.
CN202110373182.7A 2021-04-07 2021-04-07 File storage method, decoding method, device, storage medium and electronic device Active CN113099270B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110373182.7A CN113099270B (en) 2021-04-07 2021-04-07 File storage method, decoding method, device, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110373182.7A CN113099270B (en) 2021-04-07 2021-04-07 File storage method, decoding method, device, storage medium and electronic device

Publications (2)

Publication Number Publication Date
CN113099270A CN113099270A (en) 2021-07-09
CN113099270B true CN113099270B (en) 2023-03-24

Family

ID=76674630

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110373182.7A Active CN113099270B (en) 2021-04-07 2021-04-07 File storage method, decoding method, device, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN113099270B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113672484A (en) * 2021-08-09 2021-11-19 深圳市猿人创新科技有限公司 Equipment monitoring method, device, equipment and medium based on log information

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1902926A (en) * 2003-11-04 2007-01-24 夏普株式会社 Resume reproduction system
JP2012147372A (en) * 2011-01-14 2012-08-02 Yamaha Corp Image processing device and program
WO2014190921A1 (en) * 2013-05-29 2014-12-04 Wang Hao Image dynamic recording device, image playback device, and image dynamic recording and playback method
CN110545367A (en) * 2018-05-28 2019-12-06 夏普株式会社 Image recording apparatus, image recording method, and recording medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103974147A (en) * 2014-03-07 2014-08-06 北京邮电大学 MPEG (moving picture experts group)-DASH protocol based online video playing control system with code rate switch control and static abstract technology
CN104967848A (en) * 2015-06-16 2015-10-07 谢维波 Scene analysis algorithm applied in network video monitoring system
CN106341666A (en) * 2016-10-13 2017-01-18 浪潮(苏州)金融技术服务有限公司 Method for effectively reducing volume of video file through dynamic area capture technology
CN107071515B (en) * 2017-04-08 2018-12-07 腾讯科技(深圳)有限公司 A kind of photograph document handling method and system
US20190268601A1 (en) * 2018-02-26 2019-08-29 Microsoft Technology Licensing, Llc Efficient streaming video for static video content
CN111182307A (en) * 2019-12-27 2020-05-19 广东德融汇科技有限公司 Ultralow code stream lossless compression method based on video images for K12 education stage

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1902926A (en) * 2003-11-04 2007-01-24 夏普株式会社 Resume reproduction system
JP2012147372A (en) * 2011-01-14 2012-08-02 Yamaha Corp Image processing device and program
WO2014190921A1 (en) * 2013-05-29 2014-12-04 Wang Hao Image dynamic recording device, image playback device, and image dynamic recording and playback method
CN110545367A (en) * 2018-05-28 2019-12-06 夏普株式会社 Image recording apparatus, image recording method, and recording medium

Also Published As

Publication number Publication date
CN113099270A (en) 2021-07-09

Similar Documents

Publication Publication Date Title
CN105052107B (en) Media content Adaptive Transmission is carried out using quality information
CN107634930B (en) Method and device for acquiring media data
CN104967862A (en) Video storage method and device, and video searching method and device
US20210304443A1 (en) Point Cloud Encoding and Decoding Method and Apparatus
CN104508689A (en) A two-dimension code processing method and a terminal
EP3780642A1 (en) Streaming media data processing method and streaming media processing server
CN110401850A (en) A kind of method and apparatus of the customized SEI of transparent transmission
CN113099270B (en) File storage method, decoding method, device, storage medium and electronic device
CN114697631B (en) Immersion medium processing method, device, equipment and storage medium
CN115547367A (en) Audio and video buffer area reading processing method and device
CN113343895B (en) Target detection method, target detection device, storage medium and electronic equipment
WO2018014545A1 (en) Code stream data processing method and apparatus
CN113742518A (en) Method, apparatus and computer program product for storing and providing video
CN105100893A (en) Video sharing method and device
CN105704215B (en) Shared file system and corresponding document sending method and device
CN110677676B (en) Video encoding method and apparatus, video decoding method and apparatus, and storage medium
CN112714338A (en) Video transmission method, video playing method, video transmission device, video playing device, computer equipment and storage medium
CN102118633B (en) Method, device and system for playing video files
CN111263097A (en) Media data transmission method and related equipment
CN110996137A (en) Video processing method and device
CN114173154B (en) Video processing method and system
CN112449209B (en) Video storage method and device, cloud server and computer readable storage medium
CN112929706A (en) Video data playback method, device, storage medium, and electronic device
CN110851155A (en) Method and device for changing theme colors of set top box interface
CN112131423A (en) Picture acquisition method, device and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant