CN103200380A - Multimedia data format conversion method - Google Patents

Multimedia data format conversion method Download PDF

Info

Publication number
CN103200380A
CN103200380A CN2012100064019A CN201210006401A CN103200380A CN 103200380 A CN103200380 A CN 103200380A CN 2012100064019 A CN2012100064019 A CN 2012100064019A CN 201210006401 A CN201210006401 A CN 201210006401A CN 103200380 A CN103200380 A CN 103200380A
Authority
CN
China
Prior art keywords
thread
data
format conversion
conversion method
coding
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
CN2012100064019A
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.)
BEIJING GOLAND Tech CO Ltd
Original Assignee
BEIJING GOLAND Tech 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 BEIJING GOLAND Tech CO Ltd filed Critical BEIJING GOLAND Tech CO Ltd
Priority to CN2012100064019A priority Critical patent/CN103200380A/en
Publication of CN103200380A publication Critical patent/CN103200380A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The invention discloses a multimedia data format conversion method, and relates to the technical field of multimedia processing. The multimedia data format conversion method sequentially comprises the steps of reading an original multimedia file, separating code stream data of the original multimedia file, decoding, encoding according to a format which the file is to be converted into, and packing multimedia data after encoding into a target conversion file. In the conversion steps, a next step obtains output data of a last step in real time, and format conversion is concomitantly accomplished. The multimedia data format conversion method shortens time of conversion in an audio/video format conversion process, and improves efficiency of conversion.

Description

The multimedia data format conversion method
Technical field
The present invention relates to the multimedia processing technology field, particularly a kind of multimedia data format conversion method.
Background technology
Along with improving constantly of living standards of the people, people's aesthetic conceptions are more and more higher.Audio frequency and video form and the related resource of various formula emerge in an endless stream, and constantly satisfy modern's amusement demand, but present playing platform is difficult to cover the audio-video document form of full format, and the instrument of therefore a large amount of audio frequency and video format conversion occurs.People are also more and more higher with the quality requirement of conversion back audio frequency and video to the speed of its conversion method simultaneously.The single-threaded transform engine of the many employings of traditional audio-video conversion method adopts single-threaded link circulation.The method specific implementation of single-threaded transform engine is, obtain source file, preview is also analyzed source file, source file is carried out demultiplexing, decomposite corresponding audio stream and video flowing and captions, to audio stream and decoding video stream, encode again respectively, source file is converted to destination file format and output, and it is the process of serial that whole process is one.In the whole circulation link, the flowing of each frame data needs all to wait for that exporting to the next stage operating side after the upper level operational processes handles, and the work of each grade operating side triggers the output that all is based on the upper level data and transmits.
The method of the single-threaded transform engine of tradition is lower to the utilance of multi-core CPU, and the load of monokaryon CPU is heavier, and redundancy time is longer.Can't carry out intelligent decision according to the ability of subscriber computer, cause whole change-over time longer.Owing to be single-threaded running operation, cause the components of system as directed wasting of resources, the not high shortcoming of cpu busy percentage.And transfer of data adopts traditional " pushing away " pattern, and the transfer of data of whole link is slower, causes change-over time longer, and switching rate is lower.
Summary of the invention
(1) technical problem that will solve
The technical problem to be solved in the present invention is: how to make and shorten change-over time in the audio frequency and video format conversion process, improve conversion efficiency.
(2) technical scheme
For solving the problems of the technologies described above, the invention provides a kind of multimedia data format conversion method, comprise step successively: read former multimedia file, separate the bit stream data, decoding of former multimedia file, the multi-medium data by form coding to be converted, after will encoding is packaged into the target convert file, in the above-mentioned switch process, next step obtains the output data of previous step in real time, finishes format conversion concomitantly.
Wherein, each described switch process is independently being carried out in the thread respectively.
Wherein, share a buffer queue between the thread of former and later two switch process correspondences respectively, previous step deposits the multi-medium data of handling the tail of the queue of formation in, and next step is monitored the data in the formation in real time, and reads multi-medium data from team's head.
Wherein, full if previous step detects described buffer queue, then stop to wherein storing data, up to described buffer queue new memory space is arranged, if next step detects described buffer queue for empty, the then thread dormancy of next step correspondence is up to there being new data that it is waken up.
Wherein, the thread of described decoding comprises: audio decoder thread, video decode thread and/or caption decoding thread, the thread of described coding is corresponding with the thread of decoding, comprising: audio coding thread, video coding thread and/or captions coding thread.
Wherein, described audio decoder thread, video decode thread and/or caption decoding thread respectively with the described thread shared buffer memory formation that separates the bit stream data of former multimedia file, audio decoder thread, video decode thread and/or caption decoding thread respectively with the thread shared buffer memory formation of correspondingly encoding, described audio coding thread, video coding thread and/or captions coding thread respectively with described will the coding after multi-medium data be packaged into the thread shared buffer memory formation of target convert file.
Wherein, in polycaryon processor, the different thread of described switch process correspondence is handled in two nuclears at least.
(3) beneficial effect
Compare with conventional method, each step is as a thread independently in the multimedia data format conversion method that the present invention proposes, concurrent execution between a plurality of steps, transfer of data adopts the FIFO caching mechanism to share, and adopt " drawing " pattern to carry out data call, thereby avoided in the conventional method because waiting time redundancy that pending data causes and the waste of computer CPU; Method of the present invention can take full advantage of CPU and the operational capability of computer, intelligentized selection active link, the problem that conversion speed is slow from solving in essence, change-over time is long.
Description of drawings
Fig. 1 is a kind of multimedia data format conversion method flow chart of the embodiment of the invention;
Fig. 2 is each thread module diagram among Fig. 1;
Two threads that Fig. 3 is are shared FIFO buffer queue schematic diagram.
Embodiment
Below in conjunction with drawings and Examples, the specific embodiment of the present invention is described in further detail.Following examples are used for explanation the present invention, but are not used for limiting the scope of the invention.
Carry out the problem of inefficiency for fear of traditional serial conversion, adopt format conversion mode concomitantly among the present invention, namely next step obtains the output data of previous step in real time in whole transfer process, finishes format conversion concomitantly.
For the ease of understanding and describing, whole transfer process is abstracted into a figure (graph) structure, as shown in Figure 1, each step of transfer process is abstracted into different modules, abbreviate filter as, filter is the encapsulation to a kind of codec or other processor, as being responsible for the decode filter of decoding, be responsible for the encode filter of coding, each module is operated in the different threads, communicate and transmit data by abstract structure pin, as shown in Figure 1, encode filter is abstract to be an independent module, main being responsible for encoded to data stream, and input pin and output pin by abstract structure carry out transfer of data, are the external interface of codec, input pin mainly connects the output pin on the upper level filter, and its output pin mainly connects the input pin on the next stage filter.Different codecs has different input pin and output pin.
To introduce the constructive process of Graph among the present invention below:
As described in Figure 2, when the user specify the transcoding file and dispose corresponding transcoding output condition be profile after, create corresponding source filter, the filter that each output pin on the source filter is had the input pin that coincide with this output_pin according to user's profile removal search, be the filter that code/decode format conforms to, and this input pin and this output pin of this filter coupled together, generate corresponding output pin.Usually this filter can be demux filter, is example with it here, continues to seek the filter of the input pin of the output pin coupling on the demux filter, and these two pin are coupled together.Successively time link filter at different levels form final transcoding graph by that analogy.
The running of Graph is as follows:
Have the various filter among Fig. 2 in the whole transcoding link, be responsible for each several part work in the transcoding process respectively.
Source filter: be responsible for the read-write of original video files.
Demux filter: be responsible for separating the various bit stream datas in the inlet flow, as video flowing, caption stream, audio stream.
Video/Audio/Subtitle decode filter: be responsible for the decoding of video/audio/captions.
Video/Audio/Subtitle encode filter: the coding of being responsible for video/audio/captions.
Mux filter: various code stream compilations and the packing being responsible for importing output to the target convert file.
When transcoding graph moved, these filter were operated in concurrent execution in the different threads separately, communicate and transfer of data by interconnective pin between them.Because the ability difference of different filter deal with data, the output data of higher level's filter have little time to handle at next stage usually, and vice versa.Introduced the caching mechanism of FIFO between the pin of the filter of the superior and the subordinate, FIFO is made up of the data cell of fixed number, is referred to as message here, and message is made up of heading and data, indicates information such as the attribute of array and size in the heading, and is specific as follows:
Figure BDA0000129887640000041
Figure BDA0000129887640000051
Packet has different types, is defined among the packet_type, and filter can resolve packet_data according to different packet_type take out data from FIFO after.
As shown in Figure 3, the filter of upper level will export data push FIFO with the message form afterbody by its output_pin in the graph running, the input_pin of next stage filter extracts message from the FIFO head and handles, thereby has realized the processed in sequence of data.And expired when the output_pin of upper level filter finds FIFO, then its break-off has available message in FIFO, otherwise when the input pin of next stage filter finds do not have accessible message among the FIFO, it also break-off enter resting state, up to accessible message is arranged.
Be example with Fig. 3, Decode Filter is transferred to data fifo stream with data flow by output Pin, as the transfer of data of first output No. 1 position to data fifo stream, the transfer of data of second output is to No. 2 position of data fifo stream, and Shu Chu data leave position such as the 3rd, the 4th, the 5th, the 6th, the 7th successively in by that analogy.
Encode Filter will adopt data " to draw " pattern, calling the data of No. 1 position on the data fifo stream handles, call the data on the data flow then No. 2, call successively No. 3, No. 4, No. 5 etc. locational data are handled, if call successively, there are not data on the data fifo stream, then Encode Filter temporarily enters resting state, up to being arranged, comes new data fifo, Encode Filter will be waken up and proceed coding work, after data fifo stream storage data, Encode Filter can call each locational data successively and handle, and whole process namely is the process that a multi-threaded parallel is handled.Solved the inconsistent problem of progress that the processing speed difference causes between the different filter of the superior and the subordinate like this.
With reference to shown in Figure 2, this patent method is walked mainly may further comprise the steps by the data flow flow process:
The first step, Source filter reads and writes original video files;
Second step, Demux filter is, and source file is analyzed, audio stream, video flowing, caption stream are separated, this Demux filter is an independent thread, " drawing " pattern of employing, the output data of real-time calling source file are as the input data, and the audio stream after will handling simultaneously, video flowing, caption stream be as exporting data, and transmit with a kind of FIFO caching mechanism.
The 3rd step, Audio decode filter is as an independent thread, real-time calling FIFO audio stream, and according to the difference of the encoded attributes of audio stream, select different Audio decoder to decode, with the mechanism output of decoded data with data fifo stream, can be regarded as herein all decoded data streams are deposited among the big stock, the mode of storing and calling is a kind of mechanism of first in first out; In like manner, Video decode filter is as an independent thread, real-time calling FIFO video flowing, and according to the difference of the encoded attributes of video flowing, select different Video decoder to decode, with the mechanism output of decoded data with data fifo stream; In like manner, Subtitle decode filter is as an independent thread, real-time calling FIFO caption stream, and according to the difference of the encoded attributes of caption stream, select different Subtitle decoder to decode, with the mechanism output of decoded data with data fifo stream.
The 4th step, Video encode filter, Audio encode filter, Subtitle encodefilter are respectively as a thread module independently, be responsible for the data fifo stream of output in the 4th step is encoded, to select different encoder to encode with requiring according to the form of file destination herein, audio stream, video flowing, caption stream among the so-called stock of real-time calling, encode respectively, with the form output of FIFO mechanism.
The 6th step encapsulated the data fifo stream behind the coding, and Mux filter is as a separate threads, real-time calling data fifo stream, and according to the call format of file destination, the encapsulation filter that Intelligence Selection is different encapsulates in real time.
It more than is a kind of step on the data flow, each processing module works alone, Source filter, Demux filter, Audio decode filter, Video decode filter, Subtitle decode filter, Video encode filter, Audio encode filter, Subtitle encode filter, Mux filter can concurrent work, sharing by the FIFO caching mechanism between the data realizes, each bar active link is communicated with by data, but is separate and parallel processing on its realization and the working method.
Above execution mode only is used for explanation the present invention; and be not limitation of the present invention; the those of ordinary skill in relevant technologies field; under the situation that does not break away from the spirit and scope of the present invention; can also make a variety of changes and modification; therefore all technical schemes that are equal to also belong to category of the present invention, and scope of patent protection of the present invention should be defined by the claims.

Claims (7)

1. multimedia data format conversion method, comprise step successively: read former multimedia file, separate the bit stream data, decoding of former multimedia file, the multi-medium data by form coding to be converted, after will encoding is packaged into the target convert file, it is characterized in that, in the above-mentioned switch process, next step obtains the output data of previous step in real time, finishes format conversion concomitantly.
2. multimedia data format conversion method as claimed in claim 1 is characterized in that, each described switch process is independently being carried out in the thread respectively.
3. multimedia data format conversion method as claimed in claim 2, it is characterized in that, share a buffer queue between the thread of former and later two switch process correspondences respectively, previous step deposits the multi-medium data of handling in the tail of the queue of formation, next step is monitored the data in the formation in real time, and reads multi-medium data from team's head.
4. multimedia data format conversion method as claimed in claim 3, it is characterized in that, if it is full that previous step detects described buffer queue, then stop to wherein storing data, up to described buffer queue new memory space is arranged, if next step detects described buffer queue for empty, the then thread dormancy of next step correspondence is up to there being new data that it is waken up.
5. multimedia data format conversion method as claimed in claim 4, it is characterized in that, the thread of described decoding comprises: audio decoder thread, video decode thread and/or caption decoding thread, the thread of described coding is corresponding with the thread of decoding, comprising: audio coding thread, video coding thread and/or captions coding thread.
6. multimedia data format conversion method as claimed in claim 5, it is characterized in that, described audio decoder thread, video decode thread and/or caption decoding thread respectively with the described thread shared buffer memory formation that separates the bit stream data of former multimedia file, audio decoder thread, video decode thread and/or caption decoding thread respectively with the thread shared buffer memory formation of correspondingly encoding, described audio coding thread, video coding thread and/or captions coding thread respectively with described will the coding after multi-medium data be packaged into the thread shared buffer memory formation of target convert file.
7. as each described multimedia data format conversion method in the claim 2~6, it is characterized in that in polycaryon processor, the different thread of described switch process correspondence is handled at least in two nuclears.
CN2012100064019A 2012-01-10 2012-01-10 Multimedia data format conversion method Pending CN103200380A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2012100064019A CN103200380A (en) 2012-01-10 2012-01-10 Multimedia data format conversion method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2012100064019A CN103200380A (en) 2012-01-10 2012-01-10 Multimedia data format conversion method

Publications (1)

Publication Number Publication Date
CN103200380A true CN103200380A (en) 2013-07-10

Family

ID=48722722

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2012100064019A Pending CN103200380A (en) 2012-01-10 2012-01-10 Multimedia data format conversion method

Country Status (1)

Country Link
CN (1) CN103200380A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104768053A (en) * 2015-04-15 2015-07-08 冯山泉 Format conversion method and system based on streaming decomposition and streaming recombination
CN111476002A (en) * 2020-04-07 2020-07-31 北京东方金信科技有限公司 Data file coding format conversion method and system
CN111475462A (en) * 2020-03-10 2020-07-31 苏州浪潮智能科技有限公司 An adaptive mobile memory
CN112269787A (en) * 2020-11-09 2021-01-26 安徽华典大数据科技有限公司 Database data conversion method based on quantum computation
CN112689197A (en) * 2019-10-18 2021-04-20 腾讯科技(深圳)有限公司 File format conversion method and device and computer storage medium
CN113132756A (en) * 2021-03-12 2021-07-16 杭州当虹科技股份有限公司 Video coding and transcoding method
CN113727110A (en) * 2021-08-27 2021-11-30 猪八戒股份有限公司 Method, apparatus and medium for converting h264 format into mp4 format
CN113747236A (en) * 2021-10-19 2021-12-03 江下信息科技(惠州)有限公司 Multithreading-based high-speed audio format conversion method and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1813479A (en) * 2003-06-30 2006-08-02 皇家飞利浦电子股份有限公司 Video coding in an overcomplete wavelet domain
CN101656682A (en) * 2009-06-12 2010-02-24 中兴通讯股份有限公司 Method and system for processing mobile multimedia data broadcasting services
CN102014262A (en) * 2010-10-27 2011-04-13 杭州海康威视软件有限公司 Hard disk video recorder and system and method for converting multimedia formats

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1813479A (en) * 2003-06-30 2006-08-02 皇家飞利浦电子股份有限公司 Video coding in an overcomplete wavelet domain
CN101656682A (en) * 2009-06-12 2010-02-24 中兴通讯股份有限公司 Method and system for processing mobile multimedia data broadcasting services
CN102014262A (en) * 2010-10-27 2011-04-13 杭州海康威视软件有限公司 Hard disk video recorder and system and method for converting multimedia formats

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
DAVID FOSTER: "https://trac.handbrake.fr/wiki/HandBrakeArchitecture", 《HANDBRAKE》 *

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104768053A (en) * 2015-04-15 2015-07-08 冯山泉 Format conversion method and system based on streaming decomposition and streaming recombination
CN112689197A (en) * 2019-10-18 2021-04-20 腾讯科技(深圳)有限公司 File format conversion method and device and computer storage medium
CN111475462A (en) * 2020-03-10 2020-07-31 苏州浪潮智能科技有限公司 An adaptive mobile memory
CN111475462B (en) * 2020-03-10 2023-01-13 苏州浪潮智能科技有限公司 Self-adaptive mobile memory
CN111476002A (en) * 2020-04-07 2020-07-31 北京东方金信科技有限公司 Data file coding format conversion method and system
CN112269787A (en) * 2020-11-09 2021-01-26 安徽华典大数据科技有限公司 Database data conversion method based on quantum computation
CN113132756A (en) * 2021-03-12 2021-07-16 杭州当虹科技股份有限公司 Video coding and transcoding method
CN113132756B (en) * 2021-03-12 2023-03-21 杭州当虹科技股份有限公司 Video coding and transcoding method
CN113727110A (en) * 2021-08-27 2021-11-30 猪八戒股份有限公司 Method, apparatus and medium for converting h264 format into mp4 format
CN113747236A (en) * 2021-10-19 2021-12-03 江下信息科技(惠州)有限公司 Multithreading-based high-speed audio format conversion method and system

Similar Documents

Publication Publication Date Title
CN103200380A (en) Multimedia data format conversion method
CN104869398B (en) A kind of CABAC realized based on CPU+GPU heterogeneous platforms in HEVC parallel method
CN104081781B (en) An encoder, a decoder, an encoding and decoding method, and a method for transmitting and demultiplexing
CN105120293B (en) Image collaboration coding/decoding method and device based on CPU and GPU
CN101068366A (en) H.264 based multichannel video transcoding multiplexing method and multiplexer
CN103581680B (en) The method and system of decoder capabilities is improved using quantified controlling
CN102447906A (en) Low-latency video decoding
CN111741232B (en) A method for improving the performance of ultra-high-definition non-editing editing based on dual graphics card NVLINK
CN101860752B (en) Video code stream parallelization method for embedded multi-core system
CN103220508A (en) Coding and decoding method and device
CN101616323A (en) The system and method that encoded video data stream is decoded
CN110990358B (en) Decompression method, electronic equipment and computer readable storage medium
CN102802022A (en) Coding and decoding system and method
CN101420619A (en) Distributed media format code transferring method
CN1589025A (en) Vido decoder based on software and hardware cooperative control
CN104980682A (en) Intelligent dynamic high-definition video transmission system
CN202551259U (en) Set-top box multi-format transcoding device and multimedia playing system
WO2015031891A2 (en) Multipass encoder with heterogeneous codecs
CN102123286A (en) NAL (network abstraction layer) module of video codec and implementation method thereof
CN119996761A (en) Audio and video processing method, system, storage medium and electronic device
CN113259675A (en) Ultrahigh-definition video image parallel processing method
TWI517695B (en) On die/off die memory management
CN107426611B (en) multi-path output method and system based on video transcoding
JP4423820B2 (en) Image processing apparatus and method, program, and recording medium
CN102487439B (en) Audio and video acquisition and play processing method with whole embedding of memory

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into 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: 20130710