=±MÃD=

Multicast & RTP §Y®É¼v­µ¶Ç¿é

 

¥Ø¿ý:

-«e¨¥

-Framework

-Microsoft Direct Show 

-Filter»PFilter Graph

-¨Ï¥ÎDirectShow

-DS¾ãÅé¬[ºc

-DSªº¼u©Ê

-COM (Component Object Model)

-Multicast

-RTP/RTCP

-¦h´CÅéÀɮ׮榡

-¨t²Îªì¨B¬[ºc

-¨t²Î³Ì«á¬[ºc

-¨t²Î¬[ºc¹Ï-- DirectShow Filter

-¶Ç°eºÝScreen Shot

-±µ¦¬ºÝScreen Shot

-«á°O

-°Ñ¦Ò¸ê®Æ

-§ë¼v¤ù©Mµ{¦¡½X¤U¸ü

 

 

¡» «e¨¥

        ¦¹±MÃDªº¥Øªº¬O±N»·ºÝCCD»PMIC¨ú±oªº¼v¹³»PÁn­µ,À£ÁY¦¨MPEG4 (Divx)®æ¦¡¡A¥HRTP³z¹LMulticastªº¤è¦¡¡A§Y®É¶Çµ¹¦h¥x¹q¸£,¹ê§@¥­¥x³£¬OWIN32 PC,³Ì²×¥Ø¼Ð¬OÅý±µ¦¬ºÝ¤£­­©óWIN32 PC,¤ñ¦p¬OWinCE PDA¡BLinux PDAµ¥µ¥,¥Ø«eªº¥­¥xµÛ­«©óWIN32 PC¡C

 

      ¾ã­Ó±MÃDªº¦¨­ûÁ`¦@¦³¤­¤H,¤u§@¤À¦¨¤T¤j³¡¤À,¤À§O¬ORTP¤p²Õ¡B¦h´CÅéÀɮ׮榡¤p²Õ¡BMicrosoft DirectShow¤p²Õ,¦Ó§Ú­Ì¤p²Õ¥D­n­t³dªº³¡¤À¬OMicrosoft DirectShow³¡¤À,Áö»¡¤u§@¬O¦p¦¹¤Àªº,¦b³\¦h¤è­±¤´¶·¥h¬ã¨s¨Ã¤F¸Ñ,§_«h¹ê§@¥Xªºµ{¦¡¼Ò²Õ¬OµLªkµ²¦Xªº¡C

 

 

 

 

 

 

 

 

¡» Framework

 

 

 

¡» Microsoft Direct Show

   ¼·©ñºÝ»P¶Ç°eºÝ¼v­µÂ^¨ú§Þ³N¥D­n¬O±ÄMicrosoft Direct Show¹F¦¨, Microsoft Direct Show¥]§t¦bMicrosoft DirectX¤§¤¤,­n¶}µoµ{¦¡¤§«e­º¥ý­n¥h·L³n©x¤èºô¯¸¤U¸üDirectX SDK (¥Ø«e¬O±Ä8.0a),¾ã­ÓSDK¤¤¥]§t³\¦h»¡©ú¤å¥ó»Pµ{¦¡½d¨Ò,¤j³¡¤Àªº§Þ³N¤ä´©³£¬O±q¦¹¨ú±oªº¡C

      Direct Show(«á²ºÙDS)¾ã­Ó¬O¥HMicrosoft COM­ì¥ó§¹¦¨,DS¥i¥H»¡¬O¼Æ­ÓCOM­ì¥ó²Õ¦¨,¨Ï¥ÎDS´N¬O©óµ{¦¡¤¤²£¥Í©Ò»ÝªºCOM­ì¥ó,¨Ã¹ï¤¸¥ó©I¥s©Ò»Ýªº¶}©ñ¤¶­±,¥H¤U¶}©l¤¶²ÐDSªº²Ó¸`³¡¤À¡C

 

 

 

 

¡» Filter»PFilter Graph

Preview

¦bDS¤¤³Ì°ò¦ªº³æ¦ìºÙ¬°Filter,¨C¤@­ÓFilter¥Nªí¹ï¦h´CÅé¸ê®Æ¶i¦æ¤@­Ó³B²z¨BÆJ,¦bDS¤¤¦³¤TºØ«¬ºAªºFilter,¤À§O¬°Source Filter¡BTransform Filter¡BRender Filter¡C

 

 

Filters

 

Source Filter¥D­nªº¤u§@¬OŪ¨úRaw Data ; Transform Filter¥D­n¤u§@¬O¨ú±oSource FilterªºRaw Data¨Ã¥[¤u³B²z(³q±`§êºtDecoder¨¤¦â),Render Filter¥D­n¤u§@¬O¨ú±oTransform Filter³B²zªºRaw Data¨Ã¿é¥X¨ì¾A·íªº¸Ë¸m(¤ñ¦p¼g¤JÀɮסB¿é¥X¼v­µ³]³Æµ¥µ¥),¨äÃö«Y¹Ï¦p¤U¹Ï©Ò¥Ü:

 

 

 

 

 

 


Filter Graph & Filter Graph Manager

   ¥Ñ¦¹¤TºØFilter¶¡²Õ¦¨ªº¹ÏºÙ¬°Filter Graph,´N¦p¤W¬yµ{¹Ï¤@¼Ë,¦Ó¦bDS¤¤¥D­n´xºÞ±±¨îFilter GraphªºCOM Component¬°Filter Graph Manager¡C

 

 

Filter component

 

   ¦U­ÓFilter¦bDS¤¤¬O¥HCOM¹ê§@,¦]¦¹§Ú­Ì¨Ï¥ÎDS´N¬Û·í©ó¦bµ{¦¡²£¥Í²Å¦X»Ý­nªºFilter Component,¨ä«á±NFilter²Õ¦¨¤@­ÓFilter Graph,³Ì«á±±¨îMedia Streamªº¬y¦V´Nºâ¤j¤½§i¦¨,¤ñ¤è¦p¤Uªº½d¨Ò(¼·©ñAVIªºFilter Graph):

 

 

 

 

 

 

 

 


Summary

³z¹LFilter Graph§Ú­Ì¥i¥H²M·¡¤F¸Ñ¨ì¦h´CÅé¸ê®Æ¬O¦p¦ó³Q³B²zªº¡C­Filterªº¬[ºcÅýÀ³¥Îµ{¦¡¹ï¦h´CÅé³B²z¯à¤O«Ü¦³¼u©Ê,µ{¦¡³]­p®v¹³¬O¦b«÷¸ËGraph,«÷¥X¤@­Ó²Å¦X§Ú­Ì¦h´CÅé»Ý¨DªºFilter Graph¡C

 

 

 

 

 

¡» ¨Ï¥ÎDirectShow

¨Ï¥ÎDSªº¨BÆJ¦b¦¹§ó¸Ô²Óªº»¡©ú¤@¹M:

STEP1

¥Ñ©ó§Ú­Ì·|¨Ï¥Î¨ìCOM,¦]¦¹¤@¶}©l§Ú­Ì¥²¶·¥ý©I¥sWindowsªì©l¤ÆCOM LibraryªºAPI,µM«á²£¥Í¤@­ÓFilter Graph Manager Component¡C

STEP2

¦A¨Ó§Ú­Ì´N­n²£¥Í§¹¾ãFilter Graph,¦Ó²£¥Íªº¤èªk¤À¬°¨âºØ,¤@ºØ¬O¦Û°Ê²£¥Í²Å¦X¦h´CÅ骺Filter Graph(¥ÑFilter Graph Manager¨Ó°µ³o¶µ¤u§@),¥t¤@ºØ¬O§Ú­Ì¤â°Ê²£¥Í­Ó­Ó»Ý­nªºFilter Component¨Ã±N¹Ïµ¹«Ø¥ß°_¨Óµ¹Filter Graph ManagerºÞ²z¡C

STEP3

³Ì«áªº¨BÆJ´N¬O±±¨îMedia Streamªº°Ê§@,¦¹®É»Ý­n¤@­ÓMedia Control Component¨Ó§@ºÞ²z,¨ä¤¤±±¨î¤FMedia StreamªºStop¡BPause¡BStart°Ê§@¡CÁÙ¦³Media Stream¥i¯à·|²£¥Í¨Ç¨Æ¥ó(¦p¼·©ñ§¹²¦),³o®É§Ú­Ì¥i¥H²£¥Í¤@­ÓMedia Event Component¨Ó§@ºÞ²z¨Æ¥óªº°Ê§@¡C

 

 

 

 

¡» DS¾ãÅé¬[ºc

   ¤U¹Ï¬O¨Ó¦ÛDS SDK Document,¦b¦¹§Ú­Ì¥i¥H§ó¤F¸ÑDSªº¤º³¡¬[ºc¡Cµê½u¤è¶ô³¡¤À´N¬O§Ú­Ìµ{¦¡©Ò¯à±±¨îªº³¡¤À,¤]¬O¤W¤W´X½g¤¶²Ðªº³¡¤À¡C

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


¡» DSªº¼u©Ê

        DS¥»¨­ªþ¤W³\¦hFilter,¦ý¤]¦³¥i¯à·|µo¥Í§ä¤£¨ì¦X¾AªºFilter¨Ó§¹¦¨§Ú­Ìªº±M®×,­n¬Oµo¥Í³oºØ±¡ªp§Ú­Ì´N±o¥h¼g¥X¤@­ÓFilter¥X¨Ó,¦Ó¼g¥X¤@­ÓFilter©Ò¯A¤Îªº­I´ºª¾ÃÑÆZ¦hªº,¦b¦¹¦¸±MÃD´N¸I¨ì³o­ÓÀYµhªº°ÝÃD¡C°ò¥»¤WDS¥»¨­¤w¸gªþ¤W¤@¨ÇBase Class,Ä~©Ó³o¨ÇBase Class¨ÃOver Ride¤@¨Ç¤èªk´N·|¨Ïªº³o­Ó¶}µo¹Lµ{®e©ö¨Ç¡C

 

 

 

 

 

¡» COM(Component Object Model)

        ¨Ï¥ÎDS¥u»Ýª¾¦p¦ó¨Ï¥ÎCOM(Filter¥þ¬°COM­ì¥ó),¦ý¦pªG»Ý­n¶}µoFilter´N¥²¶·¥h¤F¸ÑCOM,¨Ãª¾¹D¦p¦ó¹ê§@COM­ì¥ó,§_«h´N¤£¯àÄ~Äò¤U¥h,¦b¦¹Â²²¤»¡©ú¤@¤UMicrosoft COM¡C

COM

        COM¨Ã¤£¬O¤@ºØµ{¦¡»y¨¥,¤]¤£¬O¯S©wªº¨ç¦¡®w,COM¬O¤@ºØ³W®æ©w¸q,COM³W©w¤F»s§@¨ã¦³°ÊºA´À´«¯à¤O¤¸¥óªº¤èªk,¤]©w¸q¤F¥Î¤áºÝµ{¦¡»P¤¸¥ó¤§¶¡¦@¦P¦X§@ªº¼Ð·Ç¡C¨Ï¥ÎCOMÅýµ{¦¡Åܦ¨¬O¹³¥Ñ­ì¥ó²Õ¦¨,µ{¦¡³]­p®v³]­p¥i¥H­«½Æªº¨Ï¥Î­ì¥ó,¤é«á­n¬O³nÅé§ó·s¥u­n±N¶·¨O´«ªº­ì¥ó§ó·s,¤£¥Î¤j´T­×§ïµ{¦¡,Åý¤é«á³nÅéºûÅ@ªº¤u§@§ó®e©ö,´î¤Ö³nÅ馨¥»¡C

´N¦p¤U¹Ï©Ò¥Ü:

Application

 
 

 

 

 

 

 

 


        ­ì¥»³æ¤@¿W¥ßªºµ{¦¡Åܦ¨¥Ñ³\¦h­ì¥ó²Õ¦¨,¦Ó­ì¥ó¤]¯à¦b°õ¦æ¶¥¬q°ÊºA§ó´«,©Î³\¦³¨Ç¤H·|·Q³o¤£´N¬O§âµ{¦¡¤À¦¨´X­Ó¼Ò²Õ,¦ý¬O¦bCOM¤¤A¡BB¡BC¡BD¡BE¬O¤@­Ó¥i°õ¦æ¤G¶i½X(§¹¾ãªºµ{¦¡,³q±`¬ODLL),¦Ó¤£¬Ostructure paradigmªºµ{¦¡¼g§@­·®æ,¦Ó¦U¤¸¥ó³£¬O³z¹L¤¶­±¨Ó·¾³q,µ{¦¡¥i¥H¦b°õ¦æ¶¥¬q§ó´«­ì¥ó¡C

 

COM Component

 

        COM Component¬OWin32°ÊºA³sµ²µ{¦¡®w©Î¥i°õ¦æÀɦs¦bªº¥i°õ¦æµ{¦¡½X,¥HCOM³W®æ¼Ð·Ç©Ò¼g¥X¨Óªº¤¸¥ó,§Ú­Ì´NºÙ¬°COM Component¡C

 

Summary

 

     ¦bDS¤¤©Ò¦³ªºFilter³£¬O¥HCOM¦s¦b,¦b¦¹§Ú­Ì¤w¸g¥i¥H¬Ý¨ìCOMªº¤@¨Ç¦n³B,´N¬O±e¦³°ª«×ªº¼u©Ê¡C·L³nªº³\¦h§Þ³N³£¬O¥HCOM§¹¦¨,¦pOLE¡BActiveX³£¬O«Øºc¦bCOM¤W­±,COMªº¥Øªº¬O¹F¦¨³nÅéIC²z·Q¡C

 

 

 

 

 

¡» Multicast

Preview

     ¦bºô¸ô¤¤ªº¶Ç°e¼Ò¦¡¥i¥H¤À¬°¤TºØ,Unicast¡BBroadcast¡BMulticast ,UnicastÄÝ©ó¤@¹ï¤@ªº¶Ç°e¤è¦¡ ,Broadcast¬O¹ï¾ãÅéºô¸ô°µ¶Ç°e,Multicast¬O¹ï¾ãÅéºô¸ôªº¯S©w´X¥x(Multicast Group)°µ¶Ç°e,Multicastªº¹ê§@¤]¥i¥H¾aUnicast©ÎBroadcast¹ê§@¥X¨Ó,¦ý¬O³oºØ¼ÒÀÀ¤è¦¡·|«D±`®ö¶Oºô¸ô¸ê·½¡C

Multicast±`À³¥Î©ó¦h´CÅé¤è­±(¦pVOD),¦Ó¦¹¦¸ªº¦h´CÅé¶Ç°e¬O¥HMulticast¨Ó¶Ç°e,Åý¥[¤J¦PMulticast Groupªº¹q¸£¥i¥H±µ¦¬»·ºÝ¦h´CÅé¡C

 

Mbone(Multicast Backbone)

     ­Y­n¦Uºô°ì¯à¦¬°e¥þ²y©Êªºmulticast«Ê¥]¡A´N»Ý­n¨ärouter©Î¨ä¥¦µwÅé¤]­n¯à¤ä´©multicast«Ê¥]ªºÂà°e°Ê§@¡A¦ý­Y¨äºô°ì¥u¤ä´©unicast¤è¦¡ªº¶Ç°e¡A³o®É­Ô­Y¨Ï¥Î¦h§}¶Ç¿é°©·Fºô¸ô(Multicast Backbone, MBone)¡A«h§Ú­Ì¥i¥HÂǦ¹¹F¨ìºô¸ô¦h§}¶Ç¿éªº¥Øªº¡C²{¦b¥@¬É¤W¤w¸g³\³\¦h¦hªºMBoneºô¸ô¡C¦]¦¹Mbone¤Þ¤J¤F³q¹D(Tunnel)ªº·§©À¡C¨Æ¹ê¤W¡AMbone¬O¤@­ÓµêÀÀªººô¸ô°©·F¡AMboneÂǥѳq¹D±N¤@­Ó­Óªº¦h§}¶Ç¿éªººô¸ô(Multicast Island)³s°_¨Ó

 

 

Multicast Group Address

   Multicast Group Address©w¦bClass D IP,¦p¤U¹Ï:

 

 


   Ipv6ªº®æ¦¡,¦p¤U¹Ï:

 

 

 

 

 

 

 

 

¡» RTP/RTCP

Preview

RTP°w¹ï»Ý­n¶Ç°e§Y®É¸ê®Æªºapplication¡A¹³¬O¼v¹³¡AÁn­µ¡A¼ÒÀÀ¸ê®Æ¡Kµ¥¡A´£¨Ñ¤F¦bmulticast©Îunicast¤W¡AÂI¹ïÂIªº¶Ç¿é¥\¯à¡C

RTP¨S¦³«O¯d¸ê·½ªº¯à¤O¡A¥ç¤£«OÃÒ§Y®ÉªA°ÈªºOoS¡C¦ýRTP¥i»P¥t¤@±±¨î¨ó©w(§YRTCP)µ²¦X¡A¨ÓºÊ´ú¸ê®Æ¶Ç¿éªºª¬ªp¡A¥H¤Î¼W¥[¤@¨Ç±±¨î»PÃѧOªº¥\¯à¡C

Application¤@¯ë³£¦bUDP¤§¤W¶]RTP¡A³o¨âªÌ³£´£¨Ñ¤F³¡¤Àªº¶Ç¿é¥\¯à¡QµM¦Ó¡ARTP¤]¥i¥H»P¨ä¥L¾A¦Xªº¤U¼hprotocol¤@°_¹B§@¡C

¦b¶Ç²Îªºprotocol¤¤¡A­Y­n¼W¥[·sªº¥\¯à¡A¥u¦³±Nprotocol§ï±o§ó¤@¯ë¤Æ¡A©Î¬O¥[¤J¤@­Ó»Ý­n¤ÀªRªº¿ï¶µ¾÷¨î¡C¤£¦P©ó¦¹ªº¬O¡ARTP¥u­n­×§ï©ÎªÌ¼W¥[header´N¥i¥H¹F¨ì¥Øªº¡C

²{¤µªºInternetÀô¹Ò¡A¨ÃµLªk§¹¥þº¡¨¬§Y®ÉªA°Èªº­n¨D¡C¨Ï¥ÎRTPªº¼eÀWªA°È¡A¹³¬O¼v¹³¡A¥i¯à·|¼vÅT¨ä¥¦ºô¸ôªA°ÈªºQoS¡C¦]¦¹¡Aµ{¦¡³]­pªÌ¥²¶·±Ä¨ú¤@¨Ç±¹¬I¡A­­¨î¦¸­nªºªA°È§Q¥ÎÀW¼e¡C

¸s¼½Án­µ·|ij

¤@®a¤½¥qªº¦¨­û­Ì·QÂÇ¥Ñmulticast¶Ç¹FÁn­µªº¤è¦¡¡A¶i¦æ¤@³õ½u¤W·|ij¡C·|ijªº¥D®u³z¹L¬YºØ°t¸mªº¾÷¨î¡AÀò±o¤F¤@­Ómulticast address¡A¥H¤Î¤@¹ïport¡A¨ä¤¤¤@­Óport¬O¬°¤FRTP(¶Ç°eÁn­µ)¡A¥t¤@­Ó«h¬O¬°¤FRTCP(¶Ç°e±±¨îpacket)¡C³o¨Ç¦ì¸m»Pportªº¸ê°T·|¤À¥¬µ¹©Ò¦³·Q¥[¤J·|ijªº¤½¥q¦¨­û¡C

¨Ï¥ÎÁn­µ·|ijµ{¦¡ªº¤½¥q¦¨­û¡A¥i°e¥X¤@¤p¶ôªºÁn­µ¸ê®Æ¡A¨C¤@¤p¶ô¸ê®Æ«e·|³Q¥[¤WRTPªºheader¡CRTP header·|«ü¥X¨C¤@­Ópacket©Ò¥]§tªº¸ê®Æ¬O¥Î¤°»òÀ£ÁY¤è¦¡¡A¹³¬OPCM, ADPCM, LPC¡Kµ¥¡C¦b·|ijªº¹Lµ{¤§¤¤¡A¶Ç°eÁn­µ¸ê®Æªº¤½¥q¦¨­û¡A¥i¥H§ïÅÜÁn­µªºÀ£ÁY¤è¦¡¡A¥H°t¦X¸g¥Ñ¯¶ÀW³s±µ¨ìInternetªºªº·s¥[¤JªÌ¡A©Î¬O¹ïºô¸ô¾Ã¶ë°µ¥X¤ÏÀ³¡C

¦p¦P¨ä¥¦packetºô¸ô¤@¯ë¡AInternet°¸¦Ó¤]·|¿ò¥¢packet¡A©Î¬O±Npacketªº¶¶§Ç¥Î¶Ã¡C¬°¤F³B²z³o¨Ç·l®`¡ARTP header·|¥]§t®É¶¡ªº¸ê°T¡A¥H¤Î¤@­Ósequence number¡C¦p¦¹¤@¨Ó¡A©Ò¦³¥[¤J·|ijªº¦¨­û´N¥i¥H¨Ì¦¹¨Ó­«²Õ¦¬¨ìªºpacket¡A¬Æ¦Ü¦ô­p¦³¦h¤Öpacket¿ò¥¢¡C

¦]¬°¦b·|ijªº¹Lµ{¤§¤¤¡A¤½¥q¦¨­û­Ì¥i¯à·|¥[¤J©ÎÂ÷¶}·|ij¡A©Ò¥Hª¾¹D¬Y¤H¦b¦ó®É¥[¤J¡AÁÙ¦³¥L±µ¦¬¸ê®Æªºª¬ªp¡A·|¬O«Ü¦³¥Îªº¡C¬°¤F¹F¨ì³o­Ó¥Øªº¡A¨C¤@­Ó·|ij¤Wªºapplication¡A³£·|¦bRTCPªºport¤W¡A©w´Á¸s¼½¥]§t¨Ï¥ÎªÌ¦WºÙªºreception report¡CReception report·|«ü¥X¶Ç°eÁn­µ¸ê®Æªº¦¨­û¡A³Q±µ¦¬ªºµ{«×¦p¦ó¡A¤]¥i¥H¥Î¨Ó±±¨î¾A¦XªºÁn­µÀ£ÁY¤è¦¡¡C·íµM¡A°£¤F¨Ï¥ÎªÌ¦WºÙ¡A¨ä¥¦¿ëÃѸê°T¥iµø±±¨îÀW¼eªº­­¨î¡A³Q¥[¤Jreception report¡C·í¬Y¤H·QÂ÷¶}¦¹¤@·|ij¡Aapplication±N°e¥XRTP BYE packet¡C

Án­µ»P¼v¹³·|ij

¦pªGÁn­µ»P¼v¹³³£³Q¨Ï¥Î¦b·|ij¤¤¡Aapplication±N¨Ï¥Î¨â­ÓUDP port pair¡A¥H¤Î(©ÎµÛ)¨â­Ómulticast address¡A¤À§O¨Ó¶Ç°eÁn­µ»P¼v¹³ªºRTP©MRTCP¡CµM¦ÓRTP¨Ã¨S¦³¤èªkª½±µ±NÁn­µ»P¼v¹³ªºsession°µµ²¦X¡A°£«Dparticipant¦bÁn­µ»P¼v¹³ªºRTCP packet¤¤¡A³£¨Ï¥Î¬Û¦PªºCNAME¡C

±NÁn­µ»P¼v¹³¥H¤£¦Pªºsession¨Ó¶Ç°e¡A¨ä¤¤¤@­Ó­ì¦]¬O¡A¤¹³\¥[¤J·|ijªº¤H¡A¥u¿ï¾Ü±µ¦¬¨ä¤¤¤@ºØ´CÅé¡C

ÁöµMÁn­µ»P¼v¹³ªºsession¬O¤À¶}ªº¡A¦ý¬O¦P¨B¤Æ¤´µM¥i¥HÂǵÛRTCP packet¤¤ªº®É¶¡¸ê°T¨Ó¹F¨ì¡C

Mixer

¦b¤§«eªº¨â­Ó±¡ªp¤¤¡A§Ú­Ì°²³]©Ò¦³ªºparticipant³£¯à±µ¦¬¬Û¦Pformatªº´CÅé¸ê®Æ¡CµM¦Ó¡A³o«o¤£¬O§¹¥þ¥¿½Tªº¡C

·Q¹³¬Y¤@°Ï°ìªº¤H¬O³z¹L§C³t½u¸ô³s±µ¨ìInternet¡A¦Ó¨ä¥¦°Ï°ìªº¤H«h¬O³z¹L°ª³t½u¸ô³s±µ¨ìInternet¡C»P¨ä±j­¢©Ò¦³¤H³£¨Ï¥Î¸û¤ÖªºÀW¼e¡ARTP¹ç¥i¦b¾aªñ²Ä³tºô¸ô¤§³B¡A©ñ¸m¤@­Ó¦W¬°mixerªº¾÷¨î¡C

Mixer·|¥ý±N¦¬¨ìªºpacket§@¦P¨B¤Æ¥H­«²Õpacket¡AµM«á±N³o¨Ç­«²Õ¹Lªºpacket²V©M¨ì³æ¤@ªº¸ê®Æ¬y¡A³Ì«á¦A±NÀ£ÁY¤è¦¡§ï¬°¾A¦X§C³tºô¸ôªºformat¡A¨Ã³z¹L§C³t½u¸ô±N·sformatªºpacket¶Ç°eµ¹§C³tºô¸ô¤¤ªºparticipant¡C

¦bRTPªºheader¤¤¡A·|¦³¤@ºØ¤èªk¥i¥HÅýmixer¿ëÃѨC¤@­Ó²V©M¹Lªºpacketªº¶Ç°eªÌ¡A¦p¦¹¤@¨Ó¡Areceiver´N¥i¥Hª¾¹Dpacket¬O¥Ñ½Öµo¥X¨Óªº¡C

 

Translators

¦pªG¦³¨Çparticipant¬O³z¹L°ª³t½u¸ô³s±µ¨ìInternet¡A¥i¬O¤£¤ä´©IP Multicast¡A¹³¬O³QFirewall»PInternet¹jµ´¡A¦]¬°Firewall¥~ªºpacket³£µLªk¶i¤JFirewall¤º³¡¡C¦b³oºØ±¡ªp¤U¡ARTP±N¨Ï¥Î¤@­Ó¦W¬°Translatorªº¾÷¨î¡C

Translatorªº¾÷¨î¬O¦w¸m¨â­ÓTranslator¡A¤@­Ó¦bFirewall¥~³¡¡A¤@­Ó¦bFirewall¤º³¡¡C¥~³¡ªºTranslator¶Ç°emulticast packet¡A¤º³¡ªºTranslator«h³z¹L¦w¥þªººÞ¹D¦¬¨ì³o¨Çmulticast¡A¤§«á¤º³¡ªºTranslator¦A±N³o¨Çmulticast packetÂà°eµ¹Firewall¤ºªºparticipant¡C

¨ä¥¦¥Î³~

¦b¤@­Ó¼v¹³·|ij¤¤¡Amixer¥i¥H§â¨C­Ó¤Hªº¼v¹³¤À¦¨­Y¤zµ¥¥÷¡AµM«á±N¥¦­Ì¦X¦¨©ñ¨ì³æ¤@­Ó¸ê®Æ¬y¡A¨Ó¼ÒÀÀ¸sÅ骺´º¶H¡C

¦pªG¦b¤@­Ó»·¶Z·|ij¤¤¡A¦³¨â¸s¤H¤À§O¨Ï¥Î¤£¦Pªº©³¼hprotocol¡A¨Ò¦p¤@¸s¤H¨Ï¥ÎIP/UDP¡A¥t¤@¸s¤H¨Ï¥ÎST-II¡C©Î¬O¼v¹³ªºÀ£ÁY¤è¦¡¬O¤@­Ópacket±µµÛ¤@­Ópacket¡A¦Ó¤£»Ý­«²Õ©Î²V©M¡C¦¹®É¡ATranslator¤]¥i¬£¤W¥Î³õ¡C   

RTP±M¦³¦Wµü»¡©ú

RTP packet: ¤@­Ó¶}ÀY¦³RTP headerªºpacket¡A§Y¬°RTP packet¡C³q±`¦b©³¼hprotocol¤¤¡A¤@­Ópacket¥u¥]§t¤@­ÓRTP packet¡A¦ý³z¹L¤@¨Ç¯S§Oªºencapsulation¤èªk¡A©³¼hpacket¤]¥i¥H¥]§t¤@­Ó¥H¤WªºRTP packet¡C

 

RTP payload: ¦bRTP packet¤¤¡A¯u¥¿­n¶Ç°eªº¸ê®Æ¡A§Y¬°RTP payload¡C¨Ò¦p¦b¼v¹³·|ij¤¤¡A¼v¹³¸ê®Æ´N¬ORTP payload¡C

RTCP packet: ¤@­Ó¶}ÀY¬ORTCP header¡A«á­±±µµÛ±±¨î¸ê®Æªºpacket¡A§Y¬°RTCP packet¡C³q±`³\¦hRTCP packet·|³Qµ²¦X¡A¦A¥[¤W©³¼hªºheader¡A¦Óµ²¦X«áªºRTCP packetªø«×·|³Q¬ö¿ý¦bRTCP header¤¤ªºlengthÄæ¦ì¡C

Port: ·íRTP·Q¶Ç°eRTP packet»PRTCP packet¨ì¦P¤@­ÓIP Address®É¡Aport´N¥i¥H¥Î¨Ó°Ï¤À¥Øªº¦aªº¤£¦P¡C

Transport address: ¤@¯ë³£¬OIP Address¥[¤WUDP port¡Cpacket³£¬O±q¤@­Ósource transport address¶Ç¨ì¤@­Ódestination transport address¡C

 

RTP        session: ¹ï©ó¨C¤@­ÓRTP¨Ï¥ÎªÌ¦Ó¨¥¡ARTP session¬O¥Ñ¤@¹ïdestination transport address©w¸q¦Ó¦¨(¤@­Ó¬°¤FRTP¡A¥t¤@­Ó¬°¤FRTCP)¡C­nª`·Nªº¬O¡A¤@­Ó¦h´CÅé·|ij¤¤¡A¤£¦Pªº´CÅé¸ê®Æ³Ì¦n¦b¤£¦PªºRTP session¤¤¶Ç°e¡C

Synchronization source (SSRC): SSRC¬O¤@­ÓÀH¾÷¿ï¨úªºÃѧO­È¡A¥Î·N¬O¨Ï¤@­ÓRTP session¤¤ªºparticipant³£¦³¿W¤@µL¤GªºÃѧO¸ê°T¡C¦ý¬O¦P¤@­Ó¨Ï¥ÎªÌ¦b¤£¦PªºRTP session¤¤¡A¨Ã¤£¤@©w­n¥Î¦P¤@­ÓSSRC¡C

Contributing source (CSRC): ¤§«e´£¹Lmixer¥i¥H±N¤£¦P¨Ó·½ªºRTP packet²V©M©ñ¨ì¦P¤@­ÓRTP packet¤¤¡C¦¹®É¡ARTP¤]·|¦bRTP header¤¤¬ö¿ý»P³o­Ópacket¦³ÃöªºSSRC¡A¦Ó³o¨ÇSSRC¦X°_¨Ó´N¥s°µCSRC¡C

End system: ¦pªG¤@­Óapplication¥i¥H²£¥Í¤º®e³Q¥]¦bRTP packet¤¤³Q¶Ç°e¡A©Î¬O¥i¥HŪ¨úRTP packet¤¤ªº¤º®e¡A´N¥i¥H³QºÙ¬°End system¡C

Monitor: ¦pªG¤@­Óapplication¥i¥H±µ¦¬¦b¤@­ÓRTP session¤¤©Ò¦³participant°e¨ÓªºRTCP packet¡A´N¥i¥H³QºÙ¬°Monitor¡CMonitor¥i¥H³Q¤º«Ø¦bEnd system¤¤¡Q¤]¥i¥H¤£ª½±µ°Ñ»PRTP session¡A³oºØMonitor³QºÙ¬°Third Party Monitor¡C

RTP header¤¤ªº©T©wÄæ¦ì

0

1

2

3

0

1

2

3

4

5

6

7

8

9

0

1

2

3

4

5

6

7

8

9

0

1

2

3

4

5

6

7

8

9

0

1

 

V=2

P

X

CC

M

PT

Sequence number

Timestamp

Synchronization source (SSRC) identifier

Contributing source (CSRC) identifier

¡K¡K

 

RTP headerÄæ¦ì»¡©ú

Version (V): »¡©úRTPªºª©¥»¡C

Padding (P): ¦pªG³o­ÓÄæ¦ì³Q³]©w¡ARTP packet§ÀºÝ±N·|¥]§t¤@­Ó¥H¤Wªºpadding octets¡A¦ý¥¦­Ì¨Ã¤£¬ORTP payloadªº¤@³¡¥÷¡A¦Ó¦bpaddingªº³Ì«á¤@­Óoctet·|°O¿ý¦b³o­ÓRTP packet¤¤¦³¦h¤Ö­Óoctet¡C¦b¬Y¨ÇÀ£ÁYºtºâªk¡A©Î¬O©³¼hªº³q°T¨ó©w¡Apadding¦³¥i¯à·|³Q¥Î¨ì¡C

Extension (X): ¦pªG³o­ÓÄæ¦ì³Q³]©w¡A¦b©T©wªºRTP header«áÁÙ­n¥[¤W¤@­Ó header extension¡C

CSRC count (CC): ¬ö¿ýCSRCªº­Ó¼Æ¡C

Marker (M): ¥Î§@­«­n¨Æ¥ó¡A¹³¬O¼v¹³¤¤frameªº¬É­­ÃѧO­È¡C³o­Ó­Èªº¸ÑÄÀ¬O¯dµ¹application¥h³B²z¡C

Payload type (PT): ¥Î¨Ó©w¸qRTP payloadªºformat¡A¦Óformatªº¸ÑÄÀ«h¬O¯dµ¹application¥h³B²z¡C

Sequence number: ¨C°e¥X¤@­ÓRTP packet¤§«á¡Asequence number´N·|¼W¥[¤@¡CSequence number¤]¥i¥H³Qreceiver¥Î¨Ó°»´úpacket loss¡A¥H¤Î«ì´_packetªº¶¶§Ç¡C

Timestamp: ¥Î¨Ó°O¿ýRTP packet²Ä¤@­Óoctet³QŪ¨úªº¨ú¼Ë®É¶¡¡C

SSRC: ¦p¦P«e­±ªº©w¸q¡C­nª`·Nªº¬O¡A¦pªG¤@­Ósource§ïÅÜ¥¦ªºsource transport address¡A¥¦¥²¶·¿ï¾Ü¤@­Ó·sªºSSRC¡C

CSRC list: ¦p¦P«e­±ªº©w¸q¡C­nª`·Nªº¬O¡A¦pªG¤@­ÓRTP packet¥]§t15­Ó¥H¤WªºCSRC¡A¥u¦³15­ÓCSRC¥i¥H³QÃѧO¡C

RTP headerª`·N¨Æ¶µ

«e¤Q¤G­Óoctet¤@©w·|¥X²{¦b¨C­ÓRTP packet¡Q¦ýCSRC list¥u¦³packet¸g¹Lmixer¤~·|³Q¶ñ¤J¡C

Multiplexingª`·N¨Æ¶µ

­n¥ý»¡©úªº¬O¡A¦pªG¤@­Óprotocol·Q¦³®Ä²vªº¹B§@¡AmultiplexingªºÂIÀ³¸ÓºÉ¶q´î¤Ö¡C

¦bRTP¤¤¡Amultiplexing¬OÂÇ¥Ñdestination transport address¨Ó§¹¦¨¡C¨Ò¦p¤@­Ó¥]§t¼v¹³»PÁn­µªº»·¶Z·|ij¡AÁn­µ»P¼v¹³±N¦b¤£¦PªºRTP session¤¤³Q¶Ç°e¡C°ò¥»¤W¡ARTP¨Ã¤£§Æ±æ¼v¹³»PÁn­µµ¥¤£¦Pªº¸ê®Æ¦b¦P¤@­ÓRTP session¤¤³Q¶Ç°e¡AµM«á¦A®Ú¾Úpayload type©ÎSSRC¨Ódemultiplex¡C

Multiplexing¥i¯à¹J¨ìªº°ÝÃD

¦b¦P¤@­ÓRTP session¤¤¨Ï¥Î¦P¤@­ÓSSRC·|³y¦¨¥H¤U¤­­Ó°ÝÃD¡Q¦Ü©ó¦b¦P¤@­ÓRTP session¤¤¨Ï¥Î¤£¦PªºSSRC¡A±N¥iÁקK«e¤T­Ó°ÝÃD¡A¦ý¤´·|¹J¨ì«á¨â­Ó°ÝÃD¡G

¦pªG¦bsession¹B§@ªº¹Lµ{¤¤¡A¦³payload typeªº§ïÅÜ¡A±N¨S¦³¤èªkª¾¹D¬O­þ¤@­Óªºpayload type³Q¨ú¥N¡C

¥i¯à»Ý­n¤£¦Pªº­p®É¤è¦¡¡A¥H¤Îsequence numberªÅ¶¡¡C

¤£½×¬ORTCP sender report©Î¬ORTCP receive report¡A·í°w¹ï¦P¤@­ÓSSRC¡A³£¥u¯à´y­z¤@­Ó­p®É¤è¦¡¡A¥H¤Î¤@­Ósequence numberªÅ¶¡¡C¦Ó¥B¡A¨S¦³payload typeÄæ¦ì¡C

RTP mixer¨S¦³¿ìªkµ²¦X¤£¬Û®eªºmedia¡C

¦pªGreceiver¥u·Q±µ¦¬RTP session¨ä¤¤¤@ºØmedia¡A±N¬O¤£¥i¯àªº¡C¦¹¥~¡Areceiver application·Q¥Î¤£¦Pªºprocess¥h±µ¦¬¤£¦Pªºmedia¡A¤]¬OÃø¥H¹F¦¨ªº¡C

RTP header extension®æ¦¡

0

1

2

3

0

1

2

3

4

5

6

7

8

9

0

1

2

3

4

5

6

7

8

9

0

1

2

3

4

5

6

7

8

9

0

1

 

Defined by profile

length

header extension

¡K¡K

 

RTP header extensionÄæ¦ì»¡©ú

defined by profile: ¥Î¨Ó±µ¦¬¤@¨Çidentifier©Îparameter¡C¥H¤¹³\­n¥æ¤¬§@¥Îªºimplementation¥i¥H¥Î¤£¦Pªºheader extension¥h¸ÕÅç¡Q©Î¤¹³\¤@­Ó¯S®íªºimplementation¥i¥H¥Î¤@ºØ¥H¤Wªºheader extension¥h¸ÕÅç¡C

Length: ¥Î¨Ó°O¿ý¦bextension¤¤32-bit wordªº­Ó¼Æ¡C

RTP header extensionª`·N¨Æ¶µ

Extension¾÷¨î¬O¬°¤F¸ÕÅç·sªºpayload-format-independent¥\¯à¡AÅý¨º¨Ç¥\¯à¥i¥H¦bRTP header¤¤¥[¤J»Ý­nªº¸ê°T¡Q¦ý¬O¡A­Y¥u¬O¬Y¨Çpayload format©Ò»Ý­nªº¦Ó¥~¸ê°T¡A«h¤£©y¨Ï¥Îheader extension¡A¦Ó¬OÀ³¸Ó¥]§t¦bRTP packet¤¤ªºpayload section¡C

RTCP (RTP Control Protocol)

RTCP²¤¶

RTCPªº­ì²z´N¬O¡A¨Ï¥Î»PRTP¶Ç°epacket¤@¼Ëªº¶Ç°e¾÷¨î¡A¨C¹j¤@¬q®É¶¡´N¶Ç°econtrol packet¡C

RTCP¤T¤j¥\¯à

n         RTCP¥D­nªº¥\¯à¬O¤F¸Ñ¸ê®Ædistributionªºquality¡C¦A°t¦Xdistribution¾÷¨î¡A¹³¬OIP Multicast¡A´N¥i¥HÅýnetwork service provider³oÃþ¹ê»Ú¤W¨S¦³¥[¤JRTP sessionªº³æ¦ì¡A¥h¶EÂ_ºô¸ô¤Wªº°ÝÃD¡C

n         RTCP¥]§t¤@­Ó¤£ÅܪºRTP sourceªºtransport-level identifier¡A¥s°µcanonical name©Î¬OCNAME¡CReceiver¨Ì¾aCNAME¨Ó°lÂܨC¤@­Óparticipant¡CRTP¤]¨Ï¥ÎCNAME¦b¤@²Õ¬ÛÃöªºRTP sessions¤¤¡A±N¨Ó¦Û¦P¤@­Óparticipantªº¦hªºdata stream§@Ápô¡C

n         «e­±¨â­Ó¥\¯à³£»Ý­n©Ò¦³ªºparticipant¶Ç°eRTCP packet¡A©Ò¥H¬°¾AÀ³¤j¶qªºparticipant¡A¶Ç°eªº³t²v´N­n±±¨î¡C³z¹L¨C¤@­Óparticipant¶Ç°eRTCP packetµ¹¨ä¥Lparticipant¡A©Ò¦³ªºparticipant¥i¥HÆ[¹î²{¦bparticipantÁ`¼Æ¥Ø¡A¦Ó³o­Ó¼Æ¥Ø´N¥Î¨Ó­pºâ¶Ç°eRTCP packetªº³t²v¡C

RTCP packetºØÃþ

RTCP packet¥i¥H¥]§t¥H¤U¤­ºØ¸ê°T¡Q

n         SR: ¬ö¿ýsenderªºreception statistics¡C

n         RR: ¬ö¿ýreceiverªºreception statistics¡C

n         SDES: ¦³Ãösourceªº¸ê°T¡A¹³¬OCNAME¡C

n         BYE: «ü¥X¬Y¤@participantªºÂ÷¶}¡C

n        APP: «ü¥X¬Y¤@application¯S¦³ªºfunctions¡C

RTCPª`·N¨Æ¶µ

n         ¨C¤@­ÓRTCP packet³Ì«e­±³£·|¦³©T©wªº³¡¤À¡AµM«á®Ú¾ÚpacketºØÃþªº¤£¦P¡A±µµÛªø«×¤£¦Pªº¸ê®Æ¡A¦ýÁ`bit¼Æ³£¬O32ªº­¿¼Æ¡C

n         ¦h­ÓRTCP packet¥i¥Hµ²¦X¡A¦Ó¤£»Ý­n¥ô¦óªºseparator¡C

¨C¤@­ÓRTCP packet¤@©w­n¥]§tSR/RR»P¦³CNAMEªºSDES¡A¦Ó¥BSR/RR¤@©w¬O¦b³Ì«e­±¡C

 

 

 

 

 

¡» ¦h´CÅéÀɮ׮榡

        ¤@¯ë§Q¥ÎRTP¨Ó°µµø°TÀ³¥Î³q±`·|¤À¨â­ÓSession¨Ó°µ,¤@­ÓSession­t³dÁn­µ¶Ç°e,¥t¤@­Ó«h¬°¼v¹³,³o¼Ëªºª¬ªp¤§¤U¥²¶·¦Ò¼{¼v­µ¦P¨Bªº°ÝÃD¡C¦Ó³o¦¸¬O¶Ç°e¤@­Ó¤w¸g¤º§t¦³Án­µ¼v¹³ªºRaw Data¹L¥h(AVI file),³o¼Ë´N¤£»Ý­n¥h¦Ò¼{¨ì¼v­µ¦P¨Bªº°ÝÃD,ÅýRaw Data¤¤ªº¦P¨B¨ó©w¦Û¤v¥h°µ,§Ú­ÌÁn­µÀ£ÁYªº®æ¦¡¥D­n¬O±ÄMPEG Layer III,¼v¹³À£ÁY¥D­n¬O±ÄMPEG4,³Ì«á¦X¦¨¤@­ÓRIFF-AVI¶Ç°e¹L¥h¡C

Mpeg Audio

        Mpeg Audio¬O±ÄFrame by FrameªºÀx¦s¤è¦¡,¤@­ÓFrame´N¬O¤@­Ó³Ì°ò¥»ªº¼·©ñ³æ¦ì,Mpeg AudioªºÀÉ®×µ²ºc¦p¤U:

FRAME1
 
FRAME2
 
 

 

 

 

 

 

 

 


31                                                                                          0(bits)

     

      Headerªº·§­z¦p¤U(¸Ô²ÓÄæ¦ì¸ê°T¥i©ó³Ì«á¦C¥Xªº°Ñ¦Ò¸ê®Æ´M§ä,¦]¬°¾ã­Ó½g´T¤Ó¤j¤F,¤£¤è«K¦C¥X)

Sign

Length(bit)

Position(bit)

Description

A

11

(31-21)

Frame sync (all bits must be set)

B

2

(20-19)

MPEG Audio version ID

C

2

(18-17)

Layer description

D

1

(16)

Protection bit

E

4

(15-12)

Bitrate index

F

2

(11-10)

Sampling rate frequency index

G

1

(9)

Padding bit

H

1

(8)

Private bit. This one is only informative

I

2

(7-6)

Channel Mode

J

2

(5-4)

Mode extension

K

1

(3)

Copyright

L

1

(2)

Original

M

2

(1-0)

Emphasis

 

 

Mpeg Audio Frame Length

               ¼ÐÀYªº¸ê°T§Ú­Ì¤w¸g¸Ô²Óª¾¹D¤F,¦Ü©óRaw Dataªºªø«×¥i¥H¥Ñ¥H¤U¤½¦¡­pºâ¥X¨Ó¡C

      Read the BitRate, SampleRate , Padding bit and protection bit(CRC) from header.

 

      For Layer I files us this formula:

FrameLengthInBytes = (12 * BitRate / SampleRate + Padding) * 4 + CRC

 

      For Layer II & III files use this formula:

FrameLengthInBytes = 144 * BitRate / SampleRate + Padding + CRC

 

 

Mpeg4

 

      Mpeg4¤ºªºÀ£ÁYªk¨Ã¤£¬O«Ü²M·¡,¥i¥H°Ñ¦Ò¨äSPEC,§Ú­Ì¬O±ÄDivX MPEG4 Video Codec(filter)¨Ó¹F¦¨§Ú­Ìªº¥Øªº¡C

 

RIFF(defined by Microsoft)

 

              ¦]¬°AVIºâ¬ORIFF®æ¦¡ªºÀÉ®×,¦]¦¹¥ý²¤¶RIFF¡CRIFF(Resource Interchange File Format)¬O¤@­Ó¤G¶i¦ìªº±_ª¬µ²ºcÀÉ®×,¥¦¨Ã¤£¥Nªí¥ô¦ó¦h´CÅéÀÉ®×,¦Ó¥¦¬O§â¦h´CÅéÀÉ®×¥]¸Ë¦b¨ä©w¸qªºµ²ºc¤§¤¤,¥]¸Ë¦bRIFF¤¤ªº¦h´CÅé¸ê®Æ¥D­n¬O¥HÀɮתº°ÆÀɦW¨Ó§P§O,¦p¤U©Ò¦C:

 

¡P         Audio/visual interleaved data (.AVI)

¡P         Waveform data (.WAV)

¡P         Bitmapped data (.RDI)

¡P         MIDI information (.RMI)

¡P         Color palette (.PAL)

¡P         Multimedia movie (.RMN)

¡P         Animated cursor (.ANI)

¡P         A bundle of other RIFF files (.BND)

               ¦p¤W³£¬ORIFF®æ¦¡ªºÀÉ®×,¥u¬O¨ä¤º§tªº¦h´CÅé¸ê®Æ¤£¤@¼Ë¡C¦A¨Ó­n»¡©úªº¬ORIFFµ²ºc,¦bRIFF¤¤ªº°ò¥»³æ¦ì´N¬OChunk,¦p¤U©Ò¦C:

 

 

typedef struct _Chunk
{
    DWORD ChunkId;              /* Chunk ID marker */
    DWORD ChunkSize;            /* Size of the chunk data in bytes */
    BYTE ChunkData[ChunkSize];  /* The chunk data */
} CHUNK;
 
 

      ChunkData¤¤¤S¥i¥]§t§OªºChunck(Sub Chunk),³o¼ËªºÃö«Y¤@ª½¤U¥h´N¦p¤W©ÒºÙªº±_ª¬µ²ºc¡C

 

 

 

 

AVI

 

               AVIÄÝ©ó¦p¤W­zªºRIFF®æ¦¡,AVI¤ºÂ\ªºÀɮ׸ê®Æ¥]¬A¤FÁn­µ»P¼v¹³,¥¦ªºChunk¤À¥¬¦p¤U:

 

struct _RIFF   /* "RIFF" */
{


RIFF CHUNK
 
    struct _AVICHUNK   /* "AVI " */
    {
        struct _LISTHEADERCHUNK   /* "hdrl" */


AVI CHUNK
 
        {
            AVIHEADER AviHeader;     /* "avih" */
            struct _LISTHEADERCHUNK  /* "strl" */


LIST-HDR CHUNK
 
            {
                AVISTREAMHEADER               StreamHeader; /* "strh" */
                AVISTREAMFORMAT              StreamFormat; /* "strf" */
                AVISTREAMDATA    StreamData;   /* "strd" */
            }
        }
        struct _LISTMOVIECHUNK  /* "movi" */
        {


LIST-MOVI CHUNK
 
            struct _LISTRECORDCHUNK  /* "rec " */
            {
                /* Subchunk 1 */
                /* Subchunk 2 */
                /* Subchunk N */
            }
        }
        struct _AVIINDEXCHUNK  /* "idx1" */


INDEX CHUNK
 
        {
            /* Index data */
        }
    }
}

              

               ¦p¤W©Ò¦C,³o¬O¤@­ÓAVIªºµ²ºcÀÉ®×,¥D­nRIFF chunk¥]¸Ë¤@­ÓAVI chunk,AVI chunk¤§¤¤¤S¥]§t¤F,LIST-HDR¡BLIST-MOVI¡BINDEX¤T­Óchunk,LIST-HDR chunk¤§¤¤¥D­n¬O¬ö¿ý¼v­µ¸ê®Æªº¸ê°T,LIST-MOVI chunk¬OÂ\¼v­µ¸ê®Æ,INDEX chunk¬OÂ\¼v­µªø«×ªº¯Á¤Þ,¥D­n¬O´£¨Ñ§ÖÂà©Î°jÂà¼v­µªº¸ê°T,¸Ì­±§ó²Ó³¡ªº¤º®e¥i¥H°Ñ¦Ò«á­±¦C¥Xªº°Ñ¦Ò¸ê®Æ,¦]¬°½g´Tªø«×¹ê¦b¤Ó¤j¤F¡C

 

 

Summary

               ¨Ã¤£¬O©Ò¦³ªº®æ¦¡³£¬O¾A¦X¦bºô¸ô¤W°µ¶Ç°e,³\¦h°µ¦h´CÅé¶Ç°eªº¤½¥q³£¦³¥t¥~¦Û­qªºÀɮ׮榡,¦pReal Player RA©Î¬OMicrosoft ASF,¦¹¦¸±ÄAVI®æ¦¡±N¼v¹³¶Ç°e¥X¥h¤]¤£¬O«Ü²M·¡¬O§_¯uªº¦X¾A,³o»Ý­n§ó¥J²Óªº¬ã¨s¤~¹ï¡C

 

 

 

 

 

¡» ¨t²Îªì¨B¬[ºc

¤å¦r¤è¶ô: RTP¤å¦r¤è¶ô: RTP
 

 

 

 

 

 


        ¦p¤W¹Ï¬O§Ú­Ìªì¨B¹ê§@¥Xªº¬[ºc,­º¥ý¼·©ñºÝ±qDISK¨ú¥X­n¼·©ñAVI File°µ¤Á³Î¨Ã®M¤WRTP°µMulticast¶Ç°eµ¹¼·©ñºÝ¡C¼·©ñºÝ¥]§tReceiver»PPlayer¨â³¡¤À,¦ý¨ä¹ê¬O¦b¦P¤@µ{¦¡©ó¨â­Ó¤£¦PªºThread°õ¦æ¡C

      ¼·©ñºÝ±µ¦¬¨ì¸ê®Æ«á´N±NAVI¤ù¬q¼g¤JDISK,³Ì«áPlayer±N¼g¤JªºAVI¤ù¬qµ¹¼·©ñ¥X¨Ó¡C

      ³oÃä´N¥X²{¤F¤@¨ÇÆZ¦³½ìªº²{¶H,´N¬O§Ú­Ì¶Ç°eºÝ»P¼·©ñºÝªº³t«×­n¦p¦ó¨ó½Õ,ÁÙ¦³¤§¶¡ªºÀW¼e°ÝÃD©O?!°ò¥»¤W¶Ç°eºÝ¬O®Ú¾ÚAVI¤ù¬qªø«×¨Ó½Õ¾ã³t«×ªº¡C©Î³\¥i¯à¤S·|°Ý¬°¤°»ò¼·©ñºÝ­n³z¹LDISK¦s¨ú³o¹D¤âÄò,±µ¦¬¨ìªºAVI¤ù¬qªºRTP Packet¤@¶}©l¤£´N¬O¦b°O¾ÐÅ餤,¬°¤°»ò¤£ª½±µ¼·©ñ¥X¨Ó?!¥D­nªº­ì¦]¬O¦]¬°Player¬O¥ÎDS¨Ó¹ê§@,¦ÓDS¦¹®É´£¨ÑªºSource Filter¥u¯à±qURL©ÎFILEŪ¨úRaw Data,¦]¦Ó§Ú­Ì±ÄFILEªº¤è¦¡,©Ò¥H­n³z¹LDISK¦Ó¤£¬O±qMemory¹L¥h,¦ý¤@³z¹LDISKªº¤è¦¡,§Ú­Ìµoı¦b¼·©ñAVI¤ù¬q¤§¶¡·|¦³¨Ç³\Delay¡C

      Ãö©ó­è­è´£¨ìªº¥D­n¯Ê¥¢§Ú­Ì¤]°Q½×ªì¤@¨Ç¸Ñ¨M¤è®×,¦ý¬O³Ì¦nªº´N¬Oª½±µ³z¹LMemoryµ¹DS³B²z,¤£¥Î³o¼Ë©ä­ÓÅsÁY´î®Ä¯à,³o´Nªí¥Ü»¡§Ú­Ì»Ý­n¥h¶}µo¤@­Ó¯à±q¦Û­q°O¾ÐÅéBufferŪ¨úRaw DataªºSource Filter,¦Ü©ó³o­Ó³¡¤À¥Ñ©ó®É¶¡¤£¤¹³\,¦]¦¹©|¥¼¹ê§@¡C

 

 

 

 

 

¡» ¨t²Î³Ì«á¬[ºc

¤å¦r¤è¶ô: RTP¤å¦r¤è¶ô: RTP
 

 

 

 

 

 


       

        ³Ì«áªº¨t²Î¬[ºc¦p¤W¹Ï©Ò¥Ü,¼·©ñºÝ¥þ³¡¨S¦³ÅÜ,¦Ó¦b¶Ç°eºÝ§ï¬°¥ý¥ÑCapture (CCD & MIC Device)¨ú±o¦h´CÅé,±N¨ú±oªº¦h´CÅé¥ý¼g¤JDISK,³Ì«áSender¦A±N¼g¤JDISKªº¼v¹³¶Ç°e¥X¥h,¦ÓSend»PCapture¹ê»Ú¤W¬O¦P¤@µ{¦¡,¦ýRun¦b¤£¦PªºThread¡C

°ò¥»¤W¶Ç°eºÝ¤]¬O¦³­è­è©Ò´£ªº¤ò¯f,¨ä¹ê¬O¤£¥²³z¹LDISKªº,³o¼Ë¤S®ö¶O±¼¤@¨Ç¨t²Î®Ä¯à,¦Ó¥B®ÄªG¤S¤£¬O«Ü¦n¡C

 

 

 

 

 

 

¡» ¨t²Î¬[ºc¹Ï-- DirectShow Filter

Audio Capture

Filter

 
 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


        ¦p¤W¹Ï±NCapture»PSender³¡¤À®i¦¨¤º³¡DS Filter³sµ²ª¬ªp¡COptional³¡¤À¬O«ü¥i¥H¿ï¾ÜÀ£ÁY¤è¦¡©Î¤£À£ÁY,¼v¹³¤ä´©DivX MPEG4 Video Compressor¡BMicrosoft AVI Compressor,Án­µ¤è­±¦³MPEG Layer3 Compressor,¨ä¹ê³o¤è­±¥i¥H®Ú¾Ú¨t²Î¾Ö¦³ªºCompressor¨Ó¿ï¾Ü¡C

 

 

 

¡» ¶Ç°eºÝScreen Shot

        ¦p¹Ï¥ª¤U,¥D­nªº©Ò¦³¥\¯à³£¦b¨º¤U©ÔªºMenu¤§¤¤,¥]¬A¬O§_­nÂ^¨ú¼v¹³©ÎÁn­µ¡B¬O§_¤ä´©§Y®ÉÀ£ÁY¡C¿ï¾ÜStart Writing´N·|¶}©l§@¶Ç°e®·®»ªº¼v­µ,Stop·|¼È®É°±¤î¶Ç°e°Ê§@,ªÅ¥Õ³¡¤À¬OPreviewµøµ¡(¦p¤U¹Ïµe­±)¡C

 

¹Ï¤@¡G¶}±ÒVideo Capture®É¡A¦Û°Ê¥X²{Capture propertyµøµ¡

 

 

¹Ï¤G¡G¾Þ§@¿ï³æ¡A¥i¥H¿ï¾Ü¼v¹³¡BÁn­µÂ^¨ú¡A¥H¤ÎÀ£ÁY®æ¦¡

 

 

 

 

¡» ±µ¦¬ºÝScreen Shot

¹Ï¤T¡G¸`¥Ø¿ï³æµøµ¡

 

¹Ï¥|¡G¼·©ñCCD©MMIC§Y®ÉÂ^¨úªº¼v¹³¡BÁn­µ

 

 

 

 

 

 

¡» «á°O

        ³o­Ó±MÃD¦³¨Ç¦a¤è¬O­È±oÄ~Äò¬ã¨s¡B§ïµ½ªº,¨Ò¦pRTP/RTCPªº±±¨î¨Ï¥Î¡BDS³¡¤À§ï¼gFilter¨Ó±±¨îRaw dataªºdata flow©Î¸ÕµÛ¨Ï¥Î DS¤ºªþªºRTP Filter¡C

      Á`¦Ó¨¥¤§,³o¦¸ªº±MÃDÅý§Ú­Ì±µÄ²¨ì³\¦h¥H©¹¨S±µÄ²ªº»â°ì, ¬A¹êÅç«Çªº¤@¨Ç¾Çªø©j­Ì¤]¬O,¦]¦¹³\¦hªF¦è³£­nªá¶OÆZ¦hªº®É¶¡¥h¬ã¨s©M·j´M¸ê®Æ,¨ä¤¤§¹¦¨ªº´ú¸Õµ{¦¡¤]«Ü¦h,¥]¬A¤FMulticastÀɮ׶ǿé¡BMPEG AudioÀɮפÁ³Î¾¹¡BDirectShow¼·©ñ¼v¹³¡BÁn­µªº´ú¸Õ½d¨Ò¡BRTP¶Ç°e¡B±µ¦¬´ú¸Õµ{¦¡,»â²¤¨ìMicrosoft Direct Showªº¬[ºc©M§Þ³N¡B¤]¾Ç·|COM­ì¥ó³]­pµ¥µ¥,¦³¤F³o¨Ç·§©À»P¹ê§@ªº°ò¦,·Q¦A²`¤J¤U¥h¤]¤£·|¦p¦¹Á}²`¡C

 

 

 

 

¡» °Ñ¦Ò¸ê®Æ

l          Online MSDN (http://msdn.microsoft.com/library/)

l          Microsoft DirectShow 8.0a SDK Document (see DX SDK)

l          JRTP Library Document (http://lumumba.luc.ac.be/jori/jrtplib/jrtplib.html)

l          RTP Official Site (http://www.cs.columbia.edu/~hgs/rtp/)

l          RFC 1889 RTP

l          §¹¥þ­åªRCOM Dale Rogerson Microsoft Press

l          AVI RIFF FORMAT (http://www.oreilly.com/centers/gff/formats/micriff/index.htm)

l          DirectX, RDX, RSX, and MMX technology : Rohan Coelho and Maher Hawash Addison-Wesley Development Press

l           §õ­^·ç,¡§IP Multicast ¸s¼½ºô¸ô²¤¶¡¨,1998.3

 

 

 

 

 

 

¡» §ë¼v¤ù©Mµ{¦¡½X¤U¸ü

        --RTP & RTCP §ë¼v¤ù1

        --RTP & RTCP §ë¼v¤ù2

        --DirectShow §ë¼v¤ù

        =======================   

        --CCD Capture & Sender µ{¦¡½X (CCD_sender)

        --±µ¦¬ºÝ & ¼·©ñ µ{¦¡½X (StreamPlayer)

        --¶Ç°eÀÉ®× µ{¦¡½X (RTP_Sender)

        --Register Server µ{¦¡½X (Tcptest)