CN111246243A - File encoding and decoding method and device, terminal and storage medium - Google Patents

File encoding and decoding method and device, terminal and storage medium Download PDF

Info

Publication number
CN111246243A
CN111246243A CN202010041789.0A CN202010041789A CN111246243A CN 111246243 A CN111246243 A CN 111246243A CN 202010041789 A CN202010041789 A CN 202010041789A CN 111246243 A CN111246243 A CN 111246243A
Authority
CN
China
Prior art keywords
file
sub
target
decoding
packages
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
CN202010041789.0A
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.)
Tianmai Tuodao Beijing Technology Co Ltd
Original Assignee
Tianmai Tuodao Beijing 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 Tianmai Tuodao Beijing Technology Co Ltd filed Critical Tianmai Tuodao Beijing Technology Co Ltd
Priority to CN202010041789.0A priority Critical patent/CN111246243A/en
Publication of CN111246243A publication Critical patent/CN111246243A/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/233Processing of audio elementary streams
    • H04N21/2335Processing of audio elementary streams involving reformatting operations of audio signals, e.g. by converting from one coding standard to another
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/2343Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
    • H04N21/234309Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements by transcoding between formats or standards, e.g. from MPEG-2 to MPEG-4 or from Quicktime to Realvideo
    • 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/439Processing of audio elementary streams
    • H04N21/4398Processing of audio elementary streams involving reformatting operations of audio signals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • H04N21/440218Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display by transcoding between formats or standards, e.g. from MPEG-2 to MPEG-4
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/5017Task decomposition

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The application discloses a file coding and decoding method, a file coding and decoding device, a terminal and a storage medium. The method comprises the following steps: acquiring an original file to be processed, and dividing the original file into a plurality of sub-file packages; determining a plurality of decoding nodes and a plurality of encoding nodes for a plurality of subfiles; processing the plurality of sub-file packages according to the plurality of decoding nodes and the plurality of coding nodes to obtain a plurality of target sub-files; and combining the plurality of target subfiles to obtain a target file. According to the method and the device, the mode of determining the plurality of decoding nodes and the plurality of coding nodes is adopted, the effect of simultaneously processing the plurality of sub-file packets is achieved, the distributed processing purpose of file encoding and decoding is achieved, and the problems of low speed and low efficiency of file encoding and decoding in the prior art are solved.

Description

File encoding and decoding method and device, terminal and storage medium
Technical Field
The present application relates to the field of file transcoding technologies, and in particular, to a method, an apparatus, a terminal, and a storage medium for file encoding and decoding.
Background
In recent years, with the continuous investment of the country in network construction and the continuous reduction of internet surfing expenses, a large number of applications in daily life of people can be separated from the local computer environment to realize complete "on-line" and "cloud-end" processing, for example, the applications in the on-line processing of video documents. The current video document is processed again, so that after the user uploads the video to the server, transcoding is realized through the ffmpeg program. The transcoding mode mainly comprises two methods: firstly, starting ffmpeg processes according to files, wherein each file starts one ffmpeg process, namely a user uploads one file, and a server cluster starts one ffmpeg process to perform transcoding; and secondly, transcoding the files in a segmented manner according to the time of the files, for example, dividing a file with the time duration of 50 minutes into 50 small files, starting an ffmpeg process for each small file, transcoding one small file by each process, and combining the small files into a final target file through a management program after transcoding all the small files is finished.
The speed of the former transcoding depends on the processing speed of a single process, the latter depends on the processing speed of a single small file, the decoding and encoding are not effectively split, the decoding and encoding internal software and hardware algorithms are not effectively split, and the audio and video processing is not considered separately. Therefore, the two files have the problem of slow processing speed or the problem of incapability of effectively splitting the video file.
Disclosure of Invention
The present application is directed to solve at least one of the above technical problems, and provides a file encoding and decoding method, device, terminal and storage medium.
In a first aspect, the present application provides a file encoding and decoding method, including:
acquiring an original file to be processed, and dividing the original file into a plurality of sub-file packages;
determining a plurality of decoding nodes and a plurality of encoding nodes for a plurality of subfiles;
processing the plurality of sub-file packages according to the plurality of decoding nodes and the plurality of coding nodes to obtain a plurality of target sub-files;
and combining the plurality of target subfiles to obtain a target file.
In a second aspect, the present application provides a file encoding and decoding apparatus, including:
the file segmentation module is used for acquiring an original file to be processed and segmenting the original file into a plurality of sub-file packages;
a node determination module to determine a plurality of decoding nodes and a plurality of encoding nodes for a plurality of subfiles;
the encoding and decoding processing module is used for processing the plurality of sub-file packages according to the plurality of decoding nodes and the plurality of encoding nodes to obtain a plurality of target sub-files;
and the file merging module is used for merging the plurality of target subfiles to obtain the target file.
In a third aspect, the present application provides a terminal, including:
the file coding and decoding method comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the processor realizes the file coding and decoding method when executing the computer program.
In a fourth aspect, the present application provides a computer-readable storage medium storing computer-executable instructions for performing the file encoding and decoding method.
The beneficial effects of the embodiment of the application are as follows: the method comprises the steps of dividing an obtained original file to be processed into a plurality of sub-file packages, determining a plurality of decoding nodes and a plurality of coding nodes aiming at the plurality of sub-file packages, processing the plurality of sub-file packages according to the plurality of decoding nodes and the plurality of coding nodes to obtain a plurality of target sub-files, combining and processing the plurality of target sub-files to obtain a target file, playing a role in simultaneously processing the plurality of sub-file packages in a mode of determining the plurality of decoding nodes and the plurality of coding nodes, achieving the purpose of distributed processing of file coding and decoding, and solving the problems of low speed and low efficiency of file coding and decoding in the prior art.
Drawings
In order to more clearly illustrate the embodiments of the present application or technical solutions in the prior art, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments described in the present invention, and other drawings can be obtained by those skilled in the art according to the drawings.
Fig. 1 is a schematic flowchart of an embodiment of a file encoding and decoding method provided in an embodiment of the present application;
fig. 2 is a schematic diagram of an application framework of another embodiment of a file encoding and decoding method according to an embodiment of the present application;
fig. 3 is a block diagram structure diagram of an embodiment of a file encoding and decoding apparatus according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Example one
The present application provides a file encoding and decoding method, as shown in fig. 1, the method includes: step S101 to step S104.
Step S101: and acquiring an original file to be processed, and dividing the original file into a plurality of sub-file packages.
In the embodiment of the application, the server side obtains the original file and divides the original file into a plurality of sub-file packages. Specifically, the original file may be a video file or an audio file.
When the method is applied, any one of the segmentation algorithms can be used for carrying out segmentation processing on the original file, and the segmentation algorithm can be a mode of carrying out segmentation according to a preset segmentation representation. E.g., video files, divided by one subfile per minute; and then, an audio file is input, and the audio file is divided according to 4096 audio packets, namely 4096 audio packets are put into a stack through encapsulation. 4096 audio packets are divided into a stack to provide a basis for subsequent encoding into aac format, so that the result of decoding the stack and the total byte number of subsequent samples are aligned with 4096, and the alignment operation between the subsequent front and rear stacks is avoided.
In the embodiment of the present application, the server executes the file encoding and decoding method provided in the embodiment of the present application by using a distributed system.
Specifically, the original files to be processed are generally stored in a queue, so that the processing sequence of the original files sent by a large number of clients is ensured. In a specific application, the original files may be classified according to the account level, for example, the original files sent by the client with the high account level have a higher processing priority, that is, the original files sent by the client with the high account level are processed preferentially.
Step S102: a plurality of decoding nodes and a plurality of encoding nodes for the plurality of subfiles are determined.
According to the embodiment of the application, the plurality of decoding nodes and the plurality of coding nodes are determined, so that the parallel processing effect on the plurality of sub-file packages is achieved, the processing speed on the sub-file packages is increased, and the processing efficiency is improved.
Specifically, assuming that the subfile surrounds the video file, the video file is decoded into image frames by the decoding node, and then the image frames are encoded, thereby completing transcoding of the video file.
In particular, the number of decoding nodes and encoding nodes may be determined according to a preconfigured policy. For example, one decoding node or one encoding node processes one sub-file package, or one decoding node or one encoding node processes a plurality of sub-file packages. In specific application, a predetermined number of sub-file packets are stored in a stack or a queue, so that the sub-file packets stored in the stack or the queue are processed by a decoding node or an encoding node.
Step S103: and processing the plurality of sub-file packages according to the plurality of decoding nodes and the plurality of coding nodes to obtain a plurality of target sub-files.
Step S104: and merging the plurality of target subfiles to obtain the target file.
In the embodiment of the application, the obtained original file to be processed is divided into the plurality of sub-file packages, so that a plurality of decoding nodes and a plurality of coding nodes for the plurality of sub-file packages are determined, the plurality of sub-file packages are processed according to the plurality of decoding nodes and the plurality of coding nodes, a plurality of target sub-files are obtained, the plurality of target sub-files are merged, the target file is obtained, the effect of simultaneously processing the plurality of sub-file packages is achieved by determining the plurality of decoding nodes and the plurality of coding nodes, the purpose of distributed processing of file coding and decoding is achieved, and the problems of low file coding and decoding speed and low efficiency in the prior art are solved.
In one implementation, as shown in fig. 1, the step S101 of acquiring an original file to be processed and dividing the original file into a plurality of sub-file packages includes:
step S1011 (not shown in the figure): determining a file fingerprint ID string for an original file;
step S1012 (not shown): dividing an original file into a plurality of sub-file packages, and determining sub-labels corresponding to the sub-file packages;
step S1013 (not shown in the figure): and taking the sub-labels corresponding to the sub-file packages and the file fingerprint ID strings of the original files as the file labels corresponding to the sub-file packages respectively, so as to process the sub-file packages according to the file labels.
In the embodiment of the application, the file fingerprint ID string is used for representing the file identifier of the original file to be processed, so that when the original file is segmented, the segmented sub-file package can be determined through the file fingerprint ID string.
In another implementation, as shown in fig. 1, the step S102 of determining a plurality of decoding nodes and a plurality of encoding nodes for a plurality of sub-file packets includes:
step S1021 (not shown): creating a plurality of stack objects aiming at the file type based on the file type of the subfile package, and storing the plurality of subfile packages according to the plurality of stack objects;
step S1022 (not shown in the figure): and determining a decoding node and an encoding node which correspond to each of the plurality of stack objects.
Specifically, the file type may be characterized by a file format, for example, if the file format is rm, it is determined to be a video file; if the file format is mp3, the file is determined to be an audio file.
Specifically, the stack object is used for storing the subfile package, and when the application is performed, the time sequence is firstly stacked, and then the time sequence is subsequently stacked. In specific application, the stack object can be created in real time in the storage process. Namely, after the previous stack stores the subfile package storing the predetermined condition, another stack object is created.
In another implementation manner, the step S1021, creating a plurality of stack objects for a file type based on the file type of the sub-package, and storing the plurality of sub-packages according to the plurality of stack objects, includes:
if the plurality of sub-file packages are video files, storing the plurality of sub-file packages according to a plurality of stack objects aiming at the video files on the basis of a time sequence, wherein any stack object aiming at the video files comprises a plurality of sub-file package objects within a preset time length;
and if the plurality of sub-file packages are audio files, storing the plurality of sub-file packages according to a plurality of stack objects aiming at the audio files on the basis of a time sequence, wherein any stack object aiming at the audio time stores a preset number of sub-file packages.
Specifically, 4096 sub-file packets are stored for the stack of the audio file, that is, 4096 sub-file packets are stored for each stack, so that subsequent encoding is protected without realignment, and the purpose of rapid encoding is achieved.
In another implementation manner, the step S104 merges the plurality of target subfiles to obtain a target file, including:
packaging the plurality of target subfiles;
and merging the encapsulated target subfiles according to the time corresponding to each of the plurality of target subfiles to obtain the target file.
In the embodiment of the application, the target subfile is a subfile packet which is decoded and encoded, and the encoded audio file or video file packet with the sequenced timestamps is written into the file in a byte mode through encapsulation after the processing is finished, so that preparation is provided for subsequent combination processing, and the integrity of the finally obtained target file is ensured.
In another implementation manner, as shown in fig. 1, after the step S104 merges the plurality of target subfiles to obtain the target file, the method further includes:
step S105 (not shown in the figure): and carrying out distributed storage on the target file according to the pre-constructed distributed storage system.
According to the embodiment of the application, the distributed storage of the target file is realized through the distributed storage system, and the effective utilization rate of storage resources is improved.
Example two
To further explain the file encoding and decoding method provided in the embodiment of the present application, the following takes the flow chart shown in fig. 2 as an example.
When the application is carried out, the server receives the original file uploaded by the client and stores the original file in a queue. Suppose that the object to be processed in the current queue is the original file uploaded by the client a. The server divides the original file by the decapsulation node, assuming that the original file is a video file, the decapsulation node extracts a video part and an audio part of the original file, and stores the video part and the audio part according to the stack shown in fig. 2, respectively. The left half in fig. 2 is a plurality of stacks for the video portion, each stack for the video portion stores about 1 minute of original video (i.e., a sub-file packet), each stack for the video portion corresponds to one decoding node, an original video frame stack is obtained through processing by the plurality of decoding nodes, and then an encoding node for each stack for the video portion is processed to obtain a target video packet stack. The right half of fig. 2 is a plurality of stacks for the audio part, 4096 sub-audio packets are stored in each stack for the audio part, each stack for the audio part corresponds to one coding node, and is obtained by processing the plurality of coding nodes for the audio part, and a plurality of original audio frame stacks, each original audio frame stack corresponds to one decoding node, and are obtained by processing the decoding nodes. And finally, packaging the target video packet stacks and the original audio packet stacks through packaging nodes, and merging the target video packet stacks and the original audio packet stacks into a target file.
Specifically, the sub-packages are stored for a predetermined length of time for the stack of video files. For example, assuming that the predetermined time duration is 1 minute, each stack object stores a subfile packet with a time duration of 1 minute to ensure the integrity of the video picture, so that the subfile packet with the time duration of 1 minute is decoded, possibly obtaining a plurality of frames of the image frame. Therefore, the processing of a plurality of processing nodes (such as decoding nodes in fig. 2) improves the speed by 20-30 times compared with the existing method, shortens the processing time of the audio/video file, and improves the processing efficiency.
EXAMPLE III
An embodiment of the present application provides a file encoding and decoding apparatus, as shown in fig. 3, the apparatus 30 includes: a file dividing module 301, a node determining module 302, a coding and decoding processing module 303 and a file merging module 304.
The file segmentation module 301 is configured to obtain an original file to be processed, and segment the original file into a plurality of sub-file packages;
a node determining module 302 for determining a plurality of decoding nodes and a plurality of encoding nodes for a plurality of subfiles;
the encoding and decoding processing module 303 is configured to process the plurality of subfiles according to the plurality of decoding nodes and the plurality of encoding nodes to obtain a plurality of target subfiles;
and the file merging module 304 is configured to merge the plurality of target subfiles to obtain a target file.
According to the method and the device, the obtained original file to be processed is divided into the plurality of sub-file packages, so that a plurality of decoding nodes and a plurality of coding nodes for the plurality of sub-file packages are determined, the plurality of sub-file packages are processed according to the plurality of decoding nodes and the plurality of coding nodes, a plurality of target sub-files are obtained, the plurality of target sub-files are merged, the target file is obtained, the effect of simultaneously processing the plurality of sub-file packages is achieved by determining the plurality of decoding nodes and the plurality of coding nodes, the purpose of distributed processing of file coding and decoding is achieved, and the problems that in the prior art, the speed of file coding and decoding is low and the efficiency is low are solved.
Further, the file splitting module is configured to:
determining a file fingerprint ID string for the original file;
dividing the original file into a plurality of sub-file packages, and determining sub-tags corresponding to the sub-file packages respectively;
and taking the sub-labels corresponding to the sub-file packages and the file fingerprint ID strings of the original files as the file labels corresponding to the sub-file packages, so as to process the sub-file packages according to the file labels.
Further, the node determination module is configured to:
based on the file type of the sub-file package, creating a plurality of stack objects aiming at the file type, and storing the sub-file packages according to the stack objects;
and determining a decoding node and an encoding node which correspond to the stack objects respectively.
Further, the node determination module is configured to:
if the plurality of sub-file packages are video files, storing the plurality of sub-file packages according to a plurality of stack objects aiming at the video files on the basis of a time sequence, wherein any stack object aiming at the video files comprises the plurality of sub-file package objects within a preset time length;
and if the plurality of sub-file packages are audio files, storing the plurality of sub-file packages according to a plurality of stack objects aiming at the audio files on the basis of a time sequence, wherein any stack object aiming at the audio time stores a preset number of the sub-file packages.
Further, the file merging module is configured to:
packaging a plurality of target subfiles;
and merging the packaged target subfiles according to the time corresponding to each of the plurality of target subfiles to obtain the target file.
Further, the file merging module is configured to, after merging the plurality of target subfiles to obtain a target file, further:
and carrying out distributed storage on the target file according to a pre-constructed distributed storage system.
Further, the file merging module is further configured to:
and gradually pushing the target file to the client according to a preset loading duration based on a play request from the client.
The file encoding and decoding device of the present embodiment can execute the file encoding and decoding method provided in the first embodiment of the present application, which is similar to the first embodiment in terms of the implementation principle, and is not described herein again.
Example four
An embodiment of the present application provides a terminal, including: the file coding and decoding method comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the processor executes the computer program to realize the file coding and decoding method.
In particular, the processor may be a CPU, general purpose processor, DSP, ASIC, FPGA or other programmable logic device, transistor logic device, hardware component, or any combination thereof. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. A processor may also be a combination of computing functions, e.g., comprising one or more microprocessors, a DSP and a microprocessor, or the like.
In particular, the processor is coupled to the memory via a bus, which may include a path for communicating information. The bus may be a PCI bus or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc.
The memory may be, but is not limited to, a ROM or other type of static storage device that can store static information and instructions, a RAM or other type of dynamic storage device that can store information and instructions, an EEPROM, a CD-ROM or other optical disk storage, optical disk storage (including compact disk, laser disk, optical disk, digital versatile disk, blu-ray disk, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer.
Optionally, the memory is used for storing codes of computer programs for executing the scheme of the application, and the processor is used for controlling the execution. The processor is used for executing the application program codes stored in the memory to realize the actions of the file coding and decoding device provided by the embodiment shown in fig. 3.
According to the method and the device, the obtained original file to be processed is divided into the plurality of sub-file packages, so that a plurality of decoding nodes and a plurality of coding nodes for the plurality of sub-file packages are determined, the plurality of sub-file packages are processed according to the plurality of decoding nodes and the plurality of coding nodes, a plurality of target sub-files are obtained, the plurality of target sub-files are merged, the target file is obtained, the effect of simultaneously processing the plurality of sub-file packages is achieved by determining the plurality of decoding nodes and the plurality of coding nodes, the purpose of distributed processing of file coding and decoding is achieved, and the problems that in the prior art, the speed of file coding and decoding is low and the efficiency is low are solved.
EXAMPLE five
The embodiment of the application provides a computer-readable storage medium, which stores computer-executable instructions, and the computer-executable instructions are used for executing the file coding and decoding method provided by the embodiment.
According to the method and the device, the obtained original file to be processed is divided into the plurality of sub-file packages, so that a plurality of decoding nodes and a plurality of coding nodes for the plurality of sub-file packages are determined, the plurality of sub-file packages are processed according to the plurality of decoding nodes and the plurality of coding nodes, a plurality of target sub-files are obtained, the plurality of target sub-files are merged, the target file is obtained, the effect of simultaneously processing the plurality of sub-file packages is achieved by determining the plurality of decoding nodes and the plurality of coding nodes, the purpose of distributed processing of file coding and decoding is achieved, and the problems that in the prior art, the speed of file coding and decoding is low and the efficiency is low are solved.
The above description is only a preferred embodiment of the present application and is not intended to limit the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (10)

1. A file encoding and decoding method is characterized by comprising the following steps:
acquiring an original file to be processed, and dividing the original file into a plurality of sub-file packages;
determining a plurality of decoding nodes and a plurality of encoding nodes for a plurality of subfiles;
processing the plurality of sub-file packages according to the plurality of decoding nodes and the plurality of coding nodes to obtain a plurality of target sub-files;
and combining the plurality of target subfiles to obtain a target file.
2. The method of claim 1, wherein the obtaining an original file to be processed and dividing the original file into a plurality of sub-file packages comprises:
determining a file fingerprint ID string for the original file;
dividing the original file into a plurality of word file packets, and determining corresponding sub-tags of the word file packets;
and taking the sub-labels corresponding to the sub-file packages and the file fingerprint ID strings of the original files as the file labels corresponding to the sub-file packages, so as to process the sub-file packages according to the file labels.
3. The method of claim 1, wherein determining a plurality of decoding nodes and a plurality of encoding nodes for a plurality of subfiles comprises:
based on the file type of the sub-file package, creating a plurality of stack objects aiming at the file type, and storing the sub-file packages according to the stack objects;
and determining a decoding node and an encoding node which correspond to the stack objects respectively.
4. The method according to claim 3, wherein the creating a plurality of stack objects for the file type based on the file type of the sub-file package and storing the plurality of sub-file packages according to the plurality of stack objects comprises:
if the plurality of sub-file packages are video files, storing the plurality of sub-file packages according to a plurality of stack objects aiming at the video files on the basis of a time sequence, wherein any stack object aiming at the video files comprises the plurality of sub-file package objects within a preset time length;
and if the plurality of sub-file packages are audio files, storing the plurality of sub-file packages according to a plurality of stack objects aiming at the audio files on the basis of a time sequence, wherein any stack object aiming at the audio time stores a preset number of the sub-file packages.
5. The method according to claim 1, wherein the merging the plurality of target subfiles into a target file comprises:
packaging a plurality of target subfiles;
and merging the packaged target subfiles according to the time corresponding to each of the plurality of target subfiles to obtain the target file.
6. The method according to claim 1, wherein after the merging the plurality of target subfiles into the target file, the method further comprises:
and carrying out distributed storage on the target file according to a pre-constructed distributed storage system.
7. An apparatus for encoding and decoding a file, comprising:
the file segmentation module is used for acquiring an original file to be processed and segmenting the original file into a plurality of sub-file packages;
a node determination module to determine a plurality of decoding nodes and a plurality of encoding nodes for a plurality of subfiles;
the encoding and decoding processing module is used for processing the plurality of sub-file packages according to the plurality of decoding nodes and the plurality of encoding nodes to obtain a plurality of target sub-files;
and the file merging module is used for merging the target subfiles to obtain a target file.
8. The apparatus of claim 7, wherein the file splitting module is configured to:
determining a file fingerprint ID string for the original file;
dividing the original file into a plurality of word file packets, and determining corresponding sub-tags of the word file packets;
and taking the sub-labels corresponding to the sub-file packages and the file fingerprint ID strings of the original files as the file labels corresponding to the sub-file packages, so as to process the sub-file packages according to the file labels.
9. A terminal, comprising: memory, processor and computer program stored on the memory and executable on the processor, characterized in that the processor implements the file codec method according to any one of claims 1 to 6 when executing the computer program.
10. A computer-readable storage medium storing computer-executable instructions for performing the file codec method of any one of claims 1 to 6.
CN202010041789.0A 2020-01-15 2020-01-15 File encoding and decoding method and device, terminal and storage medium Pending CN111246243A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010041789.0A CN111246243A (en) 2020-01-15 2020-01-15 File encoding and decoding method and device, terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010041789.0A CN111246243A (en) 2020-01-15 2020-01-15 File encoding and decoding method and device, terminal and storage medium

Publications (1)

Publication Number Publication Date
CN111246243A true CN111246243A (en) 2020-06-05

Family

ID=70872230

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010041789.0A Pending CN111246243A (en) 2020-01-15 2020-01-15 File encoding and decoding method and device, terminal and storage medium

Country Status (1)

Country Link
CN (1) CN111246243A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115250367A (en) * 2021-11-12 2022-10-28 稿定(厦门)科技有限公司 Method and apparatus for mixing multimedia files

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101098483A (en) * 2007-07-19 2008-01-02 上海交通大学 Video cluster transcoding system using image group structure as parallel processing element
CN103618902A (en) * 2013-11-13 2014-03-05 天脉聚源(北京)传媒科技有限公司 Transcoding method, device and system for video file
CN104159127A (en) * 2014-08-21 2014-11-19 北京奇艺世纪科技有限公司 Method, device and system of video transcoding
CN105245880A (en) * 2015-09-21 2016-01-13 北京暴风科技股份有限公司 Video file cutting method and distributed transcoding method
CN106533980A (en) * 2016-11-30 2017-03-22 浙江宇视科技有限公司 Network data packet processing method and apparatus
CN106961613A (en) * 2017-03-30 2017-07-18 上海七牛信息技术有限公司 A kind of streaming real-time transcoding order method and system
CN110149518A (en) * 2018-02-12 2019-08-20 腾讯科技(深圳)有限公司 Processing method, system, device, equipment and the storage medium of media data

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101098483A (en) * 2007-07-19 2008-01-02 上海交通大学 Video cluster transcoding system using image group structure as parallel processing element
CN103618902A (en) * 2013-11-13 2014-03-05 天脉聚源(北京)传媒科技有限公司 Transcoding method, device and system for video file
CN104159127A (en) * 2014-08-21 2014-11-19 北京奇艺世纪科技有限公司 Method, device and system of video transcoding
CN105245880A (en) * 2015-09-21 2016-01-13 北京暴风科技股份有限公司 Video file cutting method and distributed transcoding method
CN106533980A (en) * 2016-11-30 2017-03-22 浙江宇视科技有限公司 Network data packet processing method and apparatus
CN106961613A (en) * 2017-03-30 2017-07-18 上海七牛信息技术有限公司 A kind of streaming real-time transcoding order method and system
CN110149518A (en) * 2018-02-12 2019-08-20 腾讯科技(深圳)有限公司 Processing method, system, device, equipment and the storage medium of media data

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115250367A (en) * 2021-11-12 2022-10-28 稿定(厦门)科技有限公司 Method and apparatus for mixing multimedia files
CN115250367B (en) * 2021-11-12 2024-05-28 稿定(厦门)科技有限公司 Method and device for mixing multimedia files

Similar Documents

Publication Publication Date Title
EP2770687B1 (en) Network message parsing method and communication device
WO2020155964A1 (en) Audio/video switching method and apparatus, and computer device and readable storage medium
US20210099739A1 (en) Player methods for chunked cmaf low latency playback
CN111755017B (en) Audio recording method and device for cloud conference, server and storage medium
WO2018161881A1 (en) Structuralized data processing method, data storage medium, and computer apparatus
CN112953850B (en) Data transmission method and device, computer readable medium and electronic equipment
CN114666212B (en) Configuration data issuing method
US11463494B2 (en) Balance of initial frame and limitation of traffic
CN103152606B (en) Video file processing method and device, system
CN111246243A (en) File encoding and decoding method and device, terminal and storage medium
CN111210826B (en) Voice information processing method and device, storage medium and intelligent terminal
CN114039919A (en) Traffic scheduling method, medium, device and computing equipment
WO2021012723A1 (en) Multimedia file storage and access method
US20100076944A1 (en) Multiprocessor systems for processing multimedia data and methods thereof
CN114125071A (en) Data compression transmission method and device
US10642890B2 (en) Dynamic memory allocation using natural language processing tags
CN111246215A (en) Video format conversion method and terminal
JP7247184B2 (en) Information processing device, information processing system, program and information processing method
US9100717B2 (en) Methods and systems for file based content verification using multicore architecture
CN111757168B (en) Audio decoding method, device, storage medium and equipment
CN116702218B (en) Rendering method, device, terminal and storage medium of three-dimensional model in applet
CN104506936B (en) Audio and video data processing method and device based on many-core platform
US11404087B1 (en) Facial feature location-based audio frame replacement
CN114093375A (en) Decoding method, apparatus and computer-readable storage medium
WO2024066547A1 (en) Data compression method, apparatus, computing device, and storage system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200605