CN113407769A - Cache mapping method for non-edited short video of mobile phone - Google Patents

Cache mapping method for non-edited short video of mobile phone Download PDF

Info

Publication number
CN113407769A
CN113407769A CN202110483467.6A CN202110483467A CN113407769A CN 113407769 A CN113407769 A CN 113407769A CN 202110483467 A CN202110483467 A CN 202110483467A CN 113407769 A CN113407769 A CN 113407769A
Authority
CN
China
Prior art keywords
file
data
index
locally
video
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.)
Pending
Application number
CN202110483467.6A
Other languages
Chinese (zh)
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.)
Chengdu Dongfangshengxing Electronics Co ltd
Original Assignee
Chengdu Dongfangshengxing Electronics 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 Chengdu Dongfangshengxing Electronics Co ltd filed Critical Chengdu Dongfangshengxing Electronics Co ltd
Priority to CN202110483467.6A priority Critical patent/CN113407769A/en
Publication of CN113407769A publication Critical patent/CN113407769A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/70Information retrieval; Database structures therefor; File system structures therefor of video data
    • G06F16/71Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/70Information retrieval; Database structures therefor; File system structures therefor of video data
    • G06F16/73Querying
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Software Systems (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Computational Linguistics (AREA)
  • Television Signal Processing For Recording (AREA)

Abstract

The invention discloses a cache mapping method for a non-edited short video of a mobile phone, which comprises the following steps: the method comprises the following steps: generating a mapping file and an index file index of an audio/video file locally, wherein the index file index is used for quickly searching whether data required by editing exists locally; step two: positioning or playing, when acquiring file data, firstly inquiring whether the file data exists locally, if so, reading the file data from the local for analysis and decoding; if the file data does not exist locally, the file data is acquired through the network for analysis and decoding, and the mapping file and the index file index of the local audio/video file are filled according to the file data acquired through the network. The cache mapping method has the advantages of low flow cache consumption and high reading speed, obviously reduces the pause phenomenon in the nonlinear editing process, and improves the use experience of non-edited short videos of users.

Description

Cache mapping method for non-edited short video of mobile phone
Technical Field
The invention relates to the technical field of video editing, in particular to a cache mapping method for a non-edited short video of a mobile phone.
Background
With the rapid growth of mobile internet video services, news interviewers in the radio and television industry need to create video services in scenes outside offices, and editing is performed based on a mobile phone non-editing client, media resources in a station need to be accessed through a mobile network in the editing process, the stability of the internet environment in China is not very reliable, the bandwidth is high, the speed is low, the speed is high, the speed is low, and when media files in the station are large or the current network environment is not good, how to efficiently and smoothly edit the network resources is the key point for overcoming the invention.
The conventional cloud material editing method can be used for editing after the whole file is downloaded completely and undamaged, the method can meet practical application, but has high requirements on network environment, particularly the use of a high-definition file, but the efficiency is low, data are acquired on the network, the flow can be multiplied by several times or even dozens of times of the size of the file, the user experience is poor, and the blocking phenomenon is easy to occur in the nonlinear editing process.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provides a cache mapping method for a non-edited short video of a mobile phone.
The purpose of the invention is realized by the following technical scheme:
a cache mapping method for a non-edited short video of a mobile phone comprises the following steps:
the method comprises the following steps: generating a mapping file and an index file index of an audio/video file locally, wherein the index file index is used for quickly searching whether data required by editing exists locally;
step two: positioning or playing, when acquiring file data, firstly inquiring whether the file data exists locally, if so, reading the file data from the local for analysis and decoding; if the file data does not exist locally, the file data is acquired through the network for analysis and decoding, and the mapping file and the index file index of the local audio/video file are filled according to the file data acquired through the network.
Specifically, the method further comprises: if the non-editing system of the mobile phone is idle, the system can start a background data repair thread to automatically repair the missing data in the mapping file. If the data is completely supplemented, the subsequent editing process does not need to acquire the data from the network.
Specifically, the method further comprises: after a certain audio/video file is played once or completely positioned frame by frame, the non-editing system of the mobile phone does not need to take the file data from the network.
Specifically, the process of reading the file data from the local to perform parsing and decoding includes: opening an audio and video file, 1) probe basic information, and opening different decoders according to the basic information; 2) reading a header file, and opening an analyzer and a decoder according to header file information; 3) reading data, analyzing the data, separating the data of different streams [ stream ], judging the validity of the data, and then respectively sending the data to different decoders; 4) in the decoder, the original data is decoded, and the video is rotated, scaled or format converted according to the user's needs.
Specifically, the process of filling the mapping file and the index file index of the local audio/video file according to the file data acquired by the network specifically includes: opening an audio and video file acquired by a network, creating a cache image file with the same size as the audio and video file locally, wherein the data is null, and creating an index file index for marking whether the data exists locally;
the method comprises the steps that 32768 bytes of data are read when an audio/video file is read through file data analysis or decoding, index files index are inquired when the data are acquired, and if the same file data exist locally, the index files are read locally; if the same file data does not exist locally, reading through a network, and simultaneously writing the read data into a cache mapping file, wherein the cache mapping file is equal to the source file in position, and simultaneously recording that the data at the position already exists in an index file index;
and idle filling, namely reading file data which does not exist locally through http according to the record of the index file index when the computer is idle, directly filling the read file data into the cache mapping file, and finally marking the data existing locally in the index file index.
The invention has the beneficial effects that:
1. the flow consumed by the cache is slightly larger than or equal to the size of the audio/video file, and if the method is not adopted, data needs to be acquired from the network every time any operation is carried out, and the flow can be several times, even dozens of times, larger than the size of the file per se.
2. The reading speed of the local data is several times that of the data read through the Internet, and the pause phenomenon in the non-linear editing process is obviously reduced.
3. The use experience of the user of the non-edited short video is improved.
Drawings
FIG. 1 is a flow chart of the method of the present invention.
Fig. 2 is a data flow diagram of the present invention.
Detailed Description
In order to more clearly understand the technical features, objects, and effects of the present invention, embodiments of the present invention will now be described with reference to the accompanying drawings.
In this embodiment, the existing non-editing system of the mobile phone sometimes needs to edit the audio/video file in an http manner, and the conventional editing process is as follows:
and (1.1) positioning frame by frame, connecting a server file through http, obtaining required data and decoding.
And (1.2) playing, continuously fetching data from the server through http on the basis of positioning frame by frame, and then decoding the playing.
The above editing process has the following problems: in the operation process of nonlinear editing, positioning and playing are carried out quite frequently, http reconnection is needed for each positioning, and data are obtained from a server through http. Obtaining data via http is much slower than traditional network sharing or direct local files, and if slower via the internet, may require additional overhead in network traffic. However, http reconnection is particularly slow, because tcp/ip connection requires 3-way handshaking operations, such editing manner undoubtedly increases the flow consumption and data reading time of editing, and the user experience is not good.
The improvement point of the invention is that a file buffer is added in the decoding program, including the mapping file and the index thereof. As shown in fig. 1 and fig. 2, the improved cache mapping method for the non-edited short video of the mobile phone includes the following steps:
the method comprises the following steps: generating a mapping file and an index file index of an audio/video file locally, wherein the index file index is used for quickly searching whether data required by editing exists locally;
step two: positioning or playing, when acquiring file data, firstly inquiring whether the file data exists locally, if so, reading the file data from the local for analysis and decoding; if the file data does not exist locally, the file data is acquired through the network for analysis and decoding, and the mapping file and the index file index of the local audio/video file are filled according to the file data acquired through the network.
In addition, if the non-editing system of the mobile phone is idle, the system can start a background data repair thread to automatically repair the missing data in the mapping file. If the data is completely supplemented, the subsequent editing process does not need to acquire the data from the network.
After a certain audio/video file is played once or completely positioned frame by frame, the non-editing system of the mobile phone does not need to take the file data from the network.
In the invention, the process of reading the file data from the local to analyze and decode comprises the following steps: and opening an audio and video file, 1.probe basic information, and opening different decoders according to the basic information. 2. Reading the header file, and opening the resolver and the decoder according to the header file information. 3. Reading data, analyzing the data, separating the data of different streams [ stream ], judging the validity of the data, if the data has a deletion, and sending the data to different decoders respectively. 4. In the decoder, the original data is decoded, and the video is rotated if rotation is required, scaled if scaling is required, and converted if conversion into different formats is required, as required. The audio is uniformly converted into PCM with the frequency of 48 Hz, and the like, so that other programs can be called conveniently.
In the invention, the process of filling the mapping file and the index file index of the local audio/video file according to the file data acquired by the network comprises the following steps: the method comprises the steps of opening an online audio and video file for the first time, creating a cache file with the same size locally, wherein the data is null, and creating an index for marking whether the data exists locally. Later, 32768 bytes of data are read when the audio/video file is analyzed or decoded and read, when the data is obtained, an index file is firstly seen [ the file marks whether the data exists locally ], if the file exists locally, the data is read from the local, if the file does not exist locally, the data is read on the network and written into a cache file, the position of the data is equal to that of a source file, meanwhile, the data at the position is recorded in the index to exist, when the data is read again next time, the data cannot be read from the internet, the data is read locally, the local reading is faster, and the network flow is saved more.
And idle filling, namely when the computer is idle, reading the data which does not exist locally through http according to the record of the index, directly filling the cache file, and marking that the data exists locally in the index file.
The foregoing shows and describes the general principles, essential features, and advantages of the invention. It will be understood by those skilled in the art that the present invention is not limited to the embodiments described above, which are described in the specification and illustrated only to illustrate the principle of the present invention, but that various changes and modifications may be made therein without departing from the spirit and scope of the present invention, which fall within the scope of the invention as claimed. The scope of the invention is defined by the appended claims and equivalents thereof.

Claims (5)

1. A cache mapping method for a non-edited short video of a mobile phone is characterized by comprising the following steps:
the method comprises the following steps: generating a mapping file and an index file index of an audio/video file locally, wherein the index file index is used for quickly searching whether data required by editing exists locally;
step two: positioning or playing, when acquiring file data, firstly inquiring whether the file data exists locally, if so, reading the file data from the local for analysis and decoding; if the file data does not exist locally, the file data is acquired through the network for analysis and decoding, and the mapping file and the index file index of the local audio/video file are filled according to the file data acquired through the network.
2. The method of claim 1, wherein the method further comprises: if the non-editing system of the mobile phone is idle, the system can start a background data repair thread to automatically repair the missing data in the mapping file. If the data is completely supplemented, the subsequent editing process does not need to acquire the data from the network.
3. The method of claim 1, wherein the method further comprises: after a certain audio/video file is played once or completely positioned frame by frame, the non-editing system of the mobile phone does not need to take the file data from the network.
4. The cache mapping method for the non-edited short video of the mobile phone according to claim 1, wherein the reading of the file data from the local for parsing and decoding specifically comprises: opening an audio and video file, 1) probe basic information, and opening different decoders according to the basic information; 2) reading a header file, and opening an analyzer and a decoder according to header file information; 3) reading data, analyzing the data, separating the data of different streams [ stream ], judging the validity of the data, and then respectively sending the data to different decoders; 4) in the decoder, the original data is decoded, and the video is rotated, scaled or format converted according to the user's needs.
5. The cache mapping method for the non-edited short video of the mobile phone according to claim 1, wherein the process of filling the mapping file and the index file index of the local audio/video file according to the file data obtained by the network specifically comprises: opening an audio and video file acquired by a network, creating a cache image file with the same size as the audio and video file locally, wherein the data is null, and creating an index file index for marking whether the data exists locally; the method comprises the steps that 32768 bytes of data are read when an audio/video file is read through file data analysis or decoding, index files index are inquired when the data are acquired, and if the same file data exist locally, the index files are read locally; if the same file data does not exist locally, reading through a network, and simultaneously writing the read data into a cache mapping file, wherein the cache mapping file is equal to the source file in position, and simultaneously recording that the data at the position already exists in an index file index;
and idle filling, namely reading file data which does not exist locally through http according to the record of the index file index when the computer is idle, directly filling the read file data into the cache mapping file, and finally marking the data existing locally in the index file index.
CN202110483467.6A 2021-04-30 2021-04-30 Cache mapping method for non-edited short video of mobile phone Pending CN113407769A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110483467.6A CN113407769A (en) 2021-04-30 2021-04-30 Cache mapping method for non-edited short video of mobile phone

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110483467.6A CN113407769A (en) 2021-04-30 2021-04-30 Cache mapping method for non-edited short video of mobile phone

Publications (1)

Publication Number Publication Date
CN113407769A true CN113407769A (en) 2021-09-17

Family

ID=77677782

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110483467.6A Pending CN113407769A (en) 2021-04-30 2021-04-30 Cache mapping method for non-edited short video of mobile phone

Country Status (1)

Country Link
CN (1) CN113407769A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115577684A (en) * 2022-12-07 2023-01-06 成都华栖云科技有限公司 Method, system and storage medium for connecting nonlinear editing system

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110166846A (en) * 2019-05-31 2019-08-23 成都东方盛行电子有限责任公司 A kind of caching method based on 4K code rate editor agency

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110166846A (en) * 2019-05-31 2019-08-23 成都东方盛行电子有限责任公司 A kind of caching method based on 4K code rate editor agency

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
LIVEVIDEOSTACK: "美摄云非编系统——网页端实时编辑渲染方案", 《HTTPS://ZHUANLAN.ZHIHU.COM/P/158013836》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115577684A (en) * 2022-12-07 2023-01-06 成都华栖云科技有限公司 Method, system and storage medium for connecting nonlinear editing system

Similar Documents

Publication Publication Date Title
CN112653700B (en) Website video communication method based on WEBRTC
CN104506937A (en) Method and system for sharing processing of audios and videos
CN110996160B (en) Video processing method and device, electronic equipment and computer readable storage medium
MXPA04006412A (en) Sparse caching for streaming media.
CN107734354A (en) It is a kind of that real-time clipping method and device are carried out to live stream video
WO2018130173A1 (en) Dubbing method, terminal device, server and storage medium
WO2020248324A1 (en) Streaming media data processing method and streaming media processing server
WO2007053957A1 (en) Transcoder for live streams and on demand media
WO2008098441A1 (en) Network-based program remote editing method
CN113407769A (en) Cache mapping method for non-edited short video of mobile phone
CN113079386B (en) Video online playing method and device, electronic equipment and storage medium
CN113742518A (en) Method, apparatus and computer program product for storing and providing video
CN113382278B (en) Video pushing method and device, electronic equipment and readable storage medium
CN113873288A (en) Method and device for generating playback in live broadcast process
CN112911332B (en) Method, apparatus, device and storage medium for editing video from live video stream
CN112565717B (en) Video structuring method, related device, system and storage medium
WO2021101024A1 (en) Cloud-based video virtual studio service system
CN102118633B (en) Method, device and system for playing video files
CN111107443A (en) DASH fragment file merging method, terminal device and storage medium
CN114285836B (en) Video playing method, device and medium
CN114630143B (en) Video stream storage method, device, electronic equipment and storage medium
CN115866331A (en) Video frame extraction analysis method, device, equipment and storage medium
KR100878528B1 (en) Method for editing and apparatus thereof
CN114173145A (en) HLS protocol-based dynamic code rate low-delay live broadcast method
CN111447490A (en) Streaming media file processing method and device

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20210917

RJ01 Rejection of invention patent application after publication