Audio frequency and video compiles transcoding issues fast-check method and system
Technical field
The invention belongs to field of video processing, in particular to a kind of audio frequency and video compiles transcoding issues fast-check method and system.
Background technique
It is compiled in trans-coding system in audio frequency and video, investigation problem common method is grabbed generally by operation maintenance personnel scene and inputted
Output signal and system running log carry out positioning problems, and are further used for by improvement part module after positioning problems
It exports more detailed information or takes further experiment with orientation problem.Following method:
Data are read from file or stream;
The data read are decapsulated, the audio data isolated is sent to audio decoder, the view isolated
Frequency evidence is sent to Video Decoder;
The audio data received is decoded as audio data decoder by audio decoder;
The video data decoding received is image data by Video Decoder;
It is the image of target size according to target call up conversion or down conversion by image data;
Transformed image is required to be encoded to corresponding video data encoder according to video encoding target;
Audio data decoder is encoded to corresponding coded audio data according to audio coding target call;
Video data encoder and being interleaved of coded audio data are handled;
File destination is written into data after intertexture or according to target agreement is sent.
In above-mentioned normal Video coding activity, often there is 7x24 hours unremitting codings, (such as television channel is straight
Broadcast coding), when being checked after going wrong, because the data from file or stream have often all been not present, cause
It checks extremely difficult, can only often be analyzed according to a large amount of log, and the various data during entirely compiling transcoding
Variation, which is not recorded often and causes only to verify very much by log analysis, finds final reason.The above method is often led
Cause problem resolution time too long, it is necessary to introduce a kind of further method to improve the efficiency of problem diagnosis.
Summary of the invention
In view of this, by data carrying out data and internal shape efficiently, frame by frame the purpose of the present invention is to provide a kind of
State variable comparison, so that the audio frequency and video of quick positioning question appearance position compiles transcoding issues fast-check method and system.
In order to achieve the above objectives, the present invention provides a kind of audio frequency and videos to compile transcoding issues fast-check method, including following step
It is rapid:
Data are read from file or stream, are carried out the first processing and are obtained the first processing result, the first processing result is write
Enter specified store path;
First processing result is subjected to second processing, second processing is obtained and is deposited as a result, the write-in of second processing result is specified
Store up path;
Second processing result is subjected to third processing, obtains third processing result, the write-in of third processing result is specified and is deposited
Store up path;
Third processing result is subjected to fourth process, fourth process is obtained and is deposited as a result, the write-in of fourth process result is specified
Store up path;
Wherein, there is fixed content to include period and common for the first processing, second processing, third processing and fourth process
Diagnosis include interface, the processing result in nearest a cycle is recorded in storage medium.
Preferably, described that data are read from file or stream, it carries out the first processing and obtains the first processing result, by first
Processing result is written in specified store path, and the first processing is decapsulates to the data read, the audio number isolated
According to audio decoder is sent to, the video data isolated is sent to Video Decoder;First processing result include audio data,
Video data, and video file head and media protocol head are recorded always in the first processing.
Preferably, described that first processing result is subjected to second processing, second processing is obtained as a result, by second processing result
Specified store path is written, the audio data received is decoded as audio data decoder, video for audio decoder by second processing
The video data decoding received is image data by decoder;Second processing result include decode come audio data decoder,
Image data and media information.
Preferably, described that second processing result is subjected to third processing, third processing result is obtained, by third processing result
Be written specified store path, it by the video data decoding received is image data that third processing, which is Video Decoder, by picture number
According to the image for according to target call up conversion or down conversion being target size, transformed image is wanted according to video encoding target
It asks and is encoded to corresponding video data encoder;Audio data decoder is encoded to corresponding audio according to audio coding target call
Coded data;Third processing result includes the image after decoding the image data come, up conversion or down conversion, the view after coding
Coded audio data and media information after frequency coded data, coding.
Preferably, described that third processing result is subjected to fourth process, fourth process is obtained as a result, by fourth process result
Specified store path is written, fourth process is to handle video data encoder and being interleaved of coded audio data, will be interweaved
Data write-in file destination or according to target agreement transmission afterwards;Fourth process result includes intertextureization treated data and matchmaker
Body information.
Preferably, the media information includes at least timestamp, size of data and data format.
Based on above-mentioned purpose, transcoding issues are compiled the present invention also provides a kind of audio frequency and video and check system quickly, which is characterized in that
Including reader, demultiplexer, Video Decoder, audio decoder, video converter, video encoder, audio coder, more
Path multiplexer and writer, in which:
The output of the reader is connect with the input of the demultiplexer, the output of the demultiplexer and the video
The input of decoder and the input of the audio decoder are separately connected, the output of the Video Decoder and the Video Quality Metric
The input of device connects, and the output of the video converter is connect with the input of the video encoder, the audio decoder
Output connect with the input of the audio coder, the video encoder export and the audio coder output with
The input of the multiplexer connects, and the output of the multiplexer is connect with the input of said write device;
The reader, for reading data from file or stream;The demultiplexer is obtained for carrying out the first processing
To the first processing result, specified store path is written into the first processing result;
The Video Decoder and audio decoder obtain at second for the first processing result to be carried out second processing
Reason is as a result, be written specified store path for second processing result;
The video converter, video encoder and audio coder, for second processing result to be carried out third processing,
Third processing result is obtained, specified store path is written into third processing result;
The multiplexer and writer obtain fourth process knot for third processing result to be carried out fourth process
Specified store path is written in fourth process result by fruit;
Wherein, there is fixed content to include period and common for the first processing, second processing, third processing and fourth process
Diagnosis include interface, the processing result in nearest a cycle is recorded in storage medium.
Preferably, to decapsulate to the data read, the audio data isolated is sent to for first processing
Audio decoder, the video data isolated are sent to Video Decoder;First processing result includes audio data, video counts
According to, and video file head and media protocol head are recorded always in the first processing.
Preferably, the audio data received is decoded as audio data decoder for audio decoder by the second processing, depending on
The video data decoding received is image data by frequency decoder;Second processing result includes decoding the audio decoder number come
According to, image data and media information.
Preferably, it by the video data decoding received is image data that third processing, which is Video Decoder, by image
Data are the image of target size according to target call up conversion or down conversion, by transformed image according to video encoding target
It is required that being encoded to corresponding video data encoder;Audio data decoder is encoded to corresponding sound according to audio coding target call
Frequency coded data;Third processing result includes image after decoding the image data come, up conversion or down conversion, after coding
Coded audio data and media information after video data encoder, coding.
Preferably, the fourth process is to handle video data encoder and being interleaved of coded audio data, will be handed over
Data write-in file destination or according to target agreement transmission after knitting;Fourth process result include intertextureization treated data and
Media information.
Preferably, the media information includes at least timestamp, size of data and data format.
The beneficial effects of the present invention are: it is compiled in transcoding activity in general audio frequency and video, often has 7x24 hours continuously
Disconnected coding (such as television channel live streaming coding), when being checked after going wrong, because the data from file or stream are past
Toward being all not present, cause to check extremely difficult, can only often be analyzed according to a large amount of log, and entirely compiles transcoding
During various data variation be not recorded often and cause only by log analysis verify find very much finally
The reason of.Therefore, using method and system of the invention, the data and metadata of each section in system are stored, in conjunction with
Log can be analyzed efficiently very much, and then improve client response speed.
Detailed description of the invention
In order to keep the purpose of the present invention, technical scheme and beneficial effects clearer, the present invention provides following attached drawing and carries out
Illustrate:
Fig. 1 is that the audio frequency and video of embodiment of the present invention method 1 compiles transcoding issues fast-check method flow chart of steps;
Fig. 2 is that the audio frequency and video of embodiment of the present invention method 2 compiles transcoding issues fast-check method flow chart of steps;
Fig. 3 is that the audio frequency and video of present system embodiment compiles transcoding issues quick checking system structure diagram.
Specific embodiment
Below in conjunction with attached drawing, a preferred embodiment of the present invention will be described in detail.
Embodiment 1
Referring to Fig. 1, the audio frequency and video for showing embodiment of the present invention method 1 compiles transcoding issues fast-check method steps flow chart
Figure, comprising the following steps:
S101 reads data from file or stream, carries out the first processing and obtains the first processing result, the first processing is tied
Specified store path is written in fruit;
First processing result is carried out second processing by S102, obtains second processing as a result, the write-in of second processing result is referred to
Determine store path;
Second processing result is carried out third processing, obtains third processing result by S103, and the write-in of third processing result is referred to
Determine store path;
Third processing result is carried out fourth process by S104, obtains fourth process as a result, the write-in of fourth process result is referred to
Determine store path;
Wherein, there is fixed content to include period and common for the first processing, second processing, third processing and fourth process
Diagnosis include interface, the processing result in nearest a cycle is recorded in storage medium.
Embodiment 2
Referring to fig. 2, the audio frequency and video for showing embodiment of the present invention method 2 compiles transcoding issues fast-check method steps flow chart
Figure, comprising the following steps:
S201 reads data from file or stream, and the data read are decapsulated, the audio data hair isolated
Audio decoder is given, the video data isolated is sent to Video Decoder, by the data read and isolates audio number
Specified store path is written according to, the media information of video data and media data, and records video file head and media always
Protocol header;
The audio data received is decoded as audio data decoder by S202, audio decoder, by audio decoder number after decoding
Specified store path is written according to media information;
The video data decoding received is image data by S203, Video Decoder, and image data and media information are write
Enter specified store path;
Image data is the image of target size according to target call up conversion or down conversion by S204, by up conversion or
Specified store path is written in image and media information after down conversion;
Transformed image is required to be encoded to corresponding video data encoder according to video encoding target, will be compiled by S205
Specified store path is written in video data encoder and media information after code;
Audio data decoder is encoded to corresponding coded audio data according to audio coding target call, will compiled by S206
Specified store path is written in coded audio data and media information after code;
S207 handles video data encoder and being interleaved of coded audio data, and mesh is written in the data after intertexture
It marks file or according to target agreement is sent, intertextureizations treated data and media information write-in are specified into store path;
Image data format includes yuv format and rgb format;Audio data decoder format includes PCM format;Video coding
Target call is including H.264 and H.265;Coded audio data format includes AAC and AC3 format.
Target call refers to parameter defined by video file that user finally needs, such as video format, image resolution
Rate, code rate, coding parameter, audio format, audio sample rate, code rate etc..By the above method, when audio frequency and video compiles trans-coding system
When something goes wrong, it is not required to that a large amount of log is analyzed and checked, it only need to be by the data of each component in above-mentioned each step
And metadata is stored, and when problem appearance is diagnosed, by data carries out data and internal state variable frame by frame
Comparison, and then quickly position go wrong appear in where, so that the problem of reaching rapidly and efficiently checks effect.
The above method has fixed content to include the period, can set recovery time, such as specified to include one minute, then has one
A circle queue mechanism, guarantee always have the data of one minute nearest each component to be recorded in storage medium.Oldest
When will be automatically cleared, such as specified time of receipt is one minute, diagnostic data is stored since 10:00:00, works as 10:01:
When 01 second, 10:00:00 seconds data are deleted;When 10:01:02 seconds, 10:00:01 seconds data are deleted;
And so on.Each component is voluntarily responsible for data storage and is eliminated, and can be convenient the extension for carrying out compiling transcoding process in this way, mentions
High flexibility --- such as need to introduce audio resampling component in some cases, it is only necessary to this component also meets this machine
System.Above-mentioned each component includes but are not limited to reader, demultiplexer, Video Decoder, audio decoder, Video Quality Metric
Device, video encoder, audio coder, multiplexer and writer.Storage medium can be but be not limited only to local disc
Or external storage (such as disk array, NAS).
To meet mechanism above, specifically, each component follows common diagnosis and includes interface:
Starting content is included: specified store path, and component will be written its data herein, and Method of Data Organization can be by
Component is decided in its sole discretion.
Stop content including: not carrying out data storage.
Media information includes at least timestamp, size of data, data format etc., and different components may carry more auxiliary
Help media information.Each component is when storing data, it is also necessary to which its internal all corresponding state variable is carried out sequence
Columnization storage, certainly, storage can also be also written in the intermediate data that their own internal logic generates by each component.
It is specific how quick positioning question, by taking Video Decoder as an example, by the media information inputted every time, media data
(such as H.264 encoded data) and the built-in variable of decoding front and back store.When the view of the media information of input
Frequency division resolution is 1920x1080, when the 10:00:00 moment to the image that the 10:00:05 moment solves out is 1920x1080, meaning
Taste there is no problem, but when finding that this variable sports 640x480 in 10:00:06, this point is exactly problem, this
When further diagnose, the reading data of this frame at this moment stored can be come in by component, carry out debugging
It was found that being which place specific code is wrongly write on earth.
It is corresponding with above-mentioned audio frequency and video volume transcoding issues fast-check method, it compiles and turns the present invention also provides a kind of audio frequency and video
Code problem checks system quickly, and structural schematic diagram is referring to Fig. 3, including reader 10, demultiplexer 20, Video Decoder 40, audio
Decoder 30, video converter 60, video encoder, audio coder 70, multiplexer 80 and writer 90, wherein
The output of the reader 10 is connect with the input of the demultiplexer 20, the output of the demultiplexer 20 and institute
The input and the input of the audio decoder 30 for stating Video Decoder 40 are separately connected, the output of the Video Decoder 40 with
The input of the video converter 60 connects, and the output of the video converter 60 is connect with the input of the video encoder,
The output of the audio decoder 30 is connect with the input of the audio coder 70, the output of the video encoder and described
The output of audio coder 70 is connect with the input of the multiplexer 80, the output of the multiplexer 80 with it is described
The input of writer 90 connects,
The reader 10, for reading data from file or stream;The demultiplexer 20, for carrying out the first processing
And the first processing result is obtained, specified store path is written into the first processing result;
The Video Decoder 40 and audio decoder 30 obtain for the first processing result to be carried out second processing
Specified store path is written in second processing result by two processing results;
The video converter 50, video encoder 60 and audio coder 70, for second processing result to be carried out the
Three processing, obtain third processing result, and specified store path is written in third processing result;
The multiplexer 80 and writer 90 obtain the everywhere for third processing result to be carried out fourth process
Reason is as a result, be written specified store path for fourth process result;
Wherein, there is fixed content to include period and common for the first processing, second processing, third processing and fourth process
Diagnosis include interface, the processing result in nearest a cycle is recorded in storage medium.
Specific embodiment is referring to above method embodiment, and this will not be repeated here.
Finally, it is stated that preferred embodiment above is only used to illustrate the technical scheme of the present invention and not to limit it, although logical
It crosses above preferred embodiment the present invention is described in detail, however, those skilled in the art should understand that, can be
Various changes are made to it in form and in details, without departing from claims of the present invention limited range.