CN106034252B - A kind of Streaming Media processing method and processing device - Google Patents

A kind of Streaming Media processing method and processing device Download PDF

Info

Publication number
CN106034252B
CN106034252B CN201510110136.2A CN201510110136A CN106034252B CN 106034252 B CN106034252 B CN 106034252B CN 201510110136 A CN201510110136 A CN 201510110136A CN 106034252 B CN106034252 B CN 106034252B
Authority
CN
China
Prior art keywords
frame
decoded
video
data
configuration information
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.)
Active
Application number
CN201510110136.2A
Other languages
Chinese (zh)
Other versions
CN106034252A (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.)
Shenzhen Tencent Computer Systems Co Ltd
Original Assignee
Shenzhen Tencent Computer Systems 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 Tencent Computer Systems Co Ltd filed Critical Shenzhen Tencent Computer Systems Co Ltd
Priority to CN201510110136.2A priority Critical patent/CN106034252B/en
Publication of CN106034252A publication Critical patent/CN106034252A/en
Application granted granted Critical
Publication of CN106034252B publication Critical patent/CN106034252B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The embodiment of the present invention provides a kind of Streaming Media processing method and processing device, method therein can include: obtains the video frame in video flowing to be decoded, the video frame includes data frame and non-data frame;Frame selection processing is carried out to the video frame, extracts the data frame in the video flowing;The media file head data in the video flowing are parsed, video configuration information is obtained;The obtained data frame will be extracted and be integrated into code stream to be decoded, and processing is decoded to the code stream to be decoded using the video configuration information.The present invention can treat decoded video streams and be extracted and integrated again, reduce the frame type in code stream to be decoded, and raising is decoded into power, enhancing compatibility.

Description

A kind of Streaming Media processing method and processing device
Technical field
The present invention relates to electronic technology fields, and in particular to streaming Media Technology field, especially a kind of Streaming Media processing Method and device.
Background technique
With the development of stream media technology, user all can be by various device plays videos, usual video playing by Video flowing to be decoded is decoded broadcasting, is that original video file needs to form video flowing to be played after coding, to Playing video flowing is video flowing to be decoded.Current major video coded format is H264, and 32 kinds of differences are defined in H264 Frame type, data frame and non-data frame can be divided into this 32 kinds of frame types.Wherein, comprising each in video in data frame The data of image, non-data frame include that video configuration information injects between non-data frame in video flowing to be decoded in H264 algorithm Video frame is formed between each data frame.When treating decoded video streams and being decoded processing, decoder allows for adapting to institute Some frame types can be successfully decoded, but since equipment type is different, it is understood that there may be many compatibility issues, example Such as, the chip in the equipment of some types can not the frame to some type carry out identification decoding, just will appear decoding error, from And cause video that can not play.
Summary of the invention
The embodiment of the present invention provides a kind of Streaming Media processing method and processing device, can treat decoded video streams and be extracted again And integration, the frame type in code stream to be decoded is reduced, raising is decoded into power, enhancing compatibility.
First aspect present invention provides a kind of Streaming Media processing method, it may include:
The video frame in video flowing to be decoded is obtained, the video frame includes data frame and non-data frame;
Frame selection processing is carried out to the video frame, extracts the data frame in the video flowing;
The media file head data in the video flowing are parsed, video configuration information is obtained;
The obtained data frame will be extracted and be integrated into code stream to be decoded, and using the video configuration information to it is described to Decoded bit stream is decoded processing.
Second aspect of the present invention provides a kind of Streaming Media processing unit, it may include:
First obtains module, and for obtaining the video frame in video flowing to be decoded, the video frame includes data frame and non- Data frame;
Extraction module extracts the data frame in the video flowing for carrying out frame selection processing to the video frame;
Parsing module obtains video configuration information for parsing the media file head data in the video flowing;
Decoder module is integrated, is integrated into code stream to be decoded for the obtained data frame will to be extracted, and utilize the view Frequency configuration information is decoded processing to the code stream to be decoded.
The implementation of the embodiments of the present invention has the following beneficial effects:
The embodiment of the present invention obtains the video frame in code stream to be decoded, which includes data frame and non-data frame, right The video frame carries out frame selection processing, extracts the data frame in video flowing, parses the media file head data in the video flowing, obtain Video configuration information is taken, obtained data frame will be extracted and be integrated into code stream to be decoded, and using video configuration information to be decoded Code stream is decoded processing.This mode can carry out the video frame in video flowing to be decoded again before being decoded It extracts and integration, the data frame retained in video frame improves successfully decoded to reduce the frame type in code stream to be decoded Rate, enhancing compatibility.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with It obtains other drawings based on these drawings.
Fig. 1 is a kind of flow chart of Streaming Media processing method provided in an embodiment of the present invention;
Fig. 2 is the flow chart of another Streaming Media processing method provided in an embodiment of the present invention;
Fig. 3 is video flow processing flow chart in a kind of browser provided in an embodiment of the present invention;
Fig. 4 is that a kind of frame provided in an embodiment of the present invention selects flow chart;
Fig. 5 is a kind of structural schematic diagram of Streaming Media processing unit provided in an embodiment of the present invention;
Fig. 6 is a kind of structural schematic diagram for integrating decoder module provided in an embodiment of the present invention;
Fig. 7 is the structural schematic diagram of another Streaming Media processing unit provided in an embodiment of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall within the protection scope of the present invention.
The Streaming Media processing method of the embodiment of the present invention can be applied to user and utilize smart phone, PC, individual Media playback software in the terminals such as digit aid plays in the scene of video, also can be applied to user and plays in a browser In the application scenarios of video.In specific application scenarios, when treating decoded video streams and being decoded, hardware solution can be carried out Code is that multi-media processing unit in the chip using terminal is decoded, and also can use software decoding, is programming It is decoded by primary processor.Usual hardware decodes meeting so that playing video more power saving and smoothness, therefore in concrete application In generally use hardware decoding.It is not that every kind of terminal can steadily support hardware since various terminals type is different Decoding.It is H264 in the video code model of current main-stream, 32 kinds of different frame types is defined in H264, it is hard in terminal Part decoder, which should can adapt to all frame types, steadily hardware to be supported to decode, and due to the chip of different brands, add The open system of upper Android treats decoded video streams there may be compatibility issue, shows as decoding abnormal, and picture has greatly The mosaic phenomenon of block, will lead in some cases can not decode stuck, even result in hardware crashes etc., ask to solve this Topic, the present invention treat decoded video streams and carry out Streaming Media processing before treating decoded video streams and being decoded, and are using this The Streaming Media processing method that invention provides is decoded again after extracting filtering.It can reduce in video flowing to be decoded in this way Frame type, raising is decoded into power, and enhances the decoded compatibility of hardware.
Below in conjunction with attached drawing 1- attached drawing 4, describe in detail to Streaming Media processing method provided in an embodiment of the present invention.
Fig. 1 is please referred to, is a kind of flow chart of Streaming Media processing method provided in an embodiment of the present invention;This method may include Following steps S100- step S103.
S100, obtains the video frame in video flowing to be decoded, and the video frame includes data frame and non-data frame;
In specific embodiment, video flowing to be decoded is the video flowing after being encoded, and when needing to play video, is needed pair Video flowing after being encoded is decoded processing.In video flowing to be decoded include media file head data and video frame, Middle video frame includes data frame and non-data frame, includes image data in data frame, and non-data frame includes video configuration information.Example Such as, 32 kinds of different frame types are defined in current major video coded format H264, in this 32 kinds different frame types, It is also classified into data frame and non-data frame, wherein for data frame packet containing key frame and prediction frame, key frame is refreshed image immediately (instantaneous decoding refresh picture, IDR) frame, prediction frame are non every IDR frame, and non-data frame includes Frame type it is relatively more, for example, sequence parameter set (sequence parameter set, SPS) frame, picture parameter set (picture parameter set, PPS) frame, supplemental enhancement information (Supplemental Enhancement Information, SEI) frame and access unit delimiter (access unit delimiter, AUD) frame etc..
S101 carries out frame selection processing to the video frame, extracts the data frame in the video flowing;
In specific embodiment, when treating decoded video streams and being decoded processing, decoder should can adapt to all Frame type can be successfully decoded, but in a decoder, due to the chip of different brands, in addition the open system of Android System, treating decoded video streams, there may be compatibility issues.Certain some frame type can not be decoded normally, be embodied in Decode abnormal, picture has the mosaic phenomenon of bulk, and in some cases, will lead to can not decode stuck, results even in hard Part collapse.Therefore, in embodiments of the present invention, before carrying out hardware decoding process, the video in decoded video streams is first treated Frame carries out frame selection processing, extracts the data frame in video flowing comprising image data.
It optionally, is to be mentioned first every IDR frame since the video frame of video flowing to be decoded in H264 coded format Every IDR frame and non every IDR frame all in video frame are taken, SPS frame and PPS frame therein are removed, selects filtration treatment carrying out frame Afterwards, reduce frame type, be decoded into power to improve.
S102 parses the media file head data in the video flowing, obtains video configuration information;
In specific embodiment, before carrying out specific decoding process, need to parse the media file head number in video flowing According to media file head data are present in the head information of video file.Media file head data in parsing video flowing can obtain Take video configuration information.The video configuration information can be used for it is subsequent be decoded processing during.
S103 will extract the obtained data frame and be integrated into code stream to be decoded, and utilizes the video configuration information pair The code stream to be decoded is decoded processing.
In specific embodiment, after carrying out frame selection processing, extracted data frame is integrated into code stream to be decoded, specifically Integration method can be to be integrated according to original sequence of extracted data frame.And using by parsing media in video flowing Video configuration information acquired in file header data treats decoded bit stream and is decoded processing.
Optionally, treating decoded bit stream to be decoded processing using video configuration information may include step S10-S11:
S10 initializes hardware decoder using the video configuration information;
In specific embodiment, before being decoded processing using hardware decoder, believed using acquired video configuration Breath initializes hardware decoder.It should be noted that if the data of video configuration information are H264 agreements there are format Specified in bytestream format, need to convert data to ISO-IEC-14496-12, specified in ISO-IEC-14496-15 Format, this format are that hardware decoder initializes the format used.
S11 controls the hardware decoder initialized and is decoded processing to the code stream to be decoded.
In specific embodiment, after carrying out initialization process to hardware decoder using video configuration information, control is carried out just The hardware decoder of beginningization treats decoded bit stream and is decoded processing.
It should be noted that when Dragging movement occurs in user, such as F.F. or rewind, then by final dilatory stopping Starting point of the key frame of time point recently as video flowing to be decoded, carries out frame selection since the video flowing at the time point Processing, is finally integrated into code stream to be decoded for extracted data frame.
The embodiment of the present invention obtains the video frame in code stream to be decoded, which includes data frame and non-data frame, right The video frame carries out frame selection processing, extracts the data frame in video flowing, parses the media file head data in the video flowing, obtain Video configuration information is taken, obtained data frame will be extracted and be integrated into code stream to be decoded, and using video configuration information to be decoded Code stream is decoded processing.This mode can carry out the video frame in video flowing to be decoded again before being decoded It extracts and integration, the data frame retained in video frame improves successfully decoded to reduce the frame type in code stream to be decoded Rate, enhancing compatibility.
It referring to figure 2., is the flow chart of another Streaming Media processing method provided in an embodiment of the present invention;This method can wrap Include following steps S200- step S206.
Whether S200 obtains video file to be decoded, and judge the data in the video file to be decoded with byte stream Form exists;
If so, the data in the video file to be decoded are determined as video flowing to be decoded;
If it is not, then the video file to be decoded is formatted, obtain in the form of byte stream existing for it is to be decoded Video flowing.
In specific embodiment, before carrying out frame selection processing, video file to be decoded is obtained, which is to carry out Video file after coded treatment, each frame type of video frame is in different file formats with different shapes in video file Formula exists, for example, it may be possible to be with format specified in ISO-IEC-14496-15, it is also possible to byte specified in H264 agreement Stream format, due to carrying out the process of frame selection processing in the embodiment of the present invention primarily directed in the data of bytestream format, because This needs to judge whether the data in the video file to be decoded exist in the form of byte stream, if video file to be decoded is with word Throttling form exists, then data in video flowing to be decoded is directly determined as video flowing to be decoded.If video file to be decoded is not Be in the form of byte stream exist, then the video file is formatted, obtain in the form of byte stream existing for view to be decoded Frequency flows, and specific conversion method is not construed as limiting.
S201, obtains the video frame in video flowing to be decoded, and the video frame includes data frame and non-data frame;
Optionally, the data frame includes key frame and prediction frame;It include multiple framings in the video frame, wherein each A framing includes a key frame and at least one prediction frame.
The building form of each frame can be in specific embodiment, in video frame is combined in the form of framing, habit On also become image group (group of picture, GOP), in each framing include a key frame, at least one is pre- Frame and non-data frame are surveyed, for example, in the format of H264, non-data frame may include SPS, PPS frame, and the form of framing can be with For SPS, PPS, SEI, IDR, non IDR, non IDR, non IDR, non IDR, non IDR, non IDR, video frame can be with It is the combination of multiple framings.
S202 extracts the data in the video flowing since the key frame in first framing in the video flowing Frame.
In specific embodiment, it is every IDR frame that the first frame of extracted data frame, which is necessary for key frame, other frame type mistakes Filter.Therefore since the key frame in video flowing in first framing extract video flowing in all data frames, be every IDR frame and Non every IDR frame.
S203 parses the media file head data in the video flowing, obtains video configuration information;
Step of embodiment of the present invention S203 please refers to the embodiment step S102 of Fig. 1, and details are not described herein.
S204, according to the media file head data formation sequence parameter set frame and picture parameter set frame;
In specific embodiment, from video flowing to be decoded obtain media file head data, then to media file head data into Formation sequence parameter set frame and picture parameter set frame are changed in row circulation.The figure in content and video frame that media file head data include As the content that parameter set frame and sequence parameter set frame are included is identical, only present position is different, therefore can pass through media text Part head data formation sequence parameter set frame and picture parameter set frame.
S205 will extract the obtained data frame and be integrated into code stream to be decoded, the code stream to be decoded first frame it It is preceding to be inserted into the sequence parameter set frame and described image parameter set frame generated;
In specific embodiment, the data frame extracted is integrated into code stream to be decoded, and the first frame of the code stream to be decoded is IDR Frame is inserted into sequence parameter set frame and picture parameter set frame generated before the first frame of code stream to be decoded.It should be noted that The hardware decoder of certain types does not need to be inserted into.
S206 is decoded place to the code stream to be decoded after carrying out insertion process using the video configuration information Reason.
In specific embodiment, place is decoded to the code stream to be decoded after carrying out insertion process using video configuration information Reason, initializes hardware decoder using video configuration information specifically, can be, and controls the hardware solution initialized Code device is decoded processing to the code stream to be decoded after carrying out insertion process.
The embodiment of the present invention obtains the video frame in code stream to be decoded, which includes data frame and non-data frame, right The video frame carries out frame selection processing, extracts the data frame in video flowing, parses the media file head data in the video flowing, obtain Video configuration information is taken, obtained data frame will be extracted and be integrated into code stream to be decoded, and using video configuration information to be decoded Code stream is decoded processing.This mode can carry out the video frame in video flowing to be decoded again before being decoded It extracts and integration, the data frame retained in video frame improves successfully decoded to reduce the frame type in code stream to be decoded Rate, enhancing compatibility.
It referring to figure 3., is video process flow diagram in a kind of browser provided in an embodiment of the present invention, as shown, this Video process flow in inventive embodiments the following steps are included:
Video file to be played is obtained, judges whether the video file is to exist in the form of byte stream;
If not existing in the form of byte stream, then formats, handle as view to be decoded existing for byte stream form Frequency flows;
If byte stream, then the video file is directly determined as video flowing to be decoded;
Then decoded video streams are treated and carry out frame selection processing using stream process strategy, the specific can be that being selected using frame Scheme carries out frame selection processing, and the particular content of frame selection scheme is referring to figure 4.;
It carries out the extracted data frame of frame selection scheme and is integrated into code stream to be decoded, and be sent into hardware decoder;
Control hardware decoder treats decoded bit stream and is decoded processing.
Further referring to figure 4., Fig. 4 is being specifically described for frame selection scheme;
The meta data in video flowing to be decoded are extracted, circulation is carried out and changes acquisition video configuration information, and matched using video Confidence breath initializes hardware decoder;
Non-data frame is generated according to meta data simultaneously, non-data frame includes SEI, SPS, PPS frame, removal SEI frame, reservation SPS, PPS frame, and by SPS, the insertion of PPS frame is for the first time before every IDR frame;
It treats the video frame in decoded video streams and carries out frame selection filtering, extracted since the first time every IDR frame of video frame, And in being previously inserted into according to meta data SPS generated, PPS frame for first time every IDR frame;
Non- every IDR frame for the first time does not need insertion SPS, PPS frame then, and only needs to extract every IDR frame;
Other type filtering frames extract non every IDR frame, the frame of extracted frame and insertion are integrated into code stream to be decoded It is sent into hardware decoder and carries out hardware decoding.
It is detailed to a kind of Streaming Media processing unit progress provided in an embodiment of the present invention below in conjunction with attached drawing 5- attached drawing 7 It introduces.
Referring to Fig. 5, being a kind of structural schematic diagram of Streaming Media processing unit provided in an embodiment of the present invention;The device can Include: the first acquisition module 100, extraction module 101, parsing module 102 and integrates module 103;
First obtains module 100, for obtaining the video frame in video flowing to be decoded, the video frame include data frame and Non-data frame;
In specific embodiment, video flowing to be decoded is the video flowing after being encoded, and when needing to play video, is needed pair Video flowing after being encoded is decoded processing.In video flowing to be decoded include media file head data and video frame, Middle video frame includes data frame and non-data frame, includes image data in data frame, and non-data frame includes video configuration information.Example Such as, 32 kinds of different frame types are defined in current major video coded format H264, in this 32 kinds different frame types, It is also classified into data frame and non-data frame, wherein for data frame packet containing key frame and prediction frame, key frame is refreshed image immediately (instantaneous decoding refresh picture, IDR) frame, prediction frame are non every IDR frame, and non-data frame includes Frame type it is relatively more, for example, sequence parameter set (sequence parameter set, SPS) frame, picture parameter set (picture parameter set, PPS) frame, supplemental enhancement information (Supplemental Enhancement Information, SEI) frame and access unit delimiter (access unit delimiter, AUD) frame etc..
Extraction module 101 extracts the data frame in the video flowing for carrying out frame selection processing to the video frame;
In specific embodiment, when treating decoded video streams and being decoded processing, decoder should can adapt to all Frame type can be successfully decoded, but in a decoder, due to the chip of different brands, in addition the open system of Android System, treating decoded video streams, there may be compatibility issues.Certain some frame type can not be decoded normally, be embodied in Decode abnormal, picture has the mosaic phenomenon of bulk, and in some cases, will lead to can not decode stuck, results even in hard Part collapse.Therefore, in embodiments of the present invention, before carrying out hardware decoding process, extraction module 101 first treats decoding video Video frame in stream carries out frame selection processing, extracts the data frame in video flowing comprising image data.
Optionally, in H264 coded format, extraction module 101 is first from the video frame of video flowing to be decoded Every IDR frame starts to extract every IDR frame and non every IDR frame all in video frame, removes SPS frame and PPS frame therein, is carrying out frame choosing After selecting filtration treatment, reduce frame type, is decoded into power to improve.
Parsing module 102 obtains video configuration information for parsing the media file head data in the video flowing;
In specific embodiment, before carrying out specific decoding process, need to parse the media file head number in video flowing According to media file head data are present in the head information of video file.Parsing module 102 parses the media file head in video flowing The available video configuration information of data.The video configuration information can be used for it is subsequent be decoded processing during.
Decoder module 103 is integrated, is integrated into code stream to be decoded for the obtained data frame will to be extracted, and described in utilization Video configuration information is decoded processing to the code stream to be decoded.
In specific embodiment, integrate decoder module 103 will carry out frame selection processing after, extracted data frame be integrated into Decoded bit stream, integrate the specific integration method of decoder module 103 can be according to extracted data frame original sequence progress Integration.And it is carried out using decoded bit stream is treated by video configuration information acquired in media file head data in parsing video flowing Decoding process.
Optionally, as shown in fig. 6, integrating decoder module 103 may include integral unit 1030,1031 and of initialization unit Control unit 1032;
Integral unit 1030 is integrated into code stream to be decoded for will extract the obtained data frame;
Initialization unit 1031, for being initialized using the video configuration information to hardware decoder;
In specific embodiment, before being decoded processing using hardware decoder, initialization unit 1031 is using being obtained The video configuration information taken initializes hardware decoder.It should be noted that if the data of video configuration information exist Format is bytestream format specified in H264 agreement, needs to convert data to ISO-IEC-14496-12, ISO-IEC- Format specified in 14496-15, this format are that hardware decoder initializes the format used.
Control unit 1032 solves the code stream to be decoded for controlling the hardware decoder initialized Code processing.
In specific embodiment, after carrying out initialization process to hardware decoder using video configuration information, control unit The hardware decoder that 1032 controls are initialized treats decoded bit stream and is decoded processing.
It should be noted that when Dragging movement occurs in user, such as F.F. or rewind, then by final dilatory stopping Starting point of the key frame of time point recently as video flowing to be decoded, carries out frame selection since the video flowing at the time point Processing, is finally integrated into code stream to be decoded for extracted data frame.
The embodiment of the present invention obtains the video frame in code stream to be decoded, which includes data frame and non-data frame, right The video frame carries out frame selection processing, extracts the data frame in video flowing, parses the media file head data in the video flowing, obtain Video configuration information is taken, obtained data frame will be extracted and be integrated into code stream to be decoded, and using video configuration information to be decoded Code stream is decoded processing.This mode can carry out the video frame in video flowing to be decoded again before being decoded It extracts and integration, the data frame retained in video frame improves successfully decoded to reduce the frame type in code stream to be decoded Rate, enhancing compatibility.
Fig. 7 is please referred to, for the structural schematic diagram of another Streaming Media processing unit provided in an embodiment of the present invention;This implementation The Streaming Media processing unit of example is to optimize on the basis of Streaming Media processing unit shown in Fig. 6 to obtain, as shown in fig. 7, the dress Set may include the first acquisition module 200, extraction module 201, parsing module 202, integrate decoder module 203, second obtain module 204 and generation module 205:
Second obtains module 204, for obtaining video file to be decoded, and judges the number in the video file to be decoded According to whether in the form of byte stream exist;If so, the data in the video file to be decoded are determined as video flowing to be decoded; If it is not, then the video file to be decoded is formatted, obtain in the form of byte stream existing for video flowing to be decoded.
In specific embodiment, before carrying out frame selection processing, the second acquisition module 204 obtains video file to be decoded, The video file is the video file carried out after coded treatment, and each frame type of video frame is in different files in video file Exist in different forms in format, for example, it may be possible to be with format specified in ISO-IEC-14496-15, it is also possible to H264 Bytestream format specified in agreement, due to carrying out the process of frame selection processing in the embodiment of the present invention primarily directed in byte The data of stream format, it is therefore desirable to judge whether the data in the video file to be decoded exist in the form of byte stream, if wait solve Code video file is existed in the form of byte stream, then data in video flowing to be decoded is directly determined as video flowing to be decoded.If Video file to be decoded is existed in the form of byte stream, then formats, obtained with byte manifold to the video file Video flowing to be decoded existing for formula, specific conversion method are not construed as limiting.
First obtains module 200, for obtaining the video frame in video flowing to be decoded, the video frame include data frame and Non-data frame;
Optionally, the data frame includes key frame and prediction frame;It include multiple framings in the video frame, wherein each A framing includes a key frame and at least one prediction frame.
The building form of each frame can be in specific embodiment, in video frame is combined in the form of framing, habit On also become image group (group of picture, GOP), in each framing include a key frame, at least one is pre- Frame and non-data frame are surveyed, for example, in the format of H264, non-data frame may include SPS, PPS frame, and the form of framing can be with For SPS, PPS, SEI, IDR, non IDR, non IDR, non IDR, non IDR, non IDR, non IDR, video frame can be with It is the combination of multiple framings.
Extraction module 201 is specifically used for extracting the view the key frame since first framing in the video flowing Data frame in frequency stream.
In specific embodiment, it is every IDR frame that the first frame of extracted data frame, which is necessary for key frame, other frame type mistakes Filter.Therefore extraction module 201 since the key frame in video flowing in first framing extract video flowing in all data frames, It is every IDR frame and non every IDR frame.
Parsing module 202 obtains video configuration information for parsing the media file head data in the video flowing;
Generation module 205, for according to the media file head data formation sequence parameter set frame and picture parameter set frame;
In specific embodiment, media file head data are obtained from video flowing to be decoded, generation module 205 is again to media text Part head data carry out circulation and change formation sequence parameter set frame and picture parameter set frame.The content and view that media file head data include The content that picture parameter set frame in frequency frame and sequence parameter set frame are included is identical, and only present position is different, therefore can be with Pass through media file head data formation sequence parameter set frame and picture parameter set frame.
It is described integrate decoder module 203 and be specifically used for that the obtained data frame will be extracted be integrated into code stream to be decoded, The sequence parameter set frame and described image parameter set frame generated are inserted into before the first frame of the code stream to be decoded;And it utilizes The video configuration information is decoded processing to the code stream to be decoded after carrying out insertion process.
In specific embodiment, the data frame extracted is integrated into code stream to be decoded, and the first frame of the code stream to be decoded is IDR Frame integrates decoder module 203 and is inserted into sequence parameter set frame and picture parameter set generated before the first frame of code stream to be decoded Frame.It should be noted that the hardware decoder of certain types does not need to be inserted into.
In specific embodiment, place is decoded to the code stream to be decoded after carrying out insertion process using video configuration information Reason, initializes hardware decoder using video configuration information specifically, can be, and controls the hardware solution initialized Code device is decoded processing to the code stream to be decoded after carrying out insertion process.
The embodiment of the present invention obtains the video frame in code stream to be decoded, which includes data frame and non-data frame, right The video frame carries out frame selection processing, extracts the data frame in video flowing, parses the media file head data in the video flowing, obtain Video configuration information is taken, obtained data frame will be extracted and be integrated into code stream to be decoded, and using video configuration information to be decoded Code stream is decoded processing.This mode can carry out the video frame in video flowing to be decoded again before being decoded It extracts and integration, the data frame retained in video frame improves successfully decoded to reduce the frame type in code stream to be decoded Rate, enhancing compatibility.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with Relevant hardware is instructed to complete by computer program, the program can be stored in a computer-readable storage medium In, the module or the corresponding program of unit of Streaming Media processing unit shown in attached drawing 5- attached drawing 7 are storable in terminal device or service It in the readable storage medium storing program for executing of device, and is executed by least one processor in the terminal device or server, to realize above-mentioned stream Media processing method, this method include process described in each method embodiment in Fig. 1 to Fig. 4.Wherein, the storage medium can For magnetic disk, CD, read-only memory (Read-Only Memory, ROM) or random access memory (Random Access Memory, RAM) etc..
The above disclosure is only the preferred embodiments of the present invention, cannot limit the right model of the present invention with this certainly It encloses, therefore equivalent changes made in accordance with the claims of the present invention, is still within the scope of the present invention.

Claims (10)

1. a kind of Streaming Media processing method characterized by comprising
The video frame in video flowing to be decoded is obtained, the video frame includes data frame and non-data frame, the non-data frame packet Include a variety of frame types;
Frame selection processing is carried out to the video frame, extracts the data frame in the video flowing;
The media file head data in the video flowing are parsed, video configuration information is obtained, the media file head data include The video configuration information it is identical as the video configuration information that the non-data frame includes;
The obtained data frame will be extracted and be integrated into code stream to be decoded, and using the video configuration information obtained to described Code stream to be decoded is decoded processing;
It is wherein, described that processing is decoded to the code stream to be decoded using the video configuration information obtained, comprising:
Hardware decoder is initialized using the video configuration information of acquisition;
It controls the hardware decoder initialized and processing is decoded to the code stream to be decoded.
2. the method as described in claim 1, which is characterized in that the data frame includes key frame and prediction frame;
It include multiple framings in the video frame, wherein each framing includes a key frame and at least one prediction frame.
3. method according to claim 2, which is characterized in that it is described that frame selection processing is carried out to the video frame, extract institute State the data frame in video flowing, comprising:
The data frame in the video flowing is extracted since the key frame in first framing in the video flowing.
4. method as claimed in claim 3, which is characterized in that the method also includes:
According to the media file head data formation sequence parameter set frame and picture parameter set frame;
It is described that processing is decoded to the code stream to be decoded using the video configuration information, comprising:
The sequence parameter set frame and described image parameter set frame generated are inserted into before the first frame of the code stream to be decoded;
Processing is decoded to the code stream to be decoded after carrying out insertion process using the video configuration information.
5. such as the described in any item methods of Claims 1-4, which is characterized in that the video obtained in video flowing to be decoded Before frame, further includes:
Video file to be decoded is obtained, and judges whether the data in the video file to be decoded exist in the form of byte stream;
If so, the data in the video file to be decoded are determined as video flowing to be decoded;
If it is not, then the video file to be decoded is formatted, obtain in the form of byte stream existing for video to be decoded Stream.
6. a kind of Streaming Media processing unit characterized by comprising
First obtains module, and for obtaining the video frame in video flowing to be decoded, the video frame includes data frame and non-data Frame, the non-data frame include a variety of frame types;
Extraction module extracts the data frame in the video flowing for carrying out frame selection processing to the video frame;
Parsing module obtains video configuration information, the media text for parsing the media file head data in the video flowing The video configuration information that part head data include is identical as the video configuration information that the non-data frame includes;
Decoder module is integrated, is integrated into code stream to be decoded for the obtained data frame will to be extracted, and described using what is obtained Video configuration information is decoded processing to the code stream to be decoded;
Wherein, the decoder module of integrating includes:
Integral unit is integrated into code stream to be decoded for will extract the obtained data frame;
Initialization unit, for being initialized using the video configuration information of acquisition to hardware decoder;
Control unit is decoded processing to the code stream to be decoded for controlling the hardware decoder initialized.
7. device as claimed in claim 6, which is characterized in that the data frame includes key frame and prediction frame;
It include multiple framings in the video frame, wherein each framing includes a key frame and at least one prediction frame.
8. device as claimed in claim 7, which is characterized in that the extraction module is specifically used for the from the video flowing Key frame in one framing starts to extract the data frame in the video flowing.
9. device as claimed in claim 8, which is characterized in that described device further include:
Generation module, for according to the media file head data formation sequence parameter set frame and picture parameter set frame;
It is described integrate decoder module and be specifically used for that the obtained data frame will be extracted be integrated into code stream to be decoded, described wait solve The sequence parameter set frame and described image parameter set frame generated are inserted into before the first frame of code code stream;And utilize the video Configuration information is decoded processing to the code stream to be decoded after carrying out insertion process.
10. such as the described in any item devices of claim 6 to 9, which is characterized in that described device further include:
Second obtains module, for obtaining video file to be decoded, and whether judges the data in the video file to be decoded Exist in the form of byte stream;If so, the data in the video file to be decoded are determined as video flowing to be decoded;If it is not, Then the video file to be decoded is formatted, obtain in the form of byte stream existing for video flowing to be decoded.
CN201510110136.2A 2015-03-12 2015-03-12 A kind of Streaming Media processing method and processing device Active CN106034252B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510110136.2A CN106034252B (en) 2015-03-12 2015-03-12 A kind of Streaming Media processing method and processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510110136.2A CN106034252B (en) 2015-03-12 2015-03-12 A kind of Streaming Media processing method and processing device

Publications (2)

Publication Number Publication Date
CN106034252A CN106034252A (en) 2016-10-19
CN106034252B true CN106034252B (en) 2019-08-23

Family

ID=57151045

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510110136.2A Active CN106034252B (en) 2015-03-12 2015-03-12 A kind of Streaming Media processing method and processing device

Country Status (1)

Country Link
CN (1) CN106034252B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106507115B (en) * 2016-11-30 2019-10-15 上海音绮文化发展有限公司 Coding/decoding method, device and the terminal device of VR video based on iOS device
CN109391843B (en) * 2017-08-03 2022-02-25 腾讯科技(深圳)有限公司 Online video speed doubling playing method, device, medium and intelligent terminal
CN109104581B (en) * 2018-07-25 2021-09-17 深圳市创易联合科技有限公司 Wireless screen transmission method, system and receiving terminal
CN114339408A (en) * 2021-11-26 2022-04-12 惠州华阳通用电子有限公司 Video decoding method
CN114143595A (en) * 2021-12-08 2022-03-04 珠海豹趣科技有限公司 Video wallpaper playing method and device, electronic equipment and readable storage medium
CN115942000B (en) * 2022-11-08 2023-11-21 北京力控元通科技有限公司 H.264 format video stream transcoding method, device, equipment and medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6487663B1 (en) * 1998-10-19 2002-11-26 Realnetworks, Inc. System and method for regulating the transmission of media data
CN102413358A (en) * 2011-08-12 2012-04-11 青岛海信传媒网络技术有限公司 Storage and playing method, device and system of streaming media file
CN102625155A (en) * 2011-01-27 2012-08-01 天脉聚源(北京)传媒科技有限公司 Method and system for showing video key frames
CN102857794A (en) * 2011-06-28 2013-01-02 上海聚力传媒技术有限公司 Method and device for merging video segments
CN104320669A (en) * 2014-10-24 2015-01-28 北京有恒斯康通信技术有限公司 Video transmission method and apparatus

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6487663B1 (en) * 1998-10-19 2002-11-26 Realnetworks, Inc. System and method for regulating the transmission of media data
CN102625155A (en) * 2011-01-27 2012-08-01 天脉聚源(北京)传媒科技有限公司 Method and system for showing video key frames
CN102857794A (en) * 2011-06-28 2013-01-02 上海聚力传媒技术有限公司 Method and device for merging video segments
CN102413358A (en) * 2011-08-12 2012-04-11 青岛海信传媒网络技术有限公司 Storage and playing method, device and system of streaming media file
CN104320669A (en) * 2014-10-24 2015-01-28 北京有恒斯康通信技术有限公司 Video transmission method and apparatus

Also Published As

Publication number Publication date
CN106034252A (en) 2016-10-19

Similar Documents

Publication Publication Date Title
CN106034252B (en) A kind of Streaming Media processing method and processing device
JP6410899B2 (en) Media file generation device, generation method, and program
CN101198045B (en) Stream media digital watermarking system
JP5288710B2 (en) Information storage medium recording multimedia data, reproducing method and reproducing apparatus thereof
CN105049920B (en) A kind of method for recording and device of multimedia file
CN110324706B (en) Video cover generation method and device and computer storage medium
US20070074097A1 (en) System and method for dynamic transrating based on content
CN106231348B (en) A kind of back method of GOP data, device and system
CN105049904B (en) A kind of playing method and device of multimedia file
CN111683293A (en) Method for playing H.265 video across browsers based on HTTP-FLV protocol
CN104853132A (en) Delay video recording method and system
CN104602105A (en) Video file playing method and user equipment
GB2599170A (en) Method, device, and computer program for optimizing indexing of portions of encapsulated media content data
CN107634928B (en) Code stream data processing method and device
US8688737B2 (en) Method and apparatus for generating and reproducing media object-based metadata
KR101022078B1 (en) Method and apparatus for facilitating streaming of video information, computer readable medium and method and apparatus for processing a file containing video information
WO2024098836A1 (en) Video alignment method and apparatus
JP7241874B2 (en) Method, apparatus, and computer program for signaling available portions of encapsulated media content
CN103430558A (en) A method for optimizing a video stream
CN104796702B (en) A kind of conversion method and device of H264 video frame rates
CN102047662A (en) Encoder
CN104506966B (en) The coding/decoding method and device of audio, video data
CN116033113B (en) Video conference auxiliary information transmission method and system
CN106792111A (en) A kind of use FFMPEG interfaces record the method and device of webcast website's video
CN110636368B (en) Media playing method, system, device and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant