CN105828014B - A kind of audio/video transmission method and device - Google Patents

A kind of audio/video transmission method and device Download PDF

Info

Publication number
CN105828014B
CN105828014B CN201610300043.0A CN201610300043A CN105828014B CN 105828014 B CN105828014 B CN 105828014B CN 201610300043 A CN201610300043 A CN 201610300043A CN 105828014 B CN105828014 B CN 105828014B
Authority
CN
China
Prior art keywords
field
video
mac frame
audio
length
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
Application number
CN201610300043.0A
Other languages
Chinese (zh)
Other versions
CN105828014A (en
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.)
Zhejiang Uniview Technologies Co Ltd
Original Assignee
Zhejiang Uniview Technologies 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 Zhejiang Uniview Technologies Co Ltd filed Critical Zhejiang Uniview Technologies Co Ltd
Priority to CN201610300043.0A priority Critical patent/CN105828014B/en
Publication of CN105828014A publication Critical patent/CN105828014A/en
Application granted granted Critical
Publication of CN105828014B publication Critical patent/CN105828014B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/06Systems for the simultaneous transmission of one television signal, i.e. both picture and sound, by more than one carrier
    • H04N7/063Simultaneous transmission of separate parts of one picture
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/08Systems for the simultaneous or sequential transmission of more than one television signal, e.g. additional information signals, the signals occupying wholly or partially the same frequency band, e.g. by time division
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/10Adaptations for transmission by electrical cable

Abstract

The present invention provides a kind of audio/video transmission method and device, which comprises the minimum length of video field in mac frame is determined according to the total length of mac frame and default video transmission efficiency threshold value;The minimum length of mac frame sound intermediate frequency field is determined according to the total length of mac frame and preset audio sample rate threshold value;The maximum length of information field in mac frame is determined according to the minimum length of the length of custom field, the minimum length of video field and audio field in the mac frame;Audio, video data to be transmitted is filled into the custom field of mac frame according to the minimum length of the video field, the minimum length of audio field, the maximum length of information field and actual transmissions demand, and is sent to receiving end.Using the embodiment of the present invention audio-visual synchronization can be realized using ready-made twisted pair and is transmitted on the basis of using Double-strand transmission HD video.

Description

A kind of audio/video transmission method and device
Technical field
The present invention relates to field of communication technology more particularly to a kind of audio/video transmission method and devices.
Background technique
HDMI (High Definition Multimedia Interface, high-definition multimedia interface) cable and DVI (Digital Visual Interface, digital visual interface) cable is current widely applied audio video transmission cable, Support high definition transmission, however common HDMI and DVI cable transmission is answered in remote audio-video signal transmission field apart from limited With limited.
Twisted pair is common cable, especially building in ethernet signal transmission, in garden, because its is low in cost, applies Work is simple and is widely used, and twisted pair is rather common for audio video transmission in recent years.
Since twisted pair applications are mainly data communication, using Double-strand transmission audio-video by gigabit Ethernet band Tolerance system, does not have HD video Lossless transport ability usually, can only transmit compressed vision signal.
In view of the above-mentioned problems, a kind of scheme exists in the prior art in a kind of 1000BaseT (physical layer standard) Ethernet On the basis of transmission technology, by way of customized Ethernet Jumbo frame (jumbo frame), HD video twisted pair is realized without pressure Contracting transmission.
However, in the prior art and there is no using twisted pair synchronous transfer audio-video scheme.
Summary of the invention
The present invention provides a kind of audio/video transmission method and device, to solve to utilize Double-strand transmission high definition in the prior art When video, the problem of audio-visual synchronization is transmitted cannot achieve.
According to the first aspect of the invention, a kind of audio/video transmission method is provided, comprising:
Video in mac frame is determined according to the total length of media access control mac frame and default video transmission efficiency threshold value The minimum length of field, so that video transmission efficiency is more than or equal to the default video transmission efficiency threshold value;
The minimum length of mac frame sound intermediate frequency field is determined according to the total length of mac frame and preset audio sample rate threshold value, So that the corresponding audio sample rate of mac frame is more than or equal to the preset audio sample rate threshold value;
According to the minimum of the length of custom field, the minimum length of video field and audio field in the mac frame Length determines the maximum length of information field in mac frame, so that the length of the video field, the length of audio field and letter Cease the length that the sum of length three of field is less than or equal to the custom field;Wherein, the custom field is in mac frame Field in addition to tetra- frame gap, lead code, starting-frame delimiter SFD and cyclic redundancy check CRC fields;
According to the minimum length of the video field, the minimum length of audio field, the maximum length of information field and Audio, video data to be transmitted is filled into the custom field of mac frame by actual transmissions demand, and is sent to receiving end.
According to the second aspect of the invention, a kind of audio and video transmission device is provided, comprising:
First determination unit, for the total length and default video transmission efficiency threshold according to media access control mac frame It is worth the minimum length for determining video field in mac frame, so that video transmission efficiency is more than or equal to the default video transmission efficiency Threshold value;
Second determination unit, for determining mac frame middle pitch according to the total length and preset audio sample rate threshold value of mac frame The minimum length of frequency field, so that the corresponding audio sample rate of mac frame is more than or equal to the preset audio sample rate threshold value;
Third determination unit, for according to the length of custom field, the minimum length of video field in the mac frame with And the minimum length of audio field determines the maximum length of information field in mac frame, so that length, the audio of the video field The sum of the length of field and the length three of information field are less than or equal to the length of the custom field;Wherein, it is described from Define field be mac frame in except frame gap, lead code, tetra- fields of starting-frame delimiter SFD and cyclic redundancy check CRC it Outer field;
Transmission unit, for according to the minimum length of the video field, the minimum length of audio field, information field Audio, video data to be transmitted is filled into the custom field of mac frame by maximum length and actual transmissions demand, and is sent To receiving end.
Using technical solution disclosed by the invention, pass through the total length and default video transmission efficiency threshold according to mac frame It is worth the minimum length for determining video field in mac frame, and is determined according to the total length of mac frame and preset audio sample rate threshold value The minimum length of mac frame sound intermediate frequency field, in turn, according to the length of custom field, the minimum length of video field in mac frame And the minimum length of audio field determines the maximum length of information field in mac frame, thus according to the minimum of the video field Length, the minimum length of audio field, the maximum length of information field and actual transmissions demand are by audio-video number to be transmitted According to being filled into the custom field of mac frame, and it is sent to receiving end, on the basis of using Double-strand transmission HD video, benefit Audio-visual synchronization transmission is realized with ready-made twisted pair.
Detailed description of the invention
Figure 1A is a kind of structural schematic diagram of ethernet standard mac frame;
Figure 1B is a kind of structural schematic diagram of ethernet mac frame provided in an embodiment of the present invention;
Fig. 2 is a kind of flow diagram of audio/video transmission method provided in an embodiment of the present invention;
Fig. 3 A and 3B are that the audio field under different audio sample rates provided in an embodiment of the present invention defines schematic diagram;
Fig. 4 is a kind of structural schematic diagram of audio-video equipment provided in an embodiment of the present invention;
Fig. 5 is the structural schematic diagram of another audio-video equipment provided in an embodiment of the present invention;
Fig. 6 is the structural schematic diagram of another audio-video equipment provided in an embodiment of the present invention;
Fig. 7 is a kind of R-T unit structural schematic diagram provided in an embodiment of the present invention;
Fig. 8 is the structural schematic diagram of first FPGA provided in an embodiment of the present invention a kind of;
Fig. 9 is the structural schematic diagram of 2nd FPGA provided in an embodiment of the present invention a kind of.
Specific embodiment
Technical solution in embodiment in order to enable those skilled in the art to better understand the present invention, below first to ether The structure of net MAC (Media Access Control, media access control) frame is briefly described.
In ethernet standard agreement, mac frame needs to include frame gap, lead code, SFD (Start Frame Delimiter, starting-frame delimiter), destination address, source address, type, data and CRC (Cyclic Redundancy Code, cyclic redundancy check) etc. fields, form schematic diagram can be as shown in Figure 1A;Wherein:
Frame gap field length is 12 bytes, for absorbing the clock jitter of originator;
Lead code+SFD field length totally 8 byte, for differentiating the starting of ethernet frame;
DAF destination address field length is 6 bytes, for identifying device target address;
Source address field length is 6 bytes, for identifying equipment source address;
Type field length is 2 bytes, for defining Ethernet data packet length;
Data-field length is variable, is used for transmission Ethernet data bag;Wherein, ethernet standard frame data field length is 45~1500 bytes;If Jumbo frame, data-field length is 9000~16000 bytes;
Crc field length is 4 bytes, whether there is error code for verifying transmission.
And in embodiments of the present invention, it is contemplated that in the application of audio video transmission end to end, MAC layer PHY (Physical Layer, physical layer) fields such as concern destination address, source address and type are not needed, therefore, carry out end-to-end video transmission When, destination address, source address, type and data field in former mac frame may be incorporated for it is customized, can be referred to as from Define field.
For ease of understanding, in embodiments of the present invention, destination address, source address and type field group are become and is made by oneself Adopted field 1, data field for custom field 2 as being illustrated.Wherein, the length of custom field 1 is 14 bytes, from The length for defining field 2 is data-field length in mac frame (hereinafter referred to as Y), wherein the form schematic diagram of mac frame can be with As shown in Figure 1B.
However, it should be understood that the above-mentioned mode that custom field is divided into custom field 1 and custom field 2 is only A kind of specific example that custom field uses, and it is not limiting the scope of the present invention, the embodiment of the present invention is subsequent No longer repeat.
In order to keep the above objects, features, and advantages of the embodiment of the present invention more obvious and easy to understand, with reference to the accompanying drawing Technical solution in the embodiment of the present invention is described in further detail.
Fig. 2 is referred to, Fig. 2 is a kind of flow diagram of audio/video transmission method provided in an embodiment of the present invention, such as Fig. 2 Shown, which may comprise steps of:
Step 201 determines video field in mac frame according to the total length and default video transmission efficiency threshold value of mac frame Minimum length so that video transmission efficiency is more than or equal to default video transmission efficiency threshold value.
In the embodiment of the present invention, it is contemplated that when carrying out HD video transmission, video transmission efficiency needs to be higher than corresponding view Defeated efficiency threshold is kept pouring in, just can guarantee the Lossless transport of HD video.
For example, by taking a kind of 1080p (video display format)@30 (30 frame per second) HD video as an example, it is required that Effective bandwidth is 1920*1080*30*16=0.995328Gbps (Gigabits per second), i.e., transmits when by gigabit Ethernet When 1080p 30 HD video of@, if it is desired to reach Lossless transport, video transmission efficiency is needed to reach 99.5328% (0.995328/ 1*100%=99.5328%).
It is following in order to facilitate understanding to be illustrated so that default video transmission efficiency threshold value is 99.5328% as an example, but should It recognizes, in the embodiment of the present invention, default video transmission efficiency threshold value is not limited to 99.5328%, and the embodiment of the present invention is subsequent No longer repeat.
Correspondingly, in embodiments of the present invention, when needing to carry out audio video transmission, the overall length first according to mac frame is needed Degree and default video transmission efficiency threshold value determine the minimum length of video field in mac frame.
For example, can determine video field in the mac frame for meeting default video transmission efficiency threshold value by following formula Minimum length:
Wherein, X is the length of video field, unit: byte number;
Y is the length of custom field 2, unit: byte number;
38 be the length of intrinsic field (frame gap, lead code, SFD, custom field 1, CRC), unit: byte number;
38+Y is the total length of mac frame.
Wherein, meet the minimum value (X of the X of above-mentioned formulamin) be video field in mac frame minimum length.
As an example it is assumed that the length 2 of custom field is 9000 bytes (total length of mac frame is 9038 bytes), in advance Setting video efficiency of transmission threshold value is 99.5328%, then the minimum length of video field is Xmin=(9000+38) * 99.5328% =8996 bytes, i.e., when the total length of mac frame is 9038 byte, the minimum length needs of video field reach in mac frame 8996 bytes are just able to satisfy 99.5328% video transmission efficiency requirement.
Again as an example it is assumed that the length 2 of custom field is that (total length of mac frame is 16038 words to 16000 bytes Section), presetting video transmission efficiency threshold value is 99.5328%, then the minimum length of video field is Xmin=(16000+38) * 99.5328%=15964 byte, i.e., when the total length of mac frame is 16038 byte, the minimum length of video field in mac frame Need to reach the video transmission efficiency requirement that 15964 bytes are just able to satisfy 99.5328%.
Step 202 determines mac frame sound intermediate frequency field according to the total length and preset audio sample rate threshold value of mac frame Minimum length, so that the corresponding audio sample rate of mac frame is more than or equal to the preset audio sample rate threshold value.
In the embodiment of the present invention, when carrying out the length allocation of audio field, need to guarantee the corresponding audio sample rate of mac frame Meet maximal audio sample rate requirement, that is, is more than or equal to preset audio sample rate threshold value.
Wherein, which can determine according to the actual demand to audio transmission, and general audio sample Rate does not exceed 1Mbps (megabits per second), and therefore, which, which is set as 1Mbps, can meet big portion Multi-voice frequency sample requirement.
It is 1Mbps with preset audio sample rate threshold value in the embodiment of the present invention, the minimum unit of audio transmission is single byte For be illustrated.
However, it should be understood that setting the minimum unit of 1Mbps and audio transmission for audio sample rate threshold value is individual character Section is only one of this embodiment of the present invention specific example, rather than limiting the scope of the present invention, for example, at this In inventive embodiments, audio sample rate threshold value may be set to be 1.5Mbps, and the minimum unit of audio transmission may be ratio Spy, the embodiment of the present invention is subsequent no longer to be repeated.
As an alternative embodiment, in embodiments of the present invention, according to the total length and preset audio of mac frame Sample rate threshold value determines the minimum length of mac frame sound intermediate frequency field, may comprise steps of:
11) single byte transmission bandwidth when single frame transmission, is determined according to the total length of mac frame and maximum transmission bandwidth;
12), according to sample rate threshold value and the single byte transmission bandwidth when single frame transmission is preset, mac frame sound intermediate frequency is determined The minimum length of field.
In this embodiment, in order to guarantee that audio sample rate meets default sample rate threshold requirement, need first to guarantee into When row single frame transmission (i.e. whole network only transmits a mac frame), the corresponding audio sample rate of the mac frame can satisfy default adopt Sample rate threshold requirement.
Correspondingly, in order to determine the minimum length of mac frame sound intermediate frequency field, single byte when first determining single frame transmission is needed Transmission bandwidth, wherein single byte transmission bandwidth can be determined by following formula when the single frame transmission:
Single byte transmission bandwidth=maximum bandwidth/mac frame total length when single frame transmission
It, can be according to default sample rate threshold value and the list after single byte transmission bandwidth when single frame transmission has been determined Single byte transmission bandwidth when frame transmits, determines the minimum length of mac frame sound intermediate frequency field, wherein the mac frame sound intermediate frequency field Minimum length can pass through following formula determine:
Single byte transmission bandwidth when the minimum length of audio field=preset audio sample rate threshold value/single frame transmission
For example, when maximum bandwidth is 1Gbps,
Single byte transmission bandwidth=1Gbps/ (38+Y) when single frame transmission
Single byte transmission bandwidth=(38+Y) * 1Mbps/ when the minimum length of audio field=1Mbps/ single frame transmission 1Gbps
Wherein, when aliquant, the minimum length result of audio field is to round up to quotient.
As an example it is assumed that maximum bandwidth is 1Gbps, 2 length of custom field is the 9000 bytes (total length of mac frame For 9038 bytes), then single byte transmission bandwidth is 110Kbps (kilobits per second) when single frame transmission, and the minimum of audio field is long Degree is 10 bytes.
Again as an example it is assumed that maximum bandwidth is 1Gbps, 2 length of custom field is the 16000 bytes (overall length of mac frame Degree is 16038 bytes), then single byte transmission bandwidth is 62Kbps when single frame transmission, and the minimum length of audio field is 17 words Section.
It is worth noting that in embodiments of the present invention, between above-mentioned steps 201 and step 202 and there is no certainty Sequential relationship, it can step 201 is first carried out, it is rear to execute step 202;Step 202 can also be first carried out;Step 201 is executed afterwards, It is not limited in the embodiment of the present invention.
Step 203, according to the length of custom field in mac frame, the minimum length of video field and audio field Minimum length determines the maximum length of information field in mac frame, so that the minimum of the minimum length of video field, audio field is long The sum of maximum length three of degree and information field is less than or equal to the length of custom field.
In the embodiment of the present invention, in mac frame has been determined the minimum length of video field, the minimum length of audio field it Afterwards, in mac frame the residue length of custom field be information field maximum length, i.e., the maximum of information field in mac frame Length can be determined by following formula:
Maximum length=custom field length-video field minimum length-audio field of information field is most Small length
Wherein, the length of custom field be the sum of 1 length of custom field and 2 length of custom field, i.e., (14+Y) Byte.
As an example it is assumed that the length of custom field 2 is that (length of custom field is 9000 bytes in mac frame 9014 bytes), then the minimum length of video field is 8996 bytes, and the minimum length of audio field is 10 bytes, then in mac frame The maximum length of information field is 8 bytes.
As an example it is assumed that the length of custom field 2 is that (length of custom field is 16000 bytes in mac frame 16014 bytes), then the minimum length of video field is 15964 bytes, and the minimum length of audio field is 17 bytes, then mac frame The maximum length of middle information field is 33 bytes.
Optionally, in embodiments of the present invention, information field can include but is not limited to SOF (Start of Frame, depending on Frequency frame start mark) field, LOA (Length of Audio, audio effective word joint number) field, LOV (Length of Video, video effective word joint number) field, AINDEX (Audio Index, audio index number) field and VINDEX (Video Index)。
Wherein, SOF field can be used for identification data packet whether be video frame starting packet;LOA field is for identifying sound Effective word joint number in frequency field;LOV field is used to identify the effective word joint number in video field;AINDEX field is for identifying Audio sample rate index;VINDEX field is for identifying video resolution index.
As an example it is assumed that the length of information field is 4 bytes (totally 32 bits), then bit [31] can be SOF Field, for identification data packet whether be video frame starting packet.For example, indicating that data packet is video frame when its value is 1 Starting packet;When its value is 0, indicate that data packet is not the starting packet of video frame.
Bit [30]-[27] can be LOA field, for identifying the effective word joint number in audio field, i.e. mac frame Preceding LOA byte is effective byte in audio field, and remainder bytes are slack byte.For example, it is assumed that mac frame sound intermediate frequency field Length is 10 bytes, and when the value of LOA is 0100, then preceding 4 bytes of the audio field in mac frame are audio data, remaining Byte is invalid data.
Bit [26]-[12] can be LOV field, for identifying the effective word joint number in video field, i.e. mac frame Preceding LOV byte is effective byte in video field, and remainder bytes are slack byte.For example, it is assumed that video field in mac frame Length is 9000 bytes, and when the value of LOV is 001110000100000, then preceding 7200 byte of the video field in mac frame is Video data, remaining byte are invalid data.
Bit [11]-[8] can be AINDEX field, for identifying audio index number, it can support 16 kinds of audios Sample rate index can be according to bit [11]-[8] in information field after receiving end receives the mac frame of transmitting terminal transmission It determines audio index number, and corresponding audio sample rate is determined according to the audio index number.
Bit [7]-[0] can be VINDEX field, for identifying video index number, it can support 256 kinds of videos Resolution ratio index can be according to bit [7]-[0] in information field after receiving end receives the mac frame of transmitting terminal transmission It determines video index number, and corresponding audio sample rate is determined according to the video index number.
Step 204, minimum length, the minimum length of audio field, the maximum length of information field according to video field And audio, video data to be transmitted is filled into the custom field of mac frame by actual transmissions demand, and is sent to receiving end.
In the embodiment of the present invention, according to minimum length, the minimum length of audio field of the video field that above-mentioned steps determine The maximum length of degree and information field needs first to determine video words in mac frame when needing to carry out audio, video data transmission The physical length of section, audio field and information field.
For example, it is assumed that the length of custom field 2 is 9000 bytes in mac frame, then according to cited in above-mentioned steps Example, the minimum length of video field is 8996 bytes in mac frame, and the minimum length of audio field is 10 bytes, information field Maximum length be 8 bytes, then when needing audio, video data to transmit, the reality of video field, audio field and information field Border length can be respectively 9000 bytes, 10 bytes and 4 bytes.
In this example, the structure of mac frame can successively include frame gap field, the leading code word of 7 bytes of 12 bytes Section, the SFD field of 1 byte, the information field of 4 bytes, the audio field of 10 bytes, the video field of 9000 bytes and 4 words The crc field of section.
In the embodiment of the present invention, it is determined that in mac frame the physical length of video field, audio field and information field it Afterwards, one frame of transmission can be determined according to the physical length of video field in the size and mac frame of frame video image to be transmitted Video image to be transmitted corresponds to the destination number of required mac frame.
For example, the size of frame video image to be transmitted is 1920*1080*2=by taking 1080p HD video as an example 4147200 bytes, it is assumed that the length of video field is 9000 bytes in mac frame, then the corresponding MAC of frame video image to be transmitted The destination number of frame is 4147200/9000=460.8, i.e., needs 461 mac frames (destination number 461) altogether, first 460 9000 bytes are video data in the video field of mac frame, only have 7200 bytes view in the video field of the 461st mac frame Frequency evidence.
In the embodiment of the present invention, the number of targets transmitted frame video image to be transmitted and correspond to required mac frame is being determined After amount, the corresponding audio data size of frame image to be transmitted can be determined according to actual audio sample rate, and fill it into In the mac frame of destination number.
Preferably, in embodiments of the present invention, it needs to guarantee one when audio data being filled into the mac frame of destination number The corresponding audio data of frame image to be transmitted is evenly distributed in the mac frame of destination number.
As an alternative embodiment, in embodiments of the present invention, it is according to actual audio sample rate that one frame is to be passed The corresponding audio data of defeated image is filled into the mac frame of destination number, may include:
The audio data of M+1 byte is respectively filled in the top n mac frame of the mac frame of destination number respectively, and is existed respectively The audio data of M byte is respectively filled in remaining mac frame;
Wherein, M and N is determined by following formula:
Wherein, N is the positive integer less than or equal to destination number, BW0Single byte transmission bandwidth when for single frame transmission, NTFor Destination number, S are actual audio sample rate,To takeInteger part.
In this embodiment, when being determined that transmission one frame video image to be transmitted corresponds to the number of targets of required mac frame When amount, in order to guarantee that audio data is evenly distributed in the mac frame of destination number, the mac frame of destination number can be first determined Middle single byte transmission bandwidth, i.e. k in above-mentioned formula;1 is respectively transmitted in the mac frame of destination number it is then possible to further determine that Corresponding audio sample rate, i.e. k*N when a byteT;And then it is determined according to actual audio sample rate each in the mac frame of destination number Need to transmit the audio data of several bytes, i.e. S/ (k*NT), finally according in above-mentioned formula (M × NT+ N) × k=S determines M and N.
For example, by taking the length of custom field 2 in above-mentioned steps is the example of 9000 bytes as an example, i.e. mac frame Total length is 9038 bytes, and video field length is 9000 bytes, and audio field length is 10 bytes, and information field length is 4 Byte, single byte transmission bandwidth is 110Kbps, destination number 461, k=110/461=0.2386 when single frame transmission.
If audio sample rate is 96Kbps,(0*461+N) * 0.2386= Therefore 96, i.e. N=402 under 96Kbps audio sample rate, need respectively to fill 1 in preceding 402 mac frames of 461 mac frames The audio data of a byte does not need filling audio data in remaining mac frame, wherein mac frame sound intermediate frequency field definition can be as Shown in Fig. 3 A.
If audio sample rate is 296Kbps,(2*461+N) * 0.2386= Therefore 296, i.e. N=318 under 296Kbps audio sample rate, need respectively to fill out in preceding 318 mac frames of 461 mac frames The audio data of 3 bytes is filled, the audio data of 2 bytes is respectively filled in remaining mac frame, wherein mac frame sound intermediate frequency field is fixed Justice can be as shown in Figure 3B.
By above description as can be seen that in technical solution provided in an embodiment of the present invention, pass through the overall length according to mac frame Degree and default video transmission efficiency threshold value determine the minimum length of video field in mac frame, and according to the total length of mac frame with And preset audio sample rate threshold value determines the minimum length of mac frame sound intermediate frequency field, in turn, according to custom field in mac frame Length, the minimum length of video field and the minimum length of audio field determine the maximum length of information field in mac frame, To according to the minimum length of the video field, the minimum length of audio field, the maximum length of information field and practical biography Audio, video data to be transmitted is filled into the custom field of mac frame by defeated demand, and is sent to receiving end, is utilizing twisted pair On the basis of transmitting HD video, audio-visual synchronization is realized using ready-made twisted pair and is transmitted.
Fig. 4 is referred to, is a kind of structural schematic diagram of audio and video transmission device provided in an embodiment of the present invention, such as Fig. 4 institute Show, which may include:
First determination unit 410, for the total length and default video transmission efficiency according to media access control mac frame Threshold value determines the minimum length of video field in mac frame, so that video transmission efficiency is more than or equal to the default transmission of video effect Rate threshold value;
Second determination unit 420, for determining mac frame according to the total length and preset audio sample rate threshold value of mac frame The minimum length of sound intermediate frequency field, so that the corresponding audio sample rate of mac frame is more than or equal to the preset audio sample rate threshold value;
Third determination unit 430, for long according to the length of custom field, the minimum of video field in the mac frame The minimum length of degree and audio field determines the maximum length of information field in mac frame, so that the length of the video field, The sum of the length of audio field and the length three of information field are less than or equal to the length of the custom field;Wherein, institute Stating custom field is in mac frame except frame gap, tetra- lead code, starting-frame delimiter SFD and cyclic redundancy check CRC words Field except section;
Transmission unit 440, for minimum length, the minimum length of audio field, information word according to the video field Audio, video data to be transmitted is filled into the custom field of mac frame by the maximum length and actual transmissions demand of section, and It is sent to receiving end.
Please refer to fig. 5, for the structural schematic diagram of another audio and video transmission device provided in an embodiment of the present invention, it should Embodiment is on the basis of aforementioned embodiment illustrated in fig. 4, and in audio and video transmission device shown in Fig. 5, the second determination unit 420 can be with Include:
First determine subelement 421, for when the minimum unit of audio transmission be single byte when, according to the overall length of mac frame Degree and maximum transmission bandwidth determine single byte transmission bandwidth when single frame transmission;
Second determines subelement 422, single byte when for according to the default sample rate threshold value and the single frame transmission Transmission bandwidth determines the minimum length of mac frame sound intermediate frequency field.
In an alternative embodiment, the information field includes video frame start mark SOF field, audio effective word joint number LOA field, video effective word joint number LOV field, audio index AINDEX field and video index VINDEX field;
Wherein, the SOF field for identification data packet whether be video frame starting packet;The LOA field is for marking Know the effective word joint number in audio field;The LOV field is used to identify the effective word joint number in video field;The AINDEX Field is for identifying audio sample rate index;The VINDEX field is for identifying video resolution index.
It referring to Figure 6 together, is the structural schematic diagram of another audio and video transmission device provided in an embodiment of the present invention, it should Embodiment is on the basis of aforementioned embodiment illustrated in fig. 4, and in audio and video transmission device shown in Fig. 6, transmission unit 440 be can wrap It includes:
Third determines subelement 441, for determining the reality of video field, audio field and information field in mac frame Length;
4th determines subelement 442, for video field in the size and mac frame according to frame video image to be transmitted Physical length determine that transmission one frame video image to be transmitted corresponds to the destination number of required mac frame;
Fill subelement 443, for according to actual audio sample rate by the corresponding audio number of the frame image to be transmitted According to being filled into the mac frame of the destination number, to guarantee that the corresponding audio data of the frame image to be transmitted equably divides Cloth is in the mac frame of the destination number.
In an alternative embodiment, the filling subelement 443 can be specifically used for respectively in the MAC of the destination number The audio data of M+1 byte is respectively filled in the top n mac frame of frame, and respectively fills M byte in remaining mac frame respectively Audio data;
Wherein, M and N is determined by following formula:
Wherein, N is the positive integer less than or equal to the destination number, BW0Single byte transmission bandwidth when for single frame transmission, NTFor the destination number, S is actual audio sample rate,To takeInteger part.
Fig. 7 is referred to, Fig. 7 is a kind of structural schematic diagram of R-T unit provided in an embodiment of the present invention, wherein the transmitting-receiving Device physical layer is consistent with Ethernet 1000BaseT standard, using " gigabit Ethernet PHY (i.e. the first ethernet PHY in Fig. 7 With the second ethernet PHY) ", " network transformer (i.e. in Fig. 7 with the first too net transformer and the second Ethernet transformer) ", " RJ45 (a kind of telecommunications outlet connector) ", " twisted pair " receive and dispatch audio-video, as shown in fig. 7, can also wrap in the R-T unit It includes " the first FPGA (Field-Programmable Gate Array, the field programmable gate array) " of transmitting terminal and receives " the 2nd FPGA " at end;Wherein:
In transmitting terminal, for the audio-video signal of audio-video source, the first FPGA is according to Fig.2, described in method flow The audio-video signal received is encapsulated into mac frame by mode, and after carrying out frame per second adaptation processing, passes through RGMII (Reduced Gigabit Media Independent Interface, simplifies Gigabit Media stand-alone interface) interface is sent to Ethernet PHY passes through ethernet PHY, Ethernet transformer, RJ45 and Double-strand transmission to receiving end.
In receiving end, mac frame is sent out after Ethernet transformer, ethernet PHY, by ethernet PHY by RGMII interface It send to the 2nd FPGA, the 2nd FPGA and is sent to obtained audio-video signal after the operations such as MAC layer unpacking, frame per second adaptation It is played on playing audio/video.
In one embodiment, Fig. 8 is referred to, is the structural schematic diagram of the first FPGA of one kind, as shown in figure 8, first FPGA may include that video acquisition blanking removal unit, the first DDR (Double Data Rate, Double Data Rate) video are slow Memory cell, the first frame per second adaptation unit, audio collection unit, the first RAM (deposit by Random-Access Memory, arbitrary access Reservoir) audio buffer unit, audio collection fine-adjusting unit, the customized transmission unit of MAC;Wherein:
Video acquisition removes blanker unit, removes for parsing BT1120 protocol package, and by blanking portion, by video uncorrected data It is stored in DDR video cache unit, to save Double-strand transmission bandwidth;
First DDR video cache unit is used for buffered video uncorrected data, and the first frame per second adaptation unit of cooperation realizes drop Frame per second adaptation;
First frame per second adaptation unit, for realizing drop frame per second adaptation together with the first DDR video cache unit;
Collected data for realizing audio data collecting, and are stored in the first audio ram caching by audio collection unit In unit;
First audio ram cache unit realizes audio sample rate fine tuning for combining audio sample rate fine-adjusting unit;
Audio sample rate fine-adjusting unit is finely tuned for audio sample rate, realizes the two sides MAC clock domain difference absorption;
The customized transmission unit of MAC, for being packaged audio, video data in the way of in the method flow shown in Fig. 2, so FPGA external ethernet PHY is sent to by RGMII interface afterwards.
In one embodiment, Fig. 9 is referred to, is the structural schematic diagram of the 2nd FPGA of one kind, as shown in figure 9, second FPGA may include that the customized unwrapper unit of MAC, the 2nd DDR video cache unit, the second frame per second adaptation unit, video blanking are extensive Multiple unit, the second audio ram cache unit, audio sample rate adaptation unit, audio protocols recovery unit, video frame rate concordance list Unit, audio sampling frequency index table unit;Wherein:
Video data is stored in the 2nd DDR view for unpacking to the mac frame received by the customized unwrapper unit of MAC Audio data is stored in the second audio ram cache unit by frequency cache unit;Video index number is parsed simultaneously, is used for video counts According to line index and video blanking line index, and audio index number is parsed, is indexed for audio sample rate;
2nd DDR video cache unit is used for buffered video uncorrected data, and the second frame per second adaptation unit of cooperation realizes frame Rate promotes adaptation;
Second frame per second adaptation unit, for realizing that frame per second promotes adaptation together with the 2nd DDR video cache unit;
Video blanking recovery unit, for going out video frame Elided data according to the blank lines Information recovering indexed, and will Valid data and Elided data are packaged into BT1120 protocol package and are sent to outside FPGA;
Video frame rate indexes table unit, is used for storage frame valid data row information and video blanking data row information, Two kinds of row informations can be indexed out by video index number;
Second audio ram cache unit, it is real in conjunction with audio sample rate adaptation unit for caching the audio data after unpacking Existing sample rate adaptation;
Audio sample rate adaptation unit, the audio sample rate for being obtained by index recover audio format;
Audio protocols recovery unit, for recovering I2S (integrated circuit built-in audio bus) audio protocols;
Audio sample rate indexes table unit, for storing audio sample rate index.
The function of each unit and the realization process of effect are specifically detailed in the above method and correspond to step in above-mentioned apparatus Realization process, details are not described herein.
For device embodiment, since it corresponds essentially to embodiment of the method, so related place is referring to method reality Apply the part explanation of example.The apparatus embodiments described above are merely exemplary, wherein described be used as separation unit The unit of explanation may or may not be physically separated, and component shown as a unit can be or can also be with It is not physical unit, it can it is in one place, or may be distributed over multiple network units.It can be according to actual The purpose for needing to select some or all of the modules therein to realize the present invention program.Those of ordinary skill in the art are not paying Out in the case where creative work, it can understand and implement.
As seen from the above-described embodiment, by determining MAC according to the total length and default video transmission efficiency threshold value of mac frame The minimum length of video field in frame, and mac frame middle pitch is determined according to the total length of mac frame and preset audio sample rate threshold value The minimum length of frequency field, in turn, according to the length of custom field, the minimum length and audio of video field in mac frame The minimum length of field determines the maximum length of information field in mac frame, thus according to the minimum length of the video field, audio Audio, video data to be transmitted is filled by the minimum length of field, the maximum length of information field and actual transmissions demand The custom field of mac frame, and be sent to receiving end, on the basis of using Double-strand transmission HD video, using ready-made Twisted pair realizes audio-visual synchronization transmission.
Those skilled in the art after considering the specification and implementing the invention disclosed here, will readily occur to of the invention its Its embodiment.This application is intended to cover any variations, uses, or adaptations of the invention, these modifications, purposes or Person's adaptive change follows general principle of the invention and including the undocumented common knowledge in the art of the present invention Or conventional techniques.The description and examples are only to be considered as illustrative, and true scope and spirit of the invention are by following Claim is pointed out.
It should be understood that the present invention is not limited to the precise structure already described above and shown in the accompanying drawings, and And various modifications and changes may be made without departing from the scope thereof.The scope of the present invention is limited only by the attached claims.

Claims (8)

1. a kind of audio/video transmission method characterized by comprising
Video field in mac frame is determined according to the total length of media access control mac frame and default video transmission efficiency threshold value Minimum length so that video transmission efficiency be more than or equal to the default video transmission efficiency threshold value;
The minimum length of mac frame sound intermediate frequency field is determined according to the total length of mac frame and preset audio sample rate threshold value, so that The corresponding audio sample rate of mac frame is more than or equal to the preset audio sample rate threshold value;
According to the minimum length of the length of custom field, the minimum length of video field and audio field in the mac frame The maximum length of information field in mac frame is determined, so that the length of the video field, the length of audio field and information word The sum of length three of section is less than or equal to the length of the custom field;Wherein, the custom field is that frame is removed in mac frame Field except tetra- gap, lead code, starting-frame delimiter SFD and cyclic redundancy check CRC fields;
Determine the physical length of video field, audio field and information field in mac frame;According to frame video image to be transmitted Size and mac frame in video field physical length determine transmission one frame video image to be transmitted correspond to required mac frame Destination number;The corresponding audio data of the one frame image to be transmitted is filled into the target according to actual audio sample rate In the mac frame of quantity, to guarantee that the corresponding audio data of the frame image to be transmitted is evenly distributed in the destination number Mac frame in, and be sent to receiving end.
2. the method according to claim 1, wherein described adopt according to the total length and preset audio of mac frame Sample rate threshold value determines the minimum length of mac frame sound intermediate frequency field, comprising:
When the minimum unit of audio transmission is single byte, single frames is determined according to the total length of mac frame and maximum transmission bandwidth Single byte transmission bandwidth when transmission;
Single byte transmission bandwidth when according to the default sample rate threshold value and the single frame transmission, determines mac frame sound intermediate frequency word The minimum length of section.
3. the method according to claim 1, wherein the information field includes video frame start mark SOF word Section, audio effective word joint number LOA field, video effective word joint number LOV field, audio index AINDEX field and video rope Quotation marks VINDEX field;
Wherein, the SOF field for identification data packet whether be video frame starting packet;The LOA field is for identifying sound Effective word joint number in frequency field;The LOV field is used to identify the effective word joint number in video field;The AINDEX field For identifying audio sample rate index;The VINDEX field is for identifying video resolution index.
4. the method according to claim 1, wherein described according to actual audio sample rate that one frame is to be passed The corresponding audio data of defeated image is filled into the mac frame of the destination number, comprising:
The audio data of M+1 byte is respectively filled in the top n mac frame of the mac frame of the destination number respectively, and is existed respectively The audio data of M byte is respectively filled in remaining mac frame;
Wherein, M and N is determined by following formula:
Wherein, N is the positive integer less than or equal to the destination number, BW0Single byte transmission bandwidth when for single frame transmission, NT For the destination number, S is actual audio sample rate,To takeInteger part.
5. a kind of audio and video transmission device characterized by comprising
First determination unit, for true according to the total length of media access control mac frame and default video transmission efficiency threshold value The minimum length of video field in mac frame is determined, so that video transmission efficiency is more than or equal to the default video transmission efficiency threshold value;
Second determination unit, for determining mac frame sound intermediate frequency word according to the total length and preset audio sample rate threshold value of mac frame The minimum length of section, so that the corresponding audio sample rate of mac frame is more than or equal to the preset audio sample rate threshold value;
Third determination unit, for according to the length of custom field, the minimum length of video field and sound in the mac frame The minimum length of frequency field determines the maximum length of information field in mac frame, so that length, the audio field of the video field Length and the sum of the length three of information field be less than or equal to the length of the custom field;Wherein, described customized Field be mac frame in addition to tetra- frame gap, lead code, starting-frame delimiter SFD and cyclic redundancy check CRC fields Field;
Transmission unit, comprising: third determines subelement, for determining video field, audio field and information field in mac frame Physical length;4th determines subelement, for video field in the size and mac frame according to frame video image to be transmitted Physical length determine that transmission one frame video image to be transmitted corresponds to the destination number of required mac frame;Subelement is filled, is used for The corresponding audio data of the one frame image to be transmitted is filled into the mac frame of the destination number according to actual audio sample rate In, to guarantee that the corresponding audio data of the frame image to be transmitted is evenly distributed in the mac frame of the destination number, and It is sent to receiving end.
6. device according to claim 5, which is characterized in that second determination unit includes:
First determine subelement, for when the minimum unit of audio transmission be single byte when, according to the total length of mac frame and most Large transmission bandwidth determines single byte transmission bandwidth when single frame transmission;
Second determines subelement, single byte transmission belt when for according to the default sample rate threshold value and the single frame transmission Width determines the minimum length of mac frame sound intermediate frequency field.
7. device according to claim 5, which is characterized in that the information field includes video frame start mark SOF word Section, audio effective word joint number LOA field, video effective word joint number LOV field, audio index AINDEX field and video rope Quotation marks VINDEX field;
Wherein, the SOF field for identification data packet whether be video frame starting packet;The LOA field is for identifying sound Effective word joint number in frequency field;The LOV field is used to identify the effective word joint number in video field;The AINDEX field For identifying audio sample rate index;The VINDEX field is for identifying video resolution index.
8. device according to claim 5, which is characterized in that
The filling subelement, specifically for respectively filling M+1 in the top n mac frame of the mac frame of the destination number respectively The audio data of byte, and the audio data of M byte is respectively filled in remaining mac frame respectively;
Wherein, M and N is determined by following formula:
Wherein, N is the positive integer less than or equal to the destination number, BW0Single byte transmission bandwidth when for single frame transmission, NTFor The destination number, S are actual audio sample rate,To takeInteger part.
CN201610300043.0A 2016-05-06 2016-05-06 A kind of audio/video transmission method and device Active CN105828014B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610300043.0A CN105828014B (en) 2016-05-06 2016-05-06 A kind of audio/video transmission method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610300043.0A CN105828014B (en) 2016-05-06 2016-05-06 A kind of audio/video transmission method and device

Publications (2)

Publication Number Publication Date
CN105828014A CN105828014A (en) 2016-08-03
CN105828014B true CN105828014B (en) 2019-03-08

Family

ID=56529091

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610300043.0A Active CN105828014B (en) 2016-05-06 2016-05-06 A kind of audio/video transmission method and device

Country Status (1)

Country Link
CN (1) CN105828014B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106878683A (en) * 2017-03-03 2017-06-20 天津天地伟业信息系统集成有限公司 A kind of picture stream file stores coding method
CN114040141A (en) * 2017-10-20 2022-02-11 杭州海康威视数字技术股份有限公司 Data transmission method, camera and electronic equipment
EP3813360A4 (en) 2018-07-25 2021-09-01 Hangzhou Hikvision Digital Technology Co., Ltd. Method and device for video signal identification, electronic device, and readable storage medium
CN114257338B (en) * 2021-11-26 2022-12-20 力同科技股份有限公司 Data processing method and device, communication system and communication device, equipment and medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101098213A (en) * 2007-06-18 2008-01-02 中兴通讯股份有限公司 Data transmission method and system
CN102685469A (en) * 2012-05-04 2012-09-19 北京航空航天大学 Audio-video transmission code stream framing method based on moving picture experts group-2 (MPEG-2) advanced audio coding (AAC) and H.264

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010045289A1 (en) * 2008-10-14 2010-04-22 Ripcode, Inc. System and method for progressive delivery of transcoded media content

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101098213A (en) * 2007-06-18 2008-01-02 中兴通讯股份有限公司 Data transmission method and system
CN102685469A (en) * 2012-05-04 2012-09-19 北京航空航天大学 Audio-video transmission code stream framing method based on moving picture experts group-2 (MPEG-2) advanced audio coding (AAC) and H.264

Also Published As

Publication number Publication date
CN105828014A (en) 2016-08-03

Similar Documents

Publication Publication Date Title
CN105828014B (en) A kind of audio/video transmission method and device
CN104519325B (en) A kind of adaptive support method of wireless video monitoring system based on 4G network
CN101488967B (en) Video transmission method, embedded monitoring terminal and monitoring platform server
CN103929681B (en) Method for improving RTP video streaming treatment efficiency in low-speed network
CN103607665A (en) Multilink wireless real-time video transmission method and system
CN103795593B (en) A kind of method of testing of airship high-speed communication processor up-link
CN103532923B (en) A kind of real-time media stream transmission method and system
CN103414956A (en) Real-time data transmission method and system based on transmission control protocol
CN103401741B (en) Integrated circuit and data processing method
US20120151537A1 (en) Method and system for asynchronous and isochronous data transmission in a high speed video network
CN108494698A (en) A kind of jamming control method based on transmission rate
CN103096183A (en) Efficient streaming media transmission method
CN103167322A (en) Ethernet-based image transmitting/receiving system
CN101527724B (en) Data transport container for transferring different data in internet protocol network
KR100728038B1 (en) Method and apparatus for transmitting data on plc network by aggregating data
CN101355821B (en) Method and apparatus for transmitting 10G bit optical fiber channel service in optical transmission network
US8780940B2 (en) Method and apparatus for compressing frame
CN101521813A (en) Method and device for processing media stream
CN104216958A (en) Transmission method and device based on structured data
CN105959626B (en) A kind of monitoring display screen configuration information transmission method and device
KR101603674B1 (en) Method and Apparatus for Urgent Data Transmission
US9160604B2 (en) Systems and methods to explicitly realign packets
CN101977186B (en) Device for realizing synchronous transport module level-1 (STM-1) multipath Ethernet over E1 conversion
EP1798917A1 (en) Method of passing a constant bit rate digital signal through an ethernet interface and system for carrying out the method
WO2023149545A1 (en) Communication device and communication 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
GR01 Patent grant
GR01 Patent grant