CN113840161B - Streaming media transmission method, receiving method, device, electronic equipment and storage medium - Google Patents
Streaming media transmission method, receiving method, device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN113840161B CN113840161B CN202010581954.1A CN202010581954A CN113840161B CN 113840161 B CN113840161 B CN 113840161B CN 202010581954 A CN202010581954 A CN 202010581954A CN 113840161 B CN113840161 B CN 113840161B
- Authority
- CN
- China
- Prior art keywords
- streaming media
- media
- media data
- streaming
- data
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 240
- 230000005540 biological transmission Effects 0.000 title claims abstract description 201
- 230000008569 process Effects 0.000 claims abstract description 151
- 230000026676 system process Effects 0.000 claims abstract description 127
- 238000012545 processing Methods 0.000 claims abstract description 45
- 238000005538 encapsulation Methods 0.000 claims description 28
- 238000004806 packaging method and process Methods 0.000 claims description 11
- 230000004044 response Effects 0.000 claims description 5
- 238000010586 diagram Methods 0.000 description 20
- 238000004891 communication Methods 0.000 description 11
- 238000005516 engineering process Methods 0.000 description 8
- 238000004590 computer program Methods 0.000 description 7
- 230000006870 function Effects 0.000 description 7
- 230000003287 optical effect Effects 0.000 description 5
- 230000009471 action Effects 0.000 description 4
- 230000003993 interaction Effects 0.000 description 4
- 238000012544 monitoring process Methods 0.000 description 4
- 230000005236 sound signal Effects 0.000 description 4
- 230000000977 initiatory effect Effects 0.000 description 3
- 230000002452 interceptive effect Effects 0.000 description 3
- 230000001133 acceleration Effects 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 230000000670 limiting effect Effects 0.000 description 2
- 238000007726 management method Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000002829 reductive effect Effects 0.000 description 2
- 230000002441 reversible effect Effects 0.000 description 2
- 238000012546 transfer Methods 0.000 description 2
- 230000002159 abnormal effect Effects 0.000 description 1
- 230000004075 alteration Effects 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000003384 imaging method Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/234—Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
- H04N21/2343—Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/24—Monitoring of processes or resources, e.g. monitoring of server load, available bandwidth, upstream requests
- H04N21/2405—Monitoring of the internal components or processes of the server, e.g. server load
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/25—Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
- H04N21/254—Management at additional data server, e.g. shopping server, rights management server
- H04N21/2541—Rights Management
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing 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/44—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
- H04N21/4402—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/60—Network 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/63—Control 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/643—Communication protocols
- H04N21/6437—Real-time Transport Protocol [RTP]
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Databases & Information Systems (AREA)
- General Engineering & Computer Science (AREA)
- Information Transfer Between Computers (AREA)
- Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
Abstract
The embodiment of the invention provides a streaming media transmission method, a receiving method, a transmission device, a receiving device, electronic equipment and a storage medium, aiming at reducing the performance loss of the electronic equipment during streaming media transmission or reception. The streaming media transmission method is applied to electronic equipment, a system process for processing media data is operated in the electronic equipment, and at least a media coding module and a streaming media transmission module are operated in the system process, and the method comprises the following steps: after receiving a transmission command initiated by an application process, the system process acquires and codes original media data by the media coding module to obtain coded media data, and stores the coded media data into a storage area; the streaming media transmission module acquires the coded media data from the storage area, encapsulates the acquired coded media data into streaming media data, and sends the streaming media data to a streaming media receiving end.
Description
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a streaming media transmission method, a streaming media receiving method, a streaming media transmission device, a streaming media receiving device, an electronic device, and a storage medium.
Background
In recent years, with the advent of services such as short video, live broadcast, video call, and voice call, various applications related to streaming media have been developed. The user installs the application programs in the electronic equipment such as a mobile phone, a tablet personal computer or a notebook personal computer, and the application programs are operated through the electronic equipment, so that short video service, live broadcast service, video call service or voice call service is developed.
Taking the example of using an application program installed on a mobile phone to develop live broadcast service, during live broadcast by using a related technology, the mobile phone can output collected audio and video data outwards through the following steps. (1) An application process of the application program initiates an audio and video acquisition command to a system process of a mobile phone system program; (2) The system process responds to the audio and video acquisition command, an audio and video coding module running in the system process acquires audio and video data from hardware such as a microphone, a camera and the like, codes the acquired audio and video data, and stores the coded audio and video data into a first-in first-out memory pool 1; (3) The mobile phone copies the audio and video data stored in the first-in first-out memory pool 1 to the first-in first-out memory pool 2 corresponding to the application process in a cross-process manner; (4) And the audio and video transmission module running in the application process acquires audio and video data from the first-in first-out memory pool 2, and encapsulates the acquired audio and video data into streaming media data to be sent to the server.
Because the data volume of streaming media data such as audio and video data is generally larger, the audio and video data occupies more hardware resources during the circulation. However, as presented in the above example, before the mobile phone outputs the audio and video data outwards, the audio and video data may undergo a complicated circulation process in the mobile phone. Therefore, when the related technology is used for audio and video transmission, performance loss of electronic equipment such as mobile phones and the like can be caused, and transmission efficiency is low.
Disclosure of Invention
In view of the foregoing, embodiments of the present invention provide a streaming media transmission method, a streaming media receiving method, a streaming media transmission device, a streaming media receiving device, an electronic device, and a storage medium, which aim to reduce performance loss of the electronic device during streaming media transmission or reception.
In order to solve the above problems, an embodiment of the present invention discloses a streaming media transmission method, which is applied to an electronic device, wherein a system process for processing media data is operated in the electronic device, and at least a media coding module and a streaming media transmission module are operated in the system process, and the method includes:
after receiving a transmission command initiated by an application process, the system process acquires original media data, encodes the acquired original media data to obtain encoded media data, and stores the encoded media data into a first-in first-out storage area;
The streaming media transmission module acquires the coded media data from the first-in first-out storage area, encapsulates the acquired coded media data into streaming media data, and sends the streaming media data to a streaming media receiving end.
The embodiment of the invention also discloses a streaming media receiving method which is applied to the electronic equipment, wherein a system process for processing media data is operated in the electronic equipment, and at least a streaming media transmission module and a media decoding module are operated in the system process, and the method comprises the following steps:
after receiving a receiving command initiated by an application process, the system process sends a streaming media acquisition request to a streaming media sending end by the streaming media transmission module;
the streaming media transmission module receives streaming media data returned by the streaming media sending end, decapsulates the streaming media data into media data, and stores the media data into a first-in first-out storage area;
the media decoding module acquires media data from the first-in first-out storage area and decodes the acquired media data.
The embodiment of the invention also discloses a streaming media transmission device, which comprises a media coding module and a streaming media transmission module, wherein the media coding module and the streaming media transmission module are both operated in a system process for processing media data; wherein,,
The media coding module is used for collecting original media data after the system process receives a transmission command initiated by an application process, coding the collected original media data to obtain coded media data, and storing the coded media data into a first-in first-out storage area;
the streaming media transmission module is used for acquiring the coded media data from the first-in first-out storage area, packaging the acquired coded media data into streaming media data and sending the streaming media data to a streaming media receiving end.
The embodiment of the invention also discloses a streaming media receiving device, which comprises a streaming media transmission module and a media decoding module, wherein the streaming media transmission module and the media decoding module are both operated in a system process for processing media data; wherein,,
the streaming media transmission module is used for sending a streaming media acquisition request to a streaming media sending end after the system process receives a receiving command initiated by an application process;
the streaming media transmission module is also used for receiving streaming media data returned by the streaming media sending end, decapsulating the streaming media data into media data and storing the media data into a first-in first-out storage area;
The media decoding module is configured to obtain media data from the first-in first-out storage area, and decode the obtained media data.
The embodiment of the invention also discloses an electronic device, which comprises a memory and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by one or more processors, and the one or more programs comprise instructions for:
after receiving a transmission command initiated by an application process, a system process acquires original media data by a media coding module running in the system process, codes the acquired original media data to obtain coded media data, and stores the coded media data into a first-in first-out storage area;
the streaming media transmission module running in the system process acquires the coded media data from the first-in first-out storage area, encapsulates the acquired coded media data into streaming media data, and sends the streaming media data to a streaming media receiving end;
wherein the system process is a process created for a system program of the electronic device for processing media data.
The embodiment of the invention also discloses another electronic device, which comprises a memory and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by one or more processors, and the one or more programs comprise instructions for:
after receiving a receiving command initiated by an application process, a system process sends a streaming media acquisition request to a streaming media sending end by a streaming media transmission module running in the system process;
the streaming media transmission module receives streaming media data returned by the streaming media sending end, decapsulates the streaming media data into media data, and stores the media data into a first-in first-out storage area;
a media decoding module running in the system process acquires media data from the first-in first-out storage area and decodes the acquired media data;
wherein the system process is a process created for a system program of the electronic device for processing media data.
The embodiment of the invention also discloses a readable storage medium, when the instructions in the storage medium are executed by a processor of the electronic device, the electronic device can execute one or more of the streaming media transmission method or the streaming media receiving method in the embodiment of the invention.
The embodiment of the invention has the following advantages: in the invention, the media coding module and the streaming media transmission module are both operated in the system process, and the two modules are operated in one process, so that the sharing of the storage area can be realized. Thus, after the media coding module collects and codes the original media data and stores the coded media data in the first-in first-out storage area, the streaming media transmission module can directly acquire the coded media data from the storage area, then encapsulate the acquired coded media data into streaming media data, and then send the encapsulated streaming media data to the streaming media receiving end. Compared with the prior art, the method and the device can reduce the process of cross-process copying of the media data, namely, the encoded streaming media data in the storage area corresponding to the media encoding module is not needed to be copied to the storage area corresponding to the streaming media transmission module in a cross-process way. Therefore, the invention can obviously simplify the circulation process of the media data in the electronic equipment, thereby reducing the performance loss of the electronic equipment during the transmission of the streaming media.
In the same principle, in the invention, the streaming media transmission module and the media decoding module both run in the system process, and the two modules run in one process, so that the sharing of the storage area can be realized. Thus, when the streaming media transmission module receives the streaming media data returned by the streaming media sending end, and decapsulates the received streaming media data into media data, and stores the media data into the first-in first-out storage area, the media decoding module can directly acquire the media data from the storage area and decode the acquired media data. Compared with the prior art, the method and the device can reduce the process-crossing copying flow of the media data, namely, the media data in the storage area corresponding to the streaming media transmission module does not need to be copied to the storage area corresponding to the media decoding module in a crossing way. Therefore, the invention can remarkably simplify the circulation process of the media data in the electronic equipment, thereby reducing the performance loss of the electronic equipment during the receiving of the streaming media.
Drawings
Fig. 1 is a flowchart illustrating steps of a streaming media transmission method according to an embodiment of the present invention;
fig. 2 (a) is a schematic diagram of audio and video data flowing in a mobile phone during a live service;
fig. 2 (b) is a schematic diagram of audio and video data flowing in a mobile phone during live broadcast service in the prior art;
fig. 3 is an interactive schematic diagram of a streaming media transmission method according to another embodiment of the present invention;
fig. 4 is a flowchart illustrating steps of a method for receiving streaming media according to an embodiment of the present invention;
fig. 5 is an interaction schematic diagram of a streaming media receiving method according to another embodiment of the present invention;
fig. 6 is a block diagram of a streaming media transmission device according to an embodiment of the present invention;
fig. 7 is a block diagram of a streaming media receiving apparatus according to an embodiment of the present invention;
fig. 8 is a block diagram illustrating a structure of a terminal for streaming or streaming decoding according to an embodiment of the present invention.
Detailed Description
In order that the above-recited objects, features and advantages of the present invention will become more readily apparent, a more particular description of the invention will be rendered by reference to the appended drawings and appended detailed description.
The inventive concept of the embodiment of the invention is as follows: and adding a streaming media transmission module in a system process for processing media data, so that the streaming media transmission module and the media coding module operate in the same process (namely the system process for processing the media data), thereby realizing the sharing of the storage area by the streaming media transmission module and the media coding module. As such, the media data does not have to be spanned Cheng Kaobei between the respective storage areas of the streaming media transmission module and the media encoding module as in the prior art. Therefore, the circulation process of the streaming media in the electronic equipment can be simplified, and the performance loss of the electronic equipment during the streaming media transmission is reduced.
Referring to fig. 1, fig. 1 is a flowchart illustrating steps of a streaming media transmission method according to an embodiment of the present invention. The streaming media transmission method is applied to the electronic equipment, a system process for processing media data is operated in the electronic equipment, and at least a media coding module and a streaming media transmission module are operated in the system process.
In the present invention, streaming media includes, but is not limited to: and encapsulating the media data such as video, audio or audio and video according to a streaming media encapsulation protocol.
In the present invention, the electronic device includes, but is not limited to: cell phones, tablet computers, wearable devices, etc.
In the present invention, the system process means: a process created for the running of a system program. The system process for processing media data refers to: a process created for the execution of a system program for processing media data. For easy understanding, taking an android operating system in a mobile phone as an example, the android operating system includes a media device system program for processing audio and video data, and a process created for running the media device system program is a system process, which may be called a media device process, and the system process is used for processing the audio and video data. In the invention, the media system program at least comprises two program modules, namely a media coding module and a streaming media transmission module. In this way, at least the media encoding module and the streaming media transmission module are operated in the system process created for the operation of the media system program.
As shown in fig. 1, the streaming media transmission method may include the steps of:
step S11: after receiving a transmission command initiated by an application process, the system process acquires original media data, encodes the acquired original media data to obtain encoded media data, and stores the encoded media data in a first-in first-out storage area.
In the present invention, the application process means: a process created for the running of an Application (Application). For easy understanding, for example, an application program for live broadcast is installed in a mobile phone, and a process created for running the application program is an application process, and the application process may be also called an APP process.
In particular, when the system process receives a transmission command initiated by the application process, the system process starts the media coding module and the streaming media transmission module. The media encoding module begins collecting raw media data from a hardware unit (e.g., a camera and/or microphone) of the electronic device or from other system processes. The media coding module codes the acquired original media data to obtain coded media data, and then stores the coded media data in a first-in first-out storage area. The fifo memory area may be a fifo memory pool. It should be noted that the present invention is not limited to where the media encoding module collects the original media data and how to collect the original media data.
In order to facilitate understanding of the step S11, taking an example of using an application program installed on a mobile phone to develop a live broadcast service, a system process for processing media data such as audio and video is running in the mobile phone, and the system process is a media process of an android operating system. The media process runs with a media coding module, specifically, the media coding module is an audio/video coding and decoding module of the android operating system (for example, a strageflight module applied from version 4.2 to version 8.0 of the android operating system is an audio/video coding and decoding module). In addition, a program module of a streaming media transmission module is newly added in the existing media system program, so that the streaming media transmission module is also operated in the media process created for the operation of the media system program. In short, a media encoding module and a streaming media transmission module are operated in the media process.
Referring to fig. 2 (a), fig. 2 (a) is a schematic diagram of audio and video data flowing in a mobile phone during a live service. As shown in fig. 2 (a), an audio encoding unit in a media encoding module (e.g., a strageframe module applied from version 4.2 to version 8.0 of the android operating system) collects pcm audio data (an original audio data), where the audio encoding unit may collect pcm audio data from a microphone, or may collect pcm audio data from other system processes. The audio coding unit codes the collected pcm audio data, and then stores the coded audio data into the first-in first-out memory pool.
As shown in fig. 2 (a), the video encoding unit in the media encoding module acquires yuv video data (an original video data), where the video encoding unit may acquire yuv video data from a camera, or may acquire yuv video data from other system processes, and the specific manner of acquiring yuv video data by the video encoding unit is not limited in the present invention. The video coding unit codes the collected yuv video data and stores the coded video data into the first-in first-out memory pool.
It should be noted that, the example shown in fig. 2 (a) is one embodiment of various embodiments of the present invention, which is intended to facilitate the understanding of the present invention by the skilled person, and thus the above example should not be construed as limiting the present invention.
Step S12: the streaming media transmission module acquires the coded media data from the first-in first-out storage area, encapsulates the acquired coded media data into streaming media data, and sends the streaming media data to a streaming media receiving end.
Wherein, the streaming media receiving end refers to: and other entity devices besides the electronic device for implementing the invention. Specifically, the streaming media receiving end includes, but is not limited to: server equipment and node equipment of the Internet of things. For example, when the present invention is applied to the internet field, the electronic device implementing the present invention may be a terminal (e.g., a mobile phone), and the streaming media receiving end for receiving streaming media may be a server. For example, when the invention is applied to the field of the internet of things, the electronic device implementing the invention can be one node device in the internet of things, and the streaming media receiving end for receiving streaming media can be another node device in the internet of things.
When the method is implemented, the streaming media transmission module acquires the coded media data from the first-in first-out storage area, encapsulates the acquired coded media data into streaming media data according to a preset streaming media encapsulation protocol, and then sends the streaming media data to the streaming media receiving end. The predetermined streaming media packaging protocol is the streaming media packaging protocol corresponding to the application process.
In other words, the streaming media encapsulation protocols corresponding to the different application processes are not necessarily the same, for example, the streaming media encapsulation protocol corresponding to the application process is a real-time streaming protocol (Real Time Streaming Protocol, RTSP), and when the server corresponding to the application process receives the encapsulated streaming media data, the server will decapsulate the received streaming media data based on the real-time streaming protocol. For example, the streaming media encapsulation protocol corresponding to the application process is a real-time message transmission protocol (Real Time Messaging Protocol, RTMP), and when the server corresponding to the application process receives the encapsulated streaming media data, the server will decapsulate the received streaming media data based on the real-time message transmission protocol. In the specific implementation of the invention, the system process, after the stream media transmission module obtains the coded media data from the first-in first-out storage area in response to the transmission command initiated by an application process, encapsulates the obtained media data into stream media data according to the stream media encapsulation protocol corresponding to the application process.
To facilitate understanding of the above step S12, an example shown in fig. 2 (a) is employed. Because the streaming media transmission module and the media coding module run in the same process, i.e. the media process, the streaming media transmission module and the media coding module can share the fifo memory pool. Thus, as shown in fig. 2 (a), the streaming media transmission module may directly obtain the encoded audio data and video data from the fifo memory pool, encapsulate the obtained audio data and video data into streaming media data, and then send the encapsulated streaming media data to the streaming media receiving end.
In order to more intuitively illustrate the beneficial effects of the present invention, referring to fig. 2 (b), fig. 2 (b) is a schematic diagram of the audio/video data flowing in a mobile phone during a live service in the prior art. As shown in fig. 2 (b), the flow of acquisition, encoding, and the like of audio data and video data is the same as that of fig. 2 (a). However, in the prior art, since the streaming media transmission module is not written in the media system program but in the application program, the streaming media transmission module is not run in the media process but in the application process. Thus, since the media encoding module and the streaming media transmission module respectively run in different processes, namely in the media process and the application process, the two modules are respectively allocated with different memory pools. As shown in fig. 2 (b), the media coding module corresponds to the fifo pool 1, and the streaming media transmission module corresponds to the fifo pool 2.
As shown in fig. 2 (b), after storing the encoded audio data and video data in the fifo 1, the electronic device needs to first step Cheng Kaobei the audio data and video data in the fifo 1 into the fifo 2. Then the streaming media transmission module can acquire the audio data and the video data from the first-in first-out memory pool 2, then the acquired audio data and video data are packaged into streaming media data, and finally the packaged streaming media data are sent to the streaming media receiving end.
It can be seen that the present invention can reduce the stride Cheng Kaobei of media data at least once compared to the prior art. In particular, comparing FIG. 2 (a) with FIG. 2 (b), the present invention does not have to copy media data from FIFO memory pool 1 to FIFO memory pool 2. Therefore, the invention can obviously simplify the circulation process of the media in the electronic equipment, thereby reducing the performance loss of the electronic equipment during the transmission of the streaming media.
In some embodiments of the present invention, the streaming media transmission method provided by the present invention may be applied to the internet field. In these embodiments, the electronic device implementing the present invention may be a mobile phone terminal, and the streaming media receiving end may be a server end. Since a plurality of application programs related to streaming media can be installed in the mobile phone terminal, the application programs interact with different service ends respectively. Therefore, when the user starts different application programs to develop different types of streaming media services, the streaming media transmission module in the system process will send streaming media data to different service ends.
Because the addresses of the different streaming media receiving ends are different, and furthermore, as described above, the protocols adopted by the different streaming media receiving ends when decapsulating streaming media data are different. In these embodiments, therefore, the system process needs to determine the address of the streaming media receiving end and the streaming media encapsulation protocol to send streaming media data meeting the protocol requirements to the correct streaming media receiving end. To this end, in these embodiments, the system process may also receive the streaming media receiver address passed by the application process. When the streaming media transmission module executes the step S12, specifically, the streaming media transmission module encapsulates the acquired encoded media data into streaming media data according to a predetermined streaming media encapsulation protocol; and the streaming media transmission module sends the streaming media data to the streaming media receiving end corresponding to the streaming media receiving end address. Wherein, the streaming media encapsulation protocol is predetermined according to the streaming media receiving end address.
The address of the receiving end of the streaming media may be a URL (i.e. uniform resource locator, uniform resource locator) of the receiving end of the streaming media. The URL of the streaming media receiving end is generally in the form of < protocol >:// < host >: port >/< path >, such as rtsp:// www.kuaishou..
In particular, an application system of the electronic device may be preconfigured with multiple types of streaming media encapsulation protocols, in other words, a system process of the application system of the electronic device supports multiple streaming media encapsulation protocols. During the running of the application program by the electronic device, the application process of the application program can send the URL of the streaming media receiving end to the system process while initiating a transmission command to the system process. Or the transmission command initiated by the application process to the system process carries the URL of the streaming media receiving end.
After the system process receives the URL of the streaming media receiving end, the URL of the streaming media receiving end is stored. And as previously described, the system process initiates the media encoding module and the streaming media transmission module. In this way, the streaming media transmission module obtains the URL stored in advance by the system process, and reads the streaming media protocol name from the URL, thereby determining the streaming media encapsulation protocol corresponding to the application process. In addition, the media coding module starts to collect the original media data, codes the collected original media data to obtain coded media data, and then stores the coded media data in the first-in first-out storage area. And the streaming media transmission module acquires the coded media data from the first-in first-out storage area, encapsulates the acquired media data into streaming media data according to a predetermined streaming media encapsulation protocol, and then sends the encapsulated streaming media data to the streaming media receiving end corresponding to the URL.
For the sake of understanding, it is assumed that an application a and an application B are simultaneously installed in the mobile phone terminal, where the application a supports a live broadcast function, and the application a needs to communicate with the server a during the live broadcast service. The application program B supports the video call function, and needs to communicate with the server side B during the video call service development period of the application program B.
When the live broadcast function of the application program a is enabled, the application process a created for the running of the application program a initiates a transmission command to a media process (a system process for processing media data in the android operating system), where the transmission command carries the URL of the server a. The media process receives and stores the URL, and also launches a media encoding module (e.g., the streamcast module applied by versions 4.2 through 8.0 of the android operating system) and a streaming media transport module. In this way, the streaming media transmission module obtains the URL stored in advance by the media process, and reads the streaming media protocol name from the URL, so as to determine the streaming media encapsulation protocol corresponding to the application process (assuming that the determined streaming media encapsulation protocol is the rtsp protocol). In addition, the media coding module starts to collect pcm audio data and yuv video data, codes the collected pcm audio data and yuv video data, and stores the coded audio data and video data into the first-in first-out memory pool. The streaming media transmission module directly acquires the audio data and the video data from the first-in first-out memory pool, and encapsulates the acquired audio data and video data into streaming media data according to an rtsp protocol. And the streaming media transmission module sends the packaged streaming media data to a streaming media receiving end corresponding to the URL, namely the server A.
In some embodiments of the present invention, the system process may further receive token information passed by the application process, where the token information is issued to the application process by the streaming media receiving end if the authentication of the application process passes. And when the streaming media transmission module in the system process transmits the streaming media data to the streaming media receiving end corresponding to the streaming media receiving end address, specifically, the token information and the streaming media data are firstly transmitted to the streaming media receiving end corresponding to the streaming media receiving end address.
For easy understanding, referring to fig. 3, fig. 3 is an interactive schematic diagram of a streaming media transmission method according to another embodiment of the present invention. As shown in fig. 3, the application process first sends an authentication request to the streaming media receiving end. After the streaming media receiving end executes the authentication operation on the application process, the streaming media receiving end returns an authentication result to the application process. Typically, the authentication result is one of two types: authentication pass and authentication fail. As shown in fig. 3, if the authentication of the application process passes, the streaming media receiving end also issues token information (token) to the application process.
After receiving the token information and the authentication result representing that the authentication passes, the application process initiates a transmission command to a system process (such as a media process, i.e. a system process for processing media data in an android operating system), and also transmits the URL of the streaming media receiving end and the token information to the media process. In a specific implementation, as shown in fig. 3, a transmission command initiated by an application process to a media process may be carried: URL and token information of the streaming media receiving end. The media process receives and stores the URL and token information of the streaming media receiving end.
The media process, upon receiving the transfer command, initiates a media encoding module (e.g., the streamcast module applied by version 4.2 to version 8.0 of the android operating system) and a streaming media transfer module. As shown in fig. 3, the media encoding module starts to collect and encode the original media data, and stores the encoded media data in the first-in first-out storage area. Each time the media coding module codes and stores a piece of coded media data, a notification is sent to the streaming media transmission module, the notification being used to characterize that the media coding module has stored a piece of coded media data into the first-in first-out storage area. The duration of each piece of encoded media data may be preset, for example, 100 ms, 1 second or 2 seconds, etc., and the present invention is not limited to the duration of each piece of encoded media data.
As shown in fig. 3, after receiving the notification, the streaming media transmission module obtains the encoded media data from the first-in first-out storage area, encapsulates the obtained media data into streaming media data, and finally sends the token information and the encapsulated streaming media data to the streaming media receiving end corresponding to the URL stored in advance by the media process.
In addition, as shown in fig. 3, the application process may also initiate an end command to the mediadevice process. After receiving the end command, the media encoding module stops collecting and encoding the original media data.
In the above embodiment of the present invention, by receiving the token information transferred by the application process, the system process carries the token information when the streaming media transmission module in the system process sends the streaming media data to the streaming media receiving end, so that the streaming media receiving end can perform the authentication operation based on the token information when receiving the streaming media data and the token information, thereby ensuring the interaction security between the streaming media receiving end and the terminal (i.e. the electronic device executing the present invention).
In addition, it is further considered that the network performance between the streaming media transmission module and the streaming media receiving end may have unavoidable normal fluctuation or abnormal fluctuation. When the network performance is poor, the data volume of the streaming media data sent to the streaming media receiving end in unit time of the streaming media transmission module is reduced, and the streaming media transmission module cannot timely send out the media data stored in the storage area by the media coding module, which may cause insufficient capacity of the storage area.
To this end, in some embodiments of the invention, the streaming media transmission module may monitor network performance; under the condition that the network performance does not meet the preset expected performance, the streaming media transmission module initiates an adjustment command to the media coding module; in response to the adjustment command, the media encoding module reduces the code rate and/or frame rate of the media data and/or discards a portion of the streaming media data in the storage area.
Wherein, the quality of the network performance can be represented by the numerical value of the monitoring index. For example, monitoring metrics include, but are not limited to: response time, throughput, number of retransmissions. It should be noted that, the present invention does not limit the monitoring index of the network performance.
The preset expected performance may be a threshold value set for each monitoring index. For ease of understanding, it is assumed that the monitored indicators of network performance are the number of retransmissions. The preset expected performance is as follows: the number of retransmissions per minute does not exceed 3. If the media coding module monitors the last minute, the retransmission times are 5 times. Since the number of retransmissions exceeds a threshold of the number of retransmissions (i.e. 3 retransmissions per minute), it is determined that the current network performance does not meet the preset desired performance. In this case, the streaming media transmission module initiates an adjustment command to the media encoding module.
The specific mode of the media coding module for reducing the code rate and/or the frame rate of the media data is as follows: the media coding module downregulates the code rate or frame rate of the coded media data during the coding of the original media data.
The streaming media transmission method in the above embodiments may be regarded as a procedure of streaming media data uplink (uploading). Based on the same inventive concept, the following embodiments of the present invention also provide a streaming media receiving method, where the streaming media receiving method in the following embodiments may be regarded as a process of streaming media data downlink (downloading). Considering that the uplink and the downlink of the streaming media data are based on two reverse processes under the same inventive concept, the specific implementation of the downlink process of the streaming media data (i.e. the streaming media receiving method) can refer to the uplink process of the streaming media data (i.e. the streaming media transmitting method), and the streaming media receiving method is briefly introduced by the following embodiments.
Referring to fig. 4, fig. 4 is a flowchart illustrating steps of a method for receiving streaming media according to an embodiment of the present invention. The streaming media receiving method is applied to the electronic equipment, a system process for processing media data is operated in the electronic equipment, and at least a streaming media transmission module and a media decoding module are operated in the system process.
In the present invention, streaming media includes, but is not limited to: and encapsulating the media data such as video, audio or audio and video according to a streaming media encapsulation protocol.
In the present invention, the electronic device includes, but is not limited to: cell phones, tablet computers, wearable devices, etc.
In the present invention, the system process means: a process created for the running of a system program. The system process for processing media data refers to: a process created for the execution of a system program for processing media data.
As shown in fig. 4, the streaming media receiving method may include the steps of:
step S41: after receiving a receiving command initiated by an application process, the system process sends a streaming media acquisition request to a streaming media sending end by the streaming media transmission module.
In the present invention, the application process means: a process created for the running of an Application (Application). Streaming media sender includes, but is not limited to: server equipment and node equipment of the Internet of things.
In particular, when the system process receives a transmission command initiated by an application process, the system process starts a streaming media transmission module and a media decoding module, and the streaming media transmission module sends a streaming media acquisition request to a streaming media sending end.
Step S42: the streaming media transmission module receives the streaming media data returned by the streaming media sending end, decapsulates the streaming media data into media data, and stores the media data into a first-in first-out storage area.
Here, decapsulation is the reverse process of encapsulation, and may also be referred to as decapsulating protocol packets.
When the method is specifically implemented, after the streaming media transmission module receives streaming media data returned by the streaming media sending end, the received streaming media data is unpacked into media data according to a preset streaming media packaging protocol, and then the unpacked media data is stored in a first-in first-out storage area. The predetermined streaming media packaging protocol is the streaming media packaging protocol corresponding to the application process.
Step S43: the media decoding module acquires media data from the first-in first-out storage area and decodes the acquired media data.
In the invention, the streaming media transmission module and the media decoding module run in the same process, namely, the system process for processing the media data. The streaming module and the media decoding module may thus share the first-in first-out storage area, e.g. a first-in first-out memory pool. After the stream media transmission module stores the unpacked media data into the first-in first-out storage area, the media decoding module can directly acquire the media data from the first-in first-out storage area, so that the acquired media data is decoded, and decoded media data is obtained.
In particular, when the electronic device obtains the decoded media data, the decoded media data can be played, stored or transmitted.
In the streaming media receiving method provided by the invention, the streaming media transmission module and the media decoding module are both operated in the system process, and the two modules are operated in one process, so that the sharing of the storage area can be realized. Thus, when the streaming media transmission module receives the streaming media data returned by the streaming media sending end, and decapsulates the received streaming media data into media data, and stores the media data into the first-in first-out storage area, the media decoding module can directly acquire the media data from the storage area and decode the acquired media data. Compared with the prior art, the method and the device can reduce the process-crossing copying flow of the media data, namely, the media data in the storage area corresponding to the streaming media transmission module does not need to be copied to the storage area corresponding to the media decoding module in a crossing way. Therefore, the invention can obviously simplify the circulation process of the media in the electronic equipment, thereby reducing the performance loss of the electronic equipment during the receiving of the streaming media.
In some embodiments of the present invention, the streaming media receiving method provided by the present invention may be applied to the internet field. In these embodiments, the electronic device performing the present invention may be a mobile phone terminal, and the streaming media sending end may be a server. In these embodiments, since the mobile phone terminal needs to acquire streaming media data from different service ends when executing different streaming media services, in these embodiments, the system process needs to determine the address of the streaming media receiving end, so as to send a streaming media acquisition request to the correct service end, thereby receiving the streaming media data returned by the service end.
To this end, in these embodiments, the system process may also receive the streaming media sender address delivered by the application process. When the streaming media transmission module executes the step S41, specifically, the streaming media transmission module sends a streaming media acquisition request to a streaming media transmitting end corresponding to the streaming media transmitting end address according to the streaming media transmitting end address.
In particular, the application process may send the streaming media sender address to the system process while initiating a receive command to the system process. Or the transmission command initiated by the application process to the system process carries the streaming media sender address. After receiving the address of the sending end of the streaming media, the system process stores the address of the sending end of the streaming media. And as previously described, the system process initiates the streaming media transmission module and the media decoding module. In this way, the streaming media transmission module obtains the streaming media sending end address pre-stored by the system process, and then sends a streaming media obtaining request to the streaming media sending end corresponding to the streaming media sending end address. When executing the step S42, the streaming media transmission module specifically receives the streaming media data returned by the streaming media sending end, and decapsulates the streaming media data into media data according to a predetermined streaming media encapsulation protocol, where the streaming media encapsulation protocol is predetermined according to the streaming media sending end address.
The address of the streaming media sender may be a URL (i.e. uniform resource locator, uniform resource locator) of the streaming media sender. The URL of the streaming media sender is generally in the form of < protocol >:// < host >: port >/< path >, such as rtsp:// www.kuaishou..
In particular, an application system of the electronic device may be preconfigured with multiple types of streaming media encapsulation protocols, in other words, a system process of the application system of the electronic device supports multiple streaming media encapsulation protocols. During the running of the application program by the electronic device, the application process of the application program can send the URL of the streaming media sending end to the system process while initiating a receiving command to the system process. Or the transmission command initiated by the application process to the system process carries the URL of the streaming media transmitting end.
After receiving the URL of the streaming media transmitting end, the system process stores the URL of the streaming media transmitting end. And as previously described, the system process initiates the streaming media transmission module and the media decoding module. In this way, the streaming media transmission module obtains the URL stored in advance by the system process, and reads the streaming media protocol name from the URL, thereby determining the streaming media encapsulation protocol corresponding to the application process. In addition, the streaming media transmission module also sends a streaming media acquisition request to the streaming media sending end corresponding to the URL. The streaming media sending end responds to the streaming media acquisition request and continuously returns a plurality of streaming media data to the streaming media transmission module. The streaming media transmission module decapsulates each streaming media data according to a predetermined streaming media encapsulation protocol into media data and stores the media data in a first-in first-out storage area. The media decoding module acquires media data from the first-in first-out storage area and decodes the acquired media data.
In some embodiments of the present invention, the system process may further receive token information passed by the application process, where the token information is issued to the application process when the streaming media sender authenticates the application process. When the streaming media transmission module in the system process sends a streaming media acquisition request to the streaming media sending end corresponding to the streaming media sending end address according to the streaming media sending end address, specifically, the streaming media transmission module can send the streaming media acquisition request carrying the token information to the streaming media sending end corresponding to the streaming media sending end address according to the streaming media sending end address.
For easy understanding, referring to fig. 5, fig. 5 is an interactive schematic diagram of a streaming media receiving method according to another embodiment of the present invention. As shown in fig. 5, the application process first sends an authentication request to the streaming media sender. After executing authentication operation to the application process, the streaming media sending end returns an authentication result to the application process. Typically, the authentication result is one of two types: authentication pass and authentication fail. As shown in fig. 5, if the authentication of the application process passes, the streaming media sender will also send token information (token) to the application process.
After receiving the token information and the authentication result representing that the authentication passes, the application process initiates a receiving command to a system process (such as a media process, i.e. a system process for processing media data in an android operating system), and also transmits a streaming media sender address (such as a URL of a streaming media receiver) and the token information to the media process. In a specific implementation, as shown in fig. 5, a received command initiated by an application process to a media process may be carried: URL and token information of the streaming media transmitting end. The media process receives and stores the URL and token information of the streaming media sender.
The media process, upon receiving the receive command, initiates a streaming media transport module and a media decoding module (e.g., the streamweight module applied by versions 4.2 through 8.0 of the android operating system). The streaming media transmission module acquires the streaming media sending end URL and the token information stored in advance by the media process, as shown in fig. 5, and sends a streaming media acquisition request to the streaming media sending end corresponding to the streaming media sending end URL, where the streaming media acquisition request carries the token information.
As shown in fig. 5, the streaming media transmission module receives streaming media data returned by the streaming media sending end, decapsulates the received streaming media data into media data, and stores the decapsulated media data in the first-in first-out storage area. Each time the streaming media transmission module stores a piece of media data, a notification is sent to the audio/video codec module, where the notification is used to characterize that the streaming media transmission module has stored a piece of media data into the first-in first-out storage area.
As shown in fig. 5, after receiving the notification, the media decoding module acquires media data from the storage area, and decodes the acquired media data to obtain decoded media data.
It should be noted that, for simplicity of description, the method embodiments are shown as a series of acts, but it should be understood by those skilled in the art that the embodiments are not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred embodiments, and that the acts are not necessarily required by the embodiments of the invention.
Referring to fig. 6, fig. 6 is a block diagram illustrating a streaming media transmission device according to an embodiment of the present invention. As shown in fig. 6, the apparatus includes a media encoding module 61 and a streaming media transmission module 62, and the media encoding module 61 and the streaming media transmission module 62 are both operated in a system process for processing media data, wherein:
the media encoding module 61 is configured to collect original media data after the system process receives a transmission command initiated by an application process, encode the collected original media data to obtain encoded media data, and store the encoded media data in a first-in first-out storage area;
The streaming media transmission module 62 is configured to obtain the encoded media data from the first-in first-out storage area, package the obtained encoded media data into streaming media data, and send the streaming media data to a streaming media receiving end.
Optionally, when the streaming media transmission module 62 encapsulates the encoded media data into streaming media data and sends the streaming media data to a streaming media receiving end, the streaming media transmission module is specifically configured to encapsulate the acquired encoded media data into streaming media data according to a predetermined streaming media encapsulation protocol, and send the streaming media data to a streaming media receiving end corresponding to the streaming media receiving end address; the streaming media receiving end address is sent to the system process in advance by the application process, and the streaming media packaging protocol is predetermined according to the streaming media receiving end address.
Optionally, when the streaming media transmission module 62 sends the streaming media data to the streaming media receiving end corresponding to the streaming media receiving end address, the streaming media transmission module is specifically configured to send token information and the streaming media data to the streaming media receiving end corresponding to the streaming media receiving end address;
And the token information is issued to the application process and then transmitted to the system process by the application process under the condition that the streaming media receiving end authenticates the application process.
Optionally, the streaming media transmission module 62 is further configured to monitor network performance, and initiate an adjustment command to the media encoding module 61 if the network performance does not meet a preset expected performance;
the media encoding module 61 is further configured to reduce a code rate and/or a frame rate of the media data and/or discard the partially encoded media data in the storage area in response to the adjustment command.
Optionally, the media encoding module 61 is further configured to send a notification to the streaming media transmission module 62 after storing the encoded media data in the first-in first-out storage area, where the notification is used to indicate that the media encoding module 61 stores a copy of the encoded media data in the first-in first-out storage area;
the streaming module 62 performs the step of retrieving the encoded media data from the fifo storage area after receiving the notification.
Referring to fig. 7, fig. 7 is a block diagram illustrating a structure of a streaming media receiving apparatus according to an embodiment of the present invention. As shown in fig. 7, the apparatus includes a streaming media transmission module 71 and a media decoding module 72, and the streaming media transmission module 71 and the media decoding module 72 are both operated in a system process for processing media data, wherein:
The streaming media transmission module 71 is configured to send a streaming media acquisition request to a streaming media sending end after the system process receives a receiving command initiated by an application process;
the streaming media transmission module 71 is further configured to receive streaming media data returned by the streaming media sending end, decapsulate the streaming media data into media data, and store the media data in a first-in first-out storage area;
the media decoding module 72 is configured to obtain media data from the first-in first-out storage area and decode the obtained media data.
Optionally, when the streaming media transmission module 71 sends a streaming media acquisition request to a streaming media sending end, the streaming media transmission module is specifically configured to send the streaming media acquisition request to a streaming media sending end corresponding to the streaming media sending end address according to the streaming media sending end address that is transferred to the system process by the application process;
the streaming media transmission module 71 is specifically configured to receive the streaming media data returned by the streaming media sender and decapsulate the streaming media data into media data when receiving the streaming media data returned by the streaming media sender, and decapsulate the streaming media data into media data according to a predetermined streaming media encapsulation protocol, where the streaming media encapsulation protocol is predetermined according to the streaming media sender address.
Optionally, when sending a streaming media acquisition request to a streaming media sending end corresponding to the streaming media sending end address, the streaming media transmission module 71 is specifically configured to send, according to the streaming media sending end address, a streaming media acquisition request carrying token information to the streaming media sending end corresponding to the streaming media sending end address;
and the token information is issued to the application process and then transmitted to the system process by the application process under the condition that the streaming media transmitting end authenticates the application process.
Optionally, after storing the media data in the first-in first-out storage area, the streaming module 71 is further configured to send a notification to the media decoding module 72, where the notification is used to indicate that the streaming module 71 stores a piece of media data in the first-in first-out storage area;
the media decoding module 72 performs the step of retrieving media data from the first-in first-out storage area after receiving the notification.
For the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments for relevant points.
Fig. 8 is a block diagram illustrating an electronic device 800 for streaming or streaming decoding according to an exemplary embodiment. For example, electronic device 800 may be a mobile phone, computer, digital broadcast terminal, messaging device, game console, tablet device, medical device, exercise device, personal digital assistant, or the like.
Referring to fig. 8, an electronic device 800 may include one or more of the following components: a processing component 802, a memory 804, a power component 806, a multimedia component 808, an audio component 810, an input/output (I/O) interface 812, a sensor component 814, and a communication component 816.
The processing component 802 generally controls overall operation of the electronic device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. Processing element 802 may include one or more processors 820 to execute instructions to perform all or part of the steps of the methods described above. Further, the processing component 802 can include one or more modules that facilitate interactions between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
The memory 804 is configured to store various types of data to support operations at the device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 804 may be implemented by any type or combination of volatile or nonvolatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk.
The power component 804 provides power to the various components of the electronic device 800. Power component 804 can include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for electronic device 800.
The multimedia component 808 includes a screen between the electronic device 800 and the user that provides an output interface. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may sense not only the boundary of a touch or slide action, but also the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and/or a rear camera. When the electronic device 800 is in an operational mode, such as a shooting mode or a video mode, the front camera and/or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a Microphone (MIC) configured to receive external audio signals when the electronic device 800 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may be further stored in the memory 804 or transmitted via the communication component 816. In some embodiments, audio component 810 further includes a speaker for outputting audio signals.
The I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which may be a keyboard, click wheel, buttons, etc. These buttons may include, but are not limited to: homepage button, volume button, start button, and lock button.
The sensor assembly 814 includes one or more sensors for providing status assessment of various aspects of the electronic device 800. For example, the sensor assembly 814 may detect an on/off state of the device 800, a relative positioning of the components, such as a display and keypad of the electronic device 800, the sensor assembly 814 may also detect a change in position of the electronic device 800 or a component of the electronic device 800, the presence or absence of a user's contact with the electronic device 800, an orientation or acceleration/deceleration of the electronic device 800, and a change in temperature of the electronic device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscopic sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 816 is configured to facilitate communication between the electronic device 800 and other devices, either wired or wireless. The electronic device 800 may access a wireless network based on a communication standard, such as WiFi,2G, or 3G, or a combination thereof. In one exemplary embodiment, the communication part 814 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the communication component 814 further includes a Near Field Communication (NFC) module to facilitate short range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the electronic device 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic elements for executing the methods described above.
In an exemplary embodiment, a non-transitory computer readable storage medium is also provided, such as memory 804 including instructions executable by processor 820 of electronic device 800 to perform the above-described method. For example, the non-transitory computer readable storage medium may be ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
A non-transitory computer readable storage medium, which when executed by a processor of a terminal, causes the terminal to perform a streaming method, the method comprising:
after receiving a transmission command initiated by an application process, a system process acquires original media data by a media coding module running in the system process, codes the acquired original media data to obtain coded media data, and stores the coded media data into a first-in first-out storage area;
the streaming media transmission module running in the system process acquires the coded media data from the first-in first-out storage area, encapsulates the acquired coded media data into streaming media data, and sends the streaming media data to a streaming media receiving end;
wherein the system process is a process created for a system program of the electronic device for processing media data.
Another non-transitory computer readable storage medium, which when executed by a processor of a terminal, enables the terminal to perform a streaming media reception method, the method comprising:
After receiving a receiving command initiated by an application process, a system process sends a streaming media acquisition request to a streaming media sending end by a streaming media transmission module running in the system process;
the streaming media transmission module receives streaming media data returned by the streaming media sending end, decapsulates the streaming media data into media data, and stores the media data into a first-in first-out storage area;
a media decoding module running in the system process acquires media data from the first-in first-out storage area and decodes the acquired media data;
wherein the system process is a process created for a system program of the electronic device for processing media data.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described by differences from other embodiments, and identical and similar parts between the embodiments are all enough to be referred to each other.
It will be apparent to those skilled in the art that embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the invention may take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiment and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or terminal device comprising the element.
The streaming media transmission method, the streaming media receiving method, the streaming media transmission device, the streaming media receiving device, the electronic equipment and the storage medium provided by the invention are described in detail, and specific examples are applied to illustrate the principle and the implementation of the invention, and the description of the above examples is only used for helping to understand the method and the core idea of the invention; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present invention, the present description should not be construed as limiting the present invention in view of the above.
Claims (14)
1. The streaming media transmission method is characterized by being applied to electronic equipment, wherein a system process for processing media data is operated in the electronic equipment, and at least a media coding module and a streaming media transmission module are operated in the system process, and the method comprises the following steps:
after receiving a transmission command initiated by an application process, the system process acquires original media data, encodes the acquired original media data to obtain encoded media data, and stores the encoded media data into a first-in first-out storage area;
The streaming media transmission module acquires the coded media data from the first-in first-out storage area, encapsulates the acquired coded media data into streaming media data, and sends the streaming media data to a streaming media receiving end.
2. The method according to claim 1, wherein the method further comprises:
the system process receives the streaming media receiving end address transmitted by the application process;
the step of the streaming media transmission module packaging the obtained coded media data into streaming media data and sending the streaming media data to a streaming media receiving end comprises the following steps:
the streaming media transmission module encapsulates the acquired coded media data into streaming media data according to a preset streaming media encapsulation protocol, wherein the streaming media encapsulation protocol is preset according to the streaming media receiving end address;
and the streaming media transmission module sends the streaming media data to the streaming media receiving end corresponding to the streaming media receiving end address.
3. The method according to claim 2, wherein the method further comprises:
the system process receives token information transmitted by the application process, and the token information is issued to the application process under the condition that the streaming media receiving end authenticates the application process;
The step of the streaming media transmission module sending the streaming media data to the streaming media receiving end corresponding to the streaming media receiving end address comprises the following steps:
and the streaming media transmission module transmits the token information and the streaming media data to the streaming media receiving end corresponding to the streaming media receiving end address.
4. A method according to any one of claims 1 to 3, wherein the method further comprises:
the streaming media transmission module monitors network performance;
under the condition that the network performance does not meet the preset expected performance, the streaming media transmission module initiates an adjustment command to the media coding module;
in response to the adjustment command, the media encoding module reduces the code rate and/or frame rate of the media data and/or discards the partially encoded media data in the storage area.
5. A method according to any one of claims 1 to 3, wherein after the media encoding module stores encoded media data in a first-in-first-out storage area and before the streaming module retrieves the encoded media data from the first-in-first-out storage area, the method further comprises:
The media coding module sends a notice to the streaming media transmission module, wherein the notice is used for representing that the media coding module stores a part of coded media data into the first-in first-out storage area;
the streaming media transmission module performs the step of acquiring the encoded media data from the first-in first-out storage area after receiving the notification.
6. The method for receiving the streaming media is characterized by being applied to electronic equipment, wherein a system process for processing media data is operated in the electronic equipment, and at least a streaming media transmission module and a media decoding module are operated in the system process, and the method comprises the following steps:
after receiving a receiving command initiated by an application process, the system process sends a streaming media acquisition request to a streaming media sending end by the streaming media transmission module;
the streaming media transmission module receives streaming media data returned by the streaming media sending end, decapsulates the streaming media data into media data, and stores the media data into a first-in first-out storage area;
the media decoding module acquires media data from the first-in first-out storage area and decodes the acquired media data.
7. The method of claim 6, wherein the method further comprises:
the system process receives the streaming media sender address transmitted by the application process;
the step of sending a streaming media acquisition request to a streaming media sending end by the streaming media transmission module comprises the following steps:
the streaming media transmission module sends a streaming media acquisition request to a streaming media transmitting end corresponding to the streaming media transmitting end address according to the streaming media transmitting end address;
the step of the streaming media transmission module receiving the streaming media data returned by the streaming media sending end and decapsulating the streaming media data into media data comprises the following steps:
the streaming media transmission module receives streaming media data returned by the streaming media sending end and unpacks the streaming media data into media data according to a preset streaming media packaging protocol, wherein the streaming media packaging protocol is preset according to the streaming media sending end address.
8. The method of claim 7, wherein the method further comprises:
the system process receives token information transmitted by the application process, and the token information is issued to the application process under the condition that the streaming media transmitting end authenticates the application process;
The step of the streaming media transmission module sending a streaming media acquisition request to the streaming media sending end corresponding to the streaming media sending end address according to the streaming media sending end address comprises the following steps:
and the streaming media transmission module sends a streaming media acquisition request carrying the token information to a streaming media transmitting end corresponding to the streaming media transmitting end address according to the streaming media transmitting end address.
9. The method of any of claims 6 to 8, wherein after the streaming module stores the media data in a first-in-first-out storage area and before the media decoding module retrieves the media data from the first-in-first-out storage area, the method further comprises:
the streaming media transmission module sends a notice to the media decoding module, wherein the notice is used for representing that the streaming media transmission module stores one piece of media data into the first-in first-out storage area;
the media decoding module performs the step of retrieving media data from the first-in first-out storage area after receiving the notification.
10. A streaming media transmission device, characterized in that the device comprises a media coding module and a streaming media transmission module, wherein the media coding module and the streaming media transmission module are both operated in a system process for processing media data; wherein,,
The media coding module is used for collecting original media data after the system process receives a transmission command initiated by an application process, coding the collected original media data to obtain coded media data, and storing the coded media data into a first-in first-out storage area;
the streaming media transmission module is used for acquiring the coded media data from the first-in first-out storage area, packaging the acquired coded media data into streaming media data and sending the streaming media data to a streaming media receiving end.
11. A streaming media receiving device, characterized in that the device comprises a streaming media transmission module and a media decoding module, wherein the streaming media transmission module and the media decoding module are both operated in a system process for processing media data; wherein,,
the streaming media transmission module is used for sending a streaming media acquisition request to a streaming media sending end after the system process receives a receiving command initiated by an application process;
the streaming media transmission module is also used for receiving streaming media data returned by the streaming media sending end, decapsulating the streaming media data into media data and storing the media data into a first-in first-out storage area;
The media decoding module is configured to obtain media data from the first-in first-out storage area, and decode the obtained media data.
12. An electronic device comprising a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by one or more processors, the one or more programs comprising instructions for:
after receiving a transmission command initiated by an application process, a system process acquires original media data by a media coding module running in the system process, codes the acquired original media data to obtain coded media data, and stores the coded media data into a first-in first-out storage area;
the streaming media transmission module running in the system process acquires the coded media data from the first-in first-out storage area, encapsulates the acquired coded media data into streaming media data, and sends the streaming media data to a streaming media receiving end;
wherein the system process is a process created for a system program of the electronic device for processing media data.
13. An electronic device comprising a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by one or more processors, the one or more programs comprising instructions for:
after receiving a receiving command initiated by an application process, a system process sends a streaming media acquisition request to a streaming media sending end by a streaming media transmission module running in the system process;
the streaming media transmission module receives streaming media data returned by the streaming media sending end, decapsulates the streaming media data into media data, and stores the media data into a first-in first-out storage area;
a media decoding module running in the system process acquires media data from the first-in first-out storage area and decodes the acquired media data;
wherein the system process is a process created for a system program of the electronic device for processing media data.
14. A readable storage medium, characterized in that instructions in the storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the streaming method according to one or more of the method claims 1-5 or enable the electronic device to perform the streaming method according to one or more of the method claims 6-9.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010581954.1A CN113840161B (en) | 2020-06-23 | 2020-06-23 | Streaming media transmission method, receiving method, device, electronic equipment and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010581954.1A CN113840161B (en) | 2020-06-23 | 2020-06-23 | Streaming media transmission method, receiving method, device, electronic equipment and storage medium |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN113840161A CN113840161A (en) | 2021-12-24 |
| CN113840161B true CN113840161B (en) | 2023-07-25 |
Family
ID=78964164
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202010581954.1A Active CN113840161B (en) | 2020-06-23 | 2020-06-23 | Streaming media transmission method, receiving method, device, electronic equipment and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN113840161B (en) |
Citations (16)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| EP0954178A2 (en) * | 1998-04-30 | 1999-11-03 | Matsushita Electric Industrial Co., Ltd. | Method for distributing video information to mobile object by digital radio communication |
| JPWO2005043915A1 (en) * | 2003-10-31 | 2007-05-10 | 株式会社Kddiメディアウィル | Video analysis device and video failure detection device |
| CN101478549A (en) * | 2009-01-20 | 2009-07-08 | 电子科技大学 | Operation method for memory sharing media server and functional module construction |
| WO2010043146A1 (en) * | 2008-10-14 | 2010-04-22 | 华为技术有限公司 | Method and device, server cluster for media file storage processing and service processing |
| KR20120004662A (en) * | 2010-07-07 | 2012-01-13 | 에스케이텔레콤 주식회사 | Broadcast signal encoding and decoding method for parallel processing of error correction, broadcast signal transmitting and receiving device for same and system therefor |
| CN102325182A (en) * | 2011-09-09 | 2012-01-18 | 重庆抛物线信息技术有限责任公司 | Audio-video sharing method and system |
| CN103281528A (en) * | 2013-04-10 | 2013-09-04 | 深圳康佳通信科技有限公司 | Streaming media decoding method, system and mobile terminal |
| CA2907301A1 (en) * | 2013-03-15 | 2014-09-18 | Videri Inc. | Systems and methods for decrypting digital art and imaging for display of the same |
| US9654528B1 (en) * | 2013-03-11 | 2017-05-16 | Google Inc. | Dynamic bitrate selection for streaming media |
| CN106936815A (en) * | 2017-02-06 | 2017-07-07 | 北京音未文化传媒有限责任公司 | A kind of document transmission system and its method based on encrypted audio stream |
| CN107645673A (en) * | 2017-08-29 | 2018-01-30 | 湖北航天技术研究院总体设计所 | A kind of remote measurement image real-time decoding unit |
| CN107770600A (en) * | 2017-11-07 | 2018-03-06 | 深圳创维-Rgb电子有限公司 | Streaming media data transmission method, device, equipment and storage medium |
| WO2018121738A1 (en) * | 2016-12-30 | 2018-07-05 | 北京奇虎科技有限公司 | Method and apparatus for processing streaming data task |
| CN108259930A (en) * | 2018-01-16 | 2018-07-06 | 深圳市力沃信息科技有限公司 | The transfer control method and system of a kind of electronics class board |
| WO2019019370A1 (en) * | 2017-07-24 | 2019-01-31 | 平安科技(深圳)有限公司 | Processing method for live broadcast of audio and video, storage medium and mobile terminal |
| CN109729437A (en) * | 2017-10-30 | 2019-05-07 | 中国电信股份有限公司 | Streaming media self-adapting transmission method, terminal and system |
Family Cites Families (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US7599364B2 (en) * | 2005-09-13 | 2009-10-06 | Agere Systems Inc. | Configurable network connection address forming hardware |
| CN100531382C (en) * | 2006-01-18 | 2009-08-19 | 华为技术有限公司 | Device and method for transmitting visual telephone video-audio signal |
| US9247291B2 (en) * | 2013-03-13 | 2016-01-26 | Echostar Technologies L.L.C. | Systems and methods for securely providing adaptive bit rate streaming media content on-demand |
| US10652589B2 (en) * | 2017-12-08 | 2020-05-12 | Sling Media Pvt Ltd | Systems and methods for selecting an initial streaming bitrate |
-
2020
- 2020-06-23 CN CN202010581954.1A patent/CN113840161B/en active Active
Patent Citations (16)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| EP0954178A2 (en) * | 1998-04-30 | 1999-11-03 | Matsushita Electric Industrial Co., Ltd. | Method for distributing video information to mobile object by digital radio communication |
| JPWO2005043915A1 (en) * | 2003-10-31 | 2007-05-10 | 株式会社Kddiメディアウィル | Video analysis device and video failure detection device |
| WO2010043146A1 (en) * | 2008-10-14 | 2010-04-22 | 华为技术有限公司 | Method and device, server cluster for media file storage processing and service processing |
| CN101478549A (en) * | 2009-01-20 | 2009-07-08 | 电子科技大学 | Operation method for memory sharing media server and functional module construction |
| KR20120004662A (en) * | 2010-07-07 | 2012-01-13 | 에스케이텔레콤 주식회사 | Broadcast signal encoding and decoding method for parallel processing of error correction, broadcast signal transmitting and receiving device for same and system therefor |
| CN102325182A (en) * | 2011-09-09 | 2012-01-18 | 重庆抛物线信息技术有限责任公司 | Audio-video sharing method and system |
| US9654528B1 (en) * | 2013-03-11 | 2017-05-16 | Google Inc. | Dynamic bitrate selection for streaming media |
| CA2907301A1 (en) * | 2013-03-15 | 2014-09-18 | Videri Inc. | Systems and methods for decrypting digital art and imaging for display of the same |
| CN103281528A (en) * | 2013-04-10 | 2013-09-04 | 深圳康佳通信科技有限公司 | Streaming media decoding method, system and mobile terminal |
| WO2018121738A1 (en) * | 2016-12-30 | 2018-07-05 | 北京奇虎科技有限公司 | Method and apparatus for processing streaming data task |
| CN106936815A (en) * | 2017-02-06 | 2017-07-07 | 北京音未文化传媒有限责任公司 | A kind of document transmission system and its method based on encrypted audio stream |
| WO2019019370A1 (en) * | 2017-07-24 | 2019-01-31 | 平安科技(深圳)有限公司 | Processing method for live broadcast of audio and video, storage medium and mobile terminal |
| CN107645673A (en) * | 2017-08-29 | 2018-01-30 | 湖北航天技术研究院总体设计所 | A kind of remote measurement image real-time decoding unit |
| CN109729437A (en) * | 2017-10-30 | 2019-05-07 | 中国电信股份有限公司 | Streaming media self-adapting transmission method, terminal and system |
| CN107770600A (en) * | 2017-11-07 | 2018-03-06 | 深圳创维-Rgb电子有限公司 | Streaming media data transmission method, device, equipment and storage medium |
| CN108259930A (en) * | 2018-01-16 | 2018-07-06 | 深圳市力沃信息科技有限公司 | The transfer control method and system of a kind of electronics class board |
Non-Patent Citations (3)
| Title |
|---|
| 基于S3C2410与MPEG-4的播放器的设计和实现;赖红辉;;微计算机信息(第02期);全文 * |
| 移动终端与高校图书馆特色流媒体服务;张力;;情报科学(05);全文 * |
| 高速公路联网监控中异构视频转码技术实现;严肃;陈启美;方怀东;;交通运输系统工程与信息(02);全文 * |
Also Published As
| Publication number | Publication date |
|---|---|
| CN113840161A (en) | 2021-12-24 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN113794545B (en) | Method and device for determining downlink control information format size | |
| CN109218839B (en) | Video playing method and device | |
| WO2018129936A1 (en) | Information feedback method, device, base station, and user equipment | |
| CN109714415B (en) | Data processing method and device | |
| US9723486B2 (en) | Method and apparatus for accessing network | |
| CN109005096B (en) | Application interaction method and device | |
| CN108063804B (en) | Communication method and device | |
| US10728583B2 (en) | Multimedia information playing method and system, standardized server and live broadcast terminal | |
| CN111092898B (en) | Message transmission method and related equipment | |
| CN112312222A (en) | Video sending method and device and electronic equipment | |
| CN105049219B (en) | Flow booking method and system, mobile terminal and server | |
| CN107197320A (en) | Net cast methods, devices and systems | |
| US12022499B2 (en) | Downlink control information sending method and receiving method, apparatus, and storage medium | |
| CN111953980B (en) | Video processing method and device | |
| CN108476520A (en) | Data transmission method, device and computer readable storage medium | |
| US11546884B2 (en) | Method and device for determining time-frequency resource preemption, user equipment and base station | |
| CN111385349B (en) | Communication processing method, communication processing device, terminal, server and storage medium | |
| US11218990B2 (en) | Method and apparatus for receiving and sending system information, user equipment and base station | |
| CN113840161B (en) | Streaming media transmission method, receiving method, device, electronic equipment and storage medium | |
| CN109213580A (en) | Using exchange method and device | |
| CN107395724B (en) | Network request method and device | |
| EP3264735B1 (en) | Method and device for determining coding format in volte | |
| CN109492408B (en) | Data encryption method and device | |
| JP6839281B2 (en) | Methods and equipment for transmitting system information | |
| CN109086143B (en) | Application interaction method and device |
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 | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |