CN115396692A - Video file playing method, device, equipment and storage medium - Google Patents

Video file playing method, device, equipment and storage medium Download PDF

Info

Publication number
CN115396692A
CN115396692A CN202210975668.2A CN202210975668A CN115396692A CN 115396692 A CN115396692 A CN 115396692A CN 202210975668 A CN202210975668 A CN 202210975668A CN 115396692 A CN115396692 A CN 115396692A
Authority
CN
China
Prior art keywords
file
metadata
original
target
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
CN202210975668.2A
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.)
Shenzhen Dianmao Technology Co Ltd
Original Assignee
Shenzhen Dianmao 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 Shenzhen Dianmao Technology Co Ltd filed Critical Shenzhen Dianmao Technology Co Ltd
Publication of CN115396692A publication Critical patent/CN115396692A/en
Pending legal-status Critical Current

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/23418Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving operations for analysing video streams, e.g. detecting features or characteristics
    • 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/21Server components or server architectures
    • H04N21/218Source of audio or video content, e.g. local disk arrays
    • H04N21/2183Cache memory
    • 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/433Content storage operation, e.g. storage operation in response to a pause request, caching operations
    • H04N21/4331Caching operations, e.g. of an advertisement for later insertion during playback
    • 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/437Interfacing the upstream path of the transmission network, e.g. for transmitting client requests to a VOD server
    • 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/44008Processing 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 operations for analysing video streams, e.g. detecting features or characteristics in the video stream

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The invention discloses a method, a device, equipment and a storage medium for playing a video file, wherein the method comprises the following steps: acquiring and analyzing an original MP4 file, and acquiring metadata of the original MP4 file according to analyzed data; moving the metadata to a file header designated position of the original MP4 file to generate a target MP4 file; and when an online playing instruction of the client is detected, the target MP4 file is sent to the client, wherein in the sending process of the target MP4 file, the client continues to receive the video content of the target MP4 file after reading the metadata at the specified position of the file header, and online playing is carried out according to the received video content. The invention moves the metadata of the MP4 file to the file header position through the video playing server to generate the target MP4 file, and when the client needs to request the target MP4 file online, the metadata of the file header position is downloaded and read, so that the MP4 file can be played while being downloaded, and the playing efficiency is improved.

Description

Video file playing method, device, equipment and storage medium
Technical Field
The present invention relates to the field of multimedia playing technologies, and in particular, to a method, an apparatus, a device, and a storage medium for playing a video file.
Background
MP4, commonly known as MPEG-4 Part 14, is a multimedia computer file format using MPEG-4, with an extension of. MP4, for storing digital audio and digital video. In an MP4 file, neither the physical format of the file nor the arrangement of the media data is controlled by the time sequence of the media.
In the prior art, when playing an MP4 file, the whole MP4 file is downloaded before playing, which is difficult to play while downloading, and the playing efficiency is low.
Disclosure of Invention
In view of the foregoing disadvantages of the prior art, it is an object of the present invention to provide a method, an apparatus, a device and a storage medium for playing a video file.
The technical scheme of the invention is as follows:
a method for playing a video file, wherein the video file is an MP4 file and is applied to a video playing server, and the method comprises the following steps:
acquiring an original MP4 file, analyzing the original MP4 file, and acquiring metadata of the original MP4 file according to analyzed data, wherein the metadata is descriptive information of the original MP4 file;
moving the metadata to a file header designated position of the original MP4 file to generate a target MP4 file;
and when an online playing instruction of the client is detected, sending the target MP4 file to the client. In the process of sending the target MP4 file, after reading the metadata of the specified position of the file header, the client continuously receives the video content of the target MP4 file and carries out online playing according to the received video content
In one embodiment, the moving the metadata to a file header specified position of the original MP4 file to generate a target MP4 file includes:
acquiring original storage content at a file header designated position of the original MP4 file, and transferring the original storage content to a cache;
writing the metadata into the file header designated position of the original MP4 file through a file writing function;
and after the original storage content in the cache is transferred to a specific position, generating a target MP4 file.
In one embodiment, the acquiring the original MP4 file and parsing the original MP4 file includes:
acquiring an original MP4 file uploaded by a video client, and performing format analysis on the original MP4 file according to the file packaging format of the MP4 file;
and obtaining the file type, the metadata, the video content data and the data length of the original MP4 file according to the format analysis result.
In one embodiment, the data storage format in the original MP4 file is sequentially a file type, video content data and metadata, and the writing the metadata into the specified position of the file header of the original MP4 file by the file writing function to generate the target MP4 file includes:
and extracting the metadata, and writing the metadata in front of the address where the video content data of the original MP4 file is located by a file writing function.
In one embodiment, the obtaining metadata of the original MP4 file according to the parsed data includes:
acquiring the data length stored in the original MP4 file, and reading the metadata of the designated position of the original MP4 file according to the data length.
In an embodiment, the moving the metadata to the specified position of the file header of the original MP4 file, and after generating the target MP4 file, includes:
and generating a metadata adjusting mark, and storing the metadata adjusting mark to the head position of the target MP4 file.
In one embodiment, the sending the target MP4 file to the client when the online playing instruction of the client is detected includes:
when an online playing instruction of a client is detected, judging whether a metadata adjusting mark exists in a target MP4 file or not;
if the metadata adjustment mark exists, sending the target MP4 file to a client, wherein the data storage format in the target file is the file type, the metadata and the video content in sequence;
and if the metadata adjusting mark does not exist, after moving the metadata of the target MP4 file to a file header designated position, sending the target MP4 file after the metadata is moved to a client, wherein the data storage format of the target file after the metadata is moved is the file type, the metadata and the video content in sequence.
Another embodiment of the present invention provides a playing apparatus for a video file, including:
the data analysis module is used for acquiring an original MP4 file, analyzing the original MP4 file, and acquiring metadata of the original MP4 file according to the analyzed data, wherein the metadata is descriptive information of the original MP4 file;
the data moving module is used for moving the metadata to the specified position of the file header of the original MP4 file to generate a target MP4 file;
and the data sending module is used for sending the target MP4 file to the client when an online playing instruction of the client is detected, wherein in the sending process of the target MP4 file, the client continues to receive the video content of the target MP4 file after reading the metadata at the specified position of the file header, and online playing is carried out according to the received video content.
Another embodiment of the present invention provides a playback device for a video file, the device comprising at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the above-described method of playing a video file.
Another embodiment of the present invention also provides a non-transitory computer-readable storage medium storing computer-executable instructions, which, when executed by one or more processors, may cause the one or more processors to perform the above-mentioned method for playing a video file.
Has the beneficial effects that: the embodiment of the invention moves the metadata of the MP4 file to the file header designated position of the MP4 file through the video playing server to generate the target MP4 file, when the client needs to play the target MP4 file online, the client downloads the metadata at the file header designated position, analyzes the metadata, continuously receives the video content of the MP4 file, and plays the video content of the target MP4 file online, thereby realizing the playing of the MP4 file while caching, and improving the playing efficiency of the MP4 file.
Drawings
The invention will be further described with reference to the accompanying drawings and examples, in which:
FIG. 1 is a flowchart illustrating a method for playing a video file according to an embodiment of the present invention;
fig. 2 is a schematic diagram illustrating a storage structure of MP4 file internal data according to an embodiment of a method for playing a video file of the present invention;
FIG. 3 is a functional block diagram of an embodiment of a video file playing apparatus according to the present invention;
fig. 4 is a schematic diagram of a hardware structure of an embodiment of a video file playing device according to the present invention.
Detailed Description
In order to make the objects, technical solutions and effects of the present invention clearer and clearer, the present invention is described in further detail below. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Embodiments of the present invention will be described below with reference to the accompanying drawings.
Referring to fig. 1, fig. 1 is a flowchart of a preferred embodiment of a method for playing a video file according to the present invention. As shown in fig. 1, it includes the steps of:
s100, acquiring an original MP4 file, analyzing the original MP4 file, and acquiring metadata of the original MP4 file according to analyzed data, wherein the metadata is descriptive information of the original MP4 file;
s200, moving the metadata to a file header designated position of the original MP4 file to generate a target MP4 file;
s300, when an online playing instruction of the client is detected, the target MP4 file is sent to the client, wherein in the sending process of the target MP4 file, the client continues to receive the video content of the target MP4 file after reading the metadata at the specified position of the file header, and online playing is carried out according to the received video content.
In a specific implementation, the metadata is descriptive information of the original MP4 file, the descriptive information defines data and playing information of the MP4 file, and the defined objects include, but are not limited to, a media type, a media duration, a referenced media track (track), and the like. Since the metadata of the MP4 file includes information that is crucial to playing the MP4 file, playing the MP4 file begins with parsing the metadata of the MP4 file.
All data in the MP4 file is loaded in a box (atom in QuickTime), that is, the MP4 file is composed of several boxes, each of which has a type and a length, and can be understood as a data object block. Another box may be included in the box, which is called a container box. An MP4 file will first have and only have one "ftyp" type box, which is a marker of MP4 format and contains some information about the file; there will be and only one "moov" type Box (Movie Box) later, which is a container Box, and the sub-Box contains metadata information of the media; the media Data of the MP4 file is contained in an "mdat" type Box (Midia Data Box), which is also a container Box, and there may be a plurality of boxes or none (when the media Data all refer to other files), and the structure of the media Data is described by metadata, which is called metadata (mainly recording key information of the duration of the resolution frame rate code stream of the video).
MP4 files include, but are not limited to, MP4 audio files and MP4 video files. The MP4 file of the embodiment of the present invention mainly refers to an MP4 video file. The method comprises the steps of acquiring an original MP4 file in advance, performing processing analysis on the original MP4 file, and acquiring metadata of the original MP4 file according to analyzed data, wherein the metadata generally records descriptive information such as resolution, frame rate, code stream, duration and the like of the original MP4 file. And moving the position of the metadata in the original MP4 file to the position of the file header of the original MP4 file through a writing function to generate an adjusted target MP4 file. And when an online playing instruction of the client is detected, the video playing server sends the target MP4 file to the client. In the process of sending the target MP4 file to the client, the client receives the target MP4 file, continues to receive the video content of the MP4 file after reading the metadata of the specified position of the file header, and can download and play the video content of the MP4 file in the video playing server according to the metadata information. According to the embodiment of the invention, after the element number of the original MP4 file is moved to the beginning of the MP4 file, the data downloading amount during reading the metadata can be reduced, the time for reading the metadata is reduced, and the playing real-time performance of the MP4 target is improved. The client is an intelligent terminal capable of playing the MP4 file, and the intelligent terminal includes, but is not limited to, electronic devices such as a mobile phone, a PAD, a desktop, a notebook computer, and the like.
In some embodiments, obtaining the original MP4 file and parsing the original MP4 file includes:
acquiring an original MP4 file uploaded by a video client, and performing format analysis on the original MP4 file according to the file packaging format of the MP4 file;
and obtaining the file type, the metadata, the video content data and the data length of the original MP4 file according to the format analysis result.
In specific implementation, a user uploads MP4 shot or made by the user to a video playing server through a video client to form an MP4 file, the video playing server obtains the original MP4 file, and performs format analysis on the original MP4 file according to a file packaging format of the MP4 file, as shown in fig. 2, the storage structure of the internal data of the MP4 file is an embodiment of the present invention, and ftyp box represents a file type (. MP4,.3gp,.3g2,. Mj2,. Mov), and describes a compliant version of the specification. The moov box represents important information required when the metadata record of the media is played. The mdat box represents specific media data, that is, specific video content data. After the original MP4 file is analyzed, the file type, the metadata and the data length corresponding to the video content data of the original MP4 file can be obtained according to the analysis result, and a user can conveniently obtain the position of the metadata.
In one embodiment, obtaining metadata of the original MP4 file according to the parsed data comprises:
and acquiring the data length stored in the original MP4 file, and reading the metadata of the specified position of the original MP4 file according to the data length.
In specific implementation, as shown in fig. 2, the data length of each box in the original MP4 file, where a field stores the box, is obtained, and the metadata of the specified position of the original MP4 file is read by using functions such as read according to the length. In some other embodiments, other functions may be called to read the metadata, or the metadata may be identified by adding a metadata identifier, and the metadata may be read by reading the metadata identifier. The addressing can be directly carried out by reading the data length, and the metadata can be quickly searched.
In one embodiment, moving the metadata to a specified position of a file header of the original MP4 file, and generating the target MP4 file comprises:
acquiring original storage content at a file header designated position of an original MP4 file, and transferring the original storage content to a cache;
writing the metadata into the file header designated position of the original MP4 file through a file writing function;
and after the original storage content in the cache is transferred to a specific position, generating a target MP4 file.
In specific implementation, when metadata is written in a specified position of a file header of an original MP4 file, it is necessary to determine whether the specified position of the file header has original storage content in advance, and if so, the original storage content is taken out and stored in a cache. And writing the metadata of the original MP4 file in the designated position of the original MP4 file by using a file writing function, and storing the original storage content stored in the cache in the specific position of the MP4 file as required to generate a target MP4 file. The header designation location is in the header location of the original MP4 file. The write file includes, but is not limited to, the write function, which is exemplified in the C language, the function name: write; header file: < io.h >; function prototype: int write (int handle, void buf, int len); the functions are as follows: acquiring the position of a pointer for opening a file; parameters are as follows: the int handle is a file handle for acquiring a file pointer; void buf is the content to be written; int len is the length of the file to be written; and (4) returning a value: the length of the actual written file content is returned.
In some other embodiments, other data writing functions may be used to write the metadata to the specified location of the MP 4.
Optionally, the data storage format in the original MP4 file is sequentially a file type, video content data and metadata, and the metadata is written into the specified position of the file header of the original MP4 file through a file writing function to generate the target MP4 file, including:
and extracting metadata, and writing the metadata in front of the address of the video content data of the original MP4 file through a file writing function.
In specific implementation, the MP4 video file defaults to placing the moov box behind the mdat box, which results in that the video on demand cannot be started for a second time and the playing cannot be performed while downloading, and the embodiment of the present invention places the moov box in front of the mdat box, thereby well solving the problem and ensuring that the MP4 file can be played normally. The write file function may employ a write or the like function.
In one embodiment, moving the metadata to a specified position of a file header of the original MP4 file, and after generating the target MP4 file, the method includes:
and generating a metadata adjusting mark, and storing the metadata adjusting mark to the head position of the target MP4 file.
Specifically, by generating the metadata adjustment flag, it is possible to determine whether or not the metadata in the target MP4 file is adjusted.
In one embodiment, when an online playing instruction of a client is detected, sending the target MP4 file to the client includes:
when an online playing instruction of a client is detected, judging whether a metadata adjusting mark exists in a target MP4 file or not;
if the metadata adjustment mark exists, sending the target MP4 file to the client, wherein the data storage format in the target file is the file type, the metadata and the video content in sequence;
and if the metadata adjusting mark does not exist, after moving the metadata of the target MP4 file to a file header designated position, sending the target MP4 file after the metadata is moved to the client, wherein the data storage format of the target file after the metadata is moved is the file type, the metadata and the video content in sequence.
In specific implementation, when an online playing instruction of the client is detected, the server can judge whether the MP4 file to be played has a metadata adjustment flag, if the metadata adjustment flag exists, the video playing server sends the metadata of the target MP4 file to the client, and the client acquires the video content of the target MP4 file and plays the video content in a mode of caching and playing. If the metadata adjustment mark does not exist, the video playing server adjusts the position of the metadata of the target MP4 file, then the video playing server sends the metadata of the adjusted target MP4 file to the client, the client acquires the video content of the target MP4 file, and the video playing server controls the client to play the target MP4 file in a mode of caching and playing.
The data storage format in the target file is the file type, the metadata and the video content in sequence. The embodiment of the invention can realize that after the metadata is extracted to the appointed position of the file, when the online playing instruction is detected, the client downloads the metadata of the target MP4 file first, can acquire the key information with long resolution frame rate code stream of the video after the metadata is downloaded, and controls the target MP4 to play in a mode of caching and playing at the same time according to the key information.
It can be known from the above method embodiments that the present invention provides a method for playing a video file, in which a video playing server moves metadata of an MP4 format video file to a file header position of the file to generate a target MP4 file, and when a client requests the target MP4 file on line, the client starts playing the MP4 video file after downloading the metadata to the file header position and analyzing the metadata, so as to realize that the content of the MP4 file is played while being downloaded, thereby improving the playing efficiency of the MP4 file.
It should be noted that, a certain order does not necessarily exist between the above steps, and those skilled in the art can understand, according to the description of the embodiments of the present invention, that in different embodiments, the above steps may have different execution orders, that is, may be executed in parallel, may also be executed interchangeably, and the like.
Another embodiment of the present invention provides a playing apparatus for a video file, as shown in fig. 3, the apparatus 1 includes:
the data analysis module 11 is configured to acquire an original MP4 file, analyze the original MP4 file, and acquire metadata of the original MP4 file according to the analyzed data, where the metadata is descriptive information of the original MP4 file;
the data moving module 12 is configured to move the metadata to a file header designated position of the original MP4 file, and generate a target MP4 file;
and the data sending module 13 is configured to send the target MP4 file to the client when an online playing instruction of the client is detected, where in a sending process of the target MP4 file, the client continues to receive the video content of the target MP4 file after reading the metadata at the specified position of the file header, and performs online playing according to the received video content.
The detailed description of the embodiments is omitted here for the embodiments of the method.
In some embodiments, the data parsing module 11 is specifically configured to:
acquiring an original MP4 file uploaded by a video client, and performing format analysis on the original MP4 file according to the file packaging format of the MP4 file;
and obtaining the file type, the metadata, the video content data and the data length of the original MP4 file according to the format analysis result.
The detailed description of the embodiments is omitted here for the embodiments of the method.
In one embodiment, the data parsing module 11 is further configured to:
and acquiring the data length stored in the original MP4 file, and reading the metadata of the specified position of the original MP4 file according to the data length.
The specific implementation is shown in the method embodiment, and is not described herein again.
In one embodiment, the data movement module 12 is specifically configured to:
acquiring original storage content at a file header designated position of an original MP4 file, and transferring the original storage content to a cache;
writing the metadata into the file header designated position of the original MP4 file through a file writing function;
and after the original storage content in the cache is transferred to a specific position, generating a target MP4 file.
The specific implementation is shown in the method embodiment, and is not described herein again.
In one embodiment, the data storage format in the original MP4 file is sequentially file type, video content data and metadata, and the data moving module 12 is further configured to:
extracting metadata, writing the metadata into the original MP4 file before the address of the video content data of the MP4 file through a file writing function, and generating a target MP4 file, wherein the data storage format of the target MP4 file is the file type, the metadata and the video content in sequence.
The specific implementation is shown in the method embodiment, and is not described herein again.
In one embodiment, the apparatus further comprises a tag generation module to:
and generating a metadata adjusting mark, and storing the metadata adjusting mark to the head position of the target MP4 file.
The specific implementation is shown in the method embodiment, and is not described herein again.
In one embodiment, the data transmission module 13 is configured to,
when an online playing instruction of a client is detected, judging whether a metadata adjusting mark exists in a target MP4 file or not;
if the metadata adjustment mark exists, sending the target MP4 file to the client, wherein the data storage format in the target file is the file type, the metadata and the video content in sequence;
and if the metadata adjusting mark does not exist, after moving the metadata of the target MP4 file to a file header designated position, sending the target MP4 file after the metadata is moved to the client, wherein the data storage format of the target file after the metadata is moved is the file type, the metadata and the video content in sequence.
The detailed description of the embodiments is omitted here for the embodiments of the method.
Another embodiment of the present invention provides a playing device for video files, as shown in fig. 4, the device 10 includes:
one or more processors 110 and a memory 120, where one processor 110 is illustrated in fig. 4, the processor 110 and the memory 120 may be connected by a bus or other means, and fig. 4 illustrates a connection by a bus as an example.
Processor 110 is operative to implement, the various control logic of apparatus 10, which may be a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA), a single chip microcomputer, an ARM (Acorn RISC Machine) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination of these components. Also, the processor 110 may be any conventional processor, microprocessor, or state machine. Processor 110 may also be implemented as a combination of computing devices, e.g., a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a DSP core, or any other such configuration.
The memory 120 is a non-volatile computer-readable storage medium, and can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as program instructions corresponding to the playing method of the video file in the embodiment of the present invention. The processor 110 executes various functional applications and data processing of the device 10, i.e., implements the playing method of the video file in the above-described method embodiment, by executing the nonvolatile software program, instructions and units stored in the memory 120.
The memory 120 may include a storage program area and a storage data area, wherein the storage program area may store an application program required for operating the device, at least one function; the storage data area may store data created according to the use of the device 10, and the like. Further, the memory 120 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some embodiments, memory 120 optionally includes memory located remotely from processor 110, which may be connected to device 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
One or more units are stored in the memory 120, and when executed by the one or more processors 110, perform the playing method of the video file in any of the above-described method embodiments, for example, performing the above-described method steps S100 to S300 in fig. 1.
Embodiments of the present invention provide a non-transitory computer-readable storage medium storing computer-executable instructions for execution by one or more processors, for example, to perform steps S100-S300 of the method of fig. 1 described above.
By way of example, non-volatile storage media can include read-only memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically erasable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM), which acts as external cache memory. By way of illustration and not limitation, RAM is available in many forms such as Synchronous RAM (SRAM), dynamic RAM, (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchlink DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The disclosed memory components or memory of the operating environment described herein are intended to comprise one or more of these and/or any other suitable types of memory.
Another embodiment of the present invention provides a computer program product comprising a computer program stored on a non-volatile computer-readable storage medium, the computer program comprising program instructions that, when executed by a processor, cause the processor to perform the method of playing a video file of the above method embodiment. For example, the method steps S100 to S300 in fig. 1 described above are performed.
The above-described embodiments are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the embodiment.
Through the above description of the embodiments, those skilled in the art will clearly understand that the embodiments may be implemented by software plus a general hardware platform, and may also be implemented by hardware. Based on such understanding, the above technical solutions essentially or contributing to the related art can be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of the various embodiments or some parts of the embodiments.
Conditional language such as "can," "might," or "may" is generally intended to convey that a particular embodiment can include (yet other embodiments do not include) particular features, elements, and/or operations, among others, unless specifically stated otherwise or otherwise understood within the context as used. Thus, such conditional language is also generally intended to imply that features, elements and/or operations are in any way required for one or more embodiments or that one or more embodiments necessarily include logic for deciding, with or without input or prompting, whether these features, elements and/or operations are included or are to be performed in any particular embodiment.
What has been described herein in the specification and drawings includes examples of a playing method and apparatus capable of providing a video file. It will, of course, not be possible to describe every conceivable combination of components and/or methodologies for purposes of describing the various features of the disclosure, but it can be appreciated that many further combinations and permutations of the disclosed features are possible. It is therefore evident that various modifications can be made to the disclosure without departing from the scope or spirit thereof. In addition, or in the alternative, other embodiments of the disclosure may be apparent from consideration of the specification and drawings and from practice of the disclosure as presented herein. It is intended that the examples set forth in this specification and the drawings be considered in all respects as illustrative and not restrictive. Although specific terms are employed herein, they are used in a generic and descriptive sense only and not for purposes of limitation.

Claims (10)

1. A method for playing a video file, wherein the video file is an MP4 file and is applied to a video playing server, the method comprising:
acquiring an original MP4 file, analyzing the original MP4 file, and acquiring metadata of the original MP4 file according to analyzed data, wherein the metadata is descriptive information of the original MP4 file;
moving the metadata to a file header designated position of the original MP4 file to generate a target MP4 file;
and when an online playing instruction of the client is detected, the target MP4 file is sent to the client, wherein in the sending process of the target MP4 file, the client continues to receive the video content of the target MP4 file after reading the metadata at the specified position of the file header, and online playing is carried out according to the received video content.
2. The method for playing back a video file according to claim 1, wherein the moving the metadata to a specified position of a file header of the original MP4 file to generate a target MP4 file comprises:
acquiring original storage content at a file header designated position of the original MP4 file, and transferring the original storage content to a cache;
writing the metadata into the file header designated position of the original MP4 file through a file writing function;
and after the original storage content in the cache is transferred to a specific position, generating a target MP4 file.
3. The method for playing a video file according to claim 1, wherein the acquiring an original MP4 file and parsing the original MP4 file includes:
acquiring an original MP4 file uploaded by a video client, and performing format analysis on the original MP4 file according to a file packaging format of the MP4 file;
and obtaining the file type, the metadata, the video content data and the data length of the original MP4 file according to the format analysis result.
4. The method for playing video files according to claim 2, wherein the data storage format in the original MP4 file is file type, video content data and metadata in turn, and the writing of the metadata into the file header of the original MP4 file by the file writing function includes:
and extracting the metadata, and writing the metadata in front of the address of the video content data of the original MP4 file through a file writing function.
5. The method for playing back a video file according to claim 3, wherein the obtaining metadata of the original MP4 file according to the parsed data comprises:
acquiring the data length stored in the original MP4 file, and reading the metadata of the designated position of the original MP4 file according to the data length.
6. The method for playing back a video file according to any one of claims 1 to 5, wherein after moving the metadata to a specified position of a file header of the original MP4 file and generating a target MP4 file, the method comprises:
and generating a metadata adjusting mark, and storing the metadata adjusting mark to the head position of the target MP4 file.
7. The method for playing the video file according to claim 6, wherein the sending the target MP4 file to the client when detecting an online playing instruction of the client comprises:
when an online playing instruction of a client is detected, judging whether a metadata adjusting mark exists in a target MP4 file or not;
if the metadata adjustment mark exists, sending the target MP4 file to a client, wherein the data storage format in the target file is the file type, the metadata and the video content in sequence;
and if the metadata adjusting mark does not exist, after moving the metadata of the target MP4 file to a file header designated position, sending the target MP4 file after the metadata is moved to a client, wherein the data storage format of the target file after the metadata is moved is the file type, the metadata and the video content in sequence.
8. An apparatus for playing a video file, the apparatus comprising:
the data analysis module is used for acquiring an original MP4 file, analyzing the original MP4 file, and acquiring metadata of the original MP4 file according to the analyzed data, wherein the metadata is descriptive information of the original MP4 file;
the data moving module is used for moving the metadata to the specified position of the file header of the original MP4 file to generate a target MP4 file;
and the data sending module is used for sending the target MP4 file to the client when an online playing instruction of the client is detected, wherein in the sending process of the target MP4 file, the client continues to receive the video content of the target MP4 file after reading the metadata at the specified position of the file header, and online playing is carried out according to the received video content.
9. A playback device for video files, said device comprising at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a method of playing a video file as claimed in any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium storing computer-executable instructions that, when executed by one or more processors, cause the one or more processors to perform the method of playing a video file of any of claims 1-7.
CN202210975668.2A 2021-11-04 2022-08-15 Video file playing method, device, equipment and storage medium Pending CN115396692A (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111302324 2021-11-04
CN2021113023247 2021-11-04

Publications (1)

Publication Number Publication Date
CN115396692A true CN115396692A (en) 2022-11-25

Family

ID=84119147

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210975668.2A Pending CN115396692A (en) 2021-11-04 2022-08-15 Video file playing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115396692A (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060059190A1 (en) * 2004-09-01 2006-03-16 Tomomi Fukuoka File recording method and file recording apparatus
US20080256431A1 (en) * 2007-04-13 2008-10-16 Arno Hornberger Apparatus and Method for Generating a Data File or for Reading a Data File
CN101447994A (en) * 2008-12-30 2009-06-03 深圳市迅雷网络技术有限公司 Method for downloading and playing multimedia file and equipment thereof
CN101577627A (en) * 2009-06-17 2009-11-11 腾讯科技(深圳)有限公司 System and method for downloading and playing multimedia file
US20100169390A1 (en) * 2008-12-30 2010-07-01 Samsung Electronics Co., Ltd. File transfer method and terminal adapted thereto
CN110290396A (en) * 2019-05-31 2019-09-27 广州市百果园信息技术有限公司 A kind of method, apparatus, system, equipment and the storage medium of video processing
US20200413130A1 (en) * 2018-05-29 2020-12-31 Beijing Bytedance Network Technology Co., Ltd. Playing method, device and storage medium of webpage-based media file
CN113365140A (en) * 2021-06-21 2021-09-07 北京百度网讯科技有限公司 MP4 online playing method, device, equipment, storage medium and program product

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060059190A1 (en) * 2004-09-01 2006-03-16 Tomomi Fukuoka File recording method and file recording apparatus
US20080256431A1 (en) * 2007-04-13 2008-10-16 Arno Hornberger Apparatus and Method for Generating a Data File or for Reading a Data File
CN101447994A (en) * 2008-12-30 2009-06-03 深圳市迅雷网络技术有限公司 Method for downloading and playing multimedia file and equipment thereof
US20100169390A1 (en) * 2008-12-30 2010-07-01 Samsung Electronics Co., Ltd. File transfer method and terminal adapted thereto
CN101577627A (en) * 2009-06-17 2009-11-11 腾讯科技(深圳)有限公司 System and method for downloading and playing multimedia file
US20200413130A1 (en) * 2018-05-29 2020-12-31 Beijing Bytedance Network Technology Co., Ltd. Playing method, device and storage medium of webpage-based media file
CN110290396A (en) * 2019-05-31 2019-09-27 广州市百果园信息技术有限公司 A kind of method, apparatus, system, equipment and the storage medium of video processing
CN113365140A (en) * 2021-06-21 2021-09-07 北京百度网讯科技有限公司 MP4 online playing method, device, equipment, storage medium and program product

Similar Documents

Publication Publication Date Title
US7831578B2 (en) Apparatus for file system management with virtual file name
US8010566B2 (en) Extended multimedia file structure and multimedia file producting method and multimedia file executing method
US7584206B2 (en) File recording method and file recording apparatus
WO2009046354A1 (en) Methods and apparatus for simultaneous uploading and streaming of media
CN109471738A (en) A kind of application program downloads recognition methods and the relevant device of channel
US20170163703A1 (en) Player-based play method and device
CN112532490A (en) Regression testing system and method and electronic equipment
CN105681820B (en) A kind of video barrage way of recording and device
CN110390943B (en) Audio synthesis method and device, computer equipment and storage medium
CN110493324A (en) Method for down loading, downloader and computer readable storage medium
EP1796095B1 (en) Method and device for cache pre-storage of streamed multimedia data for editing in a network environment.
CN110290396B (en) Video processing method, device, system, equipment and storage medium
CN115396692A (en) Video file playing method, device, equipment and storage medium
US20070016549A1 (en) Method system, and digital media for controlling how digital assets are to be presented in a playback device
CN106162311A (en) A kind of method playing Internet video and terminal unit
JP2006323678A (en) Content reproduction method, content reproduction system and computer program
US10915270B2 (en) Random file I/O and chunked data upload
US20160224192A1 (en) Systems and methods for a multiplatform video player
CN109962946B (en) Method and device for downloading resources
CN116828260A (en) Video rendering method, system and storage medium
CN114390319B (en) MP4 file reading and downloading method and device, electronic equipment and storage medium
US9076484B2 (en) Methods for estimating playback time and handling a cumulative playback time permission
CN111159740A (en) Data encryption access method, device, equipment and readable storage medium
US20220167057A1 (en) Managing user uploaded content
CN113438503B (en) Video file restoring method, device, computer equipment and storage medium

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