CN105898496A - HLS stream hardware decoding method based on Android device and device - Google Patents

HLS stream hardware decoding method based on Android device and device Download PDF

Info

Publication number
CN105898496A
CN105898496A CN201510797426.9A CN201510797426A CN105898496A CN 105898496 A CN105898496 A CN 105898496A CN 201510797426 A CN201510797426 A CN 201510797426A CN 105898496 A CN105898496 A CN 105898496A
Authority
CN
China
Prior art keywords
information
video
decoder
decoding
video bag
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201510797426.9A
Other languages
Chinese (zh)
Inventor
李先彪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
LeTV Information Technology Beijing Co Ltd
Original Assignee
LeTV Information Technology Beijing 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 LeTV Information Technology Beijing Co Ltd filed Critical LeTV Information Technology Beijing Co Ltd
Priority to CN201510797426.9A priority Critical patent/CN105898496A/en
Publication of CN105898496A publication Critical patent/CN105898496A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • H04N21/440218Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display by transcoding between formats or standards, e.g. from MPEG-2 to MPEG-4
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/4302Content synchronisation processes, e.g. decoder synchronisation
    • H04N21/4305Synchronising client clock from received content stream, e.g. locking decoder clock with encoder clock, extraction of the PCR packets
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/434Disassembling of a multiplex stream, e.g. demultiplexing audio and video streams, extraction of additional data from a video stream; Remultiplexing of multiplex streams; Extraction or processing of SI; Disassembling of packetised elementary stream
    • H04N21/4341Demultiplexing of audio and video streams

Abstract

The invention provides an HLS stream hardware decoding method based on an Android device and a device. FFmpeg is used to parse an HLS stream to acquire hardware decoding information. The hardware decoding information is used for configuring a decoder to decode video coding. In a configuration mode, the hardware decoding information is written into MediaCodec. FFmpeg is used to decode an audio packet of the HLS stream, and a video packet of the HLS stream is read. MediaCodec is used to decode the video packet. The audio packet and the video packet are synchronously decoded and played. Compared with soft decoding, the decoding method provided by the invention has the advantages that CPU occupancy in a decoding process is greatly reduced, and power consumption is reduced.

Description

HLS based on Android device flows hard decoder method and device
Technical field
The present embodiments relate to video decoding techniques field, particularly relate to a kind of HLS based on Android device stream hard Coding/decoding method and device.
Background technology
HLS, i.e. HTTP Live Streamin, is a kind of outstanding dynamic code rate self adaptation of American apple company exploitation Agreement, continuous media data huge for capacity are carried out segmentation by HLS protocol, are divided into large number of small documents and transmit, Cater to the file transporting of web page server, use a lightweight index file constantly updated to control little matchmaker after segmentation The download of body file and broadcasting, it is possible to achieve the live and program request of Streaming Media, and there is good autgmentability.Apple IOS It is natural support to this agreement, and another important Mobile operating system Android is the most limited to the support of HLS, opens Originator can not use Android SDK to be developed to very well to support the player of HLS protocol.
The problem resolving decoding HLS protocol for Android, the player having in prior art have employed NDK (Native Development Kit, the most primary development kit) realize resolving decoding HLS protocol, use in the dynamic base of NDK (Fast Forward Mpeg, i.e. quickly Mpeg, Mpeg are the active images and sound that a kind of compression ratio is bigger to FFmpeg Compression standard) realize soft decoding, the program can be good at resolve decoding HLS protocol, it is achieved Android end play HLS stream Media, it is achieved the most relatively easy.But but having certain drawback, i.e. owing to being soft decoding, CPU usage is high, and power consumption is big, power consumption Hurry up, be a kind of bad experience for user in mobile terminal.
Therefore, for drawbacks described above, a kind of new decoding scheme urgently proposes.
Summary of the invention
The embodiment of the present invention provides a kind of HLS based on Android device to flow hard decoder method and device, existing in order to solve Having in technology when resolving decoding HLS protocol on the equipment of android system, CPU usage is high, the defect that power consumption is big, it is achieved HLS based on Android device flows low-power consumption, high efficiency hard decoder.
The embodiment of the present invention provides a kind of HLS based on Android device to flow hard decoder method, including:
Using FFmpeg to resolve HLS stream, obtain hard decoder information, described hard decoder information is used for configuring decoder To decode Video coding;
In the configuration mode, described hard decoder information is write MediaCodec;
Use FFmpeg decode the audio pack of described HLS stream and read the video bag of described HLS stream, utilize described Described video bag is decoded by MediaCodec;
Described audio pack that synchronous decoding completes and described video bag, and play out.
The embodiment of the present invention provides a kind of HLS based on Android device to flow hard decoder device, including:
Hard decoder data obtaining module, is used for using FFmpeg to resolve HLS stream, obtains hard decoder information, described Hard decoder information is used for configuring decoder to decode Video coding;
Decoder configuration module, in the configuration mode, writes MediaCodec by described hard decoder information;
Decoder module, for using FFmpeg decode the audio pack of described HLS stream and read the video bag of described HLS stream, Utilize described MediaCodec that described video bag is decoded;
Synchronization module, the described audio pack completed for synchronous decoding and described video bag, and play out.
The HLS based on Android device that the embodiment of the present invention provides flows hard decoder method and device, by combining FFmpeg resolves HLS protocol and uses Android SDK Media Codec class to realize hard decoder, changes in prior art When Android device uses soft decoding, CPU usage is high, the defect that power consumption is big and power consumption is fast, it is achieved that good Consumer's Experience.
Accompanying drawing explanation
In order to be illustrated more clearly that the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing In having technology to describe, the required accompanying drawing used is briefly described, it should be apparent that, the accompanying drawing in describing below is this Some bright embodiments, for those of ordinary skill in the art, on the premise of not paying creative work, it is also possible to root Other accompanying drawing is obtained according to these accompanying drawings.
Fig. 1 is the techniqueflow chart of the embodiment of the present invention one;
Fig. 2 is the techniqueflow chart of the embodiment of the present invention two;
Fig. 3 is the techniqueflow chart of the embodiment of the present invention three;
Fig. 4 is the apparatus structure schematic diagram of the embodiment of the present invention four;
Fig. 5 is the techniqueflow chart of the embodiment of the present invention five.
Detailed description of the invention
For making the purpose of the embodiment of the present invention, technical scheme and advantage clearer, below in conjunction with the embodiment of the present invention In accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is The a part of embodiment of the present invention rather than whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art The every other embodiment obtained under not making creative work premise, broadly falls into the scope of protection of the invention.
Embodiment one
Fig. 1 is the techniqueflow chart of the embodiment of the present invention one, and in conjunction with Fig. 1, embodiment of the present invention one sets based on Android Standby HLS stream hard decoder method comprises the steps:
Step 110: using FFmpeg to resolve HLS stream, obtain hard decoder information, described hard decoder information is used for joining Put decoder to decode Video coding;
HLS, g are initially the stream that Apple develops for mobile devices such as its iPhone, iPod, iTouch and iPad Media protocol.HTTP Live Streaming allows content provider to be connect to the offer of above-mentioned client by normal web services device The audio and video stream media service of near real-time, including live and program request.HTTP Live Streaming supports to encode same program For multiple replacement streams of different code checks, client software can be according to the change of the network bandwidth at the replacement stream of these different code checks Between carry out intelligence switching.Additionally, HTTP Live Streaming also supports to be come by the mode such as media encryption and user authentication Reach medium copyright protection.
Having a m3u8 index file in HLS protocol, the inside is that (Transport Stream i.e. transmits flow point to some TS Parser) URL that wraps.TS is a kind of encapsulation format, and voice data and video data and auxiliary information all can be encapsulated into 188 The TS bag of byte.One TS bag is by TS head and PES (Packetized Elementary Streams, the basic code i.e. packed Stream) stream packing form.Wherein PES stream is by PES head and ES (Elementary Streams, i.e. elementary stream) stream packing Become, and ES stream includes voice data and video data.In TS bag, the video code model of encapsulation is H264, therefore, for Video, it would be desirable to decoding H264.Decoding H264 needs to transmit some decoded informations configuration decoder to decoder and could realize Decoding.
Described hardware decoded information farther include SPS (Software Product Specification) information and PPS (Picture Parameter Set) information, wherein, the parameter set information of described SPS information index row, described PPS information Refer to the parameter set information of image.
After opening the URL of described HLS stream in FFmpeg, read first video bag and judge described first video bag It it is whether the video bag of H264 form;
If it is determined that be yes, then utilize described decoder that described first video bag is decoded and obtain comprise described The Frame of SPS information and the Frame of described PPS information.
Step 120: in the configuration mode, writes MediaCodec by described hard decoder information;
Concrete, use parameter MediaCodec.BUFFER_FLAG_CODEC_CONFIG described hard decoder information to be write Enter MediaCodec.
Step 130: use FFmpeg decode the audio pack of described HLS stream and read the video bag of described HLS stream, utilize institute State MediaCodec described video bag is decoded;
MediaCodec is the hardware decoder of the decoding H264 that Android system provides, and is generally used for decoding mp4, former Raw android MediaCodec does not provide the ability of decoding HLS, due to the encapsulation that android is good, MediaCodec Decoding fairly simple, substantially process is: initializes MediaCodec, and binds a surface for display;Then will After video packet (video bag) demultiplexed for FFmpeg gives MediaCodec, MediaCodec decoding, display is being tied up On fixed surface, give MediaCodec with FFmpeg demultiplexed video packet (video bag) the most again, decoding, Display is on surface, the most repeatedly.
In the embodiment of the present invention, use FFmpeg interface read described video bag and by with a buffer with Described video bag is sent to by JNI ((Java Native Interface, i.e. Java the local interface)) method of buffer length Described MediaCodec is decoded, wherein, the content of incoming described video bag in buffer, buffer length be exactly described in regard The length of frequency bag.Specifically, the av_read_frame interface using FFmpeg in the present embodiment reads described video bag. The effect of the av_read_frame interface in FFmpeg is to read the some frames of audio frequency in code stream or the some frames of video.Such as, The when of decoding video, often one frame of video of decoding, needs first to call av_read_frame () and obtains the compression number of a frame video According to, then could be to this decoding data.
Step 140: described audio pack that synchronous decoding completes and described video bag, and play out.
Whether Decoding Time Stamp corresponding during relatively described video wraps in decoding has decoded more than described audio pack Described Decoding Time Stamp corresponding during one-tenth, the most then control the decoding speed of described video bag in order to realize video and audio frequency Synchronization.
It should be noted that in the embodiment of the present invention, use FFmpeg that video and audio frequency are demultiplexed the most in advance With, demultiplexing extracts the ES flow data of audio file and video file exactly.
In the present embodiment, use FFmpeg resolves HLS files in stream media, and uses by the hard solution of Media Codec class realization Code, when changing the soft decoding HLS files in stream media of Android device in prior art, CPU usage is high, and power consumption is big and power consumption is fast Defect, it is achieved that good Consumer's Experience.
Embodiment two
To be expanded on further how the embodiment of the present invention configures decoder to realize H264 by an embodiment with lower part Decoding.
Step 210: after opening the URL of described HLS stream in FFmpeg, uses av_read_frame to read first and regards Frequency bag;
Step 220: judge that whether described first video bag be the video bag of H264 form;
Concrete determination methods: firstly the need of the video bag determining whether that H264 encodes, H264 video data frame with 00, 00,00,01 or 00,00,01 starts;The first character joint that SPS starts simultaneously is 0x67, and the first character joint of PPS is 0x68.Cause This is for 0x00,0x00,0x00,0x01,0x67 or 0x00, and the Frame that 0x00,0x01,0x67 start comprises SPS exactly The Frame of information;For with 0x00,0x00,0x00,0x01,0x68 or 0x00, the Frame that 0x00,0x01,0x68 start It it is exactly the Frame comprising PPS information.Here we need not be SPS and PPS detailed analysis, it is only necessary to gets it , and pass them to MediaCodec.
Step 230: when judging described first video bag as the video bag of H264 form, obtains and comprises described SPS letter The Frame of breath and the Frame of described PPS information, and described SPS information and described PPS information are transferred to MediaCodec;
Step 240: in the configuration mode, writes MediaCodec by described SPS information and described PPS information.
I.e. use parameter MediaCodec.BUFFER_FLAG_CODEC_CONFIG):
MMediaCodec.queueInputBuffer (inputBufIndex, 0, sampleSize, 1, MediaCodec.BUFFER_FLAG_CODEC_CONFIG);
In the present embodiment, obtain SPS information and PPS information, and be written into MediaCodec for hard decoder H264 lattice The video bag of formula, the occupancy of CPU when significantly reducing decoding, reduce the power consumption of equipment.
Embodiment three
Will be further described in the embodiment of the present invention with lower part, for a HLS matchmaker comprising Voice & Video simultaneously What body stream Voice & Video when playing synchronized realizes process.
Step 310: use FFmpeg that HLS stream is demultiplexing as audio pack and video bag;
Step 320: use FFmpeg that described audio pack is decoded, and use MediaCodec that described video bag is entered Row decoding;
Step 330: detect the decoding time mark carried in described audio signal to be played and video signal to be played Sign whether consistent, if the Decoding Time Stamp carried in audio signal to be played and video signal to be played is inconsistent, Send synchronization request;
Owing to described video bag uses hard decoder, speed, therefore, in this step, carry with described audio signal Based on described Decoding Time Stamp, contrast the Decoding Time Stamp that described video signal carries, calculate the decoding time of the two Difference between label.
Step 340: receive described synchronization request, call release Output Buffer show video pictures, and according to Described difference controls the speed of described video bag decoding;
In this step, by binding a surface to decoder, decoder just can directly display picture, and can control The speed of system decoding.
Step 350: the audio signal described to be played after output synchronization and described video signal to be played.
In a kind of exemplary embodiment of the embodiment of the present invention, there are two kinds of synchronization control voice datas and video data The mode of Decoding Time Stamp.A kind of is the decoding time mark of Decoding Time Stamp correction video data according to voice data Sign, namely on the basis of the Decoding Time Stamp of voice data, revise the Decoding Time Stamp of video data, be allowed to and audio frequency The Decoding Time Stamp of data is consistent.A kind of is in the Decoding Time Stamp of audio, video data and audio frequency, the decoding of video data When time tag difference is bigger, during according to the decoding of the Decoding Time Stamp correction voice data of audio, video data and video data Between label.The Decoding Time Stamp of voice data and video data is all modified to the decoding time mark of described audio, video data Sign, relatively accurate to guarantee the Decoding Time Stamp of voice data and video data.
In the present embodiment, before playing after the decoding, detect audio signal to be played and video signal to be played In the Decoding Time Stamp that carries the most consistent, and then detect audio signal to be played and the output of video signal to be played Whether synchronize, and ensure that the synchronization of audio frequency and video by controlling the decoding speed of video data, decoding is fast and play quality is high, enters One step improves Consumer's Experience.
Embodiment four
Fig. 4 is the apparatus structure schematic diagram of the embodiment of the present invention four, and the embodiment of the present invention is a kind of based on Android device HLS stream hard decoder device mainly includes following big module: hard decoder data obtaining module 410, decoder configure module 420, decoder module 430, synchronization module 440.
Described hard decoder data obtaining module 410, is used for using FFmpeg to resolve HLS stream, obtains hard decoder letter Breath, described hard decoder information is used for configuring decoder to decode Video coding;
Described decoder configuration module 420, in the configuration mode, writes described hard decoder information MediaCodec;
Described decoder module 430, for using FFmpeg decode the audio pack of described HLS stream and read described HLS stream Video bag, utilizes described MediaCodec to be decoded described video bag;
Described synchronization module 440, the described audio pack completed for synchronous decoding and described video bag, and play out.
Specifically, described hardware decoded information farther includes SPS information and PPS information, and wherein, described SPS information refers to The parameter set information of ordered series of numbers, described PPS information refers to the parameter set information of image.
Further, after described hard decoder data obtaining module 410 is used for opening the URL that described HLS flows in FFmpeg, Read first video bag and judge that whether described first video bag be the video bag of H264 form;If it is determined that be yes, then profit It is decoded described first video bag with described decoder and obtains comprising the Frame of described SPS information and described The Frame of PPS information.
Further, described decoder module 430 is further used for: use the interface of FFmpeg to read described video Bao Bingtong Cross JNI to send described MediaCodec to and be decoded.
Further, described synchronization module 440 is further used for: solution corresponding during relatively described video wraps in decoding The described Decoding Time Stamp whether code time tag is corresponding when having decoded more than described audio pack, the most then control described The decoding speed of video bag is synchronization with audio frequency in order to realize video.
In the present embodiment, use FFmpeg resolves HLS files in stream media, and uses by the hard solution of Media Codec class realization Code, when changing the soft decoding HLS files in stream media of Android device in prior art, CPU usage is high, and power consumption is big and power consumption is fast Defect, it is achieved that good Consumer's Experience.
Embodiment five
Embodiment of the present invention one will be described by a more detailed embodiment with lower part to set based on Android The standby hard decoder data obtaining module in HLS stream hard decoder device, decoder configuration module, decoder module and synchronization module Work process.
Step 510: described hard decoder data obtaining module uses FFmpeg to demultiplex video and audio frequency, extracts audio frequency The ES flow data of file and video file;
Step 520: after described hard decoder data obtaining module opens the URL of described HLS stream in FFmpeg, reads first Individual video bag also judges that whether described first video bag be the video bag of H264 form;If it is determined that be yes, then utilize described solution Code device is decoded and obtains the Frame comprising described SPS information and described PPS information to described first video bag Frame;
Specifically, described hardware decoded information farther includes SPS information and PPS information, and wherein, described SPS information refers to The parameter set information of ordered series of numbers, described PPS information refers to the parameter set information of image.
Concrete determination methods: firstly the need of the video bag determining whether that H264 encodes, H264 video data frame with 00, 00,00,01 or 00,00,01 starts;The first character joint that SPS starts simultaneously is 0x67, and the first character joint of PPS is 0x68.Cause This is for 0x00,0x00,0x00,0x01,0x67 or 0x00, and the Frame that 0x00,0x01,0x67 start comprises SPS exactly The Frame of information;For with 0x00,0x00,0x00,0x01,0x68 or 0x00, the Frame that 0x00,0x01,0x68 start It it is exactly the Frame comprising PPS information.
Step 530: described hard decoder data obtaining module will comprise Frame and the described PPS letter of described SPS information The Frame of breath is sent to MediaCodec;
Step 540: described hard decoder information in the configuration mode, is write by described decoder configuration module MediaCodec;
Specifically, parameter MediaCodec.BUFFER_FLAG_CODEC_CONFIG is used):
MMediaCodec.queueInputBuffer (inputBufIndex, 0, sampleSize, 1, MediaCodec.BUFFER_FLAG_CODEC_CONFIG);
Step 550: described decoder module, uses the interface of FFmpeg read described video bag and send institute to by JNI State MediaCodec to be decoded;
The av_read_frame interface using FFmpeg in the present embodiment reads described video bag.
Step 560: described decoder module, uses FFmpeg decode the audio pack of described HLS stream and read described HLS stream Video bag, utilizes described MediaCodec to be decoded described video bag;
Step 570: described synchronization module, described audio pack that synchronous decoding completes and described video bag, and play out.
Whether Decoding Time Stamp corresponding during relatively described video wraps in decoding has decoded more than described audio pack Described Decoding Time Stamp corresponding during one-tenth, the most then control the decoding speed of described video bag in order to realize video and audio frequency Synchronization.
Device embodiment described above is only schematically, and the wherein said unit illustrated as separating component can To be or to may not be physically separate, the parts shown as unit can be or may not be physics list Unit, i.e. may be located at a place, or can also be distributed on multiple NE.Can be selected it according to the actual needs In some or all of module realize the purpose of the present embodiment scheme.Those of ordinary skill in the art are not paying creativeness Work in the case of, be i.e. appreciated that and implement.
Through the above description of the embodiments, those skilled in the art it can be understood that to each embodiment can The mode adding required general hardware platform by software realizes, naturally it is also possible to pass through hardware.Based on such understanding, on State the part that prior art contributes by technical scheme the most in other words to embody with the form of software product, should Computer software product can store in a computer-readable storage medium, such as ROM/RAM, magnetic disc, CD etc., including some fingers Make with so that a computer equipment (can be personal computer, server, or the network equipment etc.) performs each and implements The method described in some part of example or embodiment.
Last it is noted that above example is only in order to illustrate technical scheme, it is not intended to limit;Although With reference to previous embodiment, the present invention is described in detail, it will be understood by those within the art that: it still may be used So that the technical scheme described in foregoing embodiments to be modified, or wherein portion of techniques feature is carried out equivalent; And these amendment or replace, do not make appropriate technical solution essence depart from various embodiments of the present invention technical scheme spirit and Scope.

Claims (10)

1. a HLS based on Android device flows hard decoder method, it is characterised in that comprise the steps:
Using FFmpeg to resolve HLS stream, obtain hard decoder information, described hard decoder information is used for configuring decoder to solve Code Video coding;
In the configuration mode, described hard decoder information is write MediaCodec;
Use FFmpeg decode the audio pack of described HLS stream and read the video bag of described HLS stream, utilize described MediaCodec Described video bag is decoded;
Described audio pack that synchronous decoding completes and described video bag, and play out.
Method the most according to claim 1, it is characterised in that described hardware decoded information specifically includes SPS information and PPS Information, wherein, the parameter set information of described SPS information index row, described PPS information refers to the parameter set information of image.
Method the most according to claim 1 and 2, it is characterised in that obtain hard decoder information, specifically include:
After opening the URL of described HLS stream in FFmpeg, read first video bag and whether judge described first video bag Video bag for H264 form;
If it is determined that be yes, then utilize described decoder that described first video bag is decoded and obtain comprise described SPS letter The Frame of breath and the Frame of described PPS information.
Method the most according to claim 1, it is characterised in that utilize described MediaCodec that described video bag is solved Code, specifically includes:
The interface using FFmpeg reads described video bag and sends described MediaCodec to by JNI and be decoded.
Method the most according to claim 1, it is characterised in that described audio pack that synchronous decoding completes and described video Bag, and play out, specifically include:
When whether Decoding Time Stamp corresponding during relatively described video wraps in decoding has decoded more than described audio pack Corresponding described Decoding Time Stamp, the most then control the decoding speed of described video bag in order to realize the same of video and audio frequency Step.
6. a HLS based on Android device flows hard decoder device, it is characterised in that include following module:
Hard decoder data obtaining module, is used for using FFmpeg to resolve HLS stream, obtains hard decoder information, described hard solution Code information is used for configuring decoder to decode Video coding;
Decoder configuration module, in the configuration mode, writes MediaCodec by described hard decoder information;
Decoder module, for using FFmpeg decode the audio pack of described HLS stream and read the video bag of described HLS stream, utilizes Described video bag is decoded by described MediaCodec;
Synchronization module, the described audio pack completed for synchronous decoding and described video bag, and play out.
Device the most according to claim 6, it is characterised in that described hardware decoded information specifically includes SPS information and PPS Information, wherein, the parameter set information of described SPS information index row, described PPS information refers to the parameter set information of image.
8. according to the device described in claim 6 or 7, it is characterised in that described hard decoder data obtaining module is further used for:
After opening the URL of described HLS stream in FFmpeg, read first video bag and whether judge described first video bag Video bag for H264 form;
If it is determined that be yes, then utilize described decoder that described first video bag is decoded and obtain comprise described SPS letter The Frame of breath and the Frame of described PPS information.
Device the most according to claim 6, it is characterised in that described decoder module is further used for: use FFmpeg's Interface reads described video bag and sends described MediaCodec to by JNI and be decoded.
Device the most according to claim 6, it is characterised in that described synchronization module is further used for: relatively described video When whether Decoding Time Stamp corresponding during wrapping in decoding is more than described decoding corresponding when described audio pack has decoded Between label, the most then the decoding speed controlling described video bag is synchronization with audio frequency in order to realize video.
CN201510797426.9A 2015-11-18 2015-11-18 HLS stream hardware decoding method based on Android device and device Pending CN105898496A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510797426.9A CN105898496A (en) 2015-11-18 2015-11-18 HLS stream hardware decoding method based on Android device and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510797426.9A CN105898496A (en) 2015-11-18 2015-11-18 HLS stream hardware decoding method based on Android device and device

Publications (1)

Publication Number Publication Date
CN105898496A true CN105898496A (en) 2016-08-24

Family

ID=57002875

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510797426.9A Pending CN105898496A (en) 2015-11-18 2015-11-18 HLS stream hardware decoding method based on Android device and device

Country Status (1)

Country Link
CN (1) CN105898496A (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106792124A (en) * 2016-12-30 2017-05-31 合网络技术(北京)有限公司 Multimedia resource decodes player method and device
CN106804003A (en) * 2017-03-09 2017-06-06 广州四三九九信息科技有限公司 Video editing method and device based on ffmpeg
CN106878736A (en) * 2017-03-17 2017-06-20 郑州云海信息技术有限公司 A kind of method and apparatus of coding and decoding video
CN108600826A (en) * 2018-05-22 2018-09-28 深圳市茁壮网络股份有限公司 A kind of method and device playing TS streams
CN109640179A (en) * 2018-11-27 2019-04-16 Oppo广东移动通信有限公司 Video frequency decoding control method, device and electronic equipment
CN109874028A (en) * 2017-12-01 2019-06-11 深圳市雷鸟信息科技有限公司 A kind of playback method, system and the storage medium of HLS Streaming Media
CN110602551A (en) * 2019-08-22 2019-12-20 福建星网智慧科技股份有限公司 Media playing method, player, equipment and storage medium of android frame layer
CN110662084A (en) * 2019-10-15 2020-01-07 北京齐尔布莱特科技有限公司 MP4 file stream live broadcasting method, mobile terminal and storage medium
CN112532991A (en) * 2020-10-28 2021-03-19 惠州华阳通用电子有限公司 Hardware decoding method for RMFF format file
CN114339408A (en) * 2021-11-26 2022-04-12 惠州华阳通用电子有限公司 Video decoding method
WO2024062231A1 (en) * 2022-09-20 2024-03-28 V-Nova International Limited Method for decoding a video stream

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1921631A (en) * 2005-08-25 2007-02-28 三星电子株式会社 Mobile communication terminal and method for reproducing digital broadcasting
CN102724588A (en) * 2012-04-20 2012-10-10 苏州汉辰数字科技有限公司 Method for implementing video and audio communication of wired television set top box
CN104754349A (en) * 2013-12-25 2015-07-01 炫一下(北京)科技有限公司 Method and device for hardware decoding of audio/video
CN104766608A (en) * 2014-01-07 2015-07-08 深圳市中兴微电子技术有限公司 Voice control method and voice control device
KR20150085665A (en) * 2014-01-16 2015-07-24 한화테크윈 주식회사 Apparatus and method for processing image
CN104980788A (en) * 2015-02-11 2015-10-14 腾讯科技(深圳)有限公司 Video decoding method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1921631A (en) * 2005-08-25 2007-02-28 三星电子株式会社 Mobile communication terminal and method for reproducing digital broadcasting
CN102724588A (en) * 2012-04-20 2012-10-10 苏州汉辰数字科技有限公司 Method for implementing video and audio communication of wired television set top box
CN104754349A (en) * 2013-12-25 2015-07-01 炫一下(北京)科技有限公司 Method and device for hardware decoding of audio/video
CN104766608A (en) * 2014-01-07 2015-07-08 深圳市中兴微电子技术有限公司 Voice control method and voice control device
KR20150085665A (en) * 2014-01-16 2015-07-24 한화테크윈 주식회사 Apparatus and method for processing image
CN104980788A (en) * 2015-02-11 2015-10-14 腾讯科技(深圳)有限公司 Video decoding method and device

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106792124A (en) * 2016-12-30 2017-05-31 合网络技术(北京)有限公司 Multimedia resource decodes player method and device
CN106804003A (en) * 2017-03-09 2017-06-06 广州四三九九信息科技有限公司 Video editing method and device based on ffmpeg
CN106878736A (en) * 2017-03-17 2017-06-20 郑州云海信息技术有限公司 A kind of method and apparatus of coding and decoding video
CN109874028A (en) * 2017-12-01 2019-06-11 深圳市雷鸟信息科技有限公司 A kind of playback method, system and the storage medium of HLS Streaming Media
CN108600826A (en) * 2018-05-22 2018-09-28 深圳市茁壮网络股份有限公司 A kind of method and device playing TS streams
CN109640179B (en) * 2018-11-27 2020-09-22 Oppo广东移动通信有限公司 Video decoding control method and device and electronic equipment
CN109640179A (en) * 2018-11-27 2019-04-16 Oppo广东移动通信有限公司 Video frequency decoding control method, device and electronic equipment
US11456013B2 (en) 2018-11-27 2022-09-27 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Video decoding control method, electronic device, and storage medium
CN110602551A (en) * 2019-08-22 2019-12-20 福建星网智慧科技股份有限公司 Media playing method, player, equipment and storage medium of android frame layer
CN110662084B (en) * 2019-10-15 2021-07-09 北京齐尔布莱特科技有限公司 MP4 file stream live broadcasting method, mobile terminal and storage medium
CN110662084A (en) * 2019-10-15 2020-01-07 北京齐尔布莱特科技有限公司 MP4 file stream live broadcasting method, mobile terminal and storage medium
CN112532991A (en) * 2020-10-28 2021-03-19 惠州华阳通用电子有限公司 Hardware decoding method for RMFF format file
CN114339408A (en) * 2021-11-26 2022-04-12 惠州华阳通用电子有限公司 Video decoding method
WO2024062231A1 (en) * 2022-09-20 2024-03-28 V-Nova International Limited Method for decoding a video stream

Similar Documents

Publication Publication Date Title
CN105898496A (en) HLS stream hardware decoding method based on Android device and device
CN107409234B (en) Streaming based on file format using DASH format based on LCT
CN107925797B (en) Method and apparatus for acquiring audio data
JP6290950B2 (en) Method for receiving media data in a multimedia transmission system
US11070872B2 (en) Receiving device, transmitting device, and data processing method
CN107634930B (en) Method and device for acquiring media data
CN110832872B (en) Processing media data using generic descriptors for file format boxes
CN105900445B (en) The method and apparatus of steady live operation for dynamic self-adapting stream transmission
TW202032998A (en) Multiple decoder interface for streamed media data
KR20170138994A (en) Broadcast signal transmission apparatus, broadcast signal reception apparatus, broadcast signal transmission method, and broadcast signal reception method
TW201626774A (en) Carriage of media content quality information
KR102518817B1 (en) Broadcast signal transmission apparatus, broadcast signal reception apparatus, broadcast signal transmission method, and broadcast signal reception method
CN105992044A (en) Method and system of transcoding HLS to RTMP live streaming
JP2021107943A (en) Reception apparatus and reception method
JP2015136057A (en) Communication device, communication data generation method, and communication data processing method
CN104023260B (en) Hardware decoding realization method, device and player
CN1939060B (en) Method and device for promoting flow type transmission of video frequency information
CN113938470A (en) Method and device for playing RTSP data source by browser and streaming media server
CN109640162A (en) Code stream conversion method and system
CN104093089A (en) Cinema program live telecasting system and method
JP7218773B2 (en) Transmission device, transmission method, media processing device, media processing method, and reception device
TW202304216A (en) Split rendering of extended reality data over 5g networks
CN110574378B (en) Method and apparatus for media content asset change
JP4756848B2 (en) Data distribution method and information processing apparatus
WO2017092435A1 (en) Method and device for audio/video real-time transmission, transmission stream packing method, and multiplexer

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20160824