CN109511008B - Method for supporting video and audio file content addition based on object storage - Google Patents
Method for supporting video and audio file content addition based on object storage Download PDFInfo
- Publication number
- CN109511008B CN109511008B CN201811426904.5A CN201811426904A CN109511008B CN 109511008 B CN109511008 B CN 109511008B CN 201811426904 A CN201811426904 A CN 201811426904A CN 109511008 B CN109511008 B CN 109511008B
- Authority
- CN
- China
- Prior art keywords
- file
- video
- audio
- inx
- data
- 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
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing 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/433—Content storage operation, e.g. storage operation in response to a pause request, caching operations
- H04N21/4334—Recording operations
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/47—End-user applications
- H04N21/472—End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content
- H04N21/47205—End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content for manipulating displayed content, e.g. interacting with MPEG-4 objects, editing locally
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Databases & Information Systems (AREA)
- Human Computer Interaction (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Television Signal Processing For Recording (AREA)
Abstract
The invention discloses a method for supporting video and audio file content addition based on object storage, which relates to the technical field of video and audio processing, and comprises the following steps of S1: writing the source file to generate a corresponding inx file; s2: writing the video and audio files and the inx file into the object storage in an additional writing mode; s3: when the writing of the video and audio files is finished, deleting the corresponding inx files; s4: when the video and audio files are read, whether the corresponding inx file exists in the video and audio files is judged, and if the corresponding inx file does not exist, the video and audio files are completely written into the object for storage and are directly read; if the corresponding inx file exists, the video and audio file is read according to the offset and the size of each frame of the video and audio file recorded by the inx file, the video and audio file is written into the object storage in a data appending mode, so that the file is visible to a user in the acquisition process, the user can read the file in the acquisition process and edit the file, and the video and audio file is supported to be edited while being acquired in the object storage.
Description
Technical Field
The invention relates to the technical field of video and audio processing, in particular to a method for supporting video and audio file content addition based on object storage.
Background
Along with the vigorous development of the Chinese broadcast and television industry, the program making requirements are higher and higher, the timeliness and the high efficiency of media contents need to be considered, if the program contents can not be edited at the same time of acquisition, the timeliness of content transmission can be reduced, the time for making the program is wasted, but the current mode for storing the used objects can not meet the requirements of acquisition and editing at the same time, and the following defects exist:
1. the file is invisible to the user during writing
When the object is used for storage at present, the file is invisible to a user in the writing process, and the user cannot perceive the writing progress of the file, so that long-time waiting can be caused, the timeliness of content transmission is reduced, and unnecessary time waste is caused;
2. file can not be edited in writing process
At present, when an object is used for storage, a user can only read a complete file, if the file is always written in the process, the user cannot read the file, and the video file in the acquisition process cannot form the complete file in the storage because the content is always additionally written in the video file in the acquisition process, so that the user cannot edit the file in the acquisition process, and the file editing efficiency is greatly reduced.
Disclosure of Invention
The invention aims to: in order to solve the problems that the existing file adopting an object storage mode cannot be edited in the writing process and has low timeliness and efficiency, the invention provides a method for supporting the content addition of a video-audio file based on object storage.
The invention specifically adopts the following technical scheme for realizing the purpose:
a method for supporting content addition of video and audio files based on object storage comprises the following steps:
s1: writing a source file, and generating a corresponding inx file according to a source file format, wherein the inx file records the offset and the size of each frame of a video and audio file of the source file;
s2: writing the video and audio files and the inx file into the object storage in an additional writing mode;
s3: when the writing of the video and audio files is finished, deleting the corresponding inx files;
s4: when the video and audio files are read, whether the corresponding inx file exists in the video and audio files is judged, if the corresponding inx file does not exist, the video and audio files are completely written into the object for storage, and the video and audio files are directly read; if the corresponding inx file exists, the video and audio file is read according to the offset and the size of each frame of the video and audio file recorded by the inx file.
Further, the inx file comprises a head part and a data part, wherein the head part is used for storing medada data of the source file, and the medada data is used for describing the video and audio coding format, the video and audio stream number and the duration information of the source file; the data part is used for storing the index data of each frame of the video and audio file in the source file, and the index data records the offset position of each frame of video and audio in the source file, so that the frame to be taken can be conveniently found when the file is read.
Further, the additional writing in S2 includes the steps of:
s2.1: receiving a http write request of a source file, checking whether an object in object storage exists, and if the object does not exist, returning a request failure; if the object exists, reading the manifest data of the object;
s2.2: checking whether the position of the written content is the last fragment described by the manifest data; if so, writing new data in the tail of the fragment, and updating manifest data to describe the size of the fragment; if not, a new fragment is created, new data is written in the new fragment, and new fragment information is added in the manifest;
s2.3: if the new data can not be written in the S2.2, adding a new fragment, writing the new data which is not written in the new fragment, and adding the description information of the new fragment in the manifest until the new data is completely written in;
s2.4: and after the new data is completely written, forming a target file, and returning an http writing request result.
Further, when the corresponding inx file exists in S4, reading the video and audio files includes the following steps:
s4.1: after receiving a target file http read request, checking whether an object in object storage exists, and if the object does not exist, returning a request failure; if the object exists, reading the manifest data of the object;
s4.2: calculating the fragment position and the fragment offset of the tail of the target file, and reading data;
s4.3: and returning the http read request result.
The invention has the following beneficial effects:
1. in the method, in the process of writing a source file into an object storage, the object storage is written in a data appending mode, so that the file is visible to a user in the acquisition process, and the user can read the file and edit the file in the acquisition process, thereby realizing the method for supporting the acquisition and editing of the video and audio files in the object storage; and the S3 protocol is modified by combining with the analysis of the video and audio file format, so that the video and audio file can be packaged into a complete file in the writing process, and a user can read and edit the file in the acquisition process, thereby greatly improving the program making efficiency and having the characteristics of high efficiency, practicability, convenience in maintenance and cost reduction.
Drawings
FIG. 1 is a schematic diagram of a video/audio file writing process according to the present invention.
FIG. 2 is a schematic view of a video/audio file reading process according to the present invention.
FIG. 3 is a flow chart illustrating the process of additionally writing new data according to the present invention.
Fig. 4 is a flow chart illustrating the process of reading the audio/video file when the corresponding inx file exists according to the present invention.
Fig. 5 is a schematic view of the inx file structure.
Detailed Description
For a better understanding of the present invention by those skilled in the art, the present invention will be described in further detail below with reference to the accompanying drawings and the following examples.
Example 1
As shown in fig. 1 and fig. 2, the present embodiment provides a method for supporting content addition of a video/audio file based on object storage, comprising the following steps:
s1: writing a source file, and generating a corresponding inx file according to a source file format, wherein the inx file comprises a head part and a data part, the head part is used for storing medada data of the source file, and the medada data is used for describing a video and audio coding format, the number of video and audio streams and duration information of the source file; the data part is used for storing the index data of each frame of the video and audio file in the source file, and the index data records the offset position of each frame of video and audio in the source file, so that the frame to be taken can be found conveniently when the file is read;
s2: writing the video and audio files and the inx file into the object storage in an additional writing mode;
as shown in fig. 3, the additional writing includes the steps of:
s2.1: receiving a http write request of a source file, checking whether an object in object storage exists, and if the object does not exist, returning a request failure; if the object exists, reading the manifest data of the object;
s2.2: checking whether the position of the written content is the last fragment described by the manifest data; if so, writing new data in the tail of the fragment, and updating manifest data to describe the size of the fragment; if not, a new fragment is created, new data is written in the new fragment, and new fragment information is added in the manifest;
s2.3: if the new data can not be written in the S2.2, adding a new fragment, writing the new data which is not written in the new fragment, and adding the description information of the new fragment in the manifest until the new data is completely written in;
s2.4: after the new data is completely written in, a target file is formed, and an http write request result is returned
S3: when the writing of the video and audio files is finished, deleting the corresponding inx files;
s4: when the video and audio files are read, whether the corresponding inx file exists in the video and audio files is judged, if the corresponding inx file does not exist, the video and audio files are completely written into the object for storage, and the video and audio files are directly read; if the corresponding inx file exists, reading the video and audio file according to the offset and the size of each frame of the video and audio file recorded by the inx file;
as shown in fig. 4, when the corresponding inx file exists in S4, reading the video and audio files includes the following steps:
s4.1: after receiving a target file http read request, checking whether an object in object storage exists, and if the object does not exist, returning a request failure; if the object exists, reading the manifest data of the object;
s4.2: calculating the fragment position and the fragment offset of the tail of the target file, and reading data;
s4.3: and returning the http read request result.
In the process of writing the source file into the object storage, the object storage is written in a data adding mode, so that the file is visible to a user in the acquisition process, and the user can read the file and edit the file in the acquisition process, so that the video and audio files can be edited while being acquired in the object storage, the program production efficiency is greatly improved, and the method is efficient and practical.
The above description is only a preferred embodiment of the present invention, and not intended to limit the present invention, the scope of the present invention is defined by the appended claims, and all structural changes that can be made by using the contents of the description and the drawings of the present invention are intended to be embraced therein.
Claims (3)
1. A method for supporting content addition of video and audio files based on object storage is characterized by comprising the following steps:
s1: writing a source file, and generating a corresponding inx file according to a source file format, wherein the inx file records the offset and the size of each frame of a video and audio file of the source file;
s2: writing the video and audio files and the inx file into the object storage in an additional writing mode;
s3: when the writing of the video and audio files is finished, deleting the corresponding inx files;
s4: when the video and audio files are read, whether the corresponding inx file exists in the video and audio files is judged, if the corresponding inx file does not exist, the video and audio files are completely written into the object for storage, and the video and audio files are directly read; if the corresponding inx file exists, reading the video and audio file according to the offset and the size of each frame of the video and audio file recorded by the inx file;
the additional writing in S2 includes the following steps:
s2.1: receiving a http write request of a source file, checking whether an object in object storage exists, and if the object does not exist, returning a request failure; if the object exists, reading the manifest data of the object;
s2.2: checking whether the position of the written content is the last fragment described by the manifest data; if so, writing new data in the tail of the fragment, and updating manifest data to describe the size of the fragment; if not, a new fragment is created, new data is written in the new fragment, and new fragment information is added in the manifest;
s2.3: if the new data can not be written in the S2.2, adding a new fragment, writing the new data which is not written in the new fragment, and adding the description information of the new fragment in the manifest until the new data is completely written in;
s2.4: and after the new data is completely written, forming a target file, and returning an http writing request result.
2. The method for supporting content addition of video-audio files based on object storage as claimed in claim 1, wherein said inx file includes a head portion for storing mediada data of source file, and a data portion for describing video-audio encoding format, video-audio stream number and duration information of source file; the data part is used for storing index data of each frame of video and audio files in the source file, and the index data records the offset position of each frame of video and audio in the source file.
3. The method of claim 1, wherein when the corresponding inx file exists in the S4, the step of reading the video/audio file comprises the following steps:
s4.1: after receiving a target file http read request, checking whether an object in object storage exists, and if the object does not exist, returning a request failure; if the object exists, reading the manifest data of the object;
s4.2: calculating the fragment position and the fragment offset of the tail of the target file, and reading data;
s4.3: and returning the http read request result.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811426904.5A CN109511008B (en) | 2018-11-27 | 2018-11-27 | Method for supporting video and audio file content addition based on object storage |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811426904.5A CN109511008B (en) | 2018-11-27 | 2018-11-27 | Method for supporting video and audio file content addition based on object storage |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109511008A CN109511008A (en) | 2019-03-22 |
CN109511008B true CN109511008B (en) | 2021-07-13 |
Family
ID=65750828
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811426904.5A Active CN109511008B (en) | 2018-11-27 | 2018-11-27 | Method for supporting video and audio file content addition based on object storage |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109511008B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110531933B (en) * | 2019-08-23 | 2022-06-17 | 北京浪潮数据技术有限公司 | Data processing method and server |
CN111245933A (en) * | 2020-01-10 | 2020-06-05 | 上海德拓信息技术股份有限公司 | Log-based object storage additional writing implementation method |
CN112866409B (en) * | 2021-02-08 | 2022-10-11 | 深圳市杉岩数据技术有限公司 | Object transmission and collection method based on object storage fragment uploading and terminal equipment |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102375716A (en) * | 2010-08-26 | 2012-03-14 | 北大方正集团有限公司 | Variable data printing method and system |
CN103329527A (en) * | 2011-01-12 | 2013-09-25 | 西门子公司 | Compression and decompression of reference images in a video coding device |
CN105302868A (en) * | 2015-09-29 | 2016-02-03 | 北京金山安全软件有限公司 | network access record cleaning method and device |
CN107295425A (en) * | 2017-06-12 | 2017-10-24 | 北京达沃时代科技股份有限公司 | A kind of method of quick splicing transcoding slicing files |
CN107911712A (en) * | 2017-11-30 | 2018-04-13 | 歌尔科技有限公司 | Data buffering method and electronic equipment |
CN108234594A (en) * | 2017-11-28 | 2018-06-29 | 北京市商汤科技开发有限公司 | File memory method and device, electronic equipment, program and medium |
CN108769786A (en) * | 2018-05-25 | 2018-11-06 | 网宿科技股份有限公司 | A kind of method and apparatus of synthesis audio and video data streams |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP3507977A4 (en) * | 2016-08-30 | 2020-06-24 | Sonic IP, Inc. | Systems and methods for encoding and playing back 360 view video content |
-
2018
- 2018-11-27 CN CN201811426904.5A patent/CN109511008B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102375716A (en) * | 2010-08-26 | 2012-03-14 | 北大方正集团有限公司 | Variable data printing method and system |
CN103329527A (en) * | 2011-01-12 | 2013-09-25 | 西门子公司 | Compression and decompression of reference images in a video coding device |
CN105302868A (en) * | 2015-09-29 | 2016-02-03 | 北京金山安全软件有限公司 | network access record cleaning method and device |
CN107295425A (en) * | 2017-06-12 | 2017-10-24 | 北京达沃时代科技股份有限公司 | A kind of method of quick splicing transcoding slicing files |
CN108234594A (en) * | 2017-11-28 | 2018-06-29 | 北京市商汤科技开发有限公司 | File memory method and device, electronic equipment, program and medium |
CN107911712A (en) * | 2017-11-30 | 2018-04-13 | 歌尔科技有限公司 | Data buffering method and electronic equipment |
CN108769786A (en) * | 2018-05-25 | 2018-11-06 | 网宿科技股份有限公司 | A kind of method and apparatus of synthesis audio and video data streams |
Non-Patent Citations (1)
Title |
---|
《相似索引:适用于重复数据删除的二级索引》;张志珂,蒋泽军,蔡小斌,彭成章;《计算机应用研究》;20140306;全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN109511008A (en) | 2019-03-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109511008B (en) | Method for supporting video and audio file content addition based on object storage | |
CN1282195C (en) | Rewritable recording medium and its recording, reproducing method and device | |
US9870799B1 (en) | System and method for processing ancillary data associated with a video stream | |
CN101661785A (en) | Data recording apparatus, data reproduction appratus, data recording method and data display method, and recording apparatus | |
CN103324513B (en) | Program annotation method and apparatus | |
JP4481889B2 (en) | Data recording apparatus and method, program, and recording medium | |
US20170084309A1 (en) | Video file creation device and video file creation method | |
US7337297B2 (en) | Method and apparatus for recording data with pseudo-merge | |
US20060236219A1 (en) | Media timeline processing infrastructure | |
CN102231827B (en) | Indexing method capable of supporting direct and accurate positioning of frame of program stream (PS) media file | |
CN106055643B (en) | continuous writing method for MXF file writing interruption | |
CN102682016B (en) | A kind of directory system and method for supporting MOV/3GP/MP4 files | |
JP2013528823A (en) | Audio data storage method and apparatus | |
CN102117623B (en) | Method and device for recovering magnetic tape metadata | |
CN101986302A (en) | Media file association method and device | |
CN101448094A (en) | Method for rapidly importing media material | |
CN1771553A (en) | Storage medium in which audio-visual data with event information is recorded, and reproducing apparatus and reproducing method thereof | |
US9070403B2 (en) | Processing of scalable compressed video data formats for nonlinear video editing systems | |
EP2553572B1 (en) | Opportunistic frame caching | |
CN113507625B (en) | Self-adaptive video restoration method | |
CN104575542A (en) | Method and device for realizing audio regional play | |
CN102646433B (en) | Method, device and system for generating stream media real-time record file of digital court | |
CN102231847B (en) | Direct and accurate frame positioning method supporting stream media files | |
CN102681883A (en) | Resource calling method and system in media asset searching and browsing system | |
CN102157175B (en) | Digital dumping method of audio/video data and system thereof |
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 |