CN101996662B - Method and device for connecting and outputting video files - Google Patents

Method and device for connecting and outputting video files Download PDF

Info

Publication number
CN101996662B
CN101996662B CN 201010516318 CN201010516318A CN101996662B CN 101996662 B CN101996662 B CN 101996662B CN 201010516318 CN201010516318 CN 201010516318 CN 201010516318 A CN201010516318 A CN 201010516318A CN 101996662 B CN101996662 B CN 101996662B
Authority
CN
China
Prior art keywords
frame
video
audio frame
timestamp
current
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.)
Expired - Fee Related
Application number
CN 201010516318
Other languages
Chinese (zh)
Other versions
CN101996662A (en
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.)
Wondershare Technology Co ltd
Original Assignee
Shenzhen Wondershare Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Wondershare Software Co Ltd filed Critical Shenzhen Wondershare Software Co Ltd
Priority to CN 201010516318 priority Critical patent/CN101996662B/en
Publication of CN101996662A publication Critical patent/CN101996662A/en
Application granted granted Critical
Publication of CN101996662B publication Critical patent/CN101996662B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The invention relates to a method for connecting and outputting video files. The method comprises the following steps of: 1, performing timestamp smoothing processing on at least two decoded video files; 2, aligning the at least two video files after timestamp smoothing processing; and 3, encoding, synthesizing and outputting the at least two aligned video files. The step S1 comprises the following steps of: 11, repeating or losing video frames of the decoded video files to make the video frames output according to a preset frame rate; and 12, complementing silence or deleting corresponding audio data of audio frames of the decoded video files to make the audio frame aligned according to a theoretical timestamp. The invention also relates to a video file connecting and outputting device. The method and the device for connecting and outputting the video files can connect a plurality of input video files into one video file and output the video file, and can guarantee the play speed and the synchronization degree of the output video and the output audio.

Description

The connection output intent and the device of video file
Technical field
The present invention relates to the video production field, be specifically related to a kind of connection output intent and device of at least two video files.
Background technology
Along with iPhone, the popularizing of 3G mobile such as iPod and latter, people need convert all kinds of media files to can on this kind equipment, play form, and various conversion softwares arise at the historic moment.But these softwares can only carry out format conversion to the single medium file, and some video editing fans need shear a plurality of media files; Combination; Connect into a file output, and audio frequency and video transcoding software all can not connect into a file output with a plurality of files at present.
Summary of the invention
The technical problem that the present invention will solve is; Audio frequency and video transcoding software of the prior art to making video can not be with a plurality of files; Connect into the defective of a file output, a kind of connection output intent and device that can the video file of a plurality of inputs be connected into the video file of a video file output is provided.
The present invention constructs a kind of connection output intent of video file, comprising step: S1, decoded at least two video files are carried out the timestamp smoothing processing; S2, said at least two video files after the timestamp smoothing processing are carried out registration process; S3, with said at least two video files after the registration process encode, synthetic output.
In the connection output intent of a kind of video file of the present invention, said step S1 comprises: S11, handle and to make said frame of video export by preset frame per second through the frame of video of decoded video file being carried out repeating frame or frame losing; S12, through mending quiet to the audio frame of said decoded video file or abandoning corresponding voice data, make said audio frame align by theoretical timestamp.
In the connection output intent of a kind of video file of the present invention, said step S11 comprises: S111, obtain the theoretical timestamp of current video frame and said current video frame; S112, when the timestamp of said current video frame during less than the theoretical timestamp of said current video frame, through an input video frame duration, turn back to step S111; S113, when the timestamp of said current video frame during more than or equal to the theoretical timestamp of said current video frame, said current video frame is set to current output video frame, and the output time of said current video frame stabs and is set to said theoretical timestamp; S114, the difference of stabbing when said current video frame and a last video frame time are more than or equal to the output video frame duration of twice; A said last frame of video be set to said current video frame and and the difference of the timestamp of current video frame more than or equal to the output video frame between the last frame of video of the output video frame duration of twice, and the output time of a said last frame of video stab be set to the output video frame between said current video frame and the said last frame of video theoretical timestamp with the assurance output frame rate.
In the connection output intent of a kind of video file of the present invention, said step S12 comprises: S121, obtain the theoretical timestamp of current audio frame and said current audio frame; S122, when the timestamp of said current audio frame theoretical timestamp less than said current audio frame; Then said current audio frame abandons the data volume in time of difference of timestamp of said theoretical timestamp and said current audio frame; Said current audio frame is set to current output audio frame, and the output time of said current audio frame stabs the theoretical timestamp that is set to said current audio frame; When the timestamp of said current audio frame equals the theoretical timestamp of said current audio frame, said current audio frame is set to current output audio frame; When the timestamp of said current audio frame theoretical timestamp greater than said current audio frame; Quiet data in the time of the timestamp of the additional said current audio frame of then said current audio frame and the difference of said theoretical timestamp; Said current audio frame is set to current output audio frame, and the output time of said current audio frame stabs the said theoretical timestamp that is set to said current audio frame.
In the connection output intent of a kind of video file of the present invention, said step S2 comprises: S21, alternately acquisition time stabs the frame of video and the audio frame of the video file after the smoothing processing; S22, with the alignment of said frame of video and said audio frame.
In the connection output intent of a kind of video file of the present invention; Said step S22 comprises: S221, when said audio frame for finishing audio frame; And said audio frame finishes than said frame of video in advance; Then after said audio frame finishes, alternately import quiet data and said frame of video to the frame of video that finishes frame of video; S222, when said audio frame for finishing audio frame, and said frame of video finishes than said audio frame in advance, then after said frame of video finishes, the audio frame when alternately importing said frame of video and finishing is to the audio frame and the said end frame of video of said end audio frame; When S223, end of output audio frame, when the timestamp of said end audio frame through duration of said end audio frame greater than the predetermined termination time, then abandon the partial data amount that said end audio frame surpasses said predetermined termination time; S224, when the timestamp of said end audio frame greater than the predetermined termination time, then abandon said end audio frame, the previous frame of said end audio frame is defined as new end audio frame, up to confirming to finish audio frame; When the timestamp of said end frame of video greater than the predetermined termination time, then abandon said end frame of video, the previous frame of said end frame of video is defined as new end frame of video, up to confirming to finish frame of video.
In the connection output intent of a kind of video file of the present invention, comprise step: S0 before the said step S1, at least two video files are carried out decoding processing.
The present invention also constructs a kind of connection output device of video file, comprising: timestamp smoothing processing module: be used for decoded at least two video files are carried out the timestamp smoothing processing; Registration process module: be used for said at least two video files after the timestamp smoothing processing are carried out registration process; And synthetic output module: be used for output is encoded, synthesized to said at least two video files after the registration process.
In the connection output device of a kind of video file of the present invention, said timestamp smoothing processing module comprises: the frame of video processing unit: be used for making said frame of video export by preset frame per second through the frame of video of decoded video file being carried out repeating frame or frame losing processing; And audio frame processing unit: be used for making said audio frame align by theoretical timestamp through mending quiet to the audio frame of decoded video file or abandoning corresponding voice data; Said registration process module comprises: superpositing unit alternately: be used for frame of video and audio frame that acquisition time alternately stabs the video file after the smoothing processing; And alignment unit: be used for said frame of video and the alignment of said audio frame; Said alignment unit comprises:
Device: be used for when said audio frame for finishing audio frame, and said audio frame finishes than said frame of video in advance, then after said audio frame finishes, alternately imports quiet data and said frame of video to the video data that finishes frame of video;
Device: be used for being the end audio frame when said audio frame; And said frame of video finishes than said audio frame in advance; Then after said frame of video finishes, the audio frame when alternately importing said frame of video and finishing is to the audio frame and the said end frame of video of said end audio frame;
Device: when being used for the end of output audio frame, when the timestamp of said end audio frame through duration of said end audio frame greater than the predetermined termination time, then abandon the partial data amount that said end audio frame surpasses said predetermined termination time;
Device: be used for when the timestamp of said end audio frame greater than the predetermined termination time, then abandon said end audio frame, the previous frame of said end audio frame is defined as new end audio frame, up to confirming to finish audio frame; When the timestamp of said end frame of video greater than the predetermined termination time, then abandon said end frame of video, the previous frame of said end frame of video is defined as new end frame of video, up to confirming to finish frame of video.
In the connection output device of a kind of video file of the present invention, the connection output device of said video file also comprises: decoder module: be used at least two video files are carried out decoding processing.
Adopt the connection output intent and the device of video file of the present invention, can the video file of a plurality of inputs be connected into a video file output, and can guarantee the playback rate and the synchronization extent of output video and output audio.
Through other timestamp smoothing processing of branch, make frame of video audio frame alignd according to theoretical timestamp by preset frame per second output to frame of video and audio frame.Alternately obtain frame of video and guaranteed that with said audio frame alignment frame of video is consistent with the audio frame broadcasting speed, dislocation can not occur with audio frame and with said frame of video.
Description of drawings
To combine accompanying drawing and embodiment that the present invention is described further below, in the accompanying drawing:
Fig. 1 is the schematic flow sheet of first preferred embodiment of the connection output intent of video file of the present invention;
Fig. 2 is the schematic flow sheet of second preferred embodiment of the connection output intent of video file of the present invention;
Fig. 3 is the schematic flow sheet of the 3rd preferred embodiment of the connection output intent of video file of the present invention;
Fig. 4 is the schematic flow sheet of the 4th preferred embodiment of the connection output intent of video file of the present invention;
Fig. 5 is the schematic flow sheet of the 5th preferred embodiment of the connection output intent of video file of the present invention;
Fig. 6 is the schematic flow sheet of the 6th preferred embodiment of the connection output intent of video file of the present invention;
Fig. 7 is the schematic flow sheet of the 7th preferred embodiment of the connection output intent of video file of the present invention;
Fig. 8 is the structural representation of first preferred embodiment of the connection output device of video file of the present invention;
Fig. 9 is the structural representation of second preferred embodiment of the connection output device of video file of the present invention;
Figure 10 is the structural representation of the 3rd preferred embodiment of the connection output device of video file of the present invention.
Embodiment
In order to make the object of the invention, technical scheme and advantage clearer,, the present invention is further elaborated below in conjunction with accompanying drawing and embodiment.Should be appreciated that specific embodiment described herein only in order to explanation the present invention, and be not used in qualification the present invention.
As shown in Figure 1, in the schematic flow sheet of first preferred embodiment of the connection output intent of video file of the present invention, the connection output intent of said video file starts from step 100; Proceed to step 101 after the step 100, decoded at least two video files are carried out the timestamp smoothing processing; Subsequently, to next step 102, said at least two video files after the timestamp smoothing processing are carried out registration process; Subsequently, to next step 103, output is encoded, synthesized to said at least two video files after the registration process; This method ends at step 104 at last.The connection output intent of video file of the present invention carries out the processing respectively of frame of video and audio frame through the timestamp smoothing processing to decoded video file, reaches the effect that output needs; Make frame of video and the audio frame of video file align each other through registration process and be convenient to coding output, thereby realized the video file of a plurality of inputs is connected into a video file output.
As shown in Figure 2, in the schematic flow sheet of second preferred embodiment of the connection output intent of video file of the present invention, the connection output intent of said video file starts from step 200; Proceed to step 201 after the step 200, make said frame of video export by preset frame per second through the frame of video of decoded video file video file being carried out repeating frame or frame losing processing; Subsequently, to next step 202, make said audio frame align by theoretical timestamp through mending quiet to the audio frame of said decoded video file or abandoning corresponding voice data; Subsequently, to next step 203, said at least two video files after the timestamp smoothing processing are carried out registration process; Subsequently, to next step 204, output is encoded, synthesized to said at least two video files after the registration process; This method ends at step 205 at last.Frame of video is through repeating frame or frame losing, and audio frame is through mending quiet or frame losing reaches frame per second and the theoretical timestamp that output needs, and control is simple, is convenient to realize.
As shown in Figure 3, in the schematic flow sheet of the 3rd preferred embodiment of the connection output intent of video file of the present invention, the step S11 of the connection output intent of said video file starts from step 300; Proceed to step 301 after the step 300, obtain the theoretical timestamp of current video frame and said current video frame; Subsequently, to next step 302 and 303, in the step 302; The timestamp of current video frame is during less than the theoretical timestamp of said current video frame; Through an input video frame duration, turn back to step 301, in the step 303; The timestamp of current video frame is during more than or equal to the theoretical timestamp of said current video frame; Current video frame is set to current output video frame, and the output time of current video frame stabs and to be set to theoretical timestamp, after the step 303; To next step 304; The difference that current video frame and a last video frame time stab is more than or equal to the output video frame duration of twice, and a last frame of video is set to the output video frame between current video frame and the last frame of video, and the output time of going up a frame of video stab be set to the output video frame between a current video frame and the last frame of video theoretical timestamp with the assurance output frame rate; This method ends at step 305 at last.
The video flowing that decoding is come out from decoder device; Often not according to frame per second, but export, and the video flowing that code device need be imported to be imported by frame per second according to timestamp; And some user needs output file to satisfy specific frame per second; Therefore need handle frame of video, make it according to specific frame per second output, processing procedure is following:
1, calculates the theoretical timestamp=present frame sum/frame per second and calculating frame pitch=1/ frame per second of current video frame;
2, obtain current video frame;
If the timestamp of 3 current video frames is less than the theoretical timestamp of current video frame, so through an input video frame duration to obtain next frame, repeating step 2; Like the timestamp of current video frame theoretical timestamp, to step 4 more than or equal to current video frame;
4, the difference of the timestamp of a judgement current video frame and a last frame of video and the relation of 2 times of frame pitch;
If the difference of timestamp is greater than 2 times of frame pitch; Go up a frame of video so and be set to the output video frame between a current video frame and the last frame of video, and the output time of going up a frame of video stabs and to be set to its corresponding theory timestamp to guarantee that output frame rate be to preset frame per second; Current video frame is set to current output video frame simultaneously, and the output time of current video frame stabs the theoretical timestamp that is set to current video frame;
5, through the duration repeating step 1 of a frame pitch.
Whether need frame losing, the frame per second that for example need export to be 1 (also can be other numerals certainly, as 2,3 etc.) through the decision of step 302 and step 303; And the frame per second of input is 2; Promptly 1 second input 2 two field pictures, it is 0 second, 0.5 second, 1 second, 1.5 seconds, 2 seconds that the frame time of input video frame stabs sequence, in the time of 0 second; Obtain 0 second current frame of video; The timestamp of frame of video equals the theoretical timestamp of 0 second frame of video, and frame of video was set to current output video frame in 0 second, and the theory practice that the output time of frame of video is set to 0 second frame of video was stabbed 0 second; Through an input video frame duration, obtain 0.5 second current frame of video, the timestamp of the frame of video of this video is less than the theoretical timestamp of 1 second frame of video; Through returning a last step behind the input video frame duration; Obtain 1 second current frame of video, follow-up with the above, the frame per second that wants to export is 1; Just need abandon timestamp is 0.5 second, 1.5 seconds frame of video.Whether need repeating frame through step 304 decision, for example the frame per second of output is 1 (being to be 1 second the frame of video duration), if the timestamp (meaning of timestamp is to show this frame which second) of the frame of video of output is 1 second for the first time; So in theory; For the second time the timestamp of the frame of video of output is 2 seconds, is 4 like the timestamp of secondary frame of video of reality input, for by the frame per second output video frame; Repeated to export the frame of video of output for the first time at the 2nd, 3 second; Timestamp like secondary frame of video of reality input is 2.2, and the timestamp of revising secondary frame of video of actual input so was 2, exported this frame of video at the 2nd second.This processing method has well been carried out the timestamp smoothing processing to frame of video, makes that frame of video can be by preset frame per second output.
As shown in Figure 4, in the schematic flow sheet of the 4th preferred embodiment of the connection output intent of video file of the present invention, the step S12 of the connection output intent of said video file starts from step 400; Proceed to step 401 after the step 400, obtain the theoretical timestamp of current audio frame and said current audio frame; Subsequently, to next step 402; The timestamp of current audio frame is during less than the theoretical timestamp of said current audio frame; Then current audio frame abandons the data volume in time of difference of timestamp of theoretical timestamp and current audio frame of said current audio frame; Current audio frame is set to current output audio frame, and the output time of current audio frame stabs the theoretical timestamp that is set to said current audio frame; When the timestamp of current audio frame equaled the theoretical timestamp of said current audio frame, current audio frame was set to current output audio frame; When the timestamp of said current audio frame during greater than the theoretical timestamp of said current audio frame; Quiet data in the time of the difference of the timestamp of the additional said current audio frame of then said current audio frame and the theoretical timestamp of said current audio frame; Said current audio frame is set to current output audio frame, and the output time of said current audio frame stabs the theoretical timestamp that is set to said current audio frame.This method ends at step 403 at last.
The audio stream that decoding is come out from decoder device often not according to data volume, but is exported according to timestamp; And the video flowing that code device need be imported will be imported by data volume; And some user needs output file to satisfy specific frame per second, therefore need handle audio frame, makes it to export according to data volume; Handling principle is: the data volume=sample rate * channel number * sampled data output in 1 second of voice playing; Through losing data, mend quiet data, make the two continuous frames voice data satisfy the timestamp of duration (data volume in the data volume of first frame/1 second)=second frame that first frame time stabs the data volume of+the first frame.Processing procedure is following:
1, calculates the data volume in total amount of data/1 second of the theoretical timestamp of current audio frame=current input;
2, obtain current audio frame;
3, the relation of the theoretical timestamp of the timestamp of more current audio frame and current audio frame;
If the timestamp of current audio frame is less than the theoretical timestamp of current audio frame; Current audio frame abandons the data volume in time of difference of timestamp of theoretical timestamp and current audio frame of current audio frame; Current audio frame is set to current output audio frame, and the output time of current audio frame stabs the theoretical timestamp that is set to current audio frame;
If the timestamp of current audio frame equals the theoretical timestamp of current audio frame, current audio frame is set to current output audio frame;
If the timestamp of current audio frame is put into theoretical timestamp greater than current audio frame; Current audio frame replenishes the quiet data of the time of the timestamp of current audio frame and the difference that current audio frame is put into theoretical timestamp; Current audio frame is set to current output audio frame, and the output time of current audio frame stabs and to be set to current audio frame and to put into theoretical timestamp;
4, through repeating step 1 after the duration of current audio frame.
For example sample rate is 48000, and channel number is 2, and sampled data output 2 also with regard to saying that the data volume that voice playing needed in a second is 48000*2*2=192000, if the data total amount of current output is 192000, has just been exported 1 second data.In theory, the timestamp of the audio frame of next input is 1 second, if the timestamp of next frame voice data A is 0.7, will abandon 0.3 second data volume to voice data A so, i.e. the data of 0.3*192000, and alignment back voice data A was since 1 second.If the timestamp of next frame voice data A is 2, the quiet data that need mend so 1 second arrives the head of voice data A, makes A since 1 second, and promptly the head of audio frame A is mended the quiet data of 1*192000.Whether need mend quiet or abandon the operation of corresponding voice data through step 402 decision, make that audio frame can be by theoretical timestamp alignment output audio frame.
As shown in Figure 5, in the schematic flow sheet of the 5th preferred embodiment of the connection output intent of video file of the present invention, the connection output intent of said video file starts from step 500; Proceed to step 501 after the step 500, decoded at least two video files are carried out the timestamp smoothing processing; Subsequently, to next step 502; Alternately acquisition time stabs the frame of video and the audio frame of the video file after the smoothing processing, and with said frame of video and the alignment of said audio frame; Subsequently, to next step 503; Output is encoded, synthesized to said at least two video files after the registration process; This method ends at step 504 at last.Alignment has guaranteed that frame of video is consistent with the audio frame broadcasting speed with audio frame with audio frame and with frame of video alternately to obtain frame of video, dislocation can not occur.
As shown in Figure 6, in the schematic flow sheet of the 6th preferred embodiment of the connection output intent of video file of the present invention, the step S22 of the connection output intent of said video file starts from step 600; Proceed to step 601 after the step 600, when said audio frame for finishing audio frame, and said audio frame finishes than said frame of video in advance, then after said audio frame finishes, alternately imports quiet data and said frame of video to the frame of video that finishes frame of video; Subsequently, to next step 602; When said audio frame for finishing audio frame, and said frame of video finishes than said audio frame in advance, then after said frame of video finishes, the audio frame when alternately importing said frame of video and finishing is to the audio frame and the said end frame of video of said end audio frame; Subsequently; To next step 603; During the end of output audio frame, when the timestamp of said end audio frame through duration of said end audio frame greater than the predetermined termination time, then abandon the partial data amount that said end audio frame surpasses said predetermined termination time; Subsequently, to next step 604, when the timestamp of said end audio frame greater than the predetermined termination time, then abandon said end audio frame, the previous frame of said end audio frame is defined as the audio frame of new end, return step 603; When the timestamp of said end frame of video greater than the predetermined termination time, then abandon said end frame of video, the previous frame of said end frame of video is defined as the frame of video of new end; This method ends at step 605 at last.The registration process of this method is meant: when audio frame finishes in advance, in step 601, after audio frame finishes, alternately import quiet data and current video frame to the video data that finishes frame of video; When frame of video finishes in advance, in step 602, the audio frame when after frame of video finishes, replacing the input video frame end is to audio frame that finishes audio frame and end frame of video.Judge the audio frequency and video of output and the relation of the termination time of being scheduled to then; In step 603; The timestamp that finishes audio frame through duration of end audio frame greater than the predetermined termination time, then abandon the partial data amount that said end audio frame surpasses said predetermined termination time; In step 604, when the timestamp of the audio frame that finishes greater than the predetermined termination time, then abandon the audio frame of end, the previous frame of said end audio frame is defined as new end audio frame; When the timestamp that finishes frame of video greater than the predetermined termination time, then abandon said end frame of video, the previous frame of said end frame of video is defined as new end frame of video, finish audio frame and finish audio frame up to confirming.Such operation has guaranteed that well the broadcast of audio frequency and video is synchronous, the concluding time of the audio frequency and video of having alignd simultaneously and the time that needs to stop.
As shown in Figure 7, in the schematic flow sheet of the 7th preferred embodiment of the connection output intent of video file of the present invention, the connection output intent of said video file starts from step 700; Proceed to step 701 after the step 700, at least two video files are carried out decoding processing; Subsequently, to next step 702, decoded at least two video files are carried out the timestamp smoothing processing; Subsequently, to next step 703, said at least two video files after the timestamp smoothing processing are carried out registration process; Subsequently, to next step 704, output is encoded, synthesized to said at least two video files after the registration process; This method ends at step 705 at last.This method adds the process of decoding processing on original basis, be more convenient for the video file coding of a plurality of inputs to connect into a video file output.
The present invention also constructs a kind of connection output device of video file; As shown in Figure 8; In the structural representation of first preferred embodiment of the connection output device of video file of the present invention; The connection output device of said video file comprises timestamp smoothing processing module 1, registration process module 2 and synthetic output module 3; Timestamp smoothing processing module 1 is used for decoded at least two video files are carried out the timestamp smoothing processing; Registration process module 2 is used for said at least two video files after the timestamp smoothing processing are carried out registration process, and synthetic output module 3 is used for output is encoded, synthesized to said at least two video files after the registration process.The connection output device of video file of the present invention carries out the processing respectively of frame of video and audio frame through the timestamp smoothing processing of timestamp smoothing processing module 1 to decoded video file, reaches the effect that output needs; Registration process through registration process module 2 makes frame of video and the audio frame of video file align each other to be convenient to coding output, thereby has realized the video file of a plurality of inputs is connected into a video file output.
As shown in Figure 9, in the structural representation of second preferred embodiment of the connection output device of video file of the present invention, timestamp smoothing processing module 1 comprises frame of video processing unit 11 and audio frame processing unit 12; Registration process module 2 comprises alternately superpositing unit 21 and alignment unit 22.Frame of video processing unit 11 is used for making said frame of video export by preset frame per second through the frame of video of said video file being carried out repeating frame or frame losing processing; Audio frame processing unit 12 is used for making said audio frame align by theoretical timestamp through mending quiet to the audio frame of said video file or abandoning corresponding voice data; Alternately superpositing unit 21 is used for frame of video and the audio frame that acquisition time alternately stabs the video file after the smoothing processing, and alignment unit 22 is used for said frame of video and the alignment of said audio frame.Frame of video processing unit 11 is through the repeating frame or the frame losing of frame of video, and quiet or frame losing reaches frame per second and the theoretical timestamp that output needs to audio frame processing unit 12 through the benefit of audio frame, and control is simple, is convenient to realize.Alternately superpositing unit 21 alternately obtains frame of video and audio frame, and alignment has guaranteed that frame of video is consistent with the audio frame broadcasting speed to alignment unit 22 with audio frame with frame of video, dislocation can not occur.
Shown in figure 10; In the structural representation of the 3rd preferred embodiment of the connection output device of video file of the present invention; The connection output device of said video file also comprises decoder module 4, and decoder module 4 is used at least two video files are carried out decoding processing.This device adds the process of the decoding processing of decoder module 4 on original basis, be more convenient for the video file coding of a plurality of inputs to connect into a video file output.
The above is merely embodiments of the invention; Be not so limit claim of the present invention; Every equivalent structure transformation that utilizes specification of the present invention and accompanying drawing content to be done, or directly or indirectly be used in other relevant technical fields, all in like manner be included in the scope of patent protection of the present invention.

Claims (7)

1. the connection output intent of a video file is characterized in that, comprises step:
S1, decoded at least two video files are carried out the timestamp smoothing processing;
S2, said at least two video files after the timestamp smoothing processing are carried out registration process;
S3, with said at least two video files after the registration process encode, synthetic output;
Said step S2 comprises:
S21, alternately acquisition time stabs the frame of video and the audio frame of the video file after the smoothing processing;
S22, with the alignment of said frame of video and said audio frame;
Said step S22 comprises:
S221, when said audio frame for finishing audio frame, and said audio frame finishes than said frame of video in advance, then after said audio frame finishes, alternately imports quiet data and said frame of video to the video data that finishes frame of video;
S222, when said audio frame for finishing audio frame, and said frame of video finishes than said audio frame in advance, then after said frame of video finishes, the audio frame when alternately importing said frame of video and finishing is to the audio frame and the said end frame of video of said end audio frame;
When S223, end of output audio frame, when the timestamp of said end audio frame through duration of said end audio frame greater than the predetermined termination time, then abandon the partial data amount that said end audio frame surpasses said predetermined termination time;
S224, when the timestamp of said end audio frame greater than the predetermined termination time, then abandon said end audio frame, the previous frame of said end audio frame is defined as new end audio frame, up to confirming to finish audio frame;
When the timestamp of said end frame of video greater than the predetermined termination time, then abandon said end frame of video, the previous frame of said end frame of video is defined as new end frame of video, up to confirming to finish frame of video.
2. the connection output intent of video file according to claim 1 is characterized in that, said step S1 comprises:
S11, handle and to make said frame of video export by preset frame per second through the frame of video of decoded video file being carried out repeating frame or frame losing;
S12, make said audio frame align by theoretical timestamp through mending quiet to the audio frame of said decoded video file or abandoning corresponding voice data.
3. the connection output intent of video file according to claim 2 is characterized in that, said step S11 comprises:
S111, obtain the theoretical timestamp of current video frame and said current video frame;
S112, when the timestamp of said current video frame during less than the theoretical timestamp of said current video frame, through an input video frame duration, turn back to step S111;
S113, when the timestamp of said current video frame during more than or equal to the theoretical timestamp of said current video frame; Said current video frame is set to current output video frame, and the output time of said current video frame stabs the theoretical timestamp that is set to said current video frame;
S114, the difference of stabbing when said current video frame and a last video frame time are more than or equal to the output video frame duration of twice; A said last frame of video be set to said current video frame and and the difference of the timestamp of current video frame more than or equal to the output video frame between the last frame of video of the output video frame duration of twice, and the output time of a said last frame of video stab be set to the output video frame between said current video frame and the said last frame of video theoretical timestamp with the assurance output frame rate.
4. the connection output intent of video file according to claim 2 is characterized in that, said step S12 comprises:
S121, obtain the theoretical timestamp of current audio frame and said current audio frame;
S122, when the timestamp of said current audio frame theoretical timestamp less than said current audio frame; Then said current audio frame abandons the data volume in time of difference of timestamp of theoretical timestamp and said current audio frame of said current audio frame; Said current audio frame is set to current output audio frame, and the output time of said current audio frame stabs the theoretical timestamp that is set to said current audio frame;
When the timestamp of said current audio frame equals the theoretical timestamp of said current audio frame, said current audio frame is set to current output audio frame;
When the timestamp of said current audio frame theoretical timestamp greater than said current audio frame; Quiet data in the time of the difference of the timestamp of the additional said current audio frame of then said current audio frame and the theoretical timestamp of said current audio frame; Said current audio frame is set to current output audio frame, and the output time of said current audio frame stabs the theoretical timestamp that is set to said current audio frame.
5. the connection output intent of video file according to claim 1 is characterized in that, comprises step before the said step S1:
S0, at least two video files are carried out decoding processing.
6. the connection output device of a video file is characterized in that, comprising:
Timestamp smoothing processing module (1): be used for decoded at least two video files are carried out the timestamp smoothing processing;
Registration process module (2): be used for said at least two video files after the timestamp smoothing processing are carried out registration process; And
Synthetic output module (3): be used for output is encoded, synthesized to said at least two video files after the registration process;
Said timestamp smoothing processing module (1) comprising:
Frame of video processing unit (11): be used for handling, make said frame of video export by preset frame per second through the frame of video of decoded video file being carried out repeating frame or frame losing; And
Audio frame processing unit (12): be used for making said audio frame align by theoretical timestamp through mending quiet to the audio frame of decoded video file or abandoning corresponding voice data;
Said registration process module (2) comprising:
Superpositing unit (21) alternately: be used for frame of video and audio frame that acquisition time alternately stabs the video file after the smoothing processing; And
Alignment unit (22): be used for said frame of video and the alignment of said audio frame; Said alignment unit comprises:
Device: be used for when said audio frame for finishing audio frame, and said audio frame finishes than said frame of video in advance, then after said audio frame finishes, alternately imports quiet data and said frame of video to the video data that finishes frame of video;
Device: be used for being the end audio frame when said audio frame; And said frame of video finishes than said audio frame in advance; Then after said frame of video finishes, the audio frame when alternately importing said frame of video and finishing is to the audio frame and the said end frame of video of said end audio frame;
Device: when being used for the end of output audio frame, when the timestamp of said end audio frame through duration of said end audio frame greater than the predetermined termination time, then abandon the partial data amount that said end audio frame surpasses said predetermined termination time;
Device: be used for when the timestamp of said end audio frame greater than the predetermined termination time, then abandon said end audio frame, the previous frame of said end audio frame is defined as new end audio frame, up to confirming to finish audio frame; When the timestamp of said end frame of video greater than the predetermined termination time, then abandon said end frame of video, the previous frame of said end frame of video is defined as new end frame of video, up to confirming to finish frame of video.
7. the connection output device of video file according to claim 6 is characterized in that, the connection output device of said video file also comprises:
Decoder module (4): be used at least two video files are carried out decoding processing.
CN 201010516318 2010-10-22 2010-10-22 Method and device for connecting and outputting video files Expired - Fee Related CN101996662B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201010516318 CN101996662B (en) 2010-10-22 2010-10-22 Method and device for connecting and outputting video files

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201010516318 CN101996662B (en) 2010-10-22 2010-10-22 Method and device for connecting and outputting video files

Publications (2)

Publication Number Publication Date
CN101996662A CN101996662A (en) 2011-03-30
CN101996662B true CN101996662B (en) 2012-08-08

Family

ID=43786691

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201010516318 Expired - Fee Related CN101996662B (en) 2010-10-22 2010-10-22 Method and device for connecting and outputting video files

Country Status (1)

Country Link
CN (1) CN101996662B (en)

Families Citing this family (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102932673B (en) * 2011-08-11 2015-08-19 阿里巴巴集团控股有限公司 The transmission synthetic method of a kind of vision signal and audio signal, system and device
CN103248950A (en) * 2013-04-28 2013-08-14 天脉聚源(北京)传媒科技有限公司 System and method for customizing video frame rate
CN103747287B (en) * 2014-01-13 2015-09-23 合一网络技术(北京)有限公司 Be applied to the method and system of the video playout speed adjustment of flash
CN105280205B (en) * 2014-05-30 2018-03-16 深圳锐取信息技术股份有限公司 Non-linear editing software audio-visual synchronization processing method and processing device
CN104980794A (en) * 2015-06-30 2015-10-14 北京金山安全软件有限公司 Video splicing method and device
CN105049856A (en) * 2015-07-14 2015-11-11 无锡天脉聚源传媒科技有限公司 Method and device for processing video file
CN105578261B (en) * 2015-12-18 2019-04-26 无锡天脉聚源传媒科技有限公司 A kind of method and apparatus of video clipping
CN105578260A (en) * 2015-12-18 2016-05-11 无锡天脉聚源传媒科技有限公司 Video editing method and device
CN105592321A (en) * 2015-12-18 2016-05-18 无锡天脉聚源传媒科技有限公司 Method and device for clipping video
CN105791938B (en) * 2016-03-14 2019-06-21 腾讯科技(深圳)有限公司 The joining method and device of multimedia file
CN107040784B (en) * 2017-03-22 2020-12-15 深圳市中航世星科技有限公司 Video buffering processing method, system and device
CN108540732B (en) * 2018-05-07 2020-09-04 广州酷狗计算机科技有限公司 Method and device for synthesizing video
CN108737807B (en) * 2018-05-10 2020-05-26 Oppo广东移动通信有限公司 Data processing method, terminal, server and computer storage medium
CN109903752B (en) 2018-05-28 2021-04-20 华为技术有限公司 Method and device for aligning voice
CN112995720B (en) * 2019-12-16 2022-11-18 成都鼎桥通信技术有限公司 Audio and video synchronization method and device
CN112437325A (en) * 2020-11-23 2021-03-02 杭州当虹科技股份有限公司 8KSDI signal generator implementation method
CN112929713B (en) * 2021-02-07 2024-04-02 Oppo广东移动通信有限公司 Data synchronization method, device, terminal and storage medium
CN113259738B (en) * 2021-05-08 2022-07-29 广州市奥威亚电子科技有限公司 Audio and video synchronization method and device, electronic equipment and storage medium
CN113329255A (en) * 2021-06-02 2021-08-31 重庆锐明信息技术有限公司 Multi-channel video synchronous playing method, system and medium based on browser
CN113390452B (en) * 2021-06-16 2023-08-18 北京康斯特仪表科技股份有限公司 Method and device for calibrating switch type instrument
CN113507637A (en) * 2021-07-13 2021-10-15 北京字跳网络技术有限公司 Media file processing method, device, equipment, readable storage medium and product

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101207809A (en) * 2006-12-19 2008-06-25 浙江工业大学 Method and system for transmitting real time flow media based on video frequency frame splitting
CN101312530A (en) * 2007-05-24 2008-11-26 中兴通讯股份有限公司 Method and apparatus for smoothing transmission code rate of time division stream media
CN101312534A (en) * 2007-05-23 2008-11-26 中兴通讯股份有限公司 Code rate smoothing method and apparatus of time division stream media
CN101771869A (en) * 2008-12-30 2010-07-07 深圳市万兴软件有限公司 AV (audio/video) encoding and decoding device and method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101207809A (en) * 2006-12-19 2008-06-25 浙江工业大学 Method and system for transmitting real time flow media based on video frequency frame splitting
CN101312534A (en) * 2007-05-23 2008-11-26 中兴通讯股份有限公司 Code rate smoothing method and apparatus of time division stream media
CN101312530A (en) * 2007-05-24 2008-11-26 中兴通讯股份有限公司 Method and apparatus for smoothing transmission code rate of time division stream media
CN101771869A (en) * 2008-12-30 2010-07-07 深圳市万兴软件有限公司 AV (audio/video) encoding and decoding device and method

Also Published As

Publication number Publication date
CN101996662A (en) 2011-03-30

Similar Documents

Publication Publication Date Title
CN101996662B (en) Method and device for connecting and outputting video files
CN102226944B (en) Audio mixing method and equipment thereof
CN102055966B (en) Compression method and system for media file
TWI476761B (en) Audio encoding method and system for generating a unified bitstream decodable by decoders implementing different decoding protocols
CN101605252B (en) Method and system for converting program stream into transport stream
CN101895750B (en) Set-top box and PC-oriented real-time streaming media server and working method
CN104284241B (en) A kind of video clipping method and device
CN107667400B (en) Segment aligned audio coding
CN100579236C (en) Audio coding/decoding method and device
CN109218794B (en) Remote operation guidance method and system
CN105611317A (en) Video-audio transcoding device and method capable of supporting audio unvarnished transmission
CN101578654A (en) Apparatus and method for restoring multi-channel audio signal using he-aac decoder and mpeg surround decoder
CN106796797A (en) Transmission equipment, sending method, receiving device and method of reseptance
CN107404648B (en) A kind of multi-channel video code-transferring method based on HEVC
KR20160060686A (en) Audio decoder, apparatus for generating encoded audio output data and methods permitting initializing a decoder
CN102291399B (en) Streaming media switching platform
CN102915736B (en) Mixed audio processing method and stereo process system
Wieckowski et al. A complete end to end open source toolchain for the versatile video coding (VVC) standard
CN109640162A (en) Code stream conversion method and system
CN103177725B (en) Method and device for transmitting aligned multichannel audio frequency
CN102256128B (en) Synchronous decoding method and device
MX2022007136A (en) Video data stream, video encoder, apparatus and methods for a hypothetical reference decoder and for output layer sets.
CN101695133A (en) Video encoding and decoding method, system and encoder for backwards compatible simulcast of low-resolution/high-resolution programs
CA2431063A1 (en) Method and apparatus for adaptive bit rate control in an asynchronized encoding system
CN102752400A (en) Multiplicity speed security transmission method of inter-network audio file and system thereof

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C56 Change in the name or address of the patentee

Owner name: SHENZHEN WONDERSHARE INFORMATION TECHNOLOGY CO., L

Free format text: FORMER NAME: SHENZHEN WONDERSHARE SOFTWARE CO., LTD.

CP03 Change of name, title or address

Address after: 518057 Guangdong city of Shenzhen province Nanshan District Gao Xin Road, room 9 building on the north side of block A901 No. 006 TCL Industry Research Institute building A A Building 8 floor

Patentee after: SHENZHEN WONDERSHARE INFORMATION TECHNOLOGY Co.,Ltd.

Address before: Room 9, block A901 building on the north side of a building 518057 North TCL A of Guangdong Province, Shenzhen city Nanshan District South Road West ten high new technology

Patentee before: WONDERSHARE SOFTWARE Co.,Ltd.

CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: 850000 Tibet autonomous region, Lhasa City, New District, west of the East Ring Road, 1-4 road to the north, south of 1-3 Road, Liu Dong building, east of the 8 unit 6, floor 2, No.

Patentee after: WONDERSHARE TECHNOLOGY CO.,LTD.

Address before: 518057 Guangdong city of Shenzhen province Nanshan District Gao Xin Road, room 9 building on the north side of block A901 No. 006 TCL Industry Research Institute building A A Building 8 floor

Patentee before: SHENZHEN WONDERSHARE INFORMATION TECHNOLOGY Co.,Ltd.

CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20120808