CN102710512A - Cross-platform stream generator and control method - Google Patents

Cross-platform stream generator and control method Download PDF

Info

Publication number
CN102710512A
CN102710512A CN2012101620290A CN201210162029A CN102710512A CN 102710512 A CN102710512 A CN 102710512A CN 2012101620290 A CN2012101620290 A CN 2012101620290A CN 201210162029 A CN201210162029 A CN 201210162029A CN 102710512 A CN102710512 A CN 102710512A
Authority
CN
China
Prior art keywords
file
multicast
rtp
module
cross
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
CN2012101620290A
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.)
CHENGDU 30KAITIAN COMMUNICATION INDUSTRY Co Ltd
Original Assignee
CHENGDU 30KAITIAN COMMUNICATION INDUSTRY Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by CHENGDU 30KAITIAN COMMUNICATION INDUSTRY Co Ltd filed Critical CHENGDU 30KAITIAN COMMUNICATION INDUSTRY Co Ltd
Priority to CN2012101620290A priority Critical patent/CN102710512A/en
Publication of CN102710512A publication Critical patent/CN102710512A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a cross-platform stream generator which comprises a multicast contracting unit, a network connecting unit, a document processing unit and an RTSP (real time streaming protocol) processing unit; the cross-platform stream generator control method comprises four steps, i.e., document processing, network connecting, multicast contracting and RTSP processing; the multicast contracting step comprises an RTP (real time protocol) packaging step, a data packet transmitting step and a transmitting speed control step; and the transmitting speed control step comprises a code rate control step, a constant code rate data stream broadcast control step and a change code rate data stream broadcast control step. The cross-platform stream generator can be deployed on any platform which supports a Java virtual machine; the use range is widened greatly; the deploying difficulty is reduced; and the transmitting speed can be set, so that conditions such as network bandwidth, delay, packet loss of the RTP packet, shaking and the like are simulated easily, and the test to the performance of application programs of an IPTV (internet protocol television) is realized.

Description

A kind of cross-platform flow-generator and control method
Technical field
The present invention relates to a kind of cross-platform flow-generator and control method.
Background technology
At present, when the application and development of on the IPTV STB, being correlated with for Streaming Media is debugged, generally select WinSend software to send code stream control as server end.But WinSend can only be applicable under the windows platform, under other platform, lacks a instrument that can be used for debugging TS stream.The flow-generator of Java exploitation can be common to any operating system, as long as the Java Virtual Machine support.Therefore the cross-platform flow-generator of java can be reduced at the developing and debugging of IPTV STB under the non-Windows platform greatly, and this instrument can be used as the multicast generator and is widely used simultaneously.
Summary of the invention
The objective of the invention is to solve the deficiency of prior art, provide a kind of can be cross-platform control data stream transmission speed, can reduce by bottom data and connect and the vulnerability of application program that causes and the cross-platform flow-generator and the control method of fault.
The objective of the invention is to realize: a kind of cross-platform flow-generator through following technical scheme; It comprises multicast give out a contract for a project unit, network connection unit, file process unit and RTSP protocol processing unit, and the described multicast unit of giving out a contract for a project comprises transmission speed control module, packet sending module and RTP package module; Network connection unit comprises multicast address management module and port connection management module; The file process unit comprises TS file read module and file cache module; The RTSP protocol processing unit comprises port monitoring module, signaling parsing module and signaling responding module.
A kind of cross-platform flow-generator control method; It comprises that file process, network connect, multicast is given out a contract for a project and four steps of RTSP protocol processes; The multicast step of giving out a contract for a project comprises RTP package step, packet forwarding step and transmission speed controlled step, and described transmission speed controlled step comprises that a Rate Control step, a permanent code rate data spread and put controlled step and a variable code rate data flow Play Control step:
Described Rate Control substep comprises following substep:
S101: the actual delivery time of record data stream is current system time CurrentTime (n), wherein, n=0,1,2 ..., when sending for the first time, n=0;
S102: the difference that calculates system time and delivery time according to the theoretical delivery time SentTime (n) of RTP bag: Difference=CurrentTime (0)-SentTime (0);
S103: calculate the time of having a rest after the intact RTP of every transmission wraps: SleepTime (n)=SentTime (n)-[CurrentTime (n)-Difference];
Described permanent code rate data spreads and puts controlled step and comprise following substep:
S201: calculate the time that n permanent code check RTP bag will send: SentTime (n)=(RTPPacketNum*188*8)/bitRate; Wherein, RTPPacketNum is the index of this RTP bag, increases successively since 0, and 7*188 is the byte number of a RTP bag; Becoming after taking advantage of 8 with the position is unit, and bitRate is the constant code rate of appointment;
Described variable code rate data flow Play Control step comprises following substep:
S301: get the transmitting time SentTime (n) that the PCR that comprises video in the RTP bag wraps as this RTP;
S302: when sending the variable code rate data flow, carry out reading of data as unit with 7*188;
S303: relatively contain the PCR and the last PCR that sends of video in the current RTP bag, calculate and obtain the time of having a rest.
File process step of the present invention may further comprise the steps:
S401: whether import file name and checking file be complete effective, if not the complete and effective file, then returns error message;
S402: if file is complete effectively, initialization buffer memory and opening file then;
S403: whether the check buffer memory is empty, if be empty, then whether check arrives end-of-file, if arrived end-of-file, file pointer then resets;
S404: read file and write buffer memory.
Network connexon step of the present invention may further comprise the steps:
S501: select network interface card, multicast address and network connection port;
S502: set up IP multicast socket;
S503: the attributes section relevant with the IP multicast is set;
S504: receive when sending request, send data to multicast group.
RTSP protocol processes substep of the present invention may further comprise the steps:
S601: its enable port is monitored;
S602: when receiving the RTSP request, the analysis request signaling is also sent feedback signaling.
The invention has the beneficial effects as follows: cross-platform flow-generator can be deployed on the platform of any support Java Virtual Machine, has widened the scope of application greatly, has reduced the deployment difficulty; Can be provided with simultaneously, thereby at an easy rate situation such as the packet loss of the network bandwidth, delay, RTP bag, shake simulated, realize test the performance of IPTV set-top box application program under variety of network conditions to transmission speed; In addition, this cross-platform flow-generator has reduced vulnerability of application program and the fault that is caused by the bottom data connection.
Description of drawings
Fig. 1 is the composition structural representation block diagram of flow-generator of the present invention;
Fig. 2 is a file process flow chart of steps of the present invention;
Fig. 3 is a network Connection Step flow chart of the present invention;
Fig. 4 is a RTSP protocol processes flow chart of steps of the present invention.
Embodiment
Further describe technical scheme of the present invention below in conjunction with accompanying drawing:
As shown in Figure 1; A kind of cross-platform flow-generator; It comprises multicast give out a contract for a project unit, network connection unit, file process unit and RTSP protocol processing unit, and the described multicast unit of giving out a contract for a project comprises transmission speed control module, packet sending module and RTP package module; Network connection unit comprises multicast address management module and port connection management module; The file process unit comprises TS file read module and file cache module; The RTSP protocol processing unit comprises port monitoring module, signaling parsing module and signaling responding module.
A kind of cross-platform flow-generator control method; It comprises that file process, network connect, multicast is given out a contract for a project and four steps of RTSP protocol processes; The multicast step of giving out a contract for a project comprises RTP package step, packet forwarding step and transmission speed controlled step, and described transmission speed controlled step comprises that a Rate Control step, a permanent code rate data spread and put controlled step and a variable code rate data flow Play Control step:
Described Rate Control substep comprises following substep:
S101: the actual delivery time of record data stream is current system time CurrentTime (n), wherein, n=0,1,2 ..., when sending for the first time, n=0;
S102: the difference that calculates system time and delivery time according to the theoretical delivery time SentTime (n) of RTP bag: Difference=CurrentTime (0)-SentTime (0);
S103: calculate the time of having a rest after the intact RTP of every transmission wraps: SleepTime (n)=SentTime (n)-[CurrentTime (n)-Difference];
Described permanent code rate data spreads and puts controlled step and comprise following substep:
S201: calculate the time that n permanent code check RTP bag will send: SentTime (n)=(RTPPacketNum*188*8)/bitRate; Wherein, RTPPacketNum is the index of this RTP bag, increases successively since 0, and 7*188 is the byte number of a RTP bag; Becoming after taking advantage of 8 with the position is unit, and bitRate is the constant code rate of appointment;
Described variable code rate data flow Play Control step comprises following substep:
S301: get the transmitting time SentTime (n) that the PCR that comprises video in the RTP bag wraps as this RTP;
S302: when sending the variable code rate data flow, carry out reading of data as unit with 7*188;
S303: relatively contain the PCR and the last PCR that sends of video in the current RTP bag, calculate and obtain the time of having a rest.
As shown in Figure 2, the file process step may further comprise the steps:
S401: whether import file name and checking file be complete effective, if not the complete and effective file, then returns error message;
S402: if file is complete effectively, initialization buffer memory and opening file then;
S403: whether the check buffer memory is empty, if be empty, then whether check arrives end-of-file, if arrived end-of-file, file pointer then resets;
S404: read file and write buffer memory.
As shown in Figure 3, network connexon step may further comprise the steps:
S501: select network interface card, multicast address and network connection port;
S502: set up IP multicast socket;
S503: the attributes section relevant with the IP multicast is set;
S504: receive when sending request, send data to multicast group.
As shown in Figure 4, RTSP protocol processes step may further comprise the steps:
S601: its enable port is monitored;
S602: when receiving the RTSP request, the analysis request signaling is also sent feedback signaling.

Claims (5)

1. cross-platform flow-generator; It is characterized in that: it comprises multicast give out a contract for a project unit, network connection unit, file process unit and RTSP protocol processing unit, and the described multicast unit of giving out a contract for a project comprises transmission speed control module, packet sending module and RTP package module; Network connection unit comprises multicast address management module and port connection management module; The file process unit comprises TS file read module and file cache module; The RTSP protocol processing unit comprises port monitoring module, signaling parsing module and signaling responding module.
2. cross-platform flow-generator control method; It comprises that file process, network connect, multicast is given out a contract for a project and four steps of RTSP protocol processes; The multicast step of giving out a contract for a project comprises RTP package step, packet forwarding step and transmission speed controlled step, and it is characterized in that: described transmission speed controlled step comprises that a Rate Control step, a permanent code rate data spread and put controlled step and a variable code rate data flow Play Control step:
Described Rate Control substep comprises following substep:
S101: the actual delivery time of record data stream is current system time CurrentTime (n), wherein, n=0,1,2 ..., when sending for the first time, n=0;
S102: the difference that calculates system time and delivery time according to the theoretical delivery time SentTime (n) of RTP bag: Difference=CurrentTime (0)-SentTime (0);
S103: calculate the time of having a rest after the intact RTP of every transmission wraps: SleepTime (n)=SentTime (n)-[CurrentTime (n)-Difference];
Described permanent code rate data spreads and puts controlled step and comprise following substep:
S201: calculate the time that n permanent code check RTP bag will send: SentTime (n)=(RTPPacketNum*188*8)/bitRate; Wherein, RTPPacketNum is the index of this RTP bag, increases successively since 0, and 7*188 is the byte number of a RTP bag; Becoming after taking advantage of 8 with the position is unit, and bitRate is the constant code rate of appointment;
Described variable code rate data flow Play Control step comprises following substep:
S301: get the transmitting time SentTime (n) that the PCR that comprises video in the RTP bag wraps as this RTP;
S302: when sending the variable code rate data flow, carry out reading of data as unit with 7*188;
S303: relatively contain the PCR and the last PCR that sends of video in the current RTP bag, calculate and obtain the time of having a rest.
3. a kind of cross-platform flow-generator control method according to claim 2, it is characterized in that: described file process step may further comprise the steps:
S401: whether import file name and checking file be complete effective, if not the complete and effective file, then returns error message;
S402: if file is complete effectively, initialization buffer memory and opening file then;
S403: whether the check buffer memory is empty, if be empty, then whether check arrives end-of-file, if arrived end-of-file, file pointer then resets;
S404: read file and write buffer memory.
4. a kind of cross-platform flow-generator control method according to claim 2, it is characterized in that: described network Connection Step may further comprise the steps:
S501: select network interface card, multicast address and network connection port;
S502: set up IP multicast socket;
S503: the attributes section relevant with the IP multicast is set;
S504: receive when sending request, send data to multicast group.
5. a kind of cross-platform flow-generator control method according to claim 2 is characterized in that: described RTSP protocol processes step may further comprise the steps:
S601: its enable port is monitored;
S602: when receiving the RTSP request, the analysis request signaling is also sent feedback signaling.
CN2012101620290A 2012-05-23 2012-05-23 Cross-platform stream generator and control method Pending CN102710512A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2012101620290A CN102710512A (en) 2012-05-23 2012-05-23 Cross-platform stream generator and control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2012101620290A CN102710512A (en) 2012-05-23 2012-05-23 Cross-platform stream generator and control method

Publications (1)

Publication Number Publication Date
CN102710512A true CN102710512A (en) 2012-10-03

Family

ID=46903081

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2012101620290A Pending CN102710512A (en) 2012-05-23 2012-05-23 Cross-platform stream generator and control method

Country Status (1)

Country Link
CN (1) CN102710512A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110225372A (en) * 2019-05-07 2019-09-10 成都三零凯天通信实业有限公司 A kind of real time flow medium encryption and decryption key seamless handover method
CN115514759A (en) * 2022-11-22 2022-12-23 天津中新智冠信息技术有限公司 File forwarding method, electronic device and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1731732A (en) * 2005-06-23 2006-02-08 复旦大学 High subsequent stream medium server system for realizing video quality and delivery rate control
CN101212671A (en) * 2007-12-21 2008-07-02 上海广电(集团)有限公司中央研究院 Low-delay real-time transport stream multiplexing method
CN101951387A (en) * 2010-09-30 2011-01-19 海信集团有限公司 Method and device for transmitting stream media

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1731732A (en) * 2005-06-23 2006-02-08 复旦大学 High subsequent stream medium server system for realizing video quality and delivery rate control
CN101212671A (en) * 2007-12-21 2008-07-02 上海广电(集团)有限公司中央研究院 Low-delay real-time transport stream multiplexing method
CN101951387A (en) * 2010-09-30 2011-01-19 海信集团有限公司 Method and device for transmitting stream media

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
武爱敏: "基于IP播放TS流的码率控制策略", 《有线电视技术》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110225372A (en) * 2019-05-07 2019-09-10 成都三零凯天通信实业有限公司 A kind of real time flow medium encryption and decryption key seamless handover method
CN115514759A (en) * 2022-11-22 2022-12-23 天津中新智冠信息技术有限公司 File forwarding method, electronic device and storage medium
CN115514759B (en) * 2022-11-22 2023-03-24 天津中新智冠信息技术有限公司 File forwarding method, electronic device and storage medium

Similar Documents

Publication Publication Date Title
US10362088B2 (en) Method and apparatus for delivering media content utilizing segment and packaging information
KR102073739B1 (en) Method of delivering media data based on packet with header minimizing delivery overhead
CN102412999B (en) Packet capturing based remote fault location method, system and device
JP5512038B2 (en) Interface device and method for transmitting and receiving media data
US9319721B2 (en) Method of configuring and transmitting an MMT transport packet
RU2634908C2 (en) Method and device for mediadata delivery management
US9628531B2 (en) Systems and methods for controlling client behavior in adaptive streaming
US8625443B2 (en) System for measuring transmission bandwidth for media streaming and method for same
KR101566250B1 (en) Apparatus and method for multimedia file streaming in portable terminal
US9577682B2 (en) Adaptive forward error correction (FEC) system and method
US8325601B2 (en) Reliable network streaming of a single data stream over multiple physical interfaces
AU2011370439B2 (en) Method and apparatus for rapid data distribution
US20170034589A1 (en) Adaptive profile switching system and method for media streaming over ip networks
RU2634206C2 (en) Device and method of commutation of media streams in real time mode
CN102265535A (en) Method and apparatus for streaming multiple scalable coded video content to client devices at different encoding rates
US8356109B2 (en) Network streaming of a video stream over multiple communication channels
CN103002354A (en) Method and system for eliminating network jitter of video data during transmission
CN101321036A (en) Data package processing method, apparatus and system
CA3042075C (en) Rendering stream controller
US8375139B2 (en) Network streaming over multiple data communication channels using content feedback information
CN102710512A (en) Cross-platform stream generator and control method
US9635082B2 (en) Method of saving content to a file on a server and corresponding device
JP2012231445A (en) Packet distribution device and packet distribution method
CN101916219A (en) Streaming media display platform of on-chip multi-core network processor
CN101888406B (en) Set top box, business server, program downloading method and program transmitting method and system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20121003