CN109874049B - Method for optimizing and extracting video frame reading speed - Google Patents

Method for optimizing and extracting video frame reading speed Download PDF

Info

Publication number
CN109874049B
CN109874049B CN201910060936.6A CN201910060936A CN109874049B CN 109874049 B CN109874049 B CN 109874049B CN 201910060936 A CN201910060936 A CN 201910060936A CN 109874049 B CN109874049 B CN 109874049B
Authority
CN
China
Prior art keywords
video
frame
file
cluster
reading
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
CN201910060936.6A
Other languages
Chinese (zh)
Other versions
CN109874049A (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 Xinmai Microelectronics Co ltd
Original Assignee
Hangzhou Xiongmai Integrated Circuit Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Xiongmai Integrated Circuit Technology Co Ltd filed Critical Hangzhou Xiongmai Integrated Circuit Technology Co Ltd
Priority to CN201910060936.6A priority Critical patent/CN109874049B/en
Publication of CN109874049A publication Critical patent/CN109874049A/en
Application granted granted Critical
Publication of CN109874049B publication Critical patent/CN109874049B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a method for optimizing and extracting the reading speed of video frames, which comprises a storage step and a reading step, wherein the storage step is to download and store a video file into an embedded fat32 file system, the reading step is to read the video data of each frame, and the reading of the video frame data by using the method can realize the enhancement from a few frames per second to hundreds of frames per second in the prior art, thereby ensuring the stable high frame rate of the video frame reading; the video playing frame rate is not influenced, and the reading speed of the video frame is improved, so that the video playing frame rate is ensured.

Description

Method for optimizing and extracting video frame reading speed
Technical Field
The invention relates to a method for reading speed, in particular to a method for optimizing and extracting video frame reading speed, and belongs to the field of embedded video playing.
Background
When playing the video file stored in the fat32 file system in the embedded system, the following steps are taken to read the video file:
1) analyzing the format of the video file, and determining the specific position and length of the video frame in the video file according to the specific format;
2) requesting to read the video frame from the fat32 file system according to the position and the length obtained in the previous step;
3) the Fat32 file system obtains the cluster number corresponding to the position of the previous request according to the Fat table format of the file system, and converts the cluster number into the final hardware address;
4) initiating a plurality of reading requests to the hardware according to the hardware address obtained in the last step;
5) the hardware returns the video frame data to the program for use;
in order to achieve a certain frame rate when playing a video, before the last frame is played, the data of the next frame must be prepared, so the speed of reading the video frame is particularly critical, but due to the storage characteristics of the fat32 file system, the following points seriously limit the reading speed of the video frame, namely the problem exists:
1) as shown in fig. 1, reading the fat table multiple times is necessary to determine the position of each video frame, and converting the file offset into a cluster number;
2) as shown in fig. 1, the fat32 file system uses clusters as storage units, the data length of a video frame is large or small, and if a frame spans several clusters, it may need to read the fat table many times to determine the cluster positions corresponding to all the video frames;
3) multiple requests for the read operation speed from the hardware will greatly increase the protocol overhead, thereby affecting speed.
Due to the above problems, it is likely to seriously affect the video data reading efficiency and thus the video playing frame rate, and if the video is displayed in multiple local videos, the impact is more serious.
Disclosure of Invention
In order to solve the above-mentioned problems in the prior art, the present invention provides a method for optimizing the reading speed of extracted video frames, which has the technical characteristics of improving the reading speed of local video frames, etc.
In order to achieve the purpose, the invention is realized by the following technical scheme:
a method for optimizing and extracting the reading speed of video frames comprises a storage step and a reading step, wherein the storage step is to download and store video files into an embedded fat32 file system, and the method comprises the following steps:
step 1): the formatted storage medium is a fat32 file system, and the cluster size is specified to be enough to accommodate each frame of video data, and each frame of video data is limited to be stored in one cluster;
step 2): transplanting a fat32 file system into the embedded system;
step 3): compiling and writing the upper computer software to analyze the video format file, acquiring the video data of each frame, and requesting to send the video data of each frame to the embedded system;
step 4): compiling local embedded system software for receiving a request of upper computer software, receiving a video data request sent by the upper computer software, and creating a video directory under a root directory for each new video file;
step 5): receiving video data of each frame of an upper computer, creating a file under a corresponding video directory for the video data of each frame, naming a video file name by using a frame number, and obtaining a plurality of video frame files;
the reading step is to read the video data of each frame, and comprises the following steps:
step 1): acquiring a cluster number of a root directory, wherein a first cluster of the root directory is adjacent to the FAT2 and occupies the 1 st cluster in a cluster area sequence;
step 2): reading the data of the cluster corresponding to the root directory, reading the video file name as required, and finding the corresponding directory entry so as to find the cluster number corresponding to the directory entry; the cluster data is a file entry of each video frame file, and a cluster position corresponding to each video frame file is recorded in the file entry;
step 3): reading a cluster corresponding to the directory entry;
step 4): sequentially indexing corresponding file entries in the cluster according to the frame number of the video file name, and respectively finding out the file entry corresponding to each frame of video data;
step 5): finding out the cluster number and the cluster length corresponding to the video frame file according to the file table entry of each frame of video data;
step 6): converting the cluster number and the cluster length into an address and a length required by hardware;
step 7): initiating a hardware reading command according to the acquired cluster number and length;
step 8): the hardware returns video frame data.
As an improvement, the length of each short file entry is fixed to be 4 bytes, and the frame numbers of the video file names are sorted by natural positive integer names from 0.
Has the advantages that: the method for reading the video frame data can realize the enhancement from a few frames per second to hundreds of frames per second in the prior art, thereby ensuring the stable high frame rate of the video frame reading; the video playing frame rate is not influenced, and the reading speed of the video frame is improved, so that the video playing frame rate is ensured.
Drawings
FIG. 1 is a diagram illustrating the prior art needing to find the next cluster.
Fig. 2 is a schematic diagram of video frame file index clusters in the present invention.
Fig. 3 is a video frame file under a video directory according to embodiment 1 of the present invention.
Detailed Description
The present invention will be further described with reference to the drawings attached to the specification, but the present invention is not limited to the following examples.
Example 1
As shown in fig. 2-3, this embodiment is a method for optimizing the reading speed of extracted video frames, and this method includes a storing step and a reading step, where the storing step is to download and store a video file into an embedded fat32 file system, and includes the following steps:
step 1): formatting a storage medium (such as a CF card and the like) into a fat32 file system, and specifying a cluster size sufficient to accommodate each frame of video data, wherein each frame of video data is limited to be stored in one cluster;
step 2): transplanting a fat32 file system into the embedded system; the embedded system is a special computer system which is completely embedded in a controlled device and designed for specific application, and the core of the embedded system is composed of one or more microprocessors or single-chip microcomputers which are programmed in advance and used for executing a few tasks. Unlike general purpose computers that are capable of running user-selected software, the software on an embedded system is usually transient and is therefore often referred to as firmware;
step 3): compiling and writing the upper computer software to analyze the video format file, acquiring the video data of each frame, and requesting to send the video data of each frame to the embedded system; the upper computer software is software installed in the computer and is used for communicating with the lower computer and controlling or reading data of the lower computer;
step 4): compiling local embedded system software for receiving a request of upper computer software, receiving a video data request sent by the upper computer software, and creating a video directory under a root directory for each new video file;
step 5): receiving video data of each frame of the upper computer, creating a file under a corresponding video directory for the video data of each frame, naming a video file name by a frame number, as shown in fig. 3, wherein the directory name is video, and the directory includes frame0, frame1, frame 2, frame3, frame 4, frame5, frame 6 and frame7 video frame files;
the reading step is to read the video data of each frame, and comprises the following steps:
step 1): acquiring a cluster number of a root directory, wherein a first cluster of the root directory is adjacent to the FAT2 and occupies the 1 st cluster in a cluster area sequence;
step 2): reading the data of the cluster corresponding to the root directory, reading the video file name as required, and finding the corresponding directory entry so as to find the cluster number corresponding to the directory entry; the cluster data is a file entry of each video frame file, and a cluster position corresponding to each video frame file is recorded in the file entry; because the directory is placed under the root directory, and the position of the cluster of the root directory is fixed, the position of each directory entry in the cluster according to the root directory is very fast to obtain; as shown in fig. 2, the file entry is indexed according to the file name of the video frame to determine the cluster position corresponding to the video frame, the length of each short file entry is fixed to 4 bytes, and the position of the file entry can be determined according to the formula 4 x according to the frame numbers 0, 1, 2, and x of the video file name;
step 3): reading a cluster corresponding to the directory entry;
step 4): sequentially indexing corresponding file entries in the cluster according to the frame number of the video file name, and respectively finding out the file entry corresponding to each frame of video data; as shown in FIG. 2, for example, frame0 corresponds to the first file entry 1, frame1 corresponds to the second file entry 2, and each short file entry is 4 bytes;
step 5): finding out the cluster number and the cluster length corresponding to the video frame file according to the file table entry of each frame of video data;
step 6): converting the cluster number and the cluster length into an address and a length required by hardware;
step 7): initiating a hardware reading command according to the acquired cluster number and length;
step 8): the hardware returns video frame data.
Finally, it should be noted that the present invention is not limited to the above embodiments, and many variations are possible. All modifications which can be derived or suggested by a person skilled in the art from the disclosure of the present invention are to be considered within the scope of the invention.

Claims (2)

1. A method for optimizing and extracting the reading speed of video frames is characterized in that the method comprises a storage step and a reading step, wherein the storage step is to download and store video files into an embedded fat32 file system, and the method comprises the following steps:
step 1): the formatted storage medium is a fat32 file system, and the cluster size is specified to be enough to accommodate each frame of video data, and each frame of video data is limited to be stored in one cluster;
step 2): transplanting a fat32 file system into the embedded system;
step 3): compiling and writing the upper computer software to analyze the video format file, acquiring the video data of each frame, and requesting to send the video data of each frame to the embedded system;
step 4): compiling local embedded system software for receiving a request of upper computer software, receiving a video data request sent by the upper computer software, and creating a video directory under a root directory for each new video file;
step 5): receiving video data of each frame of an upper computer, creating a file under a corresponding video directory for the video data of each frame, naming a video file name by using a frame number, and obtaining a plurality of video frame files;
the reading step is to read the video data of each frame, and comprises the following steps:
step 1): acquiring a cluster number of a root directory, wherein a first cluster of the root directory is adjacent to the FAT2 and occupies the 1 st cluster in a cluster area sequence;
step 2): reading the data of the cluster corresponding to the root directory, reading the video file name as required, and finding the corresponding directory entry so as to find the cluster number corresponding to the directory entry; the cluster data is a file entry of each video frame file, and a cluster position corresponding to each video frame file is recorded in the file entry;
step 3): reading a cluster corresponding to the directory entry;
step 4): sequentially indexing corresponding file entries in the cluster according to the frame number of the video file name, and respectively finding out the file entry corresponding to each frame of video data;
step 5): finding out the cluster number and the cluster length corresponding to the video frame file according to the file table entry of each frame of video data;
step 6): converting the cluster number and the cluster length into an address and a length required by hardware;
step 7): initiating a hardware reading command according to the acquired cluster number and length;
step 8): the hardware returns video frame data.
2. A method for optimizing the reading speed of extracted video frames according to claim 1, wherein: the short file entry length is fixed to 4 bytes, and the frame numbers of the video file names are sorted from 0 by natural positive integer names.
CN201910060936.6A 2019-01-23 2019-01-23 Method for optimizing and extracting video frame reading speed Active CN109874049B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910060936.6A CN109874049B (en) 2019-01-23 2019-01-23 Method for optimizing and extracting video frame reading speed

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910060936.6A CN109874049B (en) 2019-01-23 2019-01-23 Method for optimizing and extracting video frame reading speed

Publications (2)

Publication Number Publication Date
CN109874049A CN109874049A (en) 2019-06-11
CN109874049B true CN109874049B (en) 2021-04-27

Family

ID=66917914

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910060936.6A Active CN109874049B (en) 2019-01-23 2019-01-23 Method for optimizing and extracting video frame reading speed

Country Status (1)

Country Link
CN (1) CN109874049B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1486462A (en) * 2001-01-12 2004-03-31 ������������ʽ���� Data recorder
CN1522534A (en) * 2001-07-04 2004-08-18 ������������ʽ���� Image recording equipment
CN101008919A (en) * 2007-01-31 2007-08-01 浙江大学 Audio/video data access method and device based on raw device
JP2009026402A (en) * 2007-07-20 2009-02-05 Teac Corp Optical disk device
CN104394371A (en) * 2014-12-01 2015-03-04 北京理工大学 System for large amount continuous image collection and quick storage
CN104484427A (en) * 2014-12-19 2015-04-01 武汉长江通信智联技术有限公司 Video file storage device and video file storage method
CN104991746A (en) * 2015-07-27 2015-10-21 深圳市蓝天威视科技有限公司 Method and system for storing and reading record data in FAT hard disk
CN107729566A (en) * 2017-11-14 2018-02-23 郑州天迈科技股份有限公司 A kind of index method for reconstructing for public transport vehicle-mounted hard disk audio/video data access

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101416322B1 (en) * 2012-09-11 2014-07-08 도시바삼성스토리지테크놀러지코리아 주식회사 Authentication method of Contents-protected Title and Device adopting the method

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1486462A (en) * 2001-01-12 2004-03-31 ������������ʽ���� Data recorder
CN1522534A (en) * 2001-07-04 2004-08-18 ������������ʽ���� Image recording equipment
CN101008919A (en) * 2007-01-31 2007-08-01 浙江大学 Audio/video data access method and device based on raw device
JP2009026402A (en) * 2007-07-20 2009-02-05 Teac Corp Optical disk device
CN104394371A (en) * 2014-12-01 2015-03-04 北京理工大学 System for large amount continuous image collection and quick storage
CN104484427A (en) * 2014-12-19 2015-04-01 武汉长江通信智联技术有限公司 Video file storage device and video file storage method
CN104991746A (en) * 2015-07-27 2015-10-21 深圳市蓝天威视科技有限公司 Method and system for storing and reading record data in FAT hard disk
CN107729566A (en) * 2017-11-14 2018-02-23 郑州天迈科技股份有限公司 A kind of index method for reconstructing for public transport vehicle-mounted hard disk audio/video data access

Also Published As

Publication number Publication date
CN109874049A (en) 2019-06-11

Similar Documents

Publication Publication Date Title
US8051249B2 (en) Method for preloading data to improve data-retrieval times
US9286165B2 (en) Apparatus and method for recovering partition using backup boot record information
CN107577436B (en) Data storage method and device
EP2915051B1 (en) Memory device and host device
US8472449B2 (en) Packet file system
CN103150395B (en) Directory path analysis method of solid state drive (SSD)-based file system
CN1963814A (en) Managing method of data of memorizer
CN109284252B (en) Lightweight file system management method in communication equipment
KR20180008774A (en) Method and system for implementing indexing when saving files
CN115292266A (en) High-reliability log storage method based on memory
US8239427B2 (en) Disk layout method for object-based storage devices
CN106709014B (en) File system conversion method and device
CN110795386B (en) Data writing method and server
CN112463020A (en) Data access method, device and equipment based on Flash
CN109874049B (en) Method for optimizing and extracting video frame reading speed
US10585592B2 (en) Disk area isolation method and device
CN111897675B (en) Method for restoring recently deleted files of F2FS file system at mobile phone end
CN102693315A (en) Method and device for removing URL (uniform resource locator) duplicate on basis of shared memory mapping
CN105549912A (en) Storage method of server cluster capable of simultaneously containing various types of operating systems
CN110543434B (en) NAND flash device, memory table management method, device and storage medium
CN111142804A (en) Management system for computer storage equipment
CN109960460B (en) Distributed storage system
CN111984197A (en) Computer buffer memory allocation method
CN111782588A (en) File reading method, device, equipment and medium
CN110765290A (en) Picture storage method, reading method, device and access 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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 311400 4th floor, building 9, Yinhu innovation center, No. 9, Fuxian Road, Yinhu street, Fuyang District, Hangzhou City, Zhejiang Province

Applicant after: Hangzhou xiongmai integrated circuit technology Co.,Ltd.

Address before: 311422 four floor, 9 floor, Silver Lake innovation centre, 9 Fu Fu Road, Fuyang Lake District, Hangzhou, Zhejiang.

Applicant before: HANGZHOU XIONGMAI INTEGRATED CIRCUIT TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant
PE01 Entry into force of the registration of the contract for pledge of patent right
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: A Method of Optimizing the Reading Speed of Video Frames

Effective date of registration: 20221109

Granted publication date: 20210427

Pledgee: Zhejiang Fuyang Rural Commercial Bank branch Limited by Share Ltd. Silver Lake

Pledgor: Hangzhou xiongmai integrated circuit technology Co.,Ltd.

Registration number: Y2022980021287

CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: 311422 4th floor, building 9, Yinhu innovation center, 9 Fuxian Road, Yinhu street, Fuyang District, Hangzhou City, Zhejiang Province

Patentee after: Zhejiang Xinmai Microelectronics Co.,Ltd.

Address before: 311400 4th floor, building 9, Yinhu innovation center, No.9 Fuxian Road, Yinhu street, Fuyang District, Hangzhou City, Zhejiang Province

Patentee before: Hangzhou xiongmai integrated circuit technology Co.,Ltd.

PC01 Cancellation of the registration of the contract for pledge of patent right

Granted publication date: 20210427

Pledgee: Zhejiang Fuyang Rural Commercial Bank branch Limited by Share Ltd. Silver Lake

Pledgor: Hangzhou xiongmai integrated circuit technology Co.,Ltd.

Registration number: Y2022980021287