A kind of audio/video coder live based on wide area network and method of work thereof
Technical field
The present invention relates to a kind of audio/video coder live based on wide area network and method of work thereof, particularly relate to a kind of audio/video coder and the method for work thereof that are applicable to field of broadcast televisions.
Background technology
In the stream media service system of real-time live broadcast, encoder is used for the audio, video data of collection in worksite to carry out compressed encoding, and then push in streaming media server, streaming media server carries out the distribution of audio, video data, thus realizes live.
Conventional codec export support agreement single, can not in wide area network propelling data, therefore encoder and streaming media server must be in same local area network (LAN), bring restriction to the deployment of stream media service system.
In practical application also there is the single problem of input interface in encoder, thus have specific requirement to the output interface of audio-video acquisition equipment.
Summary of the invention
The technical problem to be solved in the present invention is to provide a kind of audio/video coder live based on wide area network and method of work thereof.
The technical solution used in the present invention is as follows: a kind of audio/video coder live based on wide area network, is characterized in that, comprise
Signal input module, comprises two or more audio frequency and video input interface, and sends to the audio frequency and video A/D modular converter of coding module after carrying out digitlization to the audio, video data of input;
Coding module, sends to procotol package module after the audiovisual digital data of reception are carried out compressed encoding;
Procotol package module, comprises,
Protocol encapsulation module, carries out protocol encapsulation by the audio, video data after compressed encoding;
Data push away module, and the audio, video data after protocol encapsulation is pushed to streaming media server.
As preferably, described network encapsulation module also comprises data cache module, the audio, video data after buffer memory compressed encoding.
As preferably, described protocol encapsulation module also comprises initialization module, carries out initialization to protocol encapsulation module.
Based on the audio/video coder method of work that wide area network is live, concrete grammar is:
Step one, to input audio, video data carry out digitlization;
Step 2, the audio, video data after digitlization is carried out compressed encoding;
Step 3, the audio, video data after compressed encoding is carried out RTMP protocol encapsulation;
Step 4, the audio, video data after protocol encapsulation is pushed to streaming media server.
As preferably, described step also comprises after the audio, video data after by compressed encoding carries out buffer memory carries out RTMP protocol encapsulation again.
As preferably, described step also comprises, and initialization RTMP agreement, sets up the connection of same streaming media server.
As preferably, the concrete grammar step of described step 4 is, the audio, video data after compressed encoding is first encapsulated as PS stream, is then packaged into FLV form, adopts RTMP laundry transmission, initiatively sends and be connected to streaming media server.
As preferably, described method also comprises, and the DTS/PTS size of adjustment Audio and Video, ensures audio-visual synchronization.
As preferably, described method also comprises, and when data cube computation occurs abnormal, sends abnormal signal to server.
Compared with prior art, the invention has the beneficial effects as follows: can embedded multiple network agreement, audio, video data can be pushed to streaming media server in wide area network.Make audio frequency and video input interface various simultaneously, meet various practical application request.
Accompanying drawing explanation
Fig. 1 is the principle schematic of the present invention's wherein embodiment.
Fig. 2 is the workflow schematic diagram of the present invention's wherein protocol encapsulation module of an embodiment.
Embodiment
In order to make object of the present invention, technical scheme and advantage clearly understand, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein only in order to explain the present invention, be not intended to limit the present invention.
Arbitrary feature disclosed in this specification (comprising any accessory claim, summary and accompanying drawing), unless specifically stated otherwise, all can be replaced by other equivalences or the alternative features with similar object.That is, unless specifically stated otherwise, each feature is an example in a series of equivalence or similar characteristics.
As shown in Figure 1, a kind of audio/video coder live based on wide area network, comprises signal input module, comprises two or more audio frequency and video input interface, and sends to the audio frequency and video A/D modular converter of coding module after carrying out digitlization to the audio, video data of input; Coding module, sends to procotol package module after the audiovisual digital data of reception are carried out compressed encoding;
Procotol package module, comprises, protocol encapsulation module, and the audio, video data after compressed encoding is carried out protocol encapsulation; Data push away module, and the audio, video data after protocol encapsulation is pushed to streaming media server.
Can embedded multiple network agreement, audio, video data can be pushed to streaming media server in wide area network.Make audio frequency and video input interface various simultaneously, meet various practical application request.
The signal that various interface inputs by described signal input module carries out digitlization, (SuSE) Linux OS carries out the detection of each input signal, insert when ADI7441 detects various signal when there being signal and input laggard row digital conversion at configuration alternative signal, the data after conversion are supplied to back-end code module.
Audio, video data is carried out compressed encoding by coding module, is convenient to reduce encoder bit rate and transmits in a network.Be encoded to H264 coding, point HE-AAC audio frequency and H264 video two parts, be ES stream by coding module encoding stream out, be convenient to stream encapsulation format below; Ensure that encoding stream scope is within 300Kbps-15Mbps simultaneously.
As shown in Figure 2, described network encapsulation module also comprises data cache module, the audio, video data after buffer memory compressed encoding.Protocol encapsulation module constantly extracts the audio, video data after compression coding from data cache module, is packaged into RTMP bag, and sends to streaming media server by RTMP agreement.
As shown in Figure 2, described protocol encapsulation module also comprises initialization module, carries out initialization to protocol encapsulation module.
As shown in Figure 1, a kind of audio/video coder method of work live based on wide area network, concrete grammar is: step one, to input audio, video data carry out digitlization; Step 2, the audio, video data after digitlization is carried out compressed encoding; Step 3, the audio, video data after compressed encoding is carried out RTMP protocol encapsulation; Step 4, the audio, video data after protocol encapsulation is pushed to streaming media server.Thus realize live TV stream real-time Transmission in wide area network.
The embedded multiple network agreement of encoder, can push real-time live broadcast stream after protocol encapsulation in the wide area network, and therefore encoder and streaming media server need not in same local area network (LAN)s, and project plan is flexible, is more applicable to the practical application needs of various real-time live broadcast occasion.Meet the IPTV system layout based on wide area network, for some special application provide a kind of application new paragon new technology newly simultaneously.Signal input interface variation, meets the application needs of various real-time live broadcast occasion.
Digitized video data is carried out H264 compressed encoding by coding module, and voice data carries out AAC compressed encoding.
As shown in Figure 2, described step also comprises after the audio, video data after by compressed encoding carries out buffer memory carries out RTMP protocol encapsulation again, and this buffer memory ensure that the fluency of the audio frequency and video that encoder pushes.
In this specific embodiment, described step also comprises, and initialization RTMP agreement, sets up the connection of same streaming media server.
In this specific embodiment, the concrete grammar step of described step 4 is, the audio, video data after compressed encoding is first encapsulated as PS stream, then FLV form is packaged into, adopt RTMP laundry transmission, initiatively send and be connected to streaming media server, make this encoder possess ability live in the Internet.
In this specific embodiment, described method also comprises, and the DTS/PTS size of adjustment Audio and Video, ensures audio-visual synchronization.
In this specific embodiment, described method also comprises, and when data cube computation occurs abnormal, sends abnormal signal to server.