CN110602061A - Method, system and equipment for expanding network protocol and format of android player - Google Patents

Method, system and equipment for expanding network protocol and format of android player Download PDF

Info

Publication number
CN110602061A
CN110602061A CN201910783779.1A CN201910783779A CN110602061A CN 110602061 A CN110602061 A CN 110602061A CN 201910783779 A CN201910783779 A CN 201910783779A CN 110602061 A CN110602061 A CN 110602061A
Authority
CN
China
Prior art keywords
network
format
media stream
local
player
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
CN201910783779.1A
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.)
Fujian Star-Net Wisdom Technology Co Ltd
Original Assignee
Fujian Star-Net Wisdom Technology 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 Fujian Star-Net Wisdom Technology Co Ltd filed Critical Fujian Star-Net Wisdom Technology Co Ltd
Priority to CN201910783779.1A priority Critical patent/CN110602061A/en
Publication of CN110602061A publication Critical patent/CN110602061A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/60Network streaming of media packets
    • H04L65/65Network streaming protocols, e.g. real-time transport protocol [RTP] or real-time control protocol [RTCP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/60Network streaming of media packets
    • H04L65/75Media network packet handling
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/60Network structure or processes for video distribution between server and client or between remote clients; Control signalling between clients, server and network components; Transmission of management data between server and client, e.g. sending from server to client commands for recording incoming content stream; Communication details between server and client 
    • H04N21/63Control signaling related to video distribution between client, server and network components; Network processes for video distribution between server and clients or between remote clients, e.g. transmitting basic layer and enhancement layers over different transmission paths, setting up a peer-to-peer communication via Internet between remote STB's; Communication protocols; Addressing
    • H04N21/643Communication protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/60Network structure or processes for video distribution between server and client or between remote clients; Control signalling between clients, server and network components; Transmission of management data between server and client, e.g. sending from server to client commands for recording incoming content stream; Communication details between server and client 
    • H04N21/63Control signaling related to video distribution between client, server and network components; Network processes for video distribution between server and clients or between remote clients, e.g. transmitting basic layer and enhancement layers over different transmission paths, setting up a peer-to-peer communication via Internet between remote STB's; Communication protocols; Addressing
    • H04N21/643Communication protocols
    • H04N21/6437Real-time Transport Protocol [RTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/85Assembly of content; Generation of multimedia applications
    • H04N21/858Linking data to content, e.g. by linking an URL to a video object, by creating a hotspot
    • H04N21/8586Linking data to content, e.g. by linking an URL to a video object, by creating a hotspot by using a URL

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The invention provides an expansion method of network protocol and format of an android player, which comprises the following steps before the player calls a SetDataSource interface: s1, intercepting the network media stream through the local service; s2, carrying out playing protocol analysis on the intercepted network media stream in the local service, and/or recoding the network media stream into a format which can be recognized by an android player to form a new media package; s3, building a local URL; s4, forwarding the new media packet by using the local URL, and then transmitting the local URL to the SetDataSource interface for use, namely completing the expansion of the MediaPlayer network protocol and format. The invention expands the supported protocol and format of MediaPlayer and supports all protocols, so that the invention can play its role in various application scenes.

Description

Method, system and equipment for expanding network protocol and format of android player
Technical Field
The invention relates to a method, a system and equipment for expanding a network protocol and a format based on an android player.
Background
In the existing handheld terminal and set-top box equipment, the android system is widely used, and the MediaPlayer is an original media framework of the android system and is widely applied to media playing of the android platform.
In the existing MediaPlayer, the supportable network protocols and formats are quite few (for example, MP4 format transmitted by HTTP under android 4.4), and some customized protocols or audio/video formats cannot be satisfied.
As shown in fig. 1, the control of playing audio/video files and streams by the current MediaPlayer is managed by a state machine. A MediaPlayer object will transition from Idle state directly to Initialized state after invoking SetDataSource.
Disclosure of Invention
The technical problem to be solved by the invention is to provide a method, a system and equipment for expanding a network protocol and a format based on an android player, which expand the protocol and the format supported by a MediaPlayer and support all the protocols, so that the protocols can play other roles in various application scenes.
The method of the invention is realized as follows: before a player calls a SetDataSource interface, the following steps are carried out:
s1, intercepting the network media stream through the local service;
s2, carrying out playing protocol analysis on the intercepted network media stream in the local service, and/or recoding the network media stream into a format which can be recognized by an android player to form a new media package;
s3, building a local URL;
s4, forwarding the new media packet by using the local URL, and then transmitting the local URL to the SetDataSource interface for use, namely completing the expansion of the MediaPlayer network protocol and format.
The system of the invention is realized as follows: an expansion system for network protocols and formats of android players, comprising:
the intercepting module is used for intercepting the network media stream through the local service before the player calls the SetDataSource interface;
the analysis and transcoding module is used for carrying out playing protocol analysis on the intercepted network media stream in the local service and/or recoding the network media stream into a format which can be identified by an android player to form a new media package;
the URL building module is used for building a local URL;
and the forwarding and transmitting module is used for forwarding the new media packet by using the local URL and transmitting the local URL to the SetDataSource interface for use, namely the expansion of the MediaPlayer network protocol and format is completed.
The device of the invention is realized as follows: a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps when executing the program of:
s1, before the player calls the SetDataSource interface, intercepting the network media stream through the local service;
s2, carrying out playing protocol analysis on the intercepted network media stream in the local service, and/or recoding the network media stream into a format which can be recognized by an android player to form a new media package;
s3, building a local URL;
s4, forwarding the new media packet by using the local URL, and then transmitting the local URL to the SetDataSource interface for use, namely completing the expansion of the MediaPlayer network protocol and format.
The invention has the following advantages: the invention intercepts the network media stream, carries out playing protocol analysis on the intercepted network media stream in a local service, and/or recodes the network media stream into a format which can be identified by an android player, then constructs a local URL, forwards the new media packet, and transmits the local URL to a SetDataSource interface for use, thereby expanding the protocol and format supported by the MediaPlayer and supporting all protocols, so that the invention can play its role in various application scenes.
Drawings
The invention will be further described with reference to the following examples with reference to the accompanying drawings.
Fig. 1 is a flow chart of the control process of MediaPlayer on media stream in the prior art.
FIG. 2 is a flowchart of a method for expanding the network protocol and format of the android player according to the present invention.
FIG. 3 is an architecture diagram of an extension system of the android player network protocol and format according to the present invention.
Detailed Description
Referring to fig. 2, the method for expanding the network protocol and format of the android player according to the present invention is that a MediaPlayer object calls a SetDataSource interface, and the MediaPlayer converts the Idle state to an Initialized state, that is, four steps are added before the SetDataSource interface, where the four steps are respectively:
s1, intercepting the network media stream through the local service;
s2, carrying out playing protocol analysis on the intercepted network media stream in the local service, and/or recoding the network media stream into a format which can be recognized by an android player to form a new media package; the recoding is realized by an ffmpeg module of a local service; the meaning of "and/or" here is: the parsing and re-encoding of the playing protocol are not necessarily both required, and as to the specific situation, only when the playing protocol of the network media stream is a protocol that is not supported by the android player, the parsing is required by the local service; similarly, the native service re-encoding is only required if the format of the network media stream is a format that is not recognizable by the android player.
S3, building a local URL;
s4, forwarding the new media packet by using the local URL, and then transmitting the local URL to the SetDataSource interface for use, namely completing the expansion of the MediaPlayer network protocol and format.
As shown in fig. 3, based on the method of the present invention, the present invention further provides an expansion system for an android player network protocol and format, including:
the intercepting module is used for intercepting the network media stream through the local service before the player calls the SetDataSource interface;
the analysis and transcoding module is used for carrying out playing protocol analysis on the intercepted network media stream in the local service and/or recoding the network media stream into a format which can be identified by an android player to form a new media package; typically the re-encoding is achieved by means of the ffmpeg block of the local service. When the network media stream is composed of two media streams with different protocols, the analysis is to read out the RTP packet serial numbers in the two media streams respectively, and seamlessly splice the two media streams through the RTP packet serial numbers.
The URL building module is used for building a local URL;
and the forwarding and transmitting module is used for forwarding the new media packet by using the local URL and transmitting the local URL to the SetDataSource interface for use, namely the expansion of the MediaPlayer network protocol and format is completed.
Also, based on the above method of the present invention, the present invention further provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the following steps:
s1, before the player calls the SetDataSource interface, intercepting the network media stream through the local service;
s2, carrying out playing protocol analysis on the intercepted network media stream in the local service, and/or recoding the network media stream into a format which can be recognized by an android player to form a new media package; typically the re-encoding is achieved by means of the ffmpeg block of the local service. When the network media stream is composed of two media streams with different protocols, the analysis is to read out the RTP packet serial numbers in the two media streams respectively, and seamlessly splice the two media streams through the RTP packet serial numbers.
S3, building a local URL;
s4, forwarding the new media packet by using the local URL, and then transmitting the local URL to the SetDataSource interface for use, namely completing the expansion of the MediaPlayer network protocol and format.
In step S2, the re-encoding is implemented by the ffmpeg module of the local service.
Two examples are given below:
example one
In a segment of media stream, the segment of media stream is composed of a media stream, and is transmitted by using http protocol, the http protocol may be supported by MediaPlayer, but there may be an unsupported audio-video format (such as Opus), at this time, the current media stream is received by the local server, and the media stream is analyzed locally by: and extracting the media stream and demultiplexing the media stream. If an audio/video format which is not supported by the MediaPlayer is encountered, re-encoding is required (optionally, ffmpeg is used for re-encoding), and this stage is a local transcoding stage. After the message is analyzed and the transcoding is finished, a new media packet is formed, and the new media packet can be in a protocol and a format supported by the MediaPlayer. Then, a URL is established locally, the new media packet is forwarded by using the local URL, and the local URL is transmitted to a SetDataSource interface for use, namely the protocol and format expansion of the MediaPlayer is completed.
Example two
In a segment of media stream, the media stream is composed of two paths of media streams, i.e., a unicast stream and a multicast stream, and for example, the media stream of the unicast stream is played first, and then the media stream of the multicast stream is played. There is some overlap between the unicast and multicast streams, both of which are transmitted using the RTP protocol. The unicast stream and the multicast stream both have their own URLs, so that it is not supported to directly use the SetDataSource interface, and at this time, the two media streams are simultaneously received at the local service, and are locally analyzed, and the implementation method is as follows: the RTP packet sequence numbers in the network are respectively read out, so that the two media streams can be seamlessly spliced when the unicast stream is converted into the multicast stream, the stage is a local parsing stage, for example, if an audio/video format which is not supported by MediaPlayer is encountered, transcoding needs to be performed again (similarly, ffmpeg can be used for transcoding optionally), and the stage is a local transcoding stage. After the message is analyzed and the transcoding is finished, a new media packet is formed, and the new media packet can be in a protocol and a format supported by the MediaPlayer. And then establishing a URL (uniform resource locator) locally, forwarding the new media packet by using the local URL, and transmitting the local URL to a SetDataSource interface for use.
Although specific embodiments of the invention have been described above, it will be understood by those skilled in the art that the specific embodiments described are illustrative only and are not limiting upon the scope of the invention, and that equivalent modifications and variations can be made by those skilled in the art without departing from the spirit of the invention, which is to be limited only by the appended claims.

Claims (9)

1. A method for expanding network protocols and formats of android players is characterized in that: before the player calls the SetDataSource interface, the following steps are carried out:
s1, intercepting the network media stream through the local service;
s2, carrying out playing protocol analysis on the intercepted network media stream in the local service, and/or recoding the network media stream into a format which can be recognized by an android player to form a new media package;
s3, building a local URL;
s4, forwarding the new media packet by using the local URL, and then transmitting the local URL to the SetDataSource interface for use, namely completing the expansion of the MediaPlayer network protocol and format.
2. The method for expanding the android player network protocol and format of claim 1, comprising: in step S2, the re-encoding is implemented by the ffmpeg module of the local service.
3. The data reference method of the test record table and the test report table according to claim 1, wherein: if the network media stream is composed of two media streams with different protocols, in step S2, the parsing is to read out the RTP packet sequence numbers in the two media streams, and seamlessly splice the two media streams according to the RTP packet sequence numbers.
4. An expansion system of network protocol and format of an android player is characterized in that: the method comprises the following steps:
the intercepting module is used for intercepting the network media stream through the local service before the player calls the SetDataSource interface;
the analysis and transcoding module is used for carrying out playing protocol analysis on the intercepted network media stream in the local service and/or recoding the network media stream into a format which can be identified by an android player to form a new media package;
the URL building module is used for building a local URL;
and the forwarding and transmitting module is used for forwarding the new media packet by using the local URL and transmitting the local URL to the SetDataSource interface for use, namely the expansion of the MediaPlayer network protocol and format is completed.
5. The system of claim 4, wherein the android player network protocol and format expansion system comprises: the re-encoding is implemented by the ffmpeg module of the local service.
6. The system of claim 4, wherein the android player network protocol and format expansion system comprises: if the network media stream is composed of two media streams with different protocols, the analysis is to read out the RTP packet serial numbers in the two media streams respectively, and seamlessly splice the two media streams through the RTP packet serial numbers.
7. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor when executing the program performs the steps of:
s1, before the player calls the SetDataSource interface, intercepting the network media stream through the local service;
s2, carrying out playing protocol analysis on the intercepted network media stream in the local service, and/or recoding the network media stream into a format which can be recognized by an android player to form a new media package;
s3, building a local URL;
s4, forwarding the new media packet by using the local URL, and then transmitting the local URL to the SetDataSource interface for use, namely completing the expansion of the MediaPlayer network protocol and format.
8. A computer device according to claim 7, wherein: in step S2, the re-encoding is implemented by the ffmpeg module of the local service.
9. A computer device according to claim 7, wherein: if the network media stream is composed of two media streams with different protocols, in step S2, the parsing is to read out the RTP packet sequence numbers in the two media streams, and seamlessly splice the two media streams according to the RTP packet sequence numbers.
CN201910783779.1A 2019-08-23 2019-08-23 Method, system and equipment for expanding network protocol and format of android player Pending CN110602061A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910783779.1A CN110602061A (en) 2019-08-23 2019-08-23 Method, system and equipment for expanding network protocol and format of android player

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910783779.1A CN110602061A (en) 2019-08-23 2019-08-23 Method, system and equipment for expanding network protocol and format of android player

Publications (1)

Publication Number Publication Date
CN110602061A true CN110602061A (en) 2019-12-20

Family

ID=68855442

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910783779.1A Pending CN110602061A (en) 2019-08-23 2019-08-23 Method, system and equipment for expanding network protocol and format of android player

Country Status (1)

Country Link
CN (1) CN110602061A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111355976A (en) * 2020-03-31 2020-06-30 北京东方国信科技股份有限公司 Video live broadcast method and system based on HEVC standard

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120246279A1 (en) * 2009-12-04 2012-09-27 Joanna Zang System and method for delivering multimedia content for playback through network
CN102724561A (en) * 2012-05-16 2012-10-10 昆山日通电脑科技办公设备有限公司 Embedded real time streaming media network transmission method and implementation system thereof
WO2012167458A1 (en) * 2011-06-09 2012-12-13 深圳市融创天下科技股份有限公司 Method and system for adapting session description protocol of mobile terminal player
CN103036889A (en) * 2012-12-19 2013-04-10 常州中流电子科技有限公司 Self-adapting streaming media displaying method and self-adapting streaming media displaying system
CN103036888A (en) * 2012-12-19 2013-04-10 南京视海网络科技有限公司 Self-adapting stream-media play method and self-adapting play unit
CN103581699A (en) * 2013-11-04 2014-02-12 广州华工信元通信技术有限公司 Video playing method, streaming media server and streaming media playing system
US8719437B1 (en) * 2009-08-13 2014-05-06 Avvasi Inc. Enabling streaming to a media player without native streaming support
CN103916678A (en) * 2012-12-31 2014-07-09 中国移动通信集团广东有限公司 Multimedia data transcoding method, transcoding device and multimedia data play system
CN104104972A (en) * 2013-04-10 2014-10-15 深圳市快播科技有限公司 Multimedia playing method, apparatus and system
CN104113790A (en) * 2013-04-16 2014-10-22 优视科技有限公司 Video playing method based on Android operating system, and video playing device based on Android operating system
CN105142020A (en) * 2015-08-10 2015-12-09 合一网络技术(北京)有限公司 Method and system for converting video in unsupported format in mobile terminal
CN106804003A (en) * 2017-03-09 2017-06-06 广州四三九九信息科技有限公司 Video editing method and device based on ffmpeg
CN107295423A (en) * 2016-04-05 2017-10-24 南京微特喜网络科技有限公司 A kind of adaptive coding and transmission method live for mobile terminal video

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8719437B1 (en) * 2009-08-13 2014-05-06 Avvasi Inc. Enabling streaming to a media player without native streaming support
US20120246279A1 (en) * 2009-12-04 2012-09-27 Joanna Zang System and method for delivering multimedia content for playback through network
WO2012167458A1 (en) * 2011-06-09 2012-12-13 深圳市融创天下科技股份有限公司 Method and system for adapting session description protocol of mobile terminal player
CN102724561A (en) * 2012-05-16 2012-10-10 昆山日通电脑科技办公设备有限公司 Embedded real time streaming media network transmission method and implementation system thereof
CN103036889A (en) * 2012-12-19 2013-04-10 常州中流电子科技有限公司 Self-adapting streaming media displaying method and self-adapting streaming media displaying system
CN103036888A (en) * 2012-12-19 2013-04-10 南京视海网络科技有限公司 Self-adapting stream-media play method and self-adapting play unit
CN103916678A (en) * 2012-12-31 2014-07-09 中国移动通信集团广东有限公司 Multimedia data transcoding method, transcoding device and multimedia data play system
CN104104972A (en) * 2013-04-10 2014-10-15 深圳市快播科技有限公司 Multimedia playing method, apparatus and system
CN104113790A (en) * 2013-04-16 2014-10-22 优视科技有限公司 Video playing method based on Android operating system, and video playing device based on Android operating system
CN103581699A (en) * 2013-11-04 2014-02-12 广州华工信元通信技术有限公司 Video playing method, streaming media server and streaming media playing system
CN105142020A (en) * 2015-08-10 2015-12-09 合一网络技术(北京)有限公司 Method and system for converting video in unsupported format in mobile terminal
CN107295423A (en) * 2016-04-05 2017-10-24 南京微特喜网络科技有限公司 A kind of adaptive coding and transmission method live for mobile terminal video
CN106804003A (en) * 2017-03-09 2017-06-06 广州四三九九信息科技有限公司 Video editing method and device based on ffmpeg

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111355976A (en) * 2020-03-31 2020-06-30 北京东方国信科技股份有限公司 Video live broadcast method and system based on HEVC standard
CN111355976B (en) * 2020-03-31 2022-10-11 北京东方国信科技股份有限公司 Video live broadcast method and system based on HEVC standard

Similar Documents

Publication Publication Date Title
US10244078B2 (en) Information processing apparatus, information processing method, and program
WO2013111630A1 (en) Receiving device, receiving method, program, and information processing system
MX2012010750A (en) Receiver and method for reporting the usage of advanced television services.
CN103945284B (en) Information processing method and information processing unit
US10965969B2 (en) Method and apparatus for playing online television program
JP2019050554A (en) Method and apparatus for providing voice service
WO2015180446A1 (en) System and method for maintaining connection channel in multi-device interworking service
CN104080014B (en) A kind of real time video processing method and apparatus
JPWO2016174960A1 (en) Reception device, transmission device, and data processing method
CN105049931A (en) Method and system for converting video with non-supporting format in mobile terminal
US20240107087A1 (en) Server, terminal and non-transitory computer-readable medium
JP6116240B2 (en) Transmission device, transmission method, and program
CN114025244A (en) Audio and video pushing method, device, equipment and computer readable storage medium
CN103780952A (en) Intelligent terminal message sending method and system
CN110602061A (en) Method, system and equipment for expanding network protocol and format of android player
CN106303754A (en) A kind of audio data play method and device
WO2017071642A1 (en) Media playback method, device and computer storage medium
CN102547481B (en) Mobile streaming media online play list setting and content fast-switching method and system
JP6197186B2 (en) Communication system, information processing apparatus, and communication method
WO2018019167A1 (en) Set top box-based live sharing method and system
CN105791964B (en) cross-platform media file playing method and system
KR20120086311A (en) Test managing device and method for testing interactivity aspects for compliance with the brazilian digital tv standard
WO2015089790A1 (en) Service processing method, apparatus, and system
CN102123320A (en) Information sending and receiving method and system based on bidirectional digital television network
CN114866842A (en) Web video preview method, equipment and medium

Legal Events

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

Application publication date: 20191220

WD01 Invention patent application deemed withdrawn after publication