CN109788299A - Video transmission method, system, equipment and computer media between a kind of mobile device - Google Patents

Video transmission method, system, equipment and computer media between a kind of mobile device Download PDF

Info

Publication number
CN109788299A
CN109788299A CN201910184870.1A CN201910184870A CN109788299A CN 109788299 A CN109788299 A CN 109788299A CN 201910184870 A CN201910184870 A CN 201910184870A CN 109788299 A CN109788299 A CN 109788299A
Authority
CN
China
Prior art keywords
video
package
transmitted
encrypted
mobile device
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910184870.1A
Other languages
Chinese (zh)
Inventor
张泽清
禹思敏
陈宝桔
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong University of Technology
Original Assignee
Guangdong University of Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong University of Technology filed Critical Guangdong University of Technology
Priority to CN201910184870.1A priority Critical patent/CN109788299A/en
Publication of CN109788299A publication Critical patent/CN109788299A/en
Pending legal-status Critical Current

Links

Abstract

This application discloses video transmission method, system, equipment and computer medias between a kind of mobile device, this method comprises: obtaining video to be transmitted;H.264 hardware encoding is carried out to video to be transmitted, obtains encoded video;Encoded video is encrypted, encrypted video is obtained;RTP package is carried out to encrypted video, obtains package video, and transmit package video.Video transmission method, system, equipment and computer readable storage medium between a kind of mobile device provided by the present application, H.264 hardware encoding, encryption and RTP package are carried out after obtaining video to be transmitted, to video to be transmitted, obtain package video, and package video is transmitted, it ensure that the timeliness of video to be transmitted, and encryption is carried out during obtaining package video, the safety that ensure that video to be transmitted solves the technical issues of safety and timeliness of transmission of video between how realizing mobile device.

Description

Video transmission method, system, equipment and computer media between a kind of mobile device
Technical field
This application involves technical field of video transmission between mobile device, regard more specifically between a kind of mobile device Keep pouring in transmission method, system, equipment and computer media.
Background technique
With the development of communication technology, mobile device has realized SMS encryption, image ciphering, real-time voice encryption, however, Due to the big feature of video strong real-time, data volume, mobile device can not effectively be encrypted video;In addition, in order to protect The timeliness of video is demonstrate,proved, mobile device also needs higher video transmission efficiency.
In conclusion how to realize that the safety of transmission of video and timeliness are current those skilled in the art between mobile device Member's urgent problem to be solved.
Summary of the invention
The purpose of the application is to provide video transmission method between a kind of mobile device, can solve to a certain extent how Between realization mobile device the technical issues of the safety and timeliness of transmission of video.Present invention also provides between a kind of mobile device Video transmission system, equipment and computer readable storage medium.
To achieve the goals above, the application provides the following technical solutions:
Video transmission method between a kind of mobile device, comprising:
Obtain video to be transmitted;
H.264 hardware encoding is carried out to the video to be transmitted, obtains encoded video;
The encoded video is encrypted, encrypted video is obtained;
RTP package is carried out to the encrypted video, obtains package video, and transmit the package video.
Preferably, described that the encoded video is encrypted, obtain encrypted video, comprising:
Chaos encryption is carried out to the encoded video, obtains the encrypted video.
Preferably, described that chaos encryption is carried out to the encoded video, obtain the encrypted video, comprising:
Operation is carried out to the encoded video using chaos encryption formula, obtains the encrypted video;
The chaos encryption formula includes:
Wherein, k indicates the number of iterations;M (k) indicates the encoded video;C (k) indicates the encrypted video;σ=2.5 × 107, ε=3.3 × 108It indicates to be rounded downwards;
Preferably, the transmission package video, comprising:
The package video is transmitted using Real-time Transport Protocol and udp protocol.
Preferably, described that H.264 hardware encoding is carried out to the video to be transmitted, obtain encoded video, comprising:
Input block queue is obtained from H.264 codec;
Apply for a buffer empty in the input block queue;
By the video copy to be transmitted to the empty buffer area, obtain real buffer area, by the real buffer area store to The input block queue;
The output buffer queue of the H.264 codec is obtained, is cached in the output buffer queue described Encoded video, the encoded video include the H.264 codec to the video to be transmitted in the real buffer area into The video obtained after row coding;
Apply for output buffer in the output buffer queue, and obtains and cached in the output buffer The encoded video.
It is preferably, described that RTP package is carried out to the encrypted video, comprising:
Using any one or a few mode in single package mode, combination package mode, fragment package mode to institute It states encrypted video and carries out RTP package.
Preferably, further includes:
Receive video to be shown;
RTP unpacking is carried out to the video to be shown, obtains unpacking video;
The unpacking video is decrypted, decryption video is obtained;
H.264 hardware is carried out to the decryption video to decode, and obtains original video corresponding with the video to be shown.
Video transmission system between a kind of mobile device, comprising:
First obtains module, for obtaining video to be transmitted;
First coding module obtains encoded video for carrying out H.264 hardware encoding to the video to be transmitted;
First encrypting module obtains encrypted video for encrypting to the encoded video;
First package module obtains package video, and transmit the envelope for carrying out RTP package to the encrypted video Packet video.
Video transmission equipment between a kind of mobile device, comprising:
Memory, for storing computer program;
Processor realizes video transmission method between as above any mobile device when for executing the computer program The step of.
A kind of computer readable storage medium is stored with computer program in the computer readable storage medium, described When computer program is executed by processor between realization any mobile device as above the step of video transmission method.
Video transmission method between a kind of mobile device provided by the present application, obtains video to be transmitted;To video to be transmitted into Capable H.264 hardware encoding, obtains encoded video;Encoded video is encrypted, encrypted video is obtained;Encrypted video is carried out RTP package obtains package video, and transmits package video.Video transmission method between a kind of mobile device provided by the present application, H.264 hardware encoding, encryption and RTP package are carried out after obtaining video to be transmitted, to video to be transmitted, obtains package video, and And package video is transmitted, it ensure that the timeliness of video to be transmitted, and carry out during obtaining package video Encryption, ensure that the safety of video to be transmitted, solves the safety of transmission of video between how realizing mobile device And the technical issues of timeliness.It Video transmission system between a kind of mobile device provided by the present application, equipment and computer-readable deposits Storage media also solves the problems, such as relevant art.
Detailed description of the invention
In order to illustrate the technical solutions in the embodiments of the present application or in the prior art more clearly, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this The embodiment of application for those of ordinary skill in the art without creative efforts, can also basis The attached drawing of offer obtains other attached drawings.
Fig. 1 is the first pass figure of video transmission method between a kind of mobile device provided by the embodiments of the present application;
Fig. 2 is the flow chart of data processing figure of H.264 codec;
Fig. 3 is the state transition diagram of H.264 codec;
Fig. 4 is the second flow chart of video transmission method between a kind of mobile device provided by the embodiments of the present application;
Fig. 5 is Real-time Transport Protocol encapsulation format figure;
Fig. 6 is the flow chart of RTP package provided by the present application;
Fig. 7 is the flow chart that RTP provided by the present application is unpacked;
Fig. 8 is the flow chart of chaos encipher-decipher method;
Fig. 9 is the structural schematic diagram of Video transmission system between a kind of mobile device provided by the embodiments of the present application;
Figure 10 is the structural schematic diagram of video transmission equipment between a kind of mobile device provided by the embodiments of the present application;
Figure 11 is another structural schematic diagram of video transmission equipment between a kind of mobile device provided by the embodiments of the present application;
Figure 12 is the program architecture flow chart for sending the mobile device of video;
Figure 13 is the program architecture flow chart for receiving the mobile device of video.
Specific embodiment
Below in conjunction with the attached drawing in the embodiment of the present application, technical solutions in the embodiments of the present application carries out clear, complete Site preparation description, it is clear that described embodiments are only a part of embodiments of the present application, instead of all the embodiments.It is based on Embodiment in the application, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall in the protection scope of this application.
Referring to Fig. 1, Fig. 1 is the first pass of video transmission method between a kind of mobile device provided by the embodiments of the present application Figure.
Video transmission method between a kind of mobile device provided by the embodiments of the present application, may comprise steps of:
Step S101: video to be transmitted is obtained.
In practical application, mobile device can first obtain video to be transmitted, and it is to be transmitted to can be mobile device itself acquisition Video is also possible to mobile device and directly receives the video etc. transmitted;The type of video to be transmitted can be according to practical need It was determined that mobile device includes mobile phone, tablet computer etc..In concrete application scene, mobile device itself acquires video to be transmitted Process can be with are as follows: mobile device acquires the original video data of NV21 format by the camera of itself, while by original view Frequency data format is converted to NV12 format, obtains video to be transmitted;In addition, mobile device can also show original video data Preview is used as on surface.
Step S102: H.264 hardware encoding is carried out to video to be transmitted, obtains encoded video.
In practical application, mobile device can carry out H.264 hardware to video to be transmitted after obtaining video to be transmitted Coding, obtains encoded video.H.264 it is a kind of video compression coding standard involved in the application, there is high compression ratio, high-quality Encoding efficiency and preferable network adaptability are measured, coded system is H.264 divided into video coding layer VLC and network abstract layer NAL, video coding layer describe video data payload, and network abstract layer is responsible for the data load in VLC being fitted to specific net To improve network adaptability in network environment.
It, can be using slow in order to improve the code efficiency for carrying out H.264 hardware encoding to video to be transmitted in practical application Area is rushed to accelerate code efficiency.Fig. 2 and Fig. 3 are please referred to, Fig. 2 is the flow chart of data processing figure of H.264 codec, and Fig. 3 is H.264 the state transition diagram of codec, the client in Fig. 2 can be determines according to actual conditions.Then to video to be transmitted into Row H.264 hardware encoding, the process for obtaining encoded video can be with specifically: obtains input block from H.264 codec Queue;Apply for a buffer empty in the queue of input block;By video copy to be transmitted to empty buffer area, real caching is obtained Area stores real buffer area to input block queue, at this point, H.264 codec takes out one from the queue of input block A reality buffer area, and to it includes data carry out coded treatment, after end-of-encode, then by real buffer empty, obtain empty slow Area is rushed, buffer empty is stored to input block queue, and encoded video is stored in output buffer queue;It obtains H.264 the output buffer queue of codec is cached with encoded video in output buffer queue, and encoded video includes H.264 the video that codec obtains after encoding to the video to be transmitted in real buffer area;In output buffer queue Apply for an output buffer, and obtain the encoded video cached in output buffer, and output buffer is stored in output Buffer queue.
In Fig. 3, H.264 has in the life cycle of codec and stop state, execution state and release state three state.Its Middle stopping state containing 3 sub-states, respectively no initializtion state, configured state, error condition.Execution state experienced 3 Sub-states, respectively Flushing status, operating status and stream end state.When use, any one method creates an encoding and decoding After device, codec is in the state of no initializtion.Therefore, it is necessary first to configure () be called to match codec It sets, makes the configured state of codec conversion, secondly by calling start () that it is made to be converted to execution state, call again Start () makes codec enter the sub- state of refreshing, and codec can possess all cachings at this time.Once first input Caching is moved out of queue, and codec will be transferred to the sub- state of operation, and most of life cycle of codec all can shape herein It is spent under state.When the input-buffer with EOS (end-of-stream) label enters queue, codec will transition to stream The sub- state terminated, codec no longer receives new input-buffer, and it is slow to stop output when EOS is marked and reached output end It deposits.Refresh sub- state by calling flush () under execution state to make codec back within.It calls stop () Make codec back to no initializtion state, then can reconfigure.After having used codec, it is necessary to call Release () discharges its resource.In rare cases, codec can enter error condition, by calling reset () Restore it no initializtion state.Otherwise, release () is called to enter final release conditions.Concrete application scene In, H.264 codec can be accessed by transferring with configuration Android underlying multimedia Support Library MediaCodec class.
Step S103: encrypting encoded video, obtains encrypted video.
In practical application, after obtaining encoded video, encoded video can be encrypted, obtain encrypted video.Add Decryption method can be determine according to actual needs.For example chaos encryption can be carried out to encoded video, obtain encrypted video.Chaos adds Close process can be such that the header data and video compression data screened in H.264 code stream first, only to original video compress Data carry out encryption and encrypted video compression data be decrypted, specific discriminating method is as follows: one it is original H.264 Network abstraction layer unit NALU (Network Abstract Layer Unit) by [Start Code]+[NALU Header]+ [NALU Payload] three parts composition, in [Start Code], is indicate with " 00 00 00 01 " or " 00 00 01 " The beginning of one NALU unit forbids position, the reference rank of 2 bits, 5 including 1 bit in [NALU Header] The load type of a bit, [Start Code]+[NALU Header] form header data, and [NALU Payload] is video Then compressed data again encrypts the original video compression data after screening out.
In practical application, chaos encryption is carried out to encoded video, the process for obtaining encrypted video can be with specifically: using mixed Ignorant encryption formula carries out operation to encoded video, obtains encrypted video;
Chaos encryption formula includes:
Wherein, k indicates the number of iterations;M (k) presentation code video;C (k) indicates encrypted video;σ=2.5 × 107, ε= 3.3×108It indicates to be rounded downwards;aij(i, j=1,2,3,4) is parameter relevant to key;
Step S104: RTP (Real-time Transport Protocol, real-time transport protocol) is carried out to encrypted video Package obtains package video, and transmits package video.
In practical application, after obtaining encrypted video, RTP package can be carried out to encrypted video, obtain package video, And package video is transmitted to the mobile device for being used to receive video.
In concrete application scene, the process for transmitting package video can be with specifically: uses Real-time Transport Protocol and UDP (User Datagram Protocol, User Datagram Protocol) agreement transmission package video.Real-time Transport Protocol provides timestamp, sequence number, bears Format is carried, wherein timestamp is used for the synchronization of data, and sequence number is for packet loss and detection of reordering, and load format is for illustrating to count According to coded format, using Real-time Transport Protocol transmit process are as follows: isolated from encrypted video namely encrypted H.264 code stream Each network abstraction layer unit NALU, and the corresponding packet header RTP is added, then it will be sent out comprising the data packet in the packet header RTP and NALU It sees off.It, can be using any in single package mode, combination package mode, fragment package mode in concrete application scene One or more of modes carry out RTP package to encrypted video.
Video transmission method between a kind of mobile device provided by the present application, obtains video to be transmitted;To video to be transmitted into Capable H.264 hardware encoding, obtains encoded video;Encoded video is encrypted, encrypted video is obtained;Encrypted video is carried out RTP package obtains package video, and transmits package video.Video transmission method between a kind of mobile device provided by the present application, H.264 hardware encoding, encryption and RTP package are carried out after obtaining video to be transmitted, to video to be transmitted, obtains package video, and And package video is transmitted, it ensure that the timeliness of video to be transmitted, and carry out during obtaining package video Encryption, ensure that the safety of video to be transmitted, solves the safety of transmission of video between how realizing mobile device And the technical issues of timeliness.
Referring to Fig. 4, Fig. 4 is the second procedure of video transmission method between a kind of mobile device provided by the embodiments of the present application Figure.
In practical application, video transmission method may include following step between a kind of mobile device provided by the embodiments of the present application It is rapid:
Step S201: video to be transmitted is obtained.
Step S202: H.264 hardware encoding is carried out to video to be transmitted, obtains encoded video.
Step S203: encrypting encoded video, obtains encrypted video.
Step S204: RTP package is carried out to encrypted video, obtains package video, and transmit package video.
Step S205: video to be shown is received.
In practical application, video to be shown can be sent and received by Real-time Transport Protocol and udp protocol.
Step S206: carrying out RTP unpacking to video to be shown, obtains unpacking video.
In practical application, when using single package mode, combination package mode, in fragment package mode any one or When several modes carry out RTP package to encrypted video, correspondingly, using single package mode, combination package mode, fragment package Any one or a few mode in mode carries out RTP unpacking to video to be shown.
During either RTO package or RTP unpack, RTP data packet is made of fixed packet header and load two parts, wherein 12 bytes are meant that fixed before packet header, and load is audio or video data.The format in the fixed packet header RTP as shown in figure 5, Concrete meaning is as follows:
The version number that V is 2, the version number that RTP is used at present are 2 (i.e. binary ones 0);
The filling number that P is 1, if P=1, in the one or more 8 additional hytes of message tail filling.At this In invention, P=0 is chosen, is not filled in message tail;
The extension bits that X is 1, in RTP header followed by an extension header, in this application, are chosen if X=1 X=0 does not use extension header;
The CSRC that CC is 4 is counted, it is located at behind the fixed packet header RTP, the number of source identifier CSRC is provided, at this In application, CC=0000 is chosen, i.e. RTP is added without CSRC behind fixed packet header;
M is 1 marker bit, when if it is NALU last access unit or for the last fragment of NALU, M=1, Otherwise M=0;
The load type that PT is 7, changes according to the difference of package content, such as 31 represents RTP load type as H.261 Data, 34 represent RTP load type as H.263 data, and in this application, choosing PT is 96 (representing H.264 data);
The sequence number that SQ is 16, the initial value of sequence number are random value, and in this application, choosing SQ is 0, every to send one A RTP data packet, sequence number add 1;
The timestamp that TS is 32, the initial value of timestamp are random value, and choosing TS in this application is 0;
The synchronous source identifier that SSRC is 32, SSRC is randomly generated value, so that in the same RTP session phase In, without any two synchronisation source SSRC identifier having the same;
CSRC provides 0~15 source identifier, and wherein the length of each single item is 32 bits, and the size of item number is 0~15, It is determined by CC field.
Fig. 6 and Fig. 7 are please referred to, Fig. 6 is the flow chart of RTP package provided by the present application, and Fig. 7 is RTP provided by the present application The flow chart of unpacking.
Fig. 6 and Fig. 7 is respectively that transmitting terminal RTP package algorithm flow chart and RTP unpack algorithm flow chart.For each The size of NALU, data volume are also variant.In IP (Internet Protocol) network, when the IP packet for needing to transmit is big It is small when being more than maximum transmission unit MTU (Maximum Transmission Unit), IP fragmentation situation will be generated.In ether In the environment of net, the size for the maximum IP packet (MTU) that can be transmitted is 1500 bytes, and wherein IP are 20 bytes, and UDP are 8 Byte, RTP are 12 bytes, and the Maximum Payload of RTP is 1460 bytes.If the IP data packet sent is greater than MTU, need It unpacks transmission, many data packet fragments can be generated in this way, increase packet loss, reduce network speed.For transmission of video Speech if RTP packet is greater than MTU, and is arbitrarily unpacked by hardware protocol, and the player delay that will lead to receiving end plays even It can not normal play.Therefore the NALU unit for being greater than MTU, it is necessary to carry out processing of unpacking.In order to further solve this problem, In this application, the package scheme of following 3 kinds of RTP is given:
Single package mode: only encapsulating a NALU in a RTP packet, and when package directly uses RTP replacement NALU Opening code.In this application, this packing scheme is used for the NALU less than 1400 bytes;
Combination package mode: multiple NALU are encapsulated in a RTP packet, this packing can be used for lesser NALU Scheme, to improve efficiency of transmission.There are tetra- kinds of combination package modes of STAP-A, STAP-B, MTAP16, MTAP24, in the application In, use STAP-A package mode.Package format is as follows: [RTP]+[78 (STAP-A head occupies 1 byte)]+[first A NALU length (occupying two bytes)]+[first NALU content]+[second NALU length (occupying two bytes)]+[the Two NALU contents];
Fragment package mode: a NALU is encapsulated in multiple RTP packets, for being greater than the NALU of 1400 bytes using this Scheme carries out processing of unpacking, and is divided into FU-A and FU-B two types, literary grace FU-A of the present invention.Package format is as follows: [RTP Head]+[FU indicator]+[FU header]+[NALU for eliminating NALU], wherein [FU indicator] includes 1 A bit forbid position, 2 bits NRI and 5 bit fragment type, [FU header] includes the beginning of 1 bit Position, the knot position of 1 bit, 1 bit the load type for forbidding position and 5 bits, start bit and knot in [FU header] Beam position cannot be 1 simultaneously.
One original H.264NALU by [Start Code]+[NALU Header]+[NALU Payload] three parts Composition, wherein Start Code indicates the beginning of a NALU unit, it is necessary to be " 00 00 0001 " or " 00 00 01 ", NALU Head is only a byte, remaining is NALU location contents.Opening code " 00 00 01 " or " 00 00 00 01 " are removed when package Outside, by other data packets at RTP packet.
According to Fig. 6, in the mobile device end for sending video, H.264 different RTP envelopes is can be used in code stream in varied situations Packet scheme, for sequence parameter set (SPS) and picture parameter set (PPS), using combination package mode.For length less than 1400 The NALU of byte using single package mode, and is greater than 1400 bytes and then uses fragment package mode.Package process is as follows: sentencing Whether disconnected is initial code with 00000001, if it is not, then abandoning, if so, identification NALU format;Judge NALU format whether be SPS and PPS, if SPS and PPS, then using the combination packet header package mode setting RTP, if not SPS and PPS, then calculate NALU (I frame or P frame) length Len;Len is judged whether less than 1400, if using single NALU mode setting RTP packet less than 1400 Head then uses the packet header fragment package mode setting RTP, and fragment NALU head is arranged if it is greater than or equal to 1400;Judge whether it is this NALU the last one fragment RTP packet, if so, the step of judging to judge whether with 00000001 as initial code is returned to, if it is not, then The step of returning using the fragment package mode setting packet header RTP.
According to Fig. 7, in the mobile device end for receiving video, after receiving RTP packet, identified by the PT field in the packet header RTP The package mode of NALU, and the NALU header information according to different package mode reduction H.264, are spliced into a complete frame and add H.264 code stream after close.Unpacking process is as follows: judging whether using 0x80 as initial code, if it is not, then abandoning, if so, identification NALU package mode;If single package mode, then remove RTP head, the reduction head H264NALU (0x0000000161 or 0x0000000165);If combining package mode (STAP-A), then the length and content of STAP-A load 1 are obtained, RTP is removed Head restores the head SPS (0x0000000167), obtains the length and content of STAP-A load 2, removes RTP head, restores PPS head SPS and PPS is spliced in portion (0x0000000168);If fragment package mode (FU-A), fragment FU-header, judgement are obtained Whether FU-header first is 1 (initial position), if first is not 1, directly encloses payload content to Buf, if first Position is 1, then empties Buf, enclose H264 header information, and enclose payload content to Buf, whether judge FU-header first It returns if it is not, then obtaining next FU-A fragment for 1 (end mark) and executes the step of obtaining fragment FU-header.
Step S207: being decrypted to video is unpacked, and obtains decryption video.
In practical application, when being encrypted using chaos encrypting method, correspondingly, being solved using chaos decryption method It is close;Referring to Fig. 8, Fig. 8 is the flow chart of chaos encipher-decipher method.Decrypting process is as follows: using Chaotic Solution Migong formula to unpacking Video carries out operation, obtains decryption video;
Chaotic Solution Migong formula includes:
Wherein, k indicates the number of iterations;P (k) indicates to unpack video;Indicate decryption video;It indicates to be rounded downwards; aij(i, j=1,2,3,4) is parameter relevant to key.
When key parameter matching,At It is vertical, it obtainsKnow that the mobile device end for receiving video can be decrypted correctly out original video;When key parameter mismatch When,It knows to receive video Mobile device end cannot decrypt original video.
Step S208: H.264 hardware is carried out to decryption video and is decoded, original video corresponding with video to be shown is obtained.
In practical application, the video data of yuv format can be reduced into original video, and OpenGL Render is tied up Determine to be programmed in the parallel program segment shader run in graphics processor (GPU) onto display plane, converts yuv format to Rgb format carries out video by OpenGL ES and shows.
Present invention also provides Video transmission systems between a kind of mobile device, with one kind provided by the embodiments of the present application The correspondence effect that video transmission method has between mobile device.Referring to Fig. 9, Fig. 9 is a kind of shifting provided by the embodiments of the present application The structural schematic diagram of dynamic equipment room Video transmission system.
Video transmission system between a kind of mobile device provided by the embodiments of the present application may include:
First obtains module 101, for obtaining video to be transmitted;
First coding module 102 obtains encoded video for carrying out H.264 hardware encoding to video to be transmitted;
First encrypting module 103 obtains encrypted video for encrypting to encoded video;
First package module 104 obtains package video, and transmit package view for carrying out RTP package to encrypted video Frequently.
Video transmission system between a kind of mobile device provided by the embodiments of the present application, the first encrypting module may include:
First encryption unit obtains encrypted video for carrying out chaos encryption to encoded video.
Video transmission system between a kind of mobile device provided by the embodiments of the present application, the first encryption unit may include:
First encryption sub-unit operable obtains encrypted video for carrying out operation to encoded video using chaos encryption formula;
Chaos encryption formula includes:
Wherein, k indicates the number of iterations;M (k) presentation code video;C (k) indicates encrypted video;σ=2.5 × 107, ε= 3.3×108It indicates to be rounded downwards;
Video transmission system between a kind of mobile device provided by the embodiments of the present application, the first package module may include:
First transmission unit, for transmitting package video using Real-time Transport Protocol and udp protocol.
Video transmission system between a kind of mobile device provided by the embodiments of the present application, the first coding module may include:
First acquisition unit, for obtaining input block queue from H.264 codec;
First application unit, for applying for a buffer empty in the queue of input block;
First copy cell, for obtaining video copy to be transmitted to empty buffer area real buffer area, real buffer area being deposited It puts to input block queue;
Second acquisition unit delays in output buffer queue for obtaining the output buffer queue of H.264 codec Have an encoded video, encoded video include H.264 codec obtained after being encoded to the video to be transmitted in real buffer area Video;
Second application unit for applying for an output buffer in output buffer queue, and obtains output buffering The encoded video cached in area.
Video transmission system between a kind of mobile device provided by the embodiments of the present application, the first package module may include:
First packet element, for using any one in single package mode, combination package mode, fragment package mode Kind or several modes carry out RTP package to encrypted video.
Video transmission system between a kind of mobile device provided by the embodiments of the present application can also include:
First receiving module, for receiving video to be shown;
First unpacks module, for carrying out RTP unpacking to video to be shown, obtains unpacking video;
First deciphering module obtains decryption video for unpacking video to be decrypted;
First decoder module decodes for carrying out H.264 hardware to decryption video, obtains original corresponding with video to be shown Beginning video.
It, can be using buffer queue come in video transmitting procedure in order to improve video transmission efficiency in practical application Data are handled, so that mobile device can be with concurrent working, for example be can be set and are sent video data buffer queue and reception Video data buffer queue, then the video to be transmitted that the first acquisition module can will acquire, which is sent to, sends video data caching team In column;Encoded video can be transmitted to by the first coding module sends video data buffer queue;First encrypting module can incite somebody to action Encrypted video, which is transmitted to, sends video data caching;Unpacking video can be transmitted to reception video data and delayed by the first unpacking module Deposit queue;Decryption video can be transmitted to and receive video data buffer queue by the first deciphering module.
Present invention also provides video transmission equipment and computer readable storage mediums between a kind of mobile device, all have The correspondence effect that video transmission method has between a kind of mobile device provided by the embodiments of the present application.Referring to Fig. 10, Figure 10 is The structural schematic diagram of video transmission equipment between a kind of mobile device provided by the embodiments of the present application.
Video transmission equipment between a kind of mobile device provided by the embodiments of the present application may include:
Memory 201, for storing computer program;
Processor 202 is realized when for executing computer program and is regarded between mobile device described in any embodiment as above The step of keeping pouring in transmission method.
Figure 11 is please referred to, can also be wrapped in video transmission equipment between another kind mobile device provided by the embodiments of the present application Include: the input port 203 connecting with processor 202 is used for transmission the extraneous order inputted to processor 202;With processor 202 The display unit 204 of connection, the processing result for video-stream processor 202 is to the external world;The communication module being connect with processor 202 205, for realizing video transmission equipment between mobile device and extraneous communication.Display unit 204 can be display panel, laser Scanning makes display etc.;Communication mode used by communication module 205 includes but is not limited to mobile high definition chained technology (HML), universal serial bus (USB), high-definition media interface (HDMI), wireless connection: adopting wireless fidelity technology (WiFi), bluetooth The communication technology, the low-power consumption bluetooth communication technology, the communication technology based on IEEE802.11s.
A kind of computer readable storage medium provided by the embodiments of the present application is stored with meter in computer readable storage medium Calculation machine program, realizes transmission of video between mobile device described in any embodiment as above when computer program is executed by processor The step of method.
Computer readable storage medium involved in the application includes random access memory (RAM), memory, read-only memory (ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technical field Any other form of storage medium well known to interior.
Figure 12 and Figure 13 are please referred to, Figure 12 is the program architecture flow chart for sending the mobile device of video, and Figure 13 is to receive The program architecture flow chart of the mobile device of video.
The specific procedure of transmitting terminal (mobile device end for sending video) and receiving end (mobile device end for receiving video) Framework flow chart difference is as shown in Figure 12 and Figure 13.According to Figure 12, entire receiver terminal framework be broadly divided into Main class, Camera class, Encoder class, Encrypter class, Sender class and BufferQueue class.At the beginning of Main class mainly realizes thread Beginningization and the beginning and end for controlling each thread, concrete methods of realizing are as follows:
(a) initialization of int_camera_sufaceview () realization camera is executed.
(b) monitoring of setVideoFrameListener () realization camera acquisition video data is executed.
(c) beginning of startCamera () realization camera video acquisition is executed.
(d) creatEncoder () creation encoder threads are executed, and are created by new EncoderBufferQueue () A new queue is built, for caching the data of encoder.
(e) creatEncrypter () creation chaos encryption thread is executed, and passes through new EncrypterBufferQueue () creates a new queue, for caching the data of chaos encryption module.
(f) creatSender () creation network transmission line journey is executed, and is created by new SenderBufferQueue () A new queue is built, for the data of buffer network sending module.
(g) stop () is called to terminate each thread.
Camera class realizes that video acquisition and video preview, concrete methods of realizing are as follows:
(a) configuration of setPreviveParams () realization camera is executed.
(b) it executes setPreviveCallback (CaptureYuvStr) and realizes the circle collection of vision signal, and lead to It crosses onCaptureRawFrameCallback (byte [] buffer) to adjust back data to Main class, passes through push_ Data are sent into BufferQueue by encoder_frame_queue () method.
(c) startPreview () unlatching video preview is executed.
Encoder class realizes that the H.264 coding of video data, concrete methods of realizing are as follows:
(a) it executes new Encoder (EncoderBufferQueue) and creates an encoder object, and pass through ConfigEncoder () carries out parameter configuration to encoder.
(b) monitoring of setEncoderFrameListener () realization coded data is executed.
(c) stratEncoderThread () unlatching coding thread is executed, poll_queue_frame () is called to obtain team Video frame in column, and all video frames read in queue are compiled by MediaCodecEncoding () Code executes callbackEncryptFramedata () callback data, and finally executing push_encrypter_queue () will H.264 code stream is transmitted to buffer queue.
Encrypter class realizes that the chaos encryption of H.264 code stream, concrete methods of realizing are as follows:
(a) object that new Encrypter (EncrypterBufferQueue) creates an encryption is executed.
(b) stratEncrypterThread () unlatching chaos encryption thread is executed, StartEncrypt () beginning is executed Encryption obtains the H.264 code stream in queue by poll queue frame (), encrypts and all reads in queue H.264 code stream finally executes callbackSendFramedata () callback data, executes push_encrypter_queue () Encrypted H.264 code stream is transmitted to buffer queue.
Sender class realizes that the network of encrypted H.264 code stream is sent, and concrete methods of realizing is as follows:
(a) it executes new Sender (SenderBufferQueue) and creates the object that a network is sent.
(b) it executes startSenderThread () opening network and sends thread, execute StartRtpPacketizer () It realizes the RTP package to encrypted H.264 code stream, and network transmission is carried out by UdpSend ().
BufferQueue class realizes buffer queue, caches to the data of each thread
According to Figure 13, entire sender terminal framework be broadly divided into Main class, Receiver class, Decrypter class, Decoder class and BufferQueue class.Main class mainly realize thread initialization and control the beginning of each thread with Terminate, concrete methods of realizing is as follows:
(a) creatReceiver () creation network receiving thread is executed.
(b) it executes creatDecrypter () creation chaos and decrypts thread, and execute new DecrypterBufferQueue () creates a new queue, for caching the data of chaos deciphering module.
(c) creatDecoder () creation decoder thread is executed, and executes new DecoderBufferQueue () wound A new queue is built, for caching the data of decoder.
(d) stop () is called to terminate each thread.
Receiver class realizes that the network of encrypted H.264 code stream receives, and concrete methods of realizing is as follows:
(a) it executes new Receiver (ReceiverBufferQueue) and creates a network reception object.
(b) startReceiverThread () opening network receiving thread is executed, is executed StartUdpReceiver () It realizes and the encrypted H.264 code stream RTP that network receives is unpacked, executing StartFrameConstruct () will be after unpacking H.264 code stream be combined into a complete frame H.264 frame.CallbackFramedata () callback data is finally executed, is executed The encrypted H.264 code stream that push_decrypter_queue () receives network is transmitted to buffer queue.
Decrypter class realizes the chaos decryption of H.264 code stream, and concrete methods of realizing is as follows:
(a) object that new Decrypter (DecrypterBufferQueue) creates an encryption is executed.
(b) it executes stratDecrypterThread () unlatching chaos and decrypts thread, StartDecrypt () is called to start Decryption executes the encrypted H.264 code stream in poll_queue_frame () acquisition queue, and decryption is all to read in queue Encrypted H.264 code stream is got, callbackDecryptFramedata () callback data is finally executed, executes push_ H.264 code stream after decryption is transmitted to buffer queue by decrypter_queue ().
Decoder class realizes the decoding to the H.264 code stream after decryption, and concrete methods of realizing is as follows:
(a) it executes new Decoder (DecoderBufferQueue) and creates a decoder object.
(b) monitoring of setDecoderFrameListener () realization decoding data is executed.
(c) execution stratDecoder () starts to decode, and in decoding process, it is real to execute startRenderThread () The video of existing OpenGL recycles display, executes startDecoderThread () unlatching decoding thread, executes poll_queue_ Frame () obtains the H.264 code stream in queue, executes findAvcNalSpsAndPPS (), when recognizing sequence parameter set (SSP) and when picture parameter set (PPS), executing configDecoder () sends it to hardware decoder and initializes decoding Device executes all H.264 code streams read in queue of Mediacodec_decoding () decoding, each frame of iterative decoding Video data.
BufferQueue class realizes buffer queue, caches to the data of each thread.
Video transmission system, equipment and computer readable storage medium between a kind of mobile device provided by the embodiments of the present application The explanation of middle relevant portion refers between a kind of mobile device provided by the embodiments of the present application corresponding part in video transmission method Detailed description, details are not described herein.In addition, in above-mentioned technical proposal provided by the embodiments of the present application with it is corresponding in the prior art The consistent part of technical solution realization principle is simultaneously unspecified, in order to avoid excessively repeat.
It should also be noted that, herein, relational terms such as first and second and the like are used merely to one Entity or operation are distinguished with another entity or operation, without necessarily requiring or implying between these entities or operation There are any actual relationship or orders.Moreover, the terms "include", "comprise" or its any other variant are intended to contain Lid non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipment Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that There is also other identical elements in process, method, article or equipment including the element.
The foregoing description of the disclosed embodiments makes those skilled in the art can be realized or use the application.To this A variety of modifications of a little embodiments will be apparent for a person skilled in the art, and the general principles defined herein can Without departing from the spirit or scope of the application, to realize in other embodiments.Therefore, the application will not be limited It is formed on the embodiments shown herein, and is to fit to consistent with the principles and novel features disclosed in this article widest Range.

Claims (10)

1. video transmission method between a kind of mobile device characterized by comprising
Obtain video to be transmitted;
H.264 hardware encoding is carried out to the video to be transmitted, obtains encoded video;
The encoded video is encrypted, encrypted video is obtained;
RTP package is carried out to the encrypted video, obtains package video, and transmit the package video.
2. being encrypted the method according to claim 1, wherein described encrypt the encoded video Video, comprising:
Chaos encryption is carried out to the encoded video, obtains the encrypted video.
3. according to the method described in claim 2, it is characterized in that, it is described to the encoded video carry out chaos encryption, obtain The encrypted video, comprising:
Operation is carried out to the encoded video using chaos encryption formula, obtains the encrypted video;
The chaos encryption formula includes:
Wherein, k indicates the number of iterations;M (k) indicates the encoded video;C (k) indicates the encrypted video;σ=2.5 × 107, ε =3.3 × 108It indicates to be rounded downwards;
4. the method according to claim 1, wherein the transmission package video, comprising:
The package video is transmitted using Real-time Transport Protocol and udp protocol.
5. the method according to claim 1, wherein described carry out H.264 hardware volume to the video to be transmitted Code, obtains encoded video, comprising:
Input block queue is obtained from H.264 codec;
Apply for a buffer empty in the input block queue;
By the video copy to be transmitted to the empty buffer area, real buffer area is obtained, the real buffer area is stored to described Input block queue;
The output buffer queue of the H.264 codec is obtained, is cached with the coding in the output buffer queue Video, the encoded video include that the H.264 codec compiles the video to be transmitted in the real buffer area The video obtained after code;
In the output buffer queue apply an output buffer, and obtain cached in the output buffer it is described Encoded video.
6. the method according to claim 1, wherein described carry out RTP package to the encrypted video, comprising:
Added using any one or a few mode in single package mode, combination package mode, fragment package mode to described Close video carries out RTP package.
7. method according to any one of claims 1 to 6, which is characterized in that further include:
Receive video to be shown;
RTP unpacking is carried out to the video to be shown, obtains unpacking video;
The unpacking video is decrypted, decryption video is obtained;
H.264 hardware is carried out to the decryption video to decode, and obtains original video corresponding with the video to be shown.
8. Video transmission system between a kind of mobile device characterized by comprising
First obtains module, for obtaining video to be transmitted;
First coding module obtains encoded video for carrying out H.264 hardware encoding to the video to be transmitted;
First encrypting module obtains encrypted video for encrypting to the encoded video;
First package module obtains package video, and transmit the package view for carrying out RTP package to the encrypted video Frequently.
9. video transmission equipment between a kind of mobile device characterized by comprising
Memory, for storing computer program;
Processor realizes video between the mobile device as described in any one of claim 1 to 7 when for executing the computer program The step of transmission method.
10. a kind of computer readable storage medium, which is characterized in that be stored with computer in the computer readable storage medium Program, video passes between the mobile device as described in any one of claim 1 to 7 is realized when the computer program is executed by processor The step of transmission method.
CN201910184870.1A 2019-03-12 2019-03-12 Video transmission method, system, equipment and computer media between a kind of mobile device Pending CN109788299A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910184870.1A CN109788299A (en) 2019-03-12 2019-03-12 Video transmission method, system, equipment and computer media between a kind of mobile device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910184870.1A CN109788299A (en) 2019-03-12 2019-03-12 Video transmission method, system, equipment and computer media between a kind of mobile device

Publications (1)

Publication Number Publication Date
CN109788299A true CN109788299A (en) 2019-05-21

Family

ID=66489061

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910184870.1A Pending CN109788299A (en) 2019-03-12 2019-03-12 Video transmission method, system, equipment and computer media between a kind of mobile device

Country Status (1)

Country Link
CN (1) CN109788299A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110474867A (en) * 2019-06-26 2019-11-19 深圳市朗强科技有限公司 A kind of transmission method of multi-medium data, system and equipment
CN114697744A (en) * 2020-12-28 2022-07-01 海能达通信股份有限公司 Video data processing method and related device
CN114827125A (en) * 2022-03-23 2022-07-29 深圳北鲲云计算有限公司 Parallel data transmission method, system and medium for high-performance computing cloud platform

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101345615A (en) * 2008-08-05 2009-01-14 广东工业大学 Design method for chaos digital secret communication system based on FPGA
CN102123026A (en) * 2011-04-12 2011-07-13 南开大学 Chaos and hyperchaos based two-level video streaming media encryption method
CN102710940A (en) * 2012-06-04 2012-10-03 公安部第三研究所 Digital signal processor (DSP) platform-based method for realizing optimization of video coding by utilizing motion estimation algorithm
CN103533356A (en) * 2013-10-10 2014-01-22 深圳市智美达科技有限公司 Video data transmission method and device
CN103716624A (en) * 2012-10-05 2014-04-09 创惟科技股份有限公司 Image data processing method
CN103747253A (en) * 2013-12-27 2014-04-23 高新兴科技集团股份有限公司 Method for transmitting video coded data based on FIFO
CN104135669A (en) * 2014-07-16 2014-11-05 广东工业大学 Video secret communication method for high-dimensional chaotic mapping
CN105791853A (en) * 2016-03-04 2016-07-20 广东工业大学 Encrypted embedded video chaotic secret communication method after H.264 coding
US20170070752A1 (en) * 2012-08-13 2017-03-09 Gurulogic Microsystems Oy Decoder and method
CN106576168A (en) * 2015-02-09 2017-04-19 株式会社日立信息通信工程 Image compression/decompression device

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101345615A (en) * 2008-08-05 2009-01-14 广东工业大学 Design method for chaos digital secret communication system based on FPGA
CN102123026A (en) * 2011-04-12 2011-07-13 南开大学 Chaos and hyperchaos based two-level video streaming media encryption method
CN102710940A (en) * 2012-06-04 2012-10-03 公安部第三研究所 Digital signal processor (DSP) platform-based method for realizing optimization of video coding by utilizing motion estimation algorithm
US20170070752A1 (en) * 2012-08-13 2017-03-09 Gurulogic Microsystems Oy Decoder and method
CN103716624A (en) * 2012-10-05 2014-04-09 创惟科技股份有限公司 Image data processing method
CN103533356A (en) * 2013-10-10 2014-01-22 深圳市智美达科技有限公司 Video data transmission method and device
CN103747253A (en) * 2013-12-27 2014-04-23 高新兴科技集团股份有限公司 Method for transmitting video coded data based on FIFO
CN104135669A (en) * 2014-07-16 2014-11-05 广东工业大学 Video secret communication method for high-dimensional chaotic mapping
CN106576168A (en) * 2015-02-09 2017-04-19 株式会社日立信息通信工程 Image compression/decompression device
CN105791853A (en) * 2016-03-04 2016-07-20 广东工业大学 Encrypted embedded video chaotic secret communication method after H.264 coding

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
陈平 等: "《基于混沌文件加密系统的设计与实现》", 《广东工业大学学报》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110474867A (en) * 2019-06-26 2019-11-19 深圳市朗强科技有限公司 A kind of transmission method of multi-medium data, system and equipment
CN114697744A (en) * 2020-12-28 2022-07-01 海能达通信股份有限公司 Video data processing method and related device
CN114697744B (en) * 2020-12-28 2023-12-19 海能达通信股份有限公司 Video data processing method and related device
CN114827125A (en) * 2022-03-23 2022-07-29 深圳北鲲云计算有限公司 Parallel data transmission method, system and medium for high-performance computing cloud platform

Similar Documents

Publication Publication Date Title
US9332268B2 (en) Electronic device for encoding a buffer parameter
US10045065B2 (en) Synchronization and control of overlay contents for video streaming in a wireless communication system
CN106470345B (en) Video encryption transmission method, video decryption method, video encryption transmission device, video decryption device and video encryption transmission system
CN109788299A (en) Video transmission method, system, equipment and computer media between a kind of mobile device
KR102117445B1 (en) Method and apparatus for packet header compression
US20160301730A1 (en) Electronic devices for sending a message and buffering a bitstream
CN107660280A (en) Low latency screen mirror image
JP2012533220A (en) System and method for transmitting content from a mobile device to a wireless display
CN107147916B (en) Method for transmitting H.265 coding video data on transmission layer
US11546619B2 (en) Data stream encoder configuration
CN105007465A (en) Cipher-text H264 video live-broadcasting and on-demand platform based on live555 frame and ffmpeg library
JP2024504421A (en) Volumetric media processing method and device, storage medium, and electronic device
KR20140129178A (en) Enabling delivery of protected content using unprotected delivery services
KR20190003729A (en) Method and apparatus for mpeg media transport integration in content distribution networks
US20140092995A1 (en) Electronic devices for signaling a random access point picture message
US9083954B2 (en) Video processing method and system and related device
KR101710011B1 (en) Image data transmission and reception method and apparatus
CN105657448B (en) A kind of retransmission method, the apparatus and system of encoded video stream
CN103313045A (en) H.264 video sub-packaging method of dispatching desk of wideband multimedia trunking system
CN110198458A (en) A kind of processing method and processing device of encrypted audio/video data
CN109104635A (en) The method and system of instant delivery screen picture
CN109743627B (en) Playing method of digital movie package based on AVS + video coding
CN114009030A (en) Techniques for signaling and identifying access unit boundaries
CN113453006B (en) Picture packaging method, device and storage medium
CN115842919B (en) Video low-delay transmission method based on hardware acceleration

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20190521

RJ01 Rejection of invention patent application after publication