Summary of the invention
The embodiment of the present invention provides a kind of video file code-transferring method, and the video file that the video monitoring equipment being intended to solve different vendor is recorded can only be play in corresponding player, and can not unify the problem of broadcasting in same player.
The embodiment of the present invention is achieved in that a kind of video file code-transferring method, and described method comprises the steps:
Import the video file treating transcoding;
Intercept the privately owned frame originating point information of video file, judge whether described video file source is known according to described privately owned frame originating point information;
Standard code process is carried out to the known video file in source, exports the data after transcoding.
Further, described the step that the known video file in source carries out standard code process specifically to be comprised:
Extract the information in the privately owned frame head of source known video file, privately owned frame head is removed;
The frame information of the video file removing privately owned frame head is analyzed;
Judge whether described frame information is standard code form, is, continue to extract next frame information and analyze, until analyze complete video file, otherwise first the number of times of profiling error is added 1, then continuation extraction next frame information is analyzed;
When cumulative errors number exceedes setting threshold, video file is converted to yuv format video file.
Further, described when cumulative errors number exceedes threshold value, step video file being converted to yuv format video file specifically comprises:
Again video file is imported;
Call the SDK of the equipment vendors recording described video file;
Utilize described SDK that this decode video files is become yuv format video file.
Further, described method also comprises:
When video file source is unknown, video file is converted to yuv format video file.
Further, when video file source is unknown, step video file being converted to yuv format video file specifically comprises:
Call the equipment vendors recording described video file and carry video file described in player plays;
To the continuous sectional drawing of picture in playing process;
Sectional drawing is generated yuv format video file.
Further, described method also comprises:
Described yuv format video file is carried out standard code.
The embodiment of the present invention additionally provides a kind of video file transcoding device, and described device comprises:
Video file imports unit, for importing the video file treating transcoding;
According to described privately owned frame originating point information, source video sequence judging unit, for intercepting the privately owned frame originating point information of video file, judges whether described video file source is known;
Standard code processing unit, for carrying out standard code process to the known video file in source, exports the data after transcoding.
Further, described standard code processing unit comprises:
Privately owned frame head removes module, for extracting the information in the privately owned frame head of source known video file, is removed by privately owned frame head;
Frame information analysis module, for analyzing the frame information of the video file removing privately owned frame head;
Coded format judge module, for judging whether described frame information is standard code form, is, continuing to extract next frame information and analyzing, until analyze complete video file, otherwise first the number of times of profiling error is added 1, then continuation extraction next frame information is analyzed;
Coded format modular converter, for when cumulative errors number exceedes setting threshold, converts yuv format video file to by video file.
Further, described coded format modular converter comprises:
SDK calls submodule, for calling the SDK of the equipment vendors recording described video file;
Decoding sub-module, becomes yuv format video file for utilizing described SDK by this decode video files.
Further, described device also comprises:
Video format conversion unit, for when video file source is unknown, converts yuv format video file to by video file.
Further, described video format conversion unit comprises:
Player calling module, carries video file described in player plays for calling the equipment vendors recording described video file;
Screen capture module, in playing process to the continuous sectional drawing of picture;
Format converting module, for generating yuv format video file by sectional drawing.
Further, described device also comprises:
Yuv format coding unit, for carrying out standard code by described yuv format video file.
In embodiments of the present invention, transcoding can be unified to the video file in the non-standard encoded video file in the Standard encoded video file in known source, known source and unknown source, the video file recorded from the equipment of distinct device manufacturer is after transcoding, can play in same player, no longer rely on the matching used player of equipment vendors, this also reduces the problem of the playback error produced because of the Equipment of manufacturer.
Embodiment
In order to make object of the present invention, technical scheme and advantage clearly understand, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein only in order to explain the present invention, be not intended to limit the present invention.
The embodiment of the present invention unifies transcoding to the Standard encoded video file in known source, the non-standard encoded video file in known source and unknown video file of originating, video file after transcoding can carry out unifying to play in same player, is no longer dependent on the matching used player of equipment vendors.
Fig. 1 shows the realization flow of the video file code-transferring method that the embodiment of the present invention provides, and details are as follows:
In step S101, import the video file treating transcoding;
In step s 102, intercept the privately owned frame originating point information of video file, judge whether video file source is known according to this privately owned frame originating point information;
In step s 103, standard code process is carried out to the known video file in source, exports the data after transcoding.
In embodiments of the present invention, judge whether known video file originates according to the result after the information in privately owned frame originating point information and keyword message storehouse contrasts, keyword message storehouse is that the privately owned frame head of video file by recording the equipment of all known manufacturers is analyzed, and the keyword message obtaining privately owned frame head is formed.
As one embodiment of the present of invention, the step of video file being carried out to standard code process is specially:
1, extract the information in the privately owned frame head of source known video file, privately owned frame head is removed;
2, the frame information of the video file removing privately owned frame head is analyzed;
3, whether judgment frame information is standard code form, is, returns and performs step 2, continues to extract next frame information and analyzes, until analyze complete video file, otherwise the number of times of profiling error is added 1, then returns execution step 2, continue to extract next frame information and analyze;
4, when cumulative errors number exceedes setting threshold, video file is converted to yuv format video file;
5, yuv format video file is carried out standard code.
In embodiments of the present invention, be non-standard coded format for small part frame information, most of frame information is the video file of standard coding format, and namely cumulative errors number does not exceed setting threshold, do not affect the video file of viewing, be considered as Standard encoded video file to process yet.
As a preferred embodiment of the present invention, when cumulative errors number exceedes the threshold value of setting, by the concrete steps that the known noncanonical format video file in source carries out standard code be:
1, the video file again imported;
2, the SDK (SoftwareDevelopment Kit, SDK) of the equipment vendors recording this video file is called;
3, utilize the SDK called that this decode video files is become yuv format video file;
4, yuv format video file is carried out standard code.
As a preferred embodiment of the present invention, standard code can also be carried out to the video file that source is unknown.
The step of the video file that source is unknown being carried out to standard code is specially:
1, call the equipment vendors recording this video file and carry this video file of player plays;
2, in playing process to the continuous sectional drawing of picture;
3, sectional drawing is generated yuv format video file;
4, the yuv format video file of generation is carried out standard code.
Fig. 2 shows the realization flow of the different coding format video file consolidation transcoding that the embodiment of the present invention provides, and details are as follows:
In step s 201, the video file treating transcoding is imported;
In step S202, intercept the privately owned frame originating point information of video file, judge whether video file source is known, is perform step S203 according to this privately owned frame originating point information, otherwise perform step S215;
In step S203, extract the information of the privately owned frame head of video file;
In step S204, remove the privately owned frame head after the information of extraction;
In step S205, judging whether that all data of the video file removing privately owned frame head all complete by analysis, is perform step S214, otherwise performs step S206;
In step S206, extract the frame information removing the video file of privately owned frame head;
In step S207, the frame information extracted is analyzed;
In step S208, judge whether this video file is standard coding format, is according to frame information, return and perform step S205, otherwise perform step S209;
In step S209, whether the accumulative frequency of discriminatory analysis mistake exceedes the threshold value of setting, is, performs step S210, otherwise errors number is added 1, then returns execution step S205;
In step S210, again import video file;
In step S211, call the SDK decoding of the equipment vendors recording this video file;
In step S212, this decode video files is become the video file of yuv format;
In step S213, the video file of yuv format is carried out standard code;
In step S214, export the data after transcoding;
In step S215, this video file of player plays that the equipment vendors of calling this video file of recording carry;
In step S216, when playing, continuous sectional drawing is carried out to picture;
In step S217, sectional drawing is generated the video file of yuv format.
Specifically show that different-format video file of the present invention unifies the realization flow of transcoding below by way of an example, the video file recorded for the equipment of certain equipment vendors is described.
Before implementing the present invention, first the privately owned frame head of the video file that the equipment of known device manufacturer is recorded is analyzed, obtain the keyword message of these equipment vendors, form keyword message storehouse.Assuming that the information of having deposited in current information bank is " the large China of DHAV ", and to set wrong accumulative frequency threshold value be 5.
As one embodiment of the present of invention, the step of the known Standard encoded video file in source being carried out to transcoding is:
1, will treat that the video file of transcoding imports, intercept the partial information of the privately owned frame head of video file, obtain information " DHAV ", compare with the information in keyword message storehouse, can be judged as utilizing the video file that the equipment of great Hua equipment vendors is recorded;
2, extract the temporal information in privately owned frame head, privately owned frame head is removed;
3, the frame information of the video file after removing privately owned frame head is analyzed;
4, through judging that video code model is standard coding format, returning and performing step 3, until analyze complete video file;
5, the data after transcoding are exported.
In embodiments of the present invention, be non-standard coded format for small part frame information, most of frame information is the video file of standard coding format, and namely cumulative errors number does not exceed setting threshold, do not affect the video file of viewing, be considered as Standard encoded video file to process yet.
As one embodiment of the present of invention, the step of the known non-standard encoded video file in source being carried out to transcoding is:
1, will treat that the video file of transcoding imports, intercept the partial information of the privately owned frame head of video file, obtain information " DHAV ", compare with the information in keyword message storehouse, can be judged as utilizing the video file that the equipment of great Hua equipment vendors is recorded;
2, extract the temporal information in privately owned frame head, privately owned frame head is removed;
3, the frame information of the video file after removing privately owned frame head is analyzed;
4, through judging that video code model is not standard coding format, the number of profiling error being added 1, and returns step 3;
5, when cumulative error number reaches 5, no longer frame information analysis is carried out to this video file, video file is imported again;
6, call the SDK decoding of great Hua equipment vendors, decode video files is become yuv format video file, then standard code is carried out to yuv format video file;
7, the data after transcoding are exported.
As one embodiment of the present of invention, the step of the video file that source is unknown being carried out to transcoding is:
1, will treat that the video file of transcoding imports, intercept the partial information of the privately owned frame head of video file, obtain information " 4HKH ", compare with the information in keyword message storehouse, the video file of the equipment recording being which equipment vendors cannot be judged;
The player that the equipment vendors of 2, calling this video file processed of record carry, plays this video file;
3, in playing process to the continuous sectional drawing of picture;
4, sectional drawing is generated yuv format video file;
5, generated yuv format video file is carried out standard code;
6, the data after transcoding are exported.
Fig. 3 shows the structure of the video file transcoding device that the embodiment of the present invention provides, and for convenience of explanation, illustrate only the part relevant to the embodiment of the present invention.
Video file imports unit 31 and imports the video file treating transcoding.
Source video sequence judging unit 32 intercepts the privately owned frame originating point information that video file imports the video file that unit 31 imports, and judges whether video file source is known according to privately owned frame originating point information.
As one embodiment of the present of invention, judge whether known video file originates according to the result after the information in privately owned frame originating point information and keyword message storehouse contrasts, keyword message storehouse is that the privately owned frame head of video file by recording the equipment of known manufacturer analyzes rear formation.
Standard code processing unit 33 carries out standard code process to the known video file in source, exports the data after transcoding.
As one embodiment of the present of invention, this video file transcoding device also comprises:
Video format conversion unit 34, when video file source is unknown, converts yuv format video file to by video file.
As one embodiment of the present of invention, this video file transcoding device also comprises:
Yuv format coding unit 35, carries out standard code by the yuv format video file that standard code processing unit 33 or video format conversion unit 34 generate.
Fig. 4 shows the structure of the standard code processing unit that the embodiment of the present invention provides, and for convenience of explanation, illustrate only the part relevant to the embodiment of the present invention.
In embodiments of the present invention, standard code processing unit comprises the removal of privately owned frame head module 41, frame information analysis module 42, coded format judge module 43 and coded format modular converter 44.
Privately owned frame head is removed module 41 and is extracted the information of originating in the privately owned frame head of known video file, is removed by privately owned frame head.
Frame information analysis module 42 is analyzed the frame information removing the video file of privately owned frame head through privately owned frame head removal module 41.
According to the result that frame information analysis module 42 is analyzed, coded format judge module 43 judges whether this frame information is standard code form, continue to extract next frame information and analyze, until analyze complete video file, otherwise the number of times of first profiling error is added 1, then continuation extraction next frame information is analyzed.
Coded format modular converter 44, when cumulative errors number exceedes setting threshold, converts yuv format video file to by video file.
In embodiments of the present invention, coded format modular converter 44 comprises SDK and calls submodule 441 and decoding sub-module 442.
SDK calls the SDK that submodule 441 calls the equipment vendors of recorded video file.
This decode video files is become yuv format video file by the SDK that decoding sub-module 442 utilizes SDK calling module 441 to call.
Fig. 5 shows the structure of the video format conversion unit that the embodiment of the present invention provides, and for convenience of explanation, illustrate only the part relevant to the embodiment of the present invention.
In embodiments of the present invention, video format conversion unit comprises player calling module 51, screen capture module 52 and format converting module 53.
The equipment vendors that player calling module 51 calls recorded video file carry player plays video file.
Screen capture module 52 in playing process to the continuous sectional drawing of picture.
The picture that format converting module 53 screen capture module 52 intercepts generates yuv format video file.
In embodiments of the present invention, transcoding can be unified to the video file in the non-standard encoded video file in the Standard encoded video file in known source, known source and unknown source, the video file recorded from the equipment of distinct device manufacturer is after transcoding, can play in same player, no longer rely on the matching used player of equipment vendors, this also reduces the problem of the playback error produced because of the Equipment of manufacturer.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, all any amendments done within the spirit and principles in the present invention, equivalent replacement and improvement etc., all should be included within protection scope of the present invention.