Professional Documents
Culture Documents
http://www.avalpa.com
!en"o
#$an%s to&
http://www.avalpa.com
Table of contents
General Index
Avalpa Broadcast Server 'ser (anual...............................................................1 #a)le of contents.................................................................................................3 *ntroduction........................................................................................................+ Avalpa Broadcast Server.................................................................................+ Avalpa Di,ital -n,ineerin, ............................................................................+ 'se cases& some e.amples..............................................................................+ Demonstration................................................................................................./ OpenCaster...................................................................................................../ Cop0ri,$t and 1arrant0......................................................................................2 OpenCaster, t$e soft1are................................................................................2 Avalpa Broadcast Server, t$e manual.............................................................2 3irst *nstallation..................................................................................................8 4o,in into t$e s0stem......................................................................................8 Settin, up a fi.ed *5 address..........................................................................8 Confi,ure multicast routin,............................................................................8 Scope of t$e user manual and intended audience............................................10 6o1 to read t$e manual................................................................................10 *nterestin, and )asic readin,s......................................................................11 Avalpa Broadcast Server )asic concepts and usa,e.........................................17 8our first transport stream ,oes )roadcast..................................................17 (ultiple.in, a Sin,le 5ro,ram #ransport Stream from local files...............70 9eneratin, 5S*/S* )asic ta)les......................................................................77 #ool dv)snoop................................................................................................7/ #ransport stream )itrate...............................................................................72 *5 net1or% tools............................................................................................78 Avalpa Broadcast Server for advanced datacastin,.........................................7: -59................................................................................................................7: #elete.t support............................................................................................33 DS(CC carousels and data castin,..............................................................32 D;B<SS'....................................................................................................32 *nteractive #; support..................................................................................40 #ool oc<update.s$.......................................................................................40 (65/(6-9+ si,nallin,............................................................................41 6))#v si,nallin,.......................................................................................4+ 'pdate an o)=ect carousel 1it$ runnin, applications...............................4/ Si,nallin, Stream -vents..........................................................................48 DS(CC<receive.............................................................................................+3 (ultiple.in, a (ultiple 5ro,ram #ransport Stream from local files............+4 B*SS<- and CSA output support....................................................................+8 Avalpa Broadcast Server&Avalpa >e) -59 9'*................................................/0 !eference....................................................................................................../0 3 http://www.avalpa.com
Avalpa Broadcast Server user manual Avalpa Broadcast Server for audio/video pla0out............................................./1 *ntroduction to in,estion.............................................................................../1 -.tractin, 5ro,ram and -lementar0 Streams& ts7pes................................../3 Anal0sin, mpe,7 video files& esvideoinfo...................................................../4 #ool v)v......................................................................................................// Anal0sin, audio elementar0 streams& esaudioinfo......................................../2 6o1 to encode mpe,7 di,ital video files 1it$ ffmpe, and m=tools............../8 6o1 to encode di,ital audio files 1it$ ffmpe,............................................../: 6o1 to capture D; input...............................................................................21 6o1 to ,enerate silence................................................................................27 Audio and video real case in,estion stud0 ...................................................23 Audio and video initial s0nc$roni"ation....................................................24 -ncodin, 1it$ .7/4.......................................................................................2+ 5la0 out sc$edulin, from command line.......................................................2/ !e<multiple.in, input transport streams..........................................................87 #ool tsorts .....................................................................................................87 Appendi. A& Acron0ms, ,lossar0 and references..............................................84 Appendi. B& D;B<# transmission parameters and net )itrates........................8+ Appendi. C& !elated readin,s .........................................................................8/ Appendi. D& (pe,7 transport stream overvie1...............................................82
ADB Global, Adobe, Computer Modules, Dek ec, Dell, D!B, "#re$o%, G&u, 'bm, (ava, )#&u%, Ma#&co&cept, Mo*#lla, +ower+c, +rem#ere, ,u& M#cros-stems are re.#stered rademarks o$ the#r respect#ve ow&ers.
http://www.avalpa.com
Introduction
Avalpa Broadcast Server
Avalpa Broadcast ,erver #s a s#&.le rack u&#t s-stem $eatur#&. a collect#o& o$ tools to .e&erate, process, mult#ple%, pla- out a&d broadcast M+0G12 tra&sport stream co&te&t. ra&sport stream 2usual $#le su$$#%es are . ,, . +, . +,, . +34 #s a commu&#cat#o& protocol $or aud#o, v#deo, a&d data wh#ch #s spec#$#ed #& M+0G12 2',5/'0C sta&dard 13616114. A& overv#ew o$ the protocol #s ava#lable o& Appe&d#%. ra&sport stream o$$ers $eatures $or error correct#o& $or tra&sport over u&rel#able med#a, a&d #s used #& broadcast &etworks such as D!B. Avalpa Broadcast ,erver inputs are usually non transport stream files stored on hard disk while output is a transport stream suitable for !B headend inte"ration throu"h !B#ASI or U $ and for stand alone broadcastin" throu"h %& modulation' !( or I$T!. "or data broadacast#&. o&l- #s also poss#b#le to output D!B packets over parallel port, o& th#s #&ter$ace 7#tter #s u&su#table $or v#deo broadcast#&.. The !B#T)#S)#* output can be directly received by Set Top Boxes and Inte"rated i"ital Tele!isions+ ,atest version of the Avalpa Broadcast Server features also re#multiplexin" features usin" as inputs !B#T)#S)#* pci boards and)or udp multicast packets+
Custom #&stallat#o&s a&d ma#&te&a&ce o$ solut#o&s '&te.rat#o& w#th others D!B s-stems ra#&#&., support a&d co&sulta&c"urther developme&t o$ $eatures a&d custom#*at#o&. a.ve&tur#:avalpa.com C05 l.pallara:avalpa.com C 5 #&$o:avalpa.com $or .e&eral 8uest#o&s or order#&. #&$o.
Co&tacts:
Avalpa Broadcast Server user manual As a data broadcastin" headend e-uipment $or s#.&all#&. table .e&erat#o& 2$or e%ample $or ,*. &umber#&. .e&erat#o&4, electro&#c pro.ram .u#de 2 /$G4 server, data carousel 2M0$' 0bbT!' Gin"a a&d M0/G1 SM**4 server, teletext a&d $#rmware up.rade 2(TA !B#SSU4 server mult#ple%ed w#th other serv#ces. As a standalone sin"le box for scheduled pre#compressed !ideo or !ideo (n# emand di"ital television services with or without interactive support+ "or vod serv#ce ca& ma&#pulate pmt a&d/or support *SA. As a developer tool for a software house and laboratories 23A and %4 5 #&volved #& d#.#tal telev#s#o& products Avalpa Broadcast ,erver ca& protot-pe adva&ced serv#ces d#rectl- o& developers , B #& the ver- same co&d#t#o&s o$ a real telev#s#o& e&v#ro&me&t, a&d pursue cert#$#cat#o&s l#ke M<+ or M<0G; or test 5 A. Ma&- others s#mpler sce&ar#os are poss#ble l#ke: A,' to '+ or '+ to A,' co&verter, or '+ to D!B1 /1C/1, modulator, '+ to '+ mult#ple%er, D!B1 /1C/1, to '+ '3D a&d so o&, #& these use cases =alo&e> Avalpa Broadcast ,erver #s usuall- a& overk#ll compared to ded#cated hardware soltut#o&s u&less -ou do&?t &eed both pla-out $u&ct#o&s a&d re1mult#ple%#&. $u&ct#o&s, #& that case Avalpa Broadcast Sever remultiplexin" functions can avoid you additional hardware costs+
Demonstration
@ou ca& dow&load a tra&sport stream mult#ple%ed b- 5pe&Caster show#&. ma&adva&ced $eatures at: http://www.avalpa.com/the1ke-1values/1;1$ree1so$tware/;A1 ope&caster1demo1roll he tra&sport stream #s read- to be broadcast w#th a D!B1 modulator us#&. BAM 1C, .uard #&terval 1// a&d code rate 2/3,-ou ca& watch o& -our tv or stb. @ou ca& pla- #t o& pc b- !)C or streamed o& '+ sett#&. b#trate at 132D1EEE bps.
OpenCaster
5pe&Caster #s the G+) v2 ope& source so$tware developed ma#&l- b- Avalpa +eople a&d #ts the heart of Avalpa Broadcast Server . Avalpa Broadcast ,erver #s our #&ter&al re$ere&ce s-stem alwa-s u&der tests a&d ru&s over a ,inux ebian 6+7 Stable s-stem. Avalpa Broadcast ,erver ca& be re8uested as #t #s or -ou ca& co&tact us to #&te.rate/custom#*e #t $or -our s-stems a&d solut#o&s o& the other ha&d (pen*aster is available as standalone source code download for ts over U $ input)output usa"e on any pc $rom Avalpa web s#te 2www.avalpa.com4 to a&-bod- that wa&ts to work o& #t, develop #t $urther or use #t as sta&dalo&e so$tware w#thout ded#cate hardware or others $u&ct#o&s that does&?t re8u#re a comple% s-stem set1up a&d/or a DB or th#rd part#es hardware #&te.rat#o&. Avalpa Broadcast Server IS .(T (.,8 what you "et installin" (pen*aster on your ,inux pc but also9 14 AF0, Avalpa :eb /$G, $or eve&t #&$ormat#o& #&sert#o& a&d .e&erat#o& based o& Apache a&d M-,B), check http://www.avalpa.com/assets/$reeso$t/ope&caster/AvalpaBroadcastFeb0+GMa&ual 1 v1.E.pd$ $or #ts ma&ual
http://www.avalpa.com
Avalpa Broadcast Server user manual 24 0ardware boards for ASI and !B# modulations for Avalpa Broadcast Server are carefully tested and choosen and their software is customi;ed for recuded latency and improved performance Avalpa Broadcast ,erver .e&erated output has bee& success$ull- #&te.rated o& top o$ ma&- th#rd part#es s-stems, amo&. them #t was alreaddeplo-ed w#th s-stems b- C#sco/,c#e&t#$#c Atla&ta, 0r#csso&/ a&dber., 0urotek, <armo&#c/,copus, M#ta&, ,cree& ,erv#ce, Fellav, DeltaCast, ,r1,-stems... 34 Support for installation and inte"ration with third parties is far faster as the hardware co&$#.urat#o& #s sta&dard Co&tact #&$o:avalpa.com $or #&$ormat#o& about s-stem #&te.rat#o&.
http://www.avalpa.com
http://www.avalpa.com
&irst Installation
Avalpa Broadcast ,erver a$ter boot w#ll look $or a dhcp address #$ a ether&et co&&ect#o& #s prov#ded. '$ the &etwork co&&ect#o& #s &ot ava#lable -ou ca& co&&ect mo&#tor, ke-board a&d mouse a&d do lo.#& $rom the ke-board.
A$ter the $#le #s saved 2"2 the& "1E4 -ou have to restart the &etwork #ssu#&.:
/etc/init$d/networkin( restart
http://www.avalpa.com
1E
http://www.avalpa.com
he $ollow#&. s-mbols w#ll serve as $ollow: ,-mbol Descr#pt#o& +a- atte&t#o& to th#s &ote, #t should be a h#&t $or a smarter usa.e o$ the so$tware
11
http://www.avalpa.com
Avalpa Broadcast Server user manual Beware, -ou ca& .et some u&des#rable e$$ect #$ -ou do&?t u&dersta&d #&struct#o&s a&d $ollow them care$ull-
<elpH h#s part #s &ot completel- up to date or $#&#shed9 ma-be -ou ca& help us, would -ou l#keG
he&, #& the para.raphs where there are pract#cal e%erc#ses us#&. mater#als to be $ou&d #& the 5Ctutor#als d#rector#es o& the server, we l#st them #& adva&ce w#th such a .raph#cal h#&t: I5C utor#als/sample.tsJ
12
http://www.avalpa.com
'$ -our server #s e8u#pped w#th 3" output -ou w#ll &eed to set modulat#o& parameters:
tsrfsend samp8e$ts -mt O=>? -mC @A?!% -m/ !/, -mc #/3 -mf '9&
13
http://www.avalpa.com
Avalpa Broadcast Server user manual '& both cases or #$ -ou are us#&. 5pe&Caster w#thout D!B hardware -ou ca& also alwa-s output over '+ &etwork#&. w#th tsudpsend' a tool $or broadcast#&. us#&. mult#cast, to ma&a.e th#s -ou ca& tr-:
ts+dpsend samp8e$ts ##,$0$!$# !#3,' !3#9!000
he $#rst problem we $ace #s that sample.ts #s too short a&d -ou wo&?t have e&ou.h t#me to tu&e a&d search the serv#ce o& the set top bo% so let?s #&troduce a tool: tsloop
h#s tool w#ll put the tra&sport stream $#le o& loop .e&erat#&. a &ew Me&dlessM stream where the or#.#&al $#le sample.ts #s repeated. sloop #s a ver- s#mple tool a&d w#ll 7ust $#% the co&t#&u#t- cou&ter at tra&sport level so there #s &ot a tra&sport error. h#s #s per$ect $or broadcast#&. data but &ot aud#o a&d v#deo because at the e&d o$ the stream the =clock> o$ aud#o a&d v#deo w#ll .o back #& t#me: olera&t decoders w#ll detect a t#me skew o& the stream clock a&d correct the#r #&ter&al clock so -ou wo&?t see a&- .l#tch. 1/ http://www.avalpa.com
Avalpa Broadcast Server user manual Ma&- decoders, however, w#ll have problems w#th such a s#mple set1up because the- are e%pect#&. a pro.ress#ve v#deo a&d aud#o t#me l#&e a&d a correct bu$$er ma&a.eme&t alwa-s pro.ress#ve a&d $orward1look#&., we w#ll address all these #ssues later o&, $or &ow to keep $#rst steps eas- rem#&d that ever- 6 seco&ds there could be some arte$acts due to the #mproper loop a&d to the modest decoder recover- sk#lls. !)C vers#o&s a$ter E.6./ are reported to do&?t work a&- more w#th the tutor#al $#les sample.ts a&d $#rstv#deo.ts because o$ these reaso&s re.ard#&. poor clock ma&a.eme&t so eve& #$ !)C works correctl- w#th a real set1up o$ 5pe&Caster where clock #s properlstamped #t w#ll $a#l to show the tutor#als u&t#l clock ma&a.eme&t #s put #& place. 2Check Demo&strat#o& chapter $or a tra&sport stream that pla-s correctl- o& !)C $or a lo&.er t#me4 5& the other Mpla-er #s able to correctl- ma&a.e the clock #ssue:
mp8a)er -nocache -noid* +dp4//##,$0$!$#4!#3,
Be$ore us#&. tsloop tool we &eed to #&troduce a& #mporta&t co&cept #& 5pe&Caster operat#o&s: the =$#$o> 2="#rst '& "#rst 5ut>4 $#$o co&&ect#o&s are the wa- 5pe&Caster tools pass , packets to each other, the packets are usuall- pulled out $rom the $#$o but later o& we w#ll see more comple% set1ups where pull a&d push l#ve to.ether. he $ollow#&. comma&d creates a $#$o:
mkfifo m)firstfifo$ts
a$ter -ou ca& e%ecute tsloop a&d the pla- comma&d to.ether:
ts8oop samp8e$ts A m)firstfifo$ts B tsrfsend m)firstfifo$ts -mt O=>? -mC @A?!% -m/ !/, -mc #/3 -mf '9&
he ?N? at the e&d o$ tsloop comma&d #s &ecessar- to put the process #& back.rou&d . he tsloop comma&d w#ll wa#t or the seco&d comma&d to MpullM the data out o$ the myfirstfifo+ts. @ou w#ll be able to rece#ve the stream w#th a dvb1t decoder tu&#&. to ;D6 M<*, the $ollow#&. p#ctures show the procedure step b- step. ,et top bo% ma&ual sca& me&O reports a s#.&al #s locked: the sca& $#&ds 1 serv#ce: Avalpa @
1;
http://www.avalpa.com
Check the modulat#o& parameters that the decoder #s us#&. actuall- match the o&e $rom the comma&d l#&e, the s#.&al status stre&.th #s also h#.h.
1C
http://www.avalpa.com
Avalpa Broadcast Server user manual let?s check the serv#ce Avalpa 1:
-ou w#ll probabl- &ot#ce a lot o$ arte$acts a&d the colour bars wo&?t tur& smoothl- over Avalpa lo.o, let?s check what?s happe&#&. w#th some a&al-ser tool.
1D
http://www.avalpa.com
Fe w#ll show, as e%ample, some scree&shots $rom ,treamPpert a&al-*er b- Dektec, here the- come:
16
http://www.avalpa.com
someth#&. seems wro&. w#th the +C3, that?s the t#m#&. #&$ormat#o& o$ the tra&sport stream, there are two reaso&s $or th#s:
we &eed to properl- ma&a.e the loop o$ the v#deo to avo#d the embedded t#me #&$o to .o backward #& t#me sample.ts was a result o$ a mult#ple%#&. w#thout +C3 correct#o&,
both problems ca& be addressed us#&. =tsstamp> a&d a&other $#$o co&&ect#o&, so here we .o:
mkfifo m)secondfifo$ts ts8oop samp8e$ts A m)firstfifo$ts B tsstamp m)firstfifo$ts !3#9!000 A m)secondfifo$ts B tsrfsend m)firstfifo$ts -mt O=>? -mC @A?!% -m/ !/, -mc #/3 -mf '9&
As -ou ca& see +C3 #s better &ow a&d a& error ca& occur at ma%#mum at the e&d o$ the loop, some red l#.hts about 0lectro&#c +ro.ram Gu#de are reported, however ma&decoder w#ll st#ll have problem to decode th#s stream a$ter the $#rst loop, because a tra&sport stream &eeds to respect &ot o&l- tra&sport co&stra#&ts but also ma&- co&stra#&ts at eleme&tar- stream level o& how the e&d a&d the start o$ the streams actuall- cha#& to.ether. h#s k#&d o$ co&stra#&ts are related to the #&&er eleme&tar- streams themselves a&d are &ot show& #& th#s a&al-ser that #s $ocused o& the tra&sport stream level. Fe w#ll 1A http://www.avalpa.com
Avalpa Broadcast Server user manual address them later o&. As we wa&t to .#ve awa- tutor#al e%amples $or 5pe&Caster w#thout hu.e v#deo $#le dow&loads we have prepared some >loop#able? transport streams for the next chapters but don=t for"et that usually a transport stream is not seamless loop#able on any decoder without some more processin" of its elementary streams' advanced chapters will show how to deal with this issue+ +ress#&. the #&$o butto& o& the decoder we $#.ure out what were the last compla#&s o$ the a&al-ser tool:
the 0lectro&#c +ro.ram Gu#de #&$o are m#ss#&. a&d t#me #&$ormat#o& looks oddH Fe w#ll $#% them later, #& the mea& t#me &ot#ce that the decoder #s so smart to rem#&d us o$ aud#o a&d v#deo +'Ds, the- w#ll come ha&d- soo&...
2E
http://www.avalpa.com
K.B. -ou &eed to stop tscbrmu%er w#th a s#.&al 2C 3)1C4 or #t w#ll .o o& $#ll#&. -our hard d#sk, that?s because #&put $#les are looped a&d mu%ed.ts #s &ot a $#$o. he result#&. mu%ed.ts w#ll have a total b#t rate sum up o$ the the b#t rate o$ all the ts #&put $#les that #s: 2/ACA1C b#t per seco&d. he b#t rate o$ the v#deo stream a&d o$ the aud#o stream comes $rom the e&coder sett#&.s, so $or &ow 7ust take them as reported, $or the other b#t rates w#ll #&troduce some co&cepts here. B#t rates are ver- #mporta&t, M+0G &etworks are usuall- co&sta&t b#t rate so -ou w#ll o$te& &eed to output $#les at the correct b#t rate or -ou w#ll have a cou&tless &umber o$ s#de e$$ects. <ow do we k&ow the b#t rate o$ the s#.&all#&. streamsG M+0G, D!B a&d all the others sta&dards spec#$- the b#t rates, -ou 7ust &eed to pa- atte&t#o& to a deta#l: +,' b#t rates are e%pressed as sect#o& per seco&d, $or e%ample a +A has to be broadcasted ever- ;EE ms, but a +A , as all the other sect#o&s, ca& be 1 ts packet up to 23 ts packets depe&d#&. o& #ts co&te&t, so b#t rate &eeds to be cha&.ed accord#&. to the sect#o&s s#*e. ,et the b#t rate to the ma%#mum allowed #s &ot a w#se cho#ce because AAQ o$ the s#.&al tables are usuall- 1 or 2 packets, so #t would result #& a b#. waste o$ ba&dw#th. +la& care$ull- -our b#t1rates whe& start#&. the mu%#&. so -ou wo&?t &eed to stop #t later o&, b#t1rates ca&?t be cha&.ed w#thout arte$acts a&d $or the decoders the best wa- to do th#s #s stop all the mu%#&. a&d restart. here #s st#ll a&other po#&t to $ace be$ore -ou ca& broadcast the mult#ple%ed .ts, the b#t rate o$ the result#&. mu%ed.ts #s &ot a b#t1rate that matches a D!B modulat#o& scheme. <ow ca& we $#% thatG 21 http://www.avalpa.com
Avalpa Broadcast Server user manual A& opt#o& #s to 7ust make some data stream $aster or to #&crease the v#deo b#t rate but there #s also a&other cho#ce: add a MKL)) +'DM $#ll#&. stream.
tsc2rm+*er 24#300000 first-ideo$ts 24!&&000 firsta+dio$ts 24300& firstpat$ts 24300& firstpmt$ts 24!'00 firstsdt$ts 24!,00 firstnit$ts 24!099,0&, n+88$ts A samp8e$ts
A &ull stream #s a stream made o$ empt- packets 2E%""4 w#th $#%ed +'D 61A1, to .et the re8u#red b#t rate -ou &eed to add a &ull.ts to the mult#ple%#&. w#th the m#ss#&. b#t rate to reach the re8u#red o&e. '& the e%ample there #s a mass#ve #&sert#o& o$ &ull packets, more tha& 1EMbps but th#s #s 7ust a& e%ampleH Kot#ced that also sample.ts $rom the $#rst tutor#al was .e&erated #& the same wa-, 7ust to make th#&. eas#er to start. o output the $#&al result use tscbrmu%er #&stead o$ tsloop $rom the prev#ouse e%ample:
mkfifo m)firstfifo$ts mkfifo m)secondfifo$ts tsc2rm+*er 24#300000 first-ideo$ts 24!&&000 firsta+dio$ts 24300& firstpat$ts 24300& firstpmt$ts 24!'00 firstsdt$ts 24!,00 firstnit$ts 24!099,0&, n+88$tsA m)firstfifo$ts B tsstamp m)firstfifo$ts !3#9!000 A m)secondfifo$ts B tsrfsend m)secondfifo$ts -mt O=>? -mC @A?!% -m/ !/, -mc #/3 -mf '9&
5& the other ha&d #$ -ou are .o#&. to broadcast a , over a& LD+ &etwork, where there are &o $#%ed b#t rates, -ou w#ll be better to avo#d se&d#&. Co&stat B#t 3ate &ull packets so the $#&al batch w#ll be:
mkfifo m)firstfifo$ts mkfifo m)secondfifo$ts tsc2rm+*er 24#300000 first-ideo$ts 24!&&000 firsta+dio$ts 24300& firstpat$ts 24300& firstpmt$ts 24!'00 firstsdt$ts 24!,00 firstnit$ts A m)firstfifo$ts B tsstamp m)firstfifo$ts #,"%"!% A m)secondfifo$ts B ts+dpsend m)secondfifo$ts ##,$0$!$# 900! #,"%"!%
Kow -ou could tr- to tu&e th#s pro.ram o& the decoder as $or the sample.ts the outcome should be the same aud#o/v#deo. '$ -ou are broadcast#&. o& a& '+ &etwork, a&- moder& pc w#th !)C w#ll be able to d#spla- the stream w#th a& #&put l#ke: udp://:22/.E.1.2:DEE1 , most o$ the '+ ! set top bo% should also eas#l- ma&a.e #t. '$ -ou wa&t to record -our output -ou ca& use the tool tsdoubleoutput:
mkfifo m)firstfifo$ts mkfifo m)secondfifo$ts mkfifo m)thirdfifo$ts to+ch o+tp+tcop)$ts tsc2rm+*er 24#300000 first-ideo$ts 24!&&000 firsta+dio$ts 24300& firstpat$ts 24300& firstpmt$ts 24!'00 firstsdt$ts 24!,00 firstnit$ts A m)firstfifo$ts B tsstamp m)firstfifo$ts #,"%"!% A m)secondfifo$ts B tsdo+28eo+tp+t m)secondfifo$ts o+tp+tcop)$ts A m)thirdfifo$ts B ts+dpsend m)thirdfifo$ts ##,$0$!$# 900! #,"%"!%
+a- atte&t#o& outputcop-.ts $#le w#ll .row& a&d $#ll -our hard d#skH <owever we w#ll see that -ou o$te& wa&t to check -our output whe& -ou are tr-#&. &ew set1 ups so #t #s ver- use$ul. 22 http://www.avalpa.com
sdt.sec #s the sect#o& o$ the sdt, 1D #s the well k&ow& p#d &umber $or the sdt stream. o .e&erate the sdt.sec we &eed to use a d#$$ere&t la&.ua.e called p-tho&, have a look at $#rstsdt.p-, here #s reported the ma#& part:
D$$$E Fer-ice >escription Ta28e 0<TFI <N 300 ,%& '$#$31 sdt 7 ser-ice5description5section0 transport5stream5id 7 !: 8 %e'o val#e- an o i$ial val#e sho#l% be %e'an%e% to %vb org ori(ina85network5id 7 !: 8 %e'o val#e- an o i$ial val#e sho#l% be %e'an%e% to %vb org ser-ice58oop 7 D ser-ice58oop5item0 ser-ice5I> 7 !: 8 %e'o val#e <IT5sched+8e5f8a( 7 0: 8 0 no $#rrent even in or'ation is broa%$aste%- 1 broa%$aste% <IT5present5fo88owin(5f8a( 7 0: 8 0 no ne9t event in or'ation is broa%$aste%- 1 yes r+nnin(5stat+s 7 ,: 8 : servi$e is r#nning- 1 not r#nning- 2 starts in a e! se$on%s-7 pa#se free5CA5mode 7 0: 8 0 'eans servi$e is not s$ra'ble%- 1 'eans at least a strea' is s$ra'ble% ser-ice5descriptor58oop 7 D ser-ice5descriptor0 ser-ice5t)pe 7 !: 8 %igital television servi$e ser-ice5pro-ider5name 7 GA-a8paG: ser-ice5name 7 GA-a8pa !G: 1: E: 1: E: 1
a&d w#ll .e&erate sdt.sec. @ou ca& ed#t $#rstsdt.p- to cha&.e the serviceBname value a&d the& e%ecute #t a.a#& to .e&erate the &ew sdt.sec.
mc -e firstsdt$p)
A$ter -ou located a&d cha&.ed the serv#ce &ame, save the $#le 2"24 e%#t 2"1E4 a&d e&ter the $ollow#&. comma&d:
$/firstsdt$p)
23
http://www.avalpa.com
Avalpa Broadcast Server user manual th#s comma&d w#ll .e&erate a &ew $#rstsdt.sec, wh#le:
sec#ts !9 C firstsdt$sec A firstsdt$ts
w#ll .e&erate a &ew $#rstsdt.ts Fhat w#ll happe& to the old o&eG #$ -ou the old $#rstsdt.ts was be#&. mult#ple%ed the tscbrmu%er w#ll .et the &ew $#rstsdt.ts as soo& as the prev#ous o&e was se&t $or the last t#me. ,o .et back to MMult#ple%#&. a ,#&.le +ro.ram ra&sport ,treamM set up, replace $#rstsdt.ts wh#le the processes are ru&&#&. a&d resca& the serv#ce o& the bo%. As -ou have probabl- &ot#ced $#rstsdt.p- has a comple% structure, that?s because #t maps 1:1 the or#.#&al spec#$#cat#o&s a&d allows to use all o$ #ts s#.&all#&.. '$ -ou look at M',5/'0C 1361611M a&d M0K 3EE /C6M -ou w#ll $#&d the descr#pt#o& o$ evers#&.le table a&d $#eld, 5pe&Caster #mpleme&ts the most #mporta&t o$ them. <ave a look at $#rstco&$#..p- $or a complete e%ample o$ s#.&all#&., a s#&.le p-tho& scr#pt descr#bes all o$ the s#.&all#&. tables -ou are us#&., -ou ca& spl#t #t #& more $#les but a s#&.le $#le #s probabl- eas#er to ed#t u&t#l -ou do&?t &eed to ma&a.e a ver- comple% setup . ake -our t#me to u&dersta&d #t properl- a&d compare #t w#th the spec#$#cat#o&s o$ the s#&.le tables.
D$$$E 8 8 Share% val#es 8 a-a8pa5transport5stream5id 7 ! 8 %e'o val#e- an o i$ial val#e sho#l% be %e'an%e% to %vb org a-a8pa5ori(ina85transport5stream5id 7 ! 8 %e'o val#e- an o i$ial val#e sho#l% be %e'an%e% to %vb org a-a8pa!5ser-ice5id 7 ! 8 %e'o val#e a-a8pa!5pmt5pid 7 !03! 8 8 )et!or6 2n or'ation .able 8 this is a basi$ )2. !ith the 'ini'#' %es$iptors- 4penCaster has a big library rea%y to #se 8 nit 7 network5information5section0 network5id 7 !: network5descriptor58oop 7 D network5descriptor0network5name 7 GA-a8paG:1: E: transport5stream58oop 7 D transport5stream58oop5item0 transport5stream5id 7 a-a8pa5transport5stream5id: ori(ina85network5id 7 a-a8pa5ori(ina85transport5stream5id: transport5descriptor58oop 7 D ser-ice58ist5descriptor0 d-25ser-ice5descriptor58oop 7 D ser-ice5descriptor58oop5item0 ser-ice5I> 7 a-a8pa!5ser-ice5id: ser-ice5t)pe 7 !: 8 %igital tv servi$e type 1: E: 1: E: 1: E: -ersion5n+m2er 7 !: 8 yo# nee% to $hange the table n#'ber every ti'e yo# e%it- so the %e$o%er
2/
http://www.avalpa.com
2;
http://www.avalpa.com
E: -ersion5n+m2er 7 !: 8 yo# nee% to $hange the table n#'ber every ti'e yo# e%it- so the %e$o%er !ill $o'pare its version !ith the ne! one an% #p%ate the table section5n+m2er 7 0: 8ast5section5n+m2er 7 0: 1 D$$$E
$#rstco&$#..p- e&ds w#th s-stem comma&ds #&vok#&. sec2ts so the- d#rectl- .e&erates .ts $#les w#thout the &eed to e%ecute ma&uall- sec2ts so e%ecute them to .e&erate the ps# .ts $#les.
2C
http://www.avalpa.com
(ool dv%snoop
Istart1hereJ dvbs&oop http://dvbs&oop.source$or.e.&et/ #s a ver- use$ul so$tware to a&al-se tra&sport stream, a&d #t #s prov#ded #& Avalpa Broadcast ,erver. @ou ca& use #t to check most the s#.&all#&. #& D!B &etworks a&d also Avalpa Broadcast ,erver ow& output. o parse +A $rom a tra&sport stream $#le:
d-2snoop -tsraw -s ts -tss+2decode -if samp8e$ts -N # 0
2D
http://www.avalpa.com
Fhere /EEEEEE #s -our #&#t#al .uess o$ the b#t rate, the tool &eeds a .uess because #t w#ll compare the #&put .uess value w#th the real b#t rate .#v#&. #&$ormat#o& about the d#$$ere&ces. A$ter the $#rst e%ecut#o& -ou ca& tr- a.a#& w#th the values su..ested b- the tool. Lsuall- -ou should 7ust ver#$- that M#&sta&t b#t rate pr#&tsM are 8u#te co&sta&t that mea&s the tra&sport stream #s &ot corrupted a&d ca& be processed. ,omet#mes b#t rate #s &ot co&sta&t because &ull packets have bee& removed $or stora.e purpose, #& th#s case &ull p#ds &eed to be re#&serted be$ore use. "or a better u&dersta&d#&. o$ +C3 have a look at ektro&#%?s MA )a-ma&?s Gu#de to +C3 Measureme&tsM A t-p#cal pr#&t o$ tspcrmeasure #s:
pid #0%,: new pcr is %!,&0'"!#: pcr de8ta is %9%#"0: 0#'$0,999& ms1: indices de8ta is ,!',& 2)tes: 0 #'$'%&000 ms1: pcr acc+rac) is -0$000'#0####: instant ts 2it rate is !3#%""""$''%,033!&,
he $#rst value #s the p#d &umber o$ the pcr/v#deo stream. he seco&d value #s the pcr value #tsel$. he th#rd value #s the pcr d#$$ere&ce $rom the prev#ous pcr value a&d #& brackets there #s the t#me passed cou&t#&. the pcr t#cks. he $ourth value #s the d#$$ere&ce #& b-tes $rom the pcr pos#t#o& #&to the $#le a&d #& brackets there #s the t#me passed w#th the .uessed b#trate o& #&put. he $#$th value #s the accurac- o$ the pred#cted pcr. he last value #s the actual b#t rate measure betwee& pcr t#cks a&d ts b-tes. '$ the tra&sport stream br#&.s +C3 #&$ormat#o& the tool w#ll be able to do the computat#o&s otherw#se the b#t rate #&$ormat#o& &eed to be k&ow& out1o$1ba&d.
26
http://www.avalpa.com
h#s comma&d w#ll start a process wa#t#&. $or a& #&com#&. co&&ect#o& o& port DEE1 that ca& be made $rom a&other pc:
tstcpsend samp8e$ts !"#$!%&$!$# 900! 3000000
Fhere the parameters are the tra&sport stream to se&d, the dest#&at#o& #p address a&d port a&d the b#t rate o$ the tra&s$er. he $#rst th#&. to keep #& m#&d #s that the bit rate is the transport stream bit rate and not the ip packets bit rate . As $ar as there #s e&ou.h ba&dw#dth the $#le w#ll be tra&s$erred a&d due to the C+ propert#es we wo&?t m#ss a&- packet. A&other opt#o& #s to use U $ packets instead of T*$ but this implies that same packet could be lost or repeated so there #s &o .uara&tee that a tra&sport stream rece#ved $rom a& LD+ stream #s .o#&. to be error1$ree a&d so #t?s a r#sk to use LD+ as a =co&tr#but#o& l#&k> betwee& 5pe&Caster tools w#thout #mpleme&t#&. some recoverstrate.-. The main reason to send a transport stream over U $ is to enable multicast $or e&d user d#str#but#o&9 the decoder rece#v#&. the stream w#ll #mpleme&t the &ecessaral.or#thms o$ error1co&cealme&t to ma&a.e packet loss wh#le decod#&. the stream #& the same wa- #t recovers $rom broadcast errors $or weak s#.&al co&d#t#o&s. :hy not %T$C Ma-be we w#ll support 3 + #& the $uture, $or &ow #t #s &ot ava#lable. 5& some sce&ar#os ca& make se&se to pa- $or more memor- #& the rece#ver tha& pa- $or &etwork ba&dw#dth so to reduce &etwork usa.e KL)) packets are removed $rom the tra&sport streams a&d th#s ca& lead to m#.rate a Co&sta&t B#t 3ate tra&sport stream #&to a !ar#able B#t 3ate tra&sport stream. h#s happe&s #$ KL)) packets are &ot u&#$orm #&serted as show& #& the chapter: =Mult#ple%#&. a ,#&.le +ro.ram ra&sport ,tream>. '&stead o$ KL)) packets a t#me stamp #s added at se&d#&. t#me a&d KL)) packets are re1 .e&erated b- the rece#ver wh#le a&al-*#&. 3 + packets #& the add#t#o&al memor- bu$$er. 5pe&Caster t#p#cal usa.e sce&ar#os are local &etworks a&d/or D!B heade&ds so we are more co&cer& about keep 7#tter a&d late&c- lower as poss#ble tha& &etwork cost, that?s wh$or &ow we str#ctl- supports LD+ o&l-. 2A http://www.avalpa.com
3E
http://www.avalpa.com
o add 0+G to -our set up -ou w#ll &eed to add the $#rste#t.ts to -our mu%#&. a&d #t would be w#se also to s#.&al a t#me #&$o. hat?s what tstdt tool #s $or. tstdt #s a tool that set the t#me o$ the serv#ce, th#s #s 7ust a h#&t $or the decoders user clock a&d does&?t a$$ect a&- low level bu$$er s-&chro&#*at#o& #ssue, the t#me #s read $rom the pc clock. he usa.e #s ver- s#mple:
tstdt inp+ts$ts A o+tp+t$ts
he #&put ts &eeds to alread- have stub tdt packets #&serted at mult#ple%#&. t#me so the tool w#ll replace them w#th packets at the curre&t t#me. +a- atte&t#o& that #$ -ou are process#&. the tra&sport stream $aster tha& real1 t#me '.e. w#th a rate h#.her the& the ow& b#t rate -ou are .o#&. to wr#te #&to the hard d#sk a tdt t#me #&$ormat#o& 8u#te mea&#&.less.
mkfifo fifom+*ed$ts mkfifo fifotdt$ts mkfifo fifotsstamp$ts tsc2rm+*er 24#300000 first-ideo$ts 24!&&000 firsta+dio$ts 24300& firstpat$ts 24300& firstpmt$ts 24!'00 firstsdt$ts 24!,00 firstnit$ts 24#000 firsteit$ts 24#000 firsttdt$ts 24!09900&, n+88$ts A fifom+*ed$ts B tstdt fifom+*ed$ts A fifotdt$ts B tsstamp fifotdt$ts !3#9!000 A fifotsstamp$ts B tsrfsend fifotsstamp$ts -mt O=>? -mC @A?!% -m/ !/, -mc #/3 -mf '9&
31
http://www.avalpa.com
32
http://www.avalpa.com
All .ree& l#.htsH h#s #s as we l#ke #t most, as -ou ca& see there are &o more errors because the last red l#.hts were about m#ss#&. 0' a&d D , tables.
33
http://www.avalpa.com
(eletext support
It%tJ h#s tutor#al descr#bes support $or d#.#tal telete%t .e&erat#o& a&d mult#ple%#&.. o descr#be how does telete%t works a&d #ts packets la-out #s out o$ th#s docume&t but we w#ll address how telete%t packets are e&capsulated #&to tra&sport stream. 5&ce a rece#ver decoded the packets has two cho#ces &ot e%clus#ve: modulate the telete%t s#.&al #&to a& a&alo. v#deo output a&d/or re&der the telete%t as o& scree& .raph#cs, however whe& the v#deo output #s <DM', the o&l- wa- to support telete%t $or the decoder #s o& scree& .raph#cs because up to &ow <DM' #s &ot support#&. #& ba&d telete%t. elete%t packets are .e&erated b- p-tho&s scr#pts prese&ted later, let?s suppose we have some telete%t packets stored #& o&e $#le, we w#ll prese&t two ut#l#t#es that take care o$ the $orthcom#&. process: t%t2pes a&d pesdata2ts:
t*t#pes pa(es$t*t !' 3%00 !&00 A t*tpa(e$pes B
%t2pes w#ll .e&erate +0, packets $rom P packets, the $#rst parameter 1; #s how ma&P packets should be #&serted #& a s#&.le +0, packet. h#s #&$ormat#o& #s related to the +0, packet t#me #&$ormat#o& a&d also b#t rate. elete%t has ma%#mum &umber o$ packet per $rame that #s actuall- spl#t #& hal$t per $#eld. 3CEE #s the &umber o$ + , clocks $or the $#rst +0, packet wh#le 16EE #s the #&creme&t o$ the + , clock ever- +0, packet, 16EE #s actuall- ;E +0, packet per seco&d, so the result #s the comma&d l#&e states that ever- 1; P packet a &ew +0, packet w#ll be .e&erated a&d ever- +0, packet matches a v#deo $#eld.
pesdata#ts t*tpa(e$pes !"9& A t*t$ts B
+esdata2ts, the seco&d tool we are us#&., w#ll 7ust e&capsulate +0, packets #& , packet w#th the .#ve& +'D, #& th#s case #s 1AD6. o k&ow the b#t rate $or the telete%t tra&sport stream math #s eas-, a$ter start#&. to e%ecute t%t2pes #t w#ll report about +0, packet s#*e, $or e%ample: =pes packet s#*e w#thout C b-te header #s 11// > th#s mea&s: 11// R C S 11;E b-tes per packet 11;E / 16/ 2 , packet pa-load4 S D , packet ever- +0, packet D T 166 T 6 1U 1E;26 per +0, #$ +0, .oes at 3CEE mea&s: 1E;26 T 2AEEEE / 3CEE4 1U 2C32EE bps "or the prev#ous e%ample we have: D3E R C 1U D3C / 16/ 1U / T 166 T 6 1U CE1C T 2AEEEE / 16EE4 1U 3EE6EE bps ,o the $#&al processes la-out assum#&. the telete%t packets are alread- .e&erated a&d 3/ http://www.avalpa.com
Avalpa Broadcast Server user manual stored #& pa.es.t%t $#le #s:
t*t#pes pa(es$t*t !' 3%00 !&00 A t*tpa(e$pes B pesdata#ts t*tpa(e$pes !"9& A t*t$ts B tsc2rm+*er 24#300000 first-ideo$ts 24!&&000 firsta+dio$ts 24#&00& pat$ts 24#&00& t*tpmt$ts 24#%'00 sdt$ts 24!,00 nit$ts 24300&00 t*t$ts 24!03"&#&, n+88$ts A m+*ed$ts B tsstamp m+*ed$ts !3#9!000 A stamped$ts B tsrfsend stamped$ts -mt O=>? -mC @A?!% -m/ !/, -mc #/3 -mf '9&
he tutor#al #s tra&sm#tt#&. / pa.es: 1EE, 2E2, 3E2 a&d /E/ +a.e 1EE has also $ast l#&k $or the others pa.es co&&ected to colour ke-s. he $#&al look #s:
About the telete%t packet .e&erat#o& #t ca& be do&e w#th p-tho& l#brar#es but re8u#res k&owled.e o$ the telete%t #tsel$. Bas#c #&$ormat#o& #s prese&ted here a&d w#ll allow -ou to properl- d#spla- te%t o&l- pa.es.
3;
http://www.avalpa.com
3C
http://www.avalpa.com
Avalpa Broadcast Server user manual 0ver- pa.es #s made o$ telete%t packets, each packet #s a& u&#t. header l#&e packets a&d looks l#ke th#s:
<JUTe8ete*t0 data5+nit5id 7 0*0#: fie8d5parit) 7 0!: 8ine5offset 7 0*9:
0*0# non-s+2tit8e: 0*03 s+2tit8es: 0*== which fie8d odd or e-enK this is the first +sef+8 ana8o( 8ine to insert
1:
ma(aLine 7 0*0,: here we descri2e pa(e ,0, row 7 0*00: #, 00*!91 8ines per ma(aLine: 0 is the pa(e header pa(e 7 0*0,: s+2pa(e 7 0*0000: erase5pa(e 7 0: no specia8 re6+est for this pa(e newsf8ash 7 0: s+2tit8e 7 0: s+ppress5header 7 0: +pdate5indicator 7 !: interr+pted5se6+ence 7 0: inhi2it5disp8a) 7 0: ma(aLine5seria8 7 !: co+ntr)5code 7 0*03: chars 7 G A-a8pa-TMT !0 0, #00" !' 00G the header itse8f
+ackets belo&.#&. the the pa.e w#ll report o&l- the ma.a*#&e &umber /, so th#s ca& lead to wro&. pa.es #s some pes packets are lost, a&-wa- a t-p#cal telete%t te%t l#&e looks l#ke:
<JUTe8ete*t0 data5+nit5id 7 0*0#: fie8d5parit) 7 0!: 8ine5offset 7 0*&: ma(aLine 7 0*0,: row 7 0*0!: the first te8ete*t pa(e row 8ine: N+st after the header chars 7 G A5,0,5! G O G A5,0,5! G : 1:
3D
http://www.avalpa.com
!B#SSU
IssuJ he tutor#al shows how to set1up a D!B1,,L update w#th 5pe&Caster. Ma&- parameters re.ard#&. the cl#e&t co&$#.urat#o& are &eeded to be #&serted so #t?s &ot e%pected to work out o$ the bo% $or a&- decoder, #t?s 7ust a skeleto& use$ul $or real use cases. Co&tact #&$o:avalpa.com $or more deta#ls. o s#.&al D!B1,,L -ou &eed to add a l#&ka.e descr#ptor to K' , have a look to ssu#data# "eneration+py
nit 7 network5information5section0 network5id 7 !: network5descriptor58oop 7 D network5descriptor0network5name 7 GA-a8paG:1: 8inka(e5descriptor0 transport5stream5id 7 a-a8pa5transport5stream5id: ori(ina85network5id 7 a-a8pa5ori(ina85transport5stream5id: ser-ice5id 7 !: 8inka(e5t)pe 7 0*0": OUI58oop 7 D OUI5data 0 OUI 7 0*!'A: an) OUI se8ector52)tes 7 GG: 1 E: pri-ate5data52)tes 7 GG: 1: E:
36
http://www.avalpa.com
E:
"or us#&. more adva&ced D!B1,,L -ou w#ll also &eed a&other descr#ptor #& the pmt re.ard#&. a &ew table, the LK :
pmt 7 pro(ram5map5section0 pro(ram5n+m2er 7 a-a8pa!5ser-ice5id: .CR5.I> 7 &!"!: pro(ram5info5descriptor58oop 7 DE: stream58oop 7 D stream58oop5item0 stream5t)pe 7 !!: data stream t)pe e8ementar)5.I> 7 a-a8pa!5+nt5pid: e8ement5info5descriptor58oop 7 D data52roadcast5id5descriptor0 data52roadcast5I> 7 0*000A: >HJ-FFU OUI5info58oop 7 D OUI5info58oop5item 0 OUI 7 an)OUI: +pdate5t)pe 7 0*0#: with 2roadcasted UNT: 0*0! witho+t UNT4 it re6+ires a stream5identifier5descriptor +pdate5-ersionin(5f8a( 7 0: no -ersion chan(e +pdate5-ersion 7 !: increment this at +pdate chan(e se8ector52)tes 7 GG: 1: E: pri-ate5data52)tes 7 GG: 1: E 1: stream58oop5item0 stream5t)pe 7 !!: data stream t)pe e8ementar)5.I> 7 a-a8pa!5dsmcc5pid: e8ement5info5descriptor58oop 7 D stream5identifier5descriptor0 component5ta( 7 dsmccJ5association5ta(: 1: E 1 E:
D!B1,,L carousel #s s#mpler tha& #&teract#ve appl#cat#o&s a&d 7ust re8u#res each $#le to be tra&sm#tted to be spec#$#ed as a =module>, the last part o$ ssu#data#"eneration+py co&$#.urat#o& $#le shows how to spec#$- them, $or a complete descr#pt#o& o$ values check: 0 ,' , 1E2 EEC
>F?CC description (! 7 /ro+p0 .ATH7G>II-!$secG: transactionId 7 0*&000000#: down8oadId 7 0*0000000!: 28ockFiLe 7 ,0%%:
3A
http://www.avalpa.com
"#&all- a scr#pt w#ll take care o$ co&vert all the .e&erated sect#o&s to a tra&sport stream $#le:
$/ss+-+pdate$sh datacaro+se8 #003 0
he scr#pt $#le .ets the sect#o&s .e&erated b- ssu#data#"eneration+py a co&verts them to tra&sport stream us#&. sec2ts he last part #s the usual mult#ple%#&. carr#ed out w#th these comma&ds:
tsc2rm+*er 24#300000 first-ideo$ts 24!&&000 firsta+dio$ts 24300& firstpat$ts 24300& firstpmt$ts 24!'00 firstsdt$ts 24!,00 firstnit$ts 24!000000 datacaro+se8$ts 24"99,0&! n+88$ts A fifom+*ed$ts B tstdt fifom+*ed$ts A fifotimed$ts B tspcrstamp fifotimed$ts !3#9!000 A fifostamped$ts B tsrfsend stamped$ts -mt O=>? -mC @A?!% -m/ !/, -mc #/3 -mf '!, B
/E
http://www.avalpa.com
"nteractive (, support
'&teract#ve telev#s#o& sta&dards usuall- re8u#res a data cast#&. more comple% tha& dvb1ssu so #&stead to descr#be modules o&e b- o&e as show& #& ssu1data1.e&erat#o&.p- $ollowed b- ssu1update.sh a& automat#c tool w#ll take care o$ all the process#&.:
Tool oc#update+sh
Lsa.e:
oc-+pdate$sh o2Nect5caro+se85director) association5ta( mod+8e5-ersion dsmcc5pid caro+se85id Dcompress5modeE Dpaddin(5onE Dc8ean5offE D>>J5siLeE D+pdate5f8a(E Dmo+nt5fre6+enc)E - caro+se85director)4 the director) to marsha8 in an o2Nect caro+se8 - association5ta( aka common ta(: referenced 2) .?Ts and AITs: e-er) caro+se8 has one - mod+8es5-ersion: a88 the mod+8es wi88 ha-e the same -ersion: )o+ need to chan(e this to notif) to the 2o* fi8es are chan(ed: (oes from 0 to !' - pid: referenced 2) .?Ts +sin( this caro+se8 - caro+se85id: referenced 2) .?Ts +sin( this caro+se8: e-er) caro+se8 has its own: it is an a8ternati-e for association5ta(: the) ha-e the same f+nction - compress5mode: 04 donRt compress: !4compress a88: #4smart compress: fi8e with $so8o e*tension are set in an +ncompressed mod+8e a8one to a88ow +se cases 8ike 6+ick ima(e fi8e +pdate: defa+8t is # - paddin(5on: e-er) section is padded: was +sef+8 with some 2+(() decoder: waste 2andwith: defa+8t off: +ns+pported since OpenCaster #$,$& - c8ean5off: donRt de8ete temp fi8e: defa+8t off: +sed for de2+( - >>J5siLe: Use c+stom siLe for >>J pa)8oad: defa+8t 7 ma* 7 ,0%% - sets the Update f8a( in the TransactionI> of >FI and >II to the -a8+e (i-en 00 or !1 - mo+nt5fre6+enc): set how often insert >II/>FI/F/W to speed +p caro+se8 mo+nt: defa+8t is twice per caro+se8 period
<ere #s a& e%ample, assum#&. ocd#r1 #s the d#rector- -ou wa&t to broadcast:
oc-+pdate$sh ocdir! 0*J 0*' #003 9 ! 0 0 ,0%% 0 #
w#ll .e&erate ocd#r1.ts tha& ca& be mu%ed to all the other tra&sport stream $#les, the parameters passed spec#$#es that:
the carousel d#rector- to marshal #s: ocd#r1 the assoc#at#o&Vta. a&d/or compo&e&tVta. to use $or +M a&d A' #s: E%B 2114 the vers#o& o$ the modules a&d sect#o&s o$ the carousel #s: ; the p#d o$ the stream #s: 2EE3 the #d o$ the carousel to use #& the +M #s: D the carousel w#ll be compressed as much as poss#ble 2#t ca& preve&t update &ot#$o& bu..- decoder4 &o padd#&. delete temp $#les de$ault block s#*e #s /ECC 2ma%#mum4 the update $la. #s set o$$ the head o$ the carousel 2D,'/D''/,GF w#ll be se&t o&ce at carousel start a&d o&ce /1 http://www.avalpa.com
Avalpa Broadcast Server user manual at carousel m#ddle4 3u&&#&. a.a#& the comma&d w#th a d#$$ere&t vers#o& &umber w#ll .e&erate a &ew ocd#r1.ts marshall#&. a.a#& the d#rectoroc-+pdate$sh ocdir! 0*J 0*% #003 9 ! 0 0 ,00% ! #
M0$)M0/G1 si"nallin"
ImhpJ Kow that we have lear&t how to marshal a $#le s-stem, the b#. th#&. #s that #& the $#le s-stem we ca& br#&. to a& #&teract#ve decoder the appl#cat#o&s. Fe &eed to #&sert the Appl#cat#o& '&$ormat#o& able s#.&all#&. #$ we wa&t the #&teract#ve decoders to be aware o$ appl#cat#o&s a&d we also &eed to properl- set up D,MCC re$ere&ces. he complete bas#c work$low at decoder s#de $or rece#v#&. appl#cat#o&s #s: 14 the decoder tu&es the cha&&el 24 the decoder parses the A' s s#.&alled b- the +M 34 the decoder prese&ts to the user the appl#cat#o& l#st .ot $rom the A' s 2#t ca& be &ecessar- to press the MappM butto& o& the remote co&trol4 /4 the user selects a& appl#cat#o& ;4 the decoder loads the D,MCC carousel re$ere&ced b- the appl#cat#o& descr#ptor or co&&ect to the remote http server C4 the decoder e%ecutes the appl#cat#o& ,o let?s have a look at mhpco&$#..p- o& how to act#ve th#s, $#rst o$ all the +M re8u#red re$ere&c#&. o$ A' a&d D,MCC streams looks l#ke th#s:
8 8 +rogra' /ap .able (2S4&2EC 17818-1 2.:.:.8) 8 this is +/. !ith DS/CC an% A2. %es$riptor or /0+ intera$tive appli$ations 8 pmt 7 pro(ram5map5section0 pro(ram5n+m2er 7 a-a8pa!5ser-ice5id: .CR5.I> 7 #0%,: pro(ram5info5descriptor58oop 7 DE: stream58oop 7 D stream58oop5item0 stream5t)pe 7 #: 8 'peg2 vi%eo strea' type e8ementar)5.I> 7 #0%,: e8ement5info5descriptor58oop 7 DE 1: stream58oop5item0 stream5t)pe 7 3: 8 'peg2 a#%io strea' type e8ementar)5.I> 7 #0%&: e8ement5info5descriptor58oop 7 DE 1: stream58oop5item0 stream5t)pe 7 ': 8 A2. strea' type e8ementar)5.I> 7 #00!: e8ement5info5descriptor58oop 7 D app8ication5si(na88in(5descriptor0 app8ication5t)pe 7 !: 8 1 D>1-? appli$ation- 2 D>1-0./L
$or the
/2
http://www.avalpa.com
E 1: stream58oop5item0 stream5t)pe 7 !!: 8 DS/CC strea' type e8ementar)5.I> 7 #003: e8ement5info5descriptor58oop 7 D 8 a n#'ber o %es$riptors spe$i ying DS/CC properites association5ta(5descriptor0 association5ta( 7 0*J: 8 this asso$iation tag i%enti ys the $aro#sel- it is #se% also !hile generating the DS/CC !ith o$-#p%ate.sh an% re eren$e% by the A2. +se 7 0: 8 so'e %e a#lt val#es ollo!- %on@t $hange the' se8ector58en(ht 7 0: 8 ... transaction5id 7 0*&0000000: 8 ... timeo+t 7 0*========: 8 ... pri-ate5data 7 GG: 1: stream5identifier5descriptor0 component5ta( 7 0*J: 8 it is the sa'e as the asso$ation tag- so'e %e$o%ers !ill loo6 or the $o'ponent tag- others or the asso$iation tag- the sa'e val#e sho#l% be #se% 1: caro+se85identifier5descriptor0 caro+se85I> 7 !: 8 $aro#sel i% n#'ber- it@s a %i erent n#'ber ro' asso$iation&$o'ponent tag- b#t it has a si'iliar p#rpo#seA i%enti ying the $aro#sel format5I> 7 0: 8 no enhan$e% boot s#pporte% pri-ate5data 7 GG: 1: data52roadcast5id5descriptor0 data52roadcast5I> 7 #,0: 8 2:0 is the $o%e spe$i ying this is DS/CC-/0+ - 2;2 or 'heg5 I>5se8ector52)tes 7 GG: 8 or 'heg5 yo# nee% sele$tor bytes BC001C001C000C000B1: E 1 E: D$$$E
'& mhpco&$#..p- -ou ca& also $#&d a& A' e%ample that w#ll .e&erate a& $#rsta#t.ts tra&sport stream $#le, let?s have a look at #t:
8 Appli$ation 2n or'aton .able (E.S2 .S 101 812 10.:.;) ait 7 app8ication5information5section0 app8ication5t)pe 7 >HJ5S5app8ication5t)pe: common5descriptor58oop 7 DE: app8ication58oop 7 D 8 here !e list only 1 appli$ation- a%%ing another appli$ation loop ite' !ill signal a se$on% appli$ation in the sa' A2.- yo# $an signal appli$ations in the sa'e A2. or 'ore A2.s app8ication58oop5item0 or(anisation5id 7 !0: 8 this is a %e'o val#e- %vb.org sho#l% assign an #niD#e val#e app8ication5id 7 !00!: 8 sho#l% be #niD#e or every organisation i% in the sa'e progra' app8ication5contro85code 7 #: 8 is +RESE).- the %e$o%er !ill a%% this appli$ation to the #ser $hoi$e o appli$ation- 1 is A*.4S.AR.- the appli$ation !ill start i''e%tiatly to loa% an% to e9e$#te- 7 is DES.R43- it !ill signal to the appli$ation to stop e9e$#ting- is E2LL- it !ill stop e9e$#te the appli$ation app8ication5descriptors58oop 7 D transport5protoco85descriptor0 protoco85id 7 ?H.5OC5protoco85id: 8 the appli$ation is broa%$aste% on /0+-DS/CC transport5protoco858a2e8 7 !: 8 $aro#sel i% remote5connection 7 0: component5ta( 7 0*J: 8 $aro#sel $o''on tag an% asso$iation tag 1: app8ication5descriptor0 app8ication5profi8e 7 0*000!: 8 +ro ile an% /0+ version -ersion5maNor 7 !: -ersion5minor 7 0: -ersion5micro 7 #:
/3
http://www.avalpa.com
Kow e%ecute:
$/mhpconfi($p)
to .e&erate ocd#r1.ts so -ou are read- to mult#ple% -our $#rst ,#&.le +ro.ram ,tream w#th a& #&teract#ve appl#cat#o&:
ra&sport
tsc2rm+*er 24#300000 first-ideo$ts 24!&&000 firsta+dio$ts 24300& firstpat$ts 24300& firstpmt$ts 24!'00 firstsdt$ts 24!,00 firstnit$ts 24!000000 ocdir!$ts 24#000 firstait$ts 24"99#0&, n+88$tsA m)firstfifo$ts B tsstamp m)firstfifo$ts !3#9!000 A m)secondfifo$ts B tsrfsend m)secondfifo$ts -mt O=>? -mC @A?!% -m/ !/, -mc #/3 -mf '9&
//
http://www.avalpa.com
Avalpa Broadcast Server user manual Kow, to test #t, proceed to the decoder tu&#&. a&d select the e%ample appl#cat#o&:
/;
http://www.avalpa.com
0bbTv si"nallin"
IhbbtvJ, Ihbbtv1dsmccJ A& e%ample o$ <bb v s#.&all#&. l#&k#&. a http:// appl#cat#o& #s also ava#lable a&d the e%ample #s s#m#lar to M<+/M<0G; but &o D,MCC, let?s have a look the the a#t table:
8 para'eters reporte% into ths A2. to signaliFe a broa%ban% appli$ation. app8i5name 7 Gapp8ication .ortai8G 8appli$ation na'e app8i5root 7 Ghttp4//!"#$!%&$!$!/portai8/G 8*RL base o transportGproto$olG%es$riptor app8i5path 7 Ginde*$htm8G 8initialGpathGbytes o si'ple appli$ation %es$riptor or(anisationId5! 7 !0 8 this is a %e'o val#e- %vb.org sho#l% assign an #niD#e val#e app8icationId5! 7 !00! 8 this is a %e'o val#e. .his n#'ber $orrespon%s to a tr#ste% appli$ation app8icationId5# 7 !00# ait 7 app8ication5information5section0 app8ication5t)pe 7 0*00!0: common5descriptor58oop 7 D e*terna85app8ication5a+thorisation5descriptor0 app8ication5identifiers 7 DDor(anisationId5!:app8icationId5!E: Dor(anisationId5!:app8icationId5#EE: app8ication5priorit) 7 D': !E 1 E: app8ication58oop 7 D app8ication58oop5item0 or(anisation5id 7 or(anisationId5!: app8ication5id 7 app8icationId5!: app8ication5contro85code 7 !: 8A*.4S.AR. app8ication5descriptors58oop 7 D transport5protoco85descriptor0 protoco85id 7 0*0003: URI52ase 7 app8i5root: URI5e*tensions 7 DE: transport5protoco858a2e8 7 3: 1: app8ication5descriptor0 app8ication5profi8e 7 0*0000: 0*0000 2asic profi8e 0*000! down8oad feat+re 0*000# .HR feat+re 0*000, RTF. feat+re -ersion5maNor 7 !: 8 $orrespon%ing to version 1.1.1 -ersion5minor 7 !: -ersion5micro 7 !: ser-ice52o+nd5f8a( 7 !: 8 the appli$ation is e9pe$te% to %ie on servi$e $hange -isi2i8it) 7 3: 8 the appli$ations is visible to the #ser app8ication5priorit) 7 !: transport5protoco858a2e8s 7 D3E: 8 2 'ore than one proto$ol is signalle% then ea$h proto$ol is an alternative %elivery 'e$hanis'. .he or%ering in%i$ates the broa%$aster@s vie! o !hi$h transport $onne$tion !ill provi%e the best #ser e9perien$e ( irst is best) 1: app8ication5name5descriptor0 app8ication5name 7 app8i5name: IFO5%3"58an(+a(e5code 7 GfraG 1: simp8e5app8ication58ocation5descriptor0initia85path52)tes 7 app8i5path 1: E 1:
5Ctutora#l1D shows a& e%ample where the <bb ! appl#cat#o& #s se&t over D,MCC
/C
http://www.avalpa.com
A use$ull $eature o$ D,MCC #s that a ru&&#&. appl#cat#o& ca& mo&#tor a $#le o& the D,MCC a&d be &ot#$#ed #$ the $#le #s cha&.ed a$ter #t was tra&sm#tted a&d rece#ved at least o&ce. he bas#c &ot#o& #s that ever- $#le o$ the D,MCC #s #& a module, a&d ever- module #s #& a sect#o&, so we &eed to update the sect#o& vers#o& as $or all the +,' tables. '$ the carousel was .e&erated w#th vers#o& ; as #& the prev#ous chapter, tr- to ed#t the te%t $rom ocd#r1/cha&.eVte%t $#le, #& our e%ample we cha&.ed $rom =Fr#te someth#&.H> to =Fr#te someth#&.H LpdateH>. @ou ca& e%ecute the e%ample as #& the prev#ous chapter a&d a$ter -ou cha&.e the $#le co&te&t -ou w#ll 7ust &eed to re ru& oc1update.sh w#th the &ew vers#o&:
oc-+pdate$sh ocdir! 0*J % #003 ! # 0 0 ,0%% 0 #
whe& the mult#ple%#&. #s ru&&#&. a&d wa#t a $ew mome&ts, here how #t looks a$ter update:
/D
http://www.avalpa.com
A& #&terest#&. $eatures o$ )#&u% ker&el s#&ce 2.C.13 #s the capab#l#t- to &ot#$- $#les-stem cha&.es to the appl#cat#o&, so #t #s prett- eas- to setup a bash scr#pt $or auto1update us#&. #&ot#$-1tools l#ke th#s:
H<R7! whi8e inotif)wait -r6 -e c8ose5write ocdir!T do 8et GH<RO7!G 8et GH<RB7!'G >AT<7Udate U echo GDV>AT<E4 +pdatin( ocdir!$ts fi8es)stem to -er4 VH<R$G oc-+pdate$sh ocdir! 0*J VH<R #003 ! # 0 0 ,0%% 0 # done
/6
http://www.avalpa.com
h#s eve&t has #d 1 a&d br#&.s some pr#vate date #& the pa-load: Meve&t 1 pr#vate dataM. h#s eve&t #s a Do 't Kow 0ve&t, the o&l- k#&d o$ stream eve&t supported b- 5pe&Caster a&d actuall- the o&l- o&e supported amo&. all M<+ decoders. MDo 't KowM mea&s that as soo& as the decoder rece#ve the eve&t #t should be se&t to the appl#cat#o&s wa#t#&. $or #t. Also <bb v supports stream eve&ts w#th the same .e&erat#o& process.
/A
http://www.avalpa.com
Avalpa Broadcast Server user manual o have the demo ru&&#&. e%ecute $or mhp1streameve&ts:
$/mhpconfi(#$p) oc-+pdate$sh ocdir! 0*J ' #003 ! # 0 0 ,0%% 0 # oc-+pdate$sh ocdir# 0*C ' #00, # # 0 0 ,0%% 0 # tsc2rm+*er 24#300000 first-ideo$ts 24!&&000 firsta+dio$ts 24300& firstpat$ts 24300& firstpmt$ts 24!'00 firstsdt$ts 24!,00 firstnit$ts 24!000000 ocdir!$ts 24!000000 ocdir#$ts 24#000 firstait$ts 24#000 firstste$ts 24&9900&, n+88$ts A m)firstfifo$ts B tsstamp m)firstfifo$ts !3#9!000 A m)secondfifo$ts B tsrfsend m)secondfifo$ts -mt O=>? -mC @A?!% -m/ !/, -mc #/3 -mf '9&
Kow -ou ca& tu&e the decoder a&d look $or the appl#cat#o& M est ,tream 0ve&tM:
'$ -ou e%ecute the appl#cat#o&, #t w#ll start a&d wa#t $or the ,tream 0ve&t:
;E
http://www.avalpa.com
;1
http://www.avalpa.com
Avalpa Broadcast Server user manual '$ -ou d#d&?t &ot#ce the mult#ple%#&. #s us#&. also a $#rstste.ts $#le, th#s $#le was .e&erated b- ./mhpco&$#.2.p- a&d co&ta#&s the eve&ts themselves se&t #& a loop. 5bv#ousl- th#s #s &ot the usual behav#our because -ou do&?t wa&t to se&d stream eve&t $rom the ver- be.#&&#&., so -ou w#ll &eed to #&#t#all- mu% a &ull.ts #&stead o$ $#rstste.ts a&d replace the stream whe& #t?s the r#.ht t#me to se&d the eve&t:
cp n+88$ts tempste$ts tsc2rm+*er 24#300000 first-ideo$ts 24!&&000 firsta+dio$ts 24300& firstpat$ts 24300& firstpmt$ts 24!'00 firstsdt$ts 24!,00 firstnit$ts 24!000000 ocdir!$ts 24!000000 ocdir#$ts 24#000 firstait$ts 24#000 firstste$ts 24&9900&, n+88$ts A m)firstfifo$ts B tsstamp m)firstfifo$ts !3#9!000 A m)secondfifo$ts B tsrfsend m)secondfifo$ts -mt O=>? -mC @A?!% -m/ !/, -mc #/3 -mf '9& cp firstste$ts tempste$ts
,o $ar so .ood, but here #t comes the d#$$#cult part: how the appl#cat#o& re.#ster to wa#t $or the eve&t. he appl#cat#o&, #& order to rece#ve the eve&ts, has to start e%ecut#&. a&d re.#ster #tsel$ to the eve&ts. o re.#ster to eve&t the appl#cat#o& &eeds a re$ere&ce ob7ect placed #& the ob7ect carousel so #t?s &ecessar- to create a ,tream 0ve&t 5b7ect #&to the $#le s-stem -ou wa&t to broadcast, that?s poss#ble w#th: steo.p<ave a look at the steo.p- scr#pt, #t w#ll .e&erate three $#les: .e#d .e&ame .tap, #$ -ou put these three #& a d#rector- #&s#de the ob7ect carousel l#ke: test.eve&t or e%ample.eve&t the carousel .e&erator w#ll create a ,tream 0ve&t 5b7ect #&stead o$ a d#rector-. h#s #s a spec#al #&1ba&d s#.&al#&..
D$$$E tap 7 str5e-ent5+se5tap01 tap$set0 id 7 0: assocTa( 7 0*>: 8 asso$iation tag %e ine% into +/. 1 taps 7 Taps 0 taps5co+nt 7 !: tap58oop 7 D tap:E: 1 e-ent5co+nt 7 3 8 n#'ber o events e-ent5names 7 <-ent5names 0 e-entnames5co+nt 7 e-ent5co+nt: e-ent5name58oop 7 D Ge-ent !G: Ge-ent #G: Ge-ent 3GE: 1 e-ent5ids 7 <-ent5ids 0 e-entids5co+nt 7 e-ent5co+nt: e-ent5id58oop 7 D !: #: 3:E: 8 i% o the events 1 D$$$E
8 na'e o
the events
<ere #s how #t looks l#ke #& ocd#r2 the .e&erated $#les .e#d, .e&ame a&d .tap:
8orenLoWn2-8pa88ara4X/OpenCaster/e*amp8e-confi(V 8s -8a ocdir#/ tota8 #0 drw*r-*r-* 3 8orenLo 8orenLo ,0"% #009-!#-0, !#4!9 $ drw*r-*r-* ' 8orenLo 8orenLo ,0"% #00&-0%-!0 0#40% $$
;2
http://www.avalpa.com
Fhe& the appl#cat#o&s 8uer-s the test.eve&t ob7ect #t w#ll $#&d out that ca& re.#ster to three d#$$ere&t eve&ts: 1, 2, 3 as descr#bed b- steo.phese three eve&t are se&t over the +'D spec#$#ed #&to the +M a&d #&to steo.p-, look $or the Mcompo&e&t ta.M both #& steo.p- a&d mhpco&$#.2.pD$$$E stream58oop5item0 stream5t)pe 7 !#: Ftream <-ent stream t)pe e8ementar)5.I> 7 ste!5pid: e8ement5info5descriptor58oop 7 D stream5identifier5descriptor0 component5ta( 7 0*>: 1: E 1: D$$$E
<ow to rece#ve stream eve&ts o& a M<+ appl#cat#o& #s out o$ the scope o$ th#s docume&t, but -ou w#ll $#&d a 7ava e%ample appl#cat#o& #& the 5pe&Caster packa.e. he complete work$low a$ter the appl#cat#o& #s started #s: 14 the decoder e%ecutes the appl#cat#o& est,te 24 the appl#cat#o& looks $or MtestM ,tream 0ve&t 5b7ect .e&erated b- steo.p- a&d placed #&to the D,MCC at .e&erat#o& t#me 34 the appl#cat#o& subscr#be to eve&t 1 /4 the appl#cat#o& rece#ves eve&t 1 $rom the $#rstste.ts .e&erated b- mhpco&$#.2.p-
;3
http://www.avalpa.com
DS'CC-receive
ImhpJ he dsmcc1rece#ve tool w#ll e%tract a dsmcc $#le s-stem $rom a tra&sport stream $#le.
mkfifo o+tp+t$sec mkdir o+tp+tdir ts#sec ocdir!$ts #003 A o+tp+t$sec B dsmcc-recei-e o+tp+tdir !00 #003 0*J C o+tp+t$sec
he $#rst comma&d w#ll e%tract sect#o&s $rom a .#ve& +'D 22EE3 #& the e%ample4 #&to a tra&sport stream $#le, the seco&d w#ll output the dsmcc $#les-stem #& the outputd#r d#rectorhowever to process the dsmcc #t &eeds to k&ow the +'D 22EE34 a&d the compo&e&t ta. 2E%B4. 1EE #s a cache value, #t spec#$#es that #t ca& store up to 1EE sect#o&s eve& #$ #t?s &ot sure #$ the- belo&. to the curre&t dsmcc or &ot.
;/
http://www.avalpa.com
he cl#p $#les are ver- short a&d w#th a ver- small b#t rate, ma&- decoders ca& have problems decod#&. cha&&el 2 a&d cha&&el 3, cha&&el 1 should pla- smooth o& all decoders, th#s ca& also be a test o& -our mpe.2 decoder recover- capab#l#t#es. A problem ar#ses because the v#deos are looped a&d so, $rom the po#&t o$ v#ew o$ the decoder, the +C3 .oes back #& t#me a$ter the e&d o$ the $#rst loop whe& we come back pla-#&. the same ts loop a seco&d t#me9 -ou ca& tr- to $#% +C3 us#&. tsstamp l#ke here:
tsc2rm+*er 24#300000 first-ideo$ts 24!&&000 firsta+dio$ts 24#300000 second-ideo$ts 24!&&000 second-ideo$ts 24#300000 third-ideo$ts 24!&&000 thirda+dio$ts 24300& mptspat$ts 24300& mptspmt!$ts 24300& mptspmt#$ts 24300& mptspmt3$ts 24!,00 mptsnit$ts 24!'00 mptssdt$ts 24'9"#0%" n+88$ts A m)firstfifo$ts B tsstamp m)firstfifo$ts !3#9!000 A m)secondfifo$ts B tsrfsend m)secondfifo$ts -mt O=>? -mC @A?!% -m/ !/, -mc #/3 -mf '9&
+lease &ote that #&put $#les are .e&erated b- 5pe&Caster #tsel$, check re1mult#ple%#&. sect#o& $or mult#ple% #&puts $rom other s-stems. ,ome scree&shots $rom the decoder w#ll $ollow:
;;
http://www.avalpa.com
;C
http://www.avalpa.com
"#&all- let?s check the a&al-ser a.a#& $or the serv#ces a&d the#r +C3: ;D http://www.avalpa.com
;6
http://www.avalpa.com
Kow -ou are read- to use tscr-pt, the bas#c usa.e #s:
tscr)pt inp+t$ts fi8e$cw A cr)pted$ts
the #&put tra&sport stream w#ll be cr-pt us#&. co&trol words $rom $#le.cw, those are 6 b-tes tw#ce, odd a&d eve& ke-s, #t #s a per$ect match $or a b#ss cam. he +,' s#.&all#&. re8u#red #s carr#ed out #& the pmt:
pmt 7 pro(ram5map5section0 pro(ram5n+m2er 7 a-a8pa!5ser-ice5id: .CR5.I> 7 #0%,: pro(ram5info5descriptor58oop 7 DE: stream58oop 7 D stream58oop5item0 stream5t)pe 7 #: mpe(# -ideo stream t)pe e8ementar)5.I> 7 #0%,: e8ement5info5descriptor58oop 7 D ca5descriptor 0 CA5s)stem5I> 7 0*#%00: CA5.I> 7 0*!===: 1: E 1: stream58oop5item0 stream5t)pe 7 ,: mpe(# a+dio stream t)pe e8ementar)5.I> 7 #0%&: e8ement5info5descriptor58oop 7 D ca5descriptor 0 CA5s)stem5I> 7 0*#%00: CA5.I> 7 0*!===: 1: E 1: E:
;A
http://www.avalpa.com
he co&trol word used #s E%EE E%EE E%EE E%EE E%E1 E%E2 E%E3 E%C h#s wo&?t be e&ou.h to support a&- ava#lable CA, s-stem but 5pe&Caster #s also able to s#.&al 0CM, 0MM a&d CA #& the same wa- as descr#bed $or the others +,'/,' show& #& the prev#ous e%amples so the support #s 8u#te complete.
The scramblin" processin" is -uite computational expensive so pay attention to your cpu usa"e+
CE
http://www.avalpa.com
C1
http://www.avalpa.com
h#s shot shows the pla- out s-stem #& act#o&, stra#.ht $rom a =bud.et> tv set, he&ce the #&terlac#&., mo#re? a&d hor#*o&tal sca&l#&e art#$actsHH Ma&- tv serv#ces are 7ust the broadcast#&. o$ recorded eve&ts, v#deo a&d $#lms 2th#&k bus#&ess telev#s#o&, hosp#tal#t- a&d some satell#te cha&&els4 . h#s co&te%t #s a per$ect match $or Avalpa Broadcast ,erver. Ls#&. the $ollow#&. tools the broadcaster ca& avo#d e%pe&s#ve real1t#me s-stems .reatl- reduc#&. costs, parts, comple%#t- a&d the stora.e &eeds $or the ru&&#&. pla- out s-stem. o u&dersta&d the pla- out s-stem #s &ecessar- to u&dersta&d the tools prese&ted #& th#s sect#o&, at the e&d o$ the chapter the s#mplest poss#ble pla- out #s real#*ed w#th 7ust a $ew comma&d l#&es.
"ntroduction to ingestion
he most #mporta&t #ssue about the #&.est#o& o$ co&te&t #s to val#date #t be$ore usa.e so #& the &e%t chapters some a&al-s#s? tools are prese&ted to make sure Avalpa Broadcast ,erver #s $#lled w#th proper #&put $rom the e&coders. C2 http://www.avalpa.com
Avalpa Broadcast Server user manual Curre&t supported #&put $ormats $or pla-out usa.e are:
M$/GF video M$/GF audio olby olby i"ital aka ac< i"ital $lus
Most o$ audio encoders usuall- wo&?t prese&t a d#$$#cult challe&.e because $or broadcast#&. usa.e the#r bit rate is constant a&d $rame s#*e #s co&sta&t too so -ou w#ll have o&l- to .et some parameters $rom the e&coders? co&$#.urat#o& a&d match them w#th Avalpa Broadcast ,erver?s parameters. !#deo 0leme&tar- ,tream #&put, however, #s a $ar more comple% sub7ect. "or mpe.2 v#deo the server makes ava#lable a& a&al-ser tool called mpe.2vbv 2!#deo Bu$$er !er#$#er4 that w#ll report problem w#th the v#deo #&put do#&. a decoder bu$$er s#mulat#o&. <2C/ a&al-*er w#ll be ava#lable soo&. !ideo bitrate can be both !ariabile Bit %ate 2!B%5 or *onstant Bit %ate 2*B%5 however #& a d#.#tal v#deo broadcast#&. arch#tecture !B3 makes se&se o&l- #$ mult#ple%ers a&d e&coders talk to each other a&d real#*e a stat#st#cal mult#ple%#&. otherw#se us#&. a !B3 e&cod#&. w#thout a stat#st#cal mult#ple%#&. would be 7ust a waste o$ ba&dw#dth. As $ar as we k&ow there #s &ot a sta&dard about stat#st#cal mult#ple%#&. a&d ever- ve&dor has #ts ow& lock1#& propr#etar- protocol betwee& e&coders, also statistical multiplexin" is valuable only on some context and re-uirement. Fork#&. w#th pre1e&coded $#les the cho#ce o$ *B% is a must especially for !( services but also for scheduled services with small number of live pro"rames . o .et -our v#deo e&coded there are ma&- poss#b#l#t#es, we descr#be some o$ the most commo&: A& ope& source e&coder l#brar- #s ava#lable #&s#de libavcodec from ffmpe", -ou w#ll be able to e&code CB3 v#deo eleme&tar- stream as descr#bed #& the chapters below w#thout problem check later chapters $or deta#ls. he reference encoders are also ava#lable $rom mpe. web s#te but #t w#ll probabl- be more cpu hu&.r- a&d less e$$ect#ve, other so$tware decoders are ava#lable both b#&ar-, ope& source, l#ce&sed a&d/or $ree. Main*oncept l#ce&ses so$tware e&coders w#th a CB3 , !B! compl#a&t !#deo 0, $or a .ood pr#ce as sta&dalo&e solut#o& also o& )#&u% workstat#o&s or #t #s ava#lable as a plu.1#& $or Adobe +rem#ere a&d ma&- other Ko& )#&ear 0d#t#&. 2K)04 so$twares, eve& Adobe +rem#er 0leme&ts has a h#.h 8ual#t- M+0G2 v#deo e&coder opt#o&. A $ree tr#al dow&load $rom the#r web s#te #s also ava#lable w#th the o&l- l#m#tat#o& o$ a watermark. +a- atte&t#o& however GL's are &ot alwa-s clear o& how to .e&erate a CB3 v#deo. 't #s worthless to sa- that a&- pro$ess#o&al broadcast#&. #&dustr#al e&coder hardware w#ll be also su#table, the& some #&e%pe&s#ve pc hardware has bee& also reported to work .ood e&ou.h too #$ co&$#.ured properl- w#th up1to1date $#rmware. C3 http://www.avalpa.com
Avalpa Broadcast Server user manual A&-wa- #& the $ollow#&. pa.es we w#ll prese&t e%amples w#th $$mpe. because #t #s #&stalled a&d #t has also a 8u#te w#de ra&.e o$ supported #&put $ormats mak#&. the tutor#als eas#er. +lease &ote the current ffmpe" version 27+6+@5 has also a basic transport stream output but it is not suitable for *B% broadcast so -ou ca&&ot use w#th other 5pe&Caster tools, that #s wh- we w#ll alwa-s show e%ample start#&. $rom pes or es #&put $#les.
A pro.ram eleme&tar- stream $#les w#ll be .e&erated, usuall- aud#o or v#deo. pesinfo w#ll report #&$ormat#o&s about the pro.ram eleme&tar- streams, usa.e #s s#mple:
pesinfo -ideo+tp+t$pes
so -ou ca& lear& about prese&tat#o& 2+ ,4 a&d decod#&. t#me stamps 2D ,4 o$ the eleme&tar- stream o$ the pro.ram stream, $or e%ample -ou ca& see #& the above pr#&t that decode t#me stamp #s correctl- a b#t earl#er tha& prese&tat#o& t#me stamp $or the same $rame. he t#me #s pr#&ted as seco&ds a&d as AE<* clock, we w#ll d#scuss a.a#& + , a&d D , later o& wh#le d#scuss#&. s-&chro&#*at#o&, remember that pes#&$o w#ll .#ve -ou the &ecessar- #&$ormat#o&. pesFes tool w#ll allow -ou to e%tract $rom a pro.ram eleme&tar- stream #ts eleme&tarstream. he tool takes as #&put a pro.ram eleme&tar- stream $#le a&d a stream header #d, -ou ca& C/ http://www.avalpa.com
Avalpa Broadcast Server user manual read the header #d us#&. pes#&$o as 7ust show& #& the e%ample.
pes#es -ideoo+tp+t$pes ##, A -ideo$es
w#ll e%tract the stream E%eE 222/4, that?s a t-p#cal v#deo #d wh#le t-p#cal aud#o #d #s E%cE 21A24
ts#pes firsta+dio$ts #0%& A a+dioo+tp+t$pes pes#es a+dioo+tp+t$pes !"# A a+dio$es
w#ll pr#&t out #&$ormat#o& $rom the v#deo $rames header, here #s a t-p#cal pr#&t o$ a Group 5$ +#cture 2G5+4:
D$$$E Fe6+ence header4 format4 9#0*'9%: ,43: #'fps: 2itrate4 %$00?2s: -2- 2+ffer siLe4 !!#: constrained4 no Fe6+ence header e*tension4 profi8e is ?ain: 8e-e8 is ?ain /O. header4 meas+red siLe4 3,,#%9 2)tes: 2itrate from meas+red siLe 0form+8a has ro+nds14 '9399&3$,%!'&32ps: drop4 no: time code4 0040040, pict+res4!&: c8osed4 no: 2roken4 no frame siLe4 #0,"0 .ostion 3'#'#&,: pict+re !!" start header4 tempora8 reference4 #: pict+re codin( t)pe4 I-=rame: -2de8a)4 ##,!, frame siLe4 9&"'& .ostion 3%0,#,#: pict+re !#0 start header4 tempora8 reference4 0: pict+re codin( t)pe4 J-=rame: -2de8a)4 !%'3" frame siLe4 !9%"9 .ostion 3%#!"3": pict+re !#! start header4 tempora8 reference4 !: pict+re codin( t)pe4 J-=rame: -2de8a)4 !&0!' frame siLe4 !&##3 .ostion 3%,0!%#: pict+re !## start header4 tempora8 reference4 ': pict+re codin( t)pe4 .-=rame: -2de8a)4 !",#& frame siLe4 303&' .ostion 3%90',9: pict+re !#3 start header4 tempora8 reference4 3: pict+re codin( t)pe4 J-=rame: -2de8a)4 !"3&# frame siLe4 !&!3& .ostion 3%&&%&': pict+re !#, start header4 tempora8 reference4 ,: pict+re codin( t)pe4 J-=rame: -2de8a)4 #0&0% frame siLe4 #3,#% .ostion 39!#!!!: pict+re !#' start header4 tempora8 reference4 &: pict+re codin( t)pe4 .-=rame: -2de8a)4 #!'"' frame siLe4 #""&, .ostion 39,#0"': pict+re !#% start header4 tempora8 reference4 %: pict+re codin( t)pe4 J-=rame: -2de8a)4 #!'"9 frame siLe4 !9!&" .ostion 39'"#&,: pict+re !#9 start header4 tempora8 reference4 9: pict+re codin( t)pe4 J-=rame: -2de8a)4 #3!3, frame siLe4 #09!" .ostion 39&0003: pict+re !#& start header4 tempora8 reference4 !!: pict+re codin( t)pe4 .-=rame: -2de8a)4 #,#,& frame siLe4 30"&0 .ostion 3&!0"&3: pict+re !#" start header4 tempora8 reference4 ": pict+re codin( t)pe4 J-=rame: -2de8a)4 #,!30 frame siLe4 ##&,, D$$$E
,ome o$ these parameters are releva&t because the- w#ll be use$ul $or mult#ple%#&., so C; http://www.avalpa.com
Avalpa Broadcast Server user manual let?s have a short descr#pt#o& o$ releva&t parameters #& the &e%t chapter. '& M+0G12, three ?p#cture t-pes? are de$#&ed. modes ma- be used to code each block. he p#cture t-pe de$#&es wh#ch pred#ct#o&
?'&tra? p#ctures 2'1p#ctures4 are coded w#thout re$ere&ce to other p#ctures. Moderate compress#o& #s ach#eved b- reduc#&. spat#al redu&da&c-, but &ot temporal redu&da&c-. he- ca& be used per#od#call- to prov#de access po#&ts #& the b#tstream where decod#&. ca& be.#&. ?+red#ct#ve? p#ctures 2+1p#ctures4 ca& use the prev#ous '1 or +1p#cture $or mot#o& compe&sat#o& a&d ma- be used as a re$ere&ce $or $urther pred#ct#o&. 0ach block #& a +1 p#cture ca& e#ther be pred#cted or #&tra1coded. B- reduc#&. spat#al a&d temporal redu&da&c-, +1p#ctures o$$er #&creased compress#o& compared to '1p#ctures. ?B#d#rect#o&all-1pred#ct#ve? p#ctures 2B1p#ctures4 ca& use the prev#ous a&d &e%t '1 or +1p#ctures $or mot#o&1compe&sat#o&, a&d o$$er the h#.hest de.ree o$ compress#o&. 0ach block #& a B1p#cture ca& be $orward, backward or b#d#rect#o&all- pred#cted or #&tra1coded. o e&able backward pred#ct#o& $rom a $uture $rame, the encoder reorders the pictures $rom &atural ?d#spla-? order to ?b#tstream? order so that the B1p#cture #s tra&sm#tted a$ter the prev#ous a&d &e%t p#ctures #t re$ere&ces. h#s #&troduces a reorder#&. dela- depe&de&t o& the &umber o$ co&secut#ve B1 p#ctures. he d#$$ere&t p#cture t-pes t-p#call- occur #& a repeat#&. se8ue&ce, termed a ?Group o$ +#ctures? or G5+. A t-p#cal G5+ #& d#spla- order #s:
J! J# I3 J, J' .% J9 J& ." J!0 J!! .!#
A re.ular G5+ structure ca& be descr#bed w#th two parameters: K, wh#ch #s the &umber o$ p#ctures #& the G5+, a&d M, wh#ch #s the spac#&. o$ +1p#ctures. he G5+ .#ve& here #s descr#bed as KS12 a&d MS2. M+0G12 does &ot #&s#st o& a re.ular G5+ structure. "or e%ample, a +1p#cture $ollow#&. a shot1cha&.e ma- be badl- pred#cted s#&ce the re$ere&ce p#cture $or pred#ct#o& #s completel- d#$$ere&t $rom the p#cture be#&. pred#cted. hus, #t mabe be&e$#c#al to code #t as a& '1p#cture #&stead. "or a .#ve& decoded p#cture 8ual#t-, cod#&. us#&. each p#cture t-pe produces a d#$$ere&t &umber o$ b#ts. '& a t-p#cal e%ample se8ue&ce, a coded '1p#cture was three t#mes lar.er tha& a coded +1p#cture, wh#ch was #tsel$ ;EQ lar.er tha& a coded B1p#cture. he &umber a$ter the p#cture t-pe #s the temporal re$ere&ce #&s#de the s#&.le G5+. 5& broadcast#&. e&v#ro&me&t a& e%ter&al add#t#o&al co&stra#&t comes $rom the user acceptable =*app#&.> t#me because a decoder &eeds to wa#t a& ' p#cture to start d#spla-#&. the v#deo so the usual &umber o$ G5+ s#*e $or broadcast#&. #s 12, less tha& hal$ a seco&d at 2; $rames per seco&d: 212 T 1/2; S E./6 sec.4 Closed .op have a d#$$ere&t se8ue&ce, the- start w#th a& ' p#cture w#th t#me re$ere&ce 1 a&d allow them to be the start o$ a& e&coded v#deo. h#s pecul#ar G5+ $eature allows also CC http://www.avalpa.com
Avalpa Broadcast Server user manual G5+ to be cha#&ed w#thout re1e&cod#&. the v#deo, we w#ll .et o& th#s top#c later o&.
Tool vbv
A&other #&terest#&. tool #s M mpe"FvideovbvM, that?s !#deo Bu$$er !er#$#er, the tool tr#es to s#mulate a mpe.2 v#deo decoder bu$$er.
mpe(#-ideo-2- -ideo$es
w#ll pr#&t u&derru& a&d overru& o$ the bu$$er #$ the- happe& or sta- 8u#et #$ the v#deo stream respects the l#m#ts report#&. =$ou&d E errors> at the e&d. '$ vbv reports error #t #s a h#&t that the v#deo was e&coded w#th a b#t rate that?s &ot e&ou.h co&sta&t. K.b. th#s tool #s a s#mulator that tr#es to be str#ct, somet#me a v#deo stream happe&s to work properl- o& real decoders 2as the- should be $ar more tolera&t4 eve& #$ vbv reports errors. 't ca& also happe& a v#deo wo&?t work properl- eve& #$ vbv does&?t compla#& because bu$$er $ull&ess #s &ot the o&l- #mporta&t #ssue $or a proper pla-back, the vbv tool $#lls the bu$$er at a co&sta&t b#t rate 2CB34 but o& real tra&sm#ss#o& the model ma- look more l#ke ma&- small burst .ett#&. a& avera.e =cbr1&ess>, #$ the burst#&ess #s &ot properl- ma&a.ed a vbv compla#&t stream w#ll $a#l to be decoded correctl-. !bv #&$ormat#o& #s also collected #& a lo. $#le vbvData.dat that ca& be plotted w#th the comma&d:
(n+p8ot p8ot$p
the plot.p $#le #s ava#lable #& the d#rector- 5pe&caster.vers#o&/tools/vbv, the result looks l#ke:
he @ #s report#&. the vbv bu$$er $ull&ess wh#le P #s report#&. the t#me #& $rame &umber. .&uplout let -ou *oom #& a& area us#&. r#.ht cl#ck so -ou ca& a&al-se peaks a&d ever-th#&. else.
CD
http://www.avalpa.com
M+0G11 Aud#o )a-er '' #s a& aud#o codec de$#&ed b- ',5/'0C 111D213. Fh#le M+3 #s much more popular $or +C a&d #&ter&et appl#cat#o&s, M+2 rema#&s a dom#&a&t sta&dard $or aud#o broadcast#&.. L&dersta&d#&. mpe. aud#o compress#o& $eatures #s be-o&d our #&terest but to mult#ple% aud#o -ou w#ll &eed to k&ow some o$ the #&$ormat#o& pr#&ted here: bit rate' samplin" rate and frame si;e. ,ampl#&. rate #s the &umber o$ samples prese&t #& 1 seco&d, that?s wh- #s e%pressed #& <*, wh#le $rame s#*e #s the d#me&s#o& #& b-tes o$ all the aud#o $rame. /6EEE <* #s 8u#te a commo& sample rate but also others are supported. W&ow#&. $rame s#*e a&d b#t rate -ou ca& $#.ure out how lo&. the $rame lasts a&d how ma&samples #t br#&.s w#th the sampler rate #&$ormat#o&. ,ummar-: to a&al-se a& aud#o stream $rom a #&put.ts -ou w#ll &eed the $ollow#&. comma&ds:
D$$$E ts#pes inp+t$ts a+diopid A a+dioo+tp+t$pes pes#es a+dioo+tp+t$pes stream5id5+s+a88)5!"# A a+dioo+tp+t$es esa+dioinfo a+dioo+tp+t$es D$$$E
C6
http://www.avalpa.com
$ow to encode mpeg/ digital video files with ffmpeg and m0tools
<ere #s a& e%ample o$ v#deo e&cod#&. do&e w#th $$mpe.:
Gffmpe( -i inp+t$e*t -an --codec mpe(#-ideo -f mpe(#-ideo -2 '000k -ma*rate '000k -minrate '000k -2f # -2+fsiLe !&3'00& -ideo$mp#G
1# #&put $#le, that ca& be v#deo $#le supported b- $$mpe. decod#&. 1a& &o aud#o, #$ aud#o #s prese&t #& the #&put #t w#ll be #.&ored 1vcodec v#deo codec, mpe.2v#deo #s the v#deo codec we are look#&. $or mpe.2 v#deo 1$ output $ormat, th#s mpe.2v#deo #s the output $#le $ormat we are look#&., eleme&tarstream v#deo 1b, 1ma%rate, 1m#&rate b#trate #& kbps, that?s depe&d o& -ou, pa- atte&t#o& some vers#o& o$ $$mpe. use kbps as #&put, others bps so -ou &eed to add *eros 1b$ &umber o$ b1$rame $or .op 1bu$s#*e vbv bu$$ers#*e, the vers#o& o$ $$mpe. used wh#le wr#t#&. th#s docume&t #s e%pect#&. the bu$$er s#*e #& b#t, so #t?s vbvVbu$$erVs#*e T 1E2/ T 1C: 163;EE6, however #& ma&- e&coders vbv $or mpe. 2 v#deo codec #s o$te& e%pressed #& 1CWb#ts u&#t. Be sure to check the output w#th esv#deo#&$o a&d vbv as e%pla#&ed #& MA&al-s#&. v#deo $#lesM, whe& -ou are do&e w#th e&cod#&. -ou w#ll &eed to do e&capsulat#o&, $$mpe. actuall- has a& opt#o& to output eleme&tar- stream e&capsulated #&to tra&sport stream but as o$ th#s wr#t#&. #t?s totall- broke&. @ou ca& e&capsulate the v#deo eleme&tar- stream #&to pro.ram stream w#th esv#deo2pes l#ke th#s:
es-ideompe(#pes -ideo$mp# A -ideo$pes
@ou ca& e&capsulate the v#deo #&to a ts l#ke #& th#s e%ample:
pes-ideo#ts #0%, #' !!# '#90000 0 -ideo$pes A -ideo$ts
2EC/ #s the v#deo p#d. 2; #s the $rame per seco&d, 112 hal$ vbv 2o& ma&- decoders 22/ #s $#&e, others have hal$ o$ #t because D!D uses hal$ a&d somet#mes #t happe&s also D!B decoder .et the same l#m#tat#o&4, ;2DEEEE #s the ts b#t rate, #t has to be b#..er tha& the v#deo b#t rate, automat#c m#&#mum .uess #s st#ll &ot ava#lable o& the so$tware, 1;Q more should be $#&e9 the tool w#ll ad7ust the pts a&d the dts to take #&to accou&t $#rst $rame tra&sm#ss#o& dela-. To improve the -uality and the compression of the video is su""ested to use yuvdenoise tool, as show& below:
ffmpe( -i inp+t$e*t -an -s 9#0*'9% -deinter8ace -r #' -aspect ,43 -f )+-,mpe(pipe - Y )+-denoise Y ffmpe( -i - -an --codec mpe(#-ideo -f mpe(#-ideo -2 #000k -ma*rate #000k -minrate #000k -2f # -2+fsiLe !3,3,&& -ideo$mp#
CA
http://www.avalpa.com
@ou ca& e&capsulate the aud#o #&to ps w#th esaud#o2pes l#ke th#s:
esa+dio#pes a+dio$mp# !!'# ,&000 9%& -! 3%00 A a+dio$pes
/6EEE sample rate, should be k&ow& or ca& be lear& w#th esaud#o#&$o, a ptsVstep #s 11;2 / sampleVrate T AEEEE, 11;2 #s $#%ed $or mpe.2 la-er 2 so $or /6kh* comes 21CE 11;2 aud#o $rame s#*e, -ou ca& read #t w#th esaud#o#&$o, #t?s #& b-tes 2KB th#s 11;2 #s bcha&ce 11;2 as the &umber o$ samples4 3CEE $#rst pts, th#s a& #mporta&t value $or aud#o/v#deo s-&chro&#*at#o&, read more below. @ou ca& a&al-se the output w#th:
pesinfo a+dio$pes
2EC6 #s the p#d &umber 11;2 #s the &umber o$ sampler per $rame /6EEE #s the sample rate DC6 #s the es $rame s#*e 11 d#sable aud#o descr#pt#o& header E the aud#o wo&?t be o& loop, a.a#& th#s #s $or $uture usa.e co&sta&t b#t rate. o calculate the output b#t rate steps are: 1 seco&d #s AEEEE pts t#cks, sample rate #s /6EEE h*, 1 $rame #s 11;2 samples. so: DE http://www.avalpa.com
Avalpa Broadcast Server user manual 2AEEEE T 11;24 / /6EEE S 21CE #s how ma&- t#cks #s a $rame a& aud#o pes $rame #s made $or e%ample o$ 36/ b-te so th#s mea&s 36//16/ S 2.E6 , packets, w#th padd#&. o& th#rd packet so 3 packets T 166 b-tes S ;C/ b-tes S /;12 b#t per pes aud#o $rame. /;12 b#t $or 21CE t#cks -ou co&vert w#th bps #t comes: 2/;12 T AEEEE4 / 21CE S 166EEE bps Fhe& b#t rate #s &ot rou&d, -ou should co&s#der us#&. the $loor #&te.er. Beware o$ padd#&.: #$ -ou check the math $or aud#o b#t rate at 1CEkbps -ou w#ll $#&d out that the , b#t rate #s the sameH Check 5pe&Caster 30ADM0 $or smarter mpe.2 aud#o b#t rates.
D1
http://www.avalpa.com
But th#s wa- #t w#ll &ever stop record#&., so to stop #t -ou ca& use ctrlRc or use a durat#o& t#me:
d-(ra2 -d 34304!0 recorded$d-
w#ll record $or 3 hours, 3E m#&utes a&d 1E seco&ds, here #s other t#me spec#$#cat#o& supported:
F?II time -a8+e4 MMMD$YEh: MMMD$YEmin: MMMD$YEDsE: MMMms: DDHH4E??4EFFD$msE smpte7DDDHH4E??4EFF4E==
he result#&. recordD!.av# $#le ca& be co&verted as e%pla#& #& prev#ous chapter #&to aud#o a&d v#deo streams. he &e%t chapter w#ll show a complete #&.est#o& $rom D!D data ava#lable o& the &et, -ou ca& replace the vob $#le w#th -our D! $#le a&d e%ecute the same steps @ou ca& also co&&ect D!Grab d#rectl- #&to $$mpe. a&d the& d#rectl- to a pla-out:
d-(ra2 -format d-! - Y /home/a-a8pa/ffmpe(/ffmpe( -f d- -i - -acodec mp# -ac # -a2 !#&000 -ar ,&000 -f mp# -) 8i-e$mp# -s 9#0*'9% -deinter8ace -r #' -aspect ,43 -f )+-,mpe(pipe -) - Y /home/a-a8pa/mNpe(too8s-!$"$0/)+-denoise/)+-denoise Y /home/a-a8pa/ffmpe(/ffmpe( -i - -an --codec mpe(#-ideo -f mpe(#-ideo -2 #000k -ma*rate #000k -minrate #000k -2f # -2+fsiLe !3,3,&& -) 8i-e$mp-
D2
http://www.avalpa.com
'& th#s case 11;2 #s the &umber o$ samples o$ a s#&.le mpe.2 aud#o $rame so #& th#s wawe ca& co&trol how ma&- $rames are .e&erated us#&. cou&t. Kumber o$ samples, &umber o$ cha&&els a&d sample rate w#ll tell -ou also how lo&. #t lasts.
D3
http://www.avalpa.com
w(et http4//-ideo$28endertest2+i8ds$de/topdir/<>/mo-ie5on8)5pa8$iso
w.et w#ll dow&load the .#so o$ 0lepha&t Dreams short a&d the $ollow#&. comma&d w#ll e&code aud#o a&d v#deo add#&. a& e%ter&al lo.o a&d e&abl#&. the #&#t#al s-&chro&#*at#o&.
s+do mo+nt -o 8oop mo-ie5on8)5pa8$iso /mnt/ ffmpe( --n -a2 !#&k -ar ,&0000 -i /mnt/HI><O5TF/HTF50!5!$HOJ -acodec mp# -ac # ed$mp# ffmpe( -i /mnt/HI><O5TF/HTF50!5!$HOJ -an --f Rmo-ie7OpenCaster/t+toria8s/encodin(/8o(o5t-$pn( DwmET DinEDwmE o-er8a)70404040 Do+tER -f mpe(#-ideo --codec mpe(#-ideo -2 #%00k -ma*rate #%00k -minrate #%00k -2f # -2+fsiLe !&3'00& -aspect ,43 ed$m#s+do +mo+nt /mnt esvideo2pes ed.m2v 1> ed.video.pes 2> ed.pes.length esa+dio#pes ed$mp# !!'# ,&000 3&, -! 3%00 A ed$a+dio$pes
D/
http://www.avalpa.com
Avalpa Broadcast Server user manual he $#le ed.pes.le&.th #s .e&erated b- esv#deo2pes a&d #t?s the le&.th o$ the v#deo #& + , t#cks, #& th#s case we w#ll .et that ed.pes.le&.th #s ;D26C6EE, t#cks o$ AEWh* so 1 $rame #s AEEEE/2; $rame per seco&d S 3CEE pts t#cks a&d ;D26C6EE/3CEE S 1;A13 $rames / 2; $ps S C3C.;2 seco&ds o$ v#deo :e need to compare this with the audio len"th to ensure the audio is a little shorter than the video' this is the only re-uirement to chain two videos encoded as Eust describedD ed.aud#o.pes s#*e #s 1E;3E26/, 1 $rame #s 11;2 sample a&d sample rate #s /6EEE so 1E;3E26/ / 236/R1/4 S 2C/;6 $rames T 11;2 / /6EEE S C3/.AA2 seco&ds o$ aud#o '& th#s case aud#o #s shorter so there #s &o problem, otherw#se:
esa+dio#pes ed$mp# !!'# ,&000 3&, -! 3%00 '9#&%&00 A ed$a+dio$pes
would have cut the aud#o be$ore the e&d o$ the v#deo. o have some v#deo cl#ps $or the pla-out -ou should repeat the same comma&ds $or a&other short B#. Buck Bu&&- 2the seco&d release st#ll courtes- $rom the Ble&der "ou&dat#o&4, ava#lable $rom: http://www.arch#ve.or./deta#ls/B#.BuckBu&&o match our set up #& the &e%t chapters -ou should e&code VTS_05_1.VOB a&d
VTS_02_1.VOB
D;
http://www.avalpa.com
s#&ce we are deal#&. w#th <D, let?s also put ;.1 aud#oH
esa+dio#pes a+dio#,p$ac3 !'3% ,&000 !9"# -! 39'0 A a+dio$pes pesa+dio#ts #0%" !'3% ,&000 !9"# 0 a+dio$pes A a+dio$ts
#t w#ll also re8u#re to cha&.e ps# to s#.&al correctl- the serv#ce #& a $ew places: $or &#t/sdt:
ser-ice5t)pe 7 0*!": a-c hd di(ita8 t- ser-ice t)pe
$or pmt:
stream58oop 7 D stream58oop5item0 stream5t)pe 7 0*!J: a-c -ideo stream t)pe e8ementar)5.I> 7 #0%%: e8ement5info5descriptor58oop 7 DE 1: stream58oop5item0 stream5t)pe 7 %: pri-ate e8ementar)5.I> 7 #0%": e8ement5info5descriptor58oop 7 D ac35descriptor0 component5t)pe5f8a( 7 0: 2sid5f8a( 7 0: mainid5f8a( 7 0: as-c5f8a( 7 0: additiona85info 7 GG: 1: E: 1: E:
DC
http://www.avalpa.com
h#s w#ll output three $#les w#th aud#o a&d v#deo co&&ected seamlessl-, please &ot#ce some po#&ts about wh- th#s works: ed, bb a&d bb2 have all the same ba&dw#dth both aud#o a&d v#deo a&d all the ba&dw#dths are CB3
the $#rst G5+ o$ ever- v#deo #s closed pesv#deo2ts co&trols vbv $ull&ess all the t#me a&d also o& the sw#tch betwee& streams.
Bas#call- the pr#&ts report about the tools clos#&. the prev#ous $#les a&d ope&#&. the &ew $#les however someth#&. $#sh- #s .o#&. o& because we read that:
22$a+dio$pes new presented a+dio frame wi88 2e at '9!%,,00: %3'$!%00 sec$ 22$-ideo$pes new presented -ideo frame is at4 '9#"0,00: %3%$'%00 sec$
Fe are out o$ s-&chro&#*at#o&H he $#rst value #s the t#me #& + , t#cks 2AE W<X4 the seco&d #s the $#rst t#me #& seco&ds 2;D1C//EE / AEEEE4. h#s problem #s also s#.&alled b- a war&#&. messa.e: DD http://www.avalpa.com
we specified that the audio file must be "enerally shorter than the video file however $or pesaud#o2ts to k&ow about how much short #t #s the aud#o compared to the v#deo #t &eeds add#t#o&al #&$ormat#o& $#les: ed.aud#o.pes.le&.th, bb.aud#o.pes.le&.th a&d bb2.aud#o.pes.le&.th that are the same $#les we .e&erated wh#le e&capsulat#&. the v#deo $#les to pes #& the prev#ous chapter so 7ust re&ame them as:
m- 22$pes$8en(th 22$a+dio$pes$8en(th m- 22#$pes$8en(th 22#$a+dio$pes$8en(th m- ed$pes$8en(th ed$a+dio$pes$8en(th
a&d restart the whole processes, a$ter the $#rst v#deo -ou w#ll correctl- read that both pesaud#o2ts a&d pesv#deo2ts report the e%act + , that #s .o#&. to be the $#rst $rame. o$ the #&com#&. v#deo:
pesa+dio#ts4 c8osin( ed$a+dio$pes$$$ c8osed pesa+dio#ts4 openin( 22$a+dio$pes$$$ open pesa+dio#ts s)nc4 22$a+dio$pes new presented a+dio frame wi88 2e at '9#"0,00: %3%$'%00 sec$: 8ast presented a+dio frame was at '9!%!'#0: %3'$!#&0 sec$ pes-ideo#ts4 c8osin( ed$-ideo$pes$$$ c8osed pes-ideo#ts4 openin( 22$-ideo$pes$$$ open pes-ideo#ts s)nc4 22$-ideo$pes new presented -ideo frame is at4 '9#"0,00: %3%$'%00 sec$: decode time stamp is at4 '9#&%&00: %3%$'#00 sec$
o recover $rom a& out o$ s-&chro&#*at#o& a$ter #t #s s#.&alled -ou w#ll &eed to do some mathemat#cs a&d add at the curre&t.aud#o.pes.le&.th value the m#ss#&. t#me so that wh#le pass#&. to the &ew stream $rom the curre&t the s-&ch #s .a#&ed. '& the &e%t pa.es a .aller- o$ some scree& shots $rom d#$$ere&t a&al-sers #s show&:
D6
http://www.avalpa.com
!W a$e 1, D A&al-s#s
DA
http://www.avalpa.com
6E
http://www.avalpa.com
61
http://www.avalpa.com
Avalpa Broadcast Server user manual Kow a&other step towards a more $le%#ble pla- out s-stem: what #$ we wa&t to cha&.e our schedule a$ter #t startedG Fe ca& do that eas#l- w#th some symbolic linkin", suppose that #&stead to use $#le &ames we use s-mbol#c l#&ks:
8n -s ed$a+dio$pes a+dio!$pes 8n -s ed$-ideo$pes -ideo!$pes 8n -s ed$a+dio$pes a+dio#$pes 8n -s ed$-ideo$pes -ideo#$pes 8n -s ed$a+dio$pes a+dio3$pes 8n -s ed$-ideo$pes -ideo3$pes pes-ideo#ts #0%, #' !!# #"00000 ! -ideo!$pes -ideo#$pes -ideo3$pes A -ideo$ts B pesa+dio#ts #0%& !!'# ,&000 3&, ! a+dio!$pes a+dio#$pes a+dio3$pes A a+dio$ts B
o cha&.e a scheduled $#le we 7ust &eed to cha&.e the s-mbol#c l#&k be$ore #t starts to be pla-:
rm rm 8n 8n a+dio#$pes -ideo#$pes -s 22$a+dio$pes a+dio#$pes -s 22$-ideo$pes -ideo#$pes
62
http://www.avalpa.com
(ool tsorts
ImptsJ Tsorts tool w#ll l#ste& to #&put &etwork a&d .rab a packet $rom #t #$ #t?s read- or replace #t w#th a &ull packet #$ there was a tra&sm#ss#o& problem a&d the packet could&?t be del#vered, here #s a& e%ample setup:
ts+dprecei-e ##,$0$!$# !#3, A inp+t$ts B torts inp+t$ts n+88$ts A tsored$ts B tspcrrestamp tsored$ts #,!30000 A stamped$ts B ts+dpsend stamped$ts ##,$0$!$#$3 !#3, #,!30000
sorts w#ll also add &ull packets #$ the #&com#&. stream #s &ot loos#&. packets but #ts b#t rate #s lower tha& the spec#$#ed. spcrrestamp w#ll take care to restamp the pcr so the 7#tter o$ the &ull p#d #&sert#o& #s reduced. o ach#ve mult#ple%#&. $rom more #&put #t #s &ecessar- to #&crease tsudprece#ve processes, let?s check a& e%ample where two #&com#&. streams are mu%ed a&d the& se&t to a&other mult#cast .roup #& output to be rece#ved b- a& #p D!B1 modulator:
ts+dprecei-e ##,$0$!$! !#3, A inp+t!$ts B ts+dprecei-e ##,$0$!$# !#3, A inp+t#$ts B torts inp+t!$ts n+88$ts A tsored!$ts B torts inp+t#$ts n+88$ts A tsored#$ts B tsc2rm+*er 24#000000 tsored!$ts 243000000 tsored#$ts o4!3#9!000 n+88$ts A m+*ed$ts B tspcrrestamp m+*ed$ts !3#9!000 A stamped$ts B ts+dpsend stamped$ts ##,$0$!$#$3 !#3, !3#9!000
'& th#s e%ample we assume the two streams are 2mbps $or 22/.E.1.1 123/ a&d 3mbps $or 22/.E.1.2 123/, tscbrmu%er w#ll #&crease the b#t rate to 132D1EE match#&. a modulat#o& scheme.
63
http://www.avalpa.com
Avalpa Broadcast Server user manual '$ the modulator #s able to add &ull p#d #s a betterto reduce the ba&dw#dth:
ts+dprecei-e ##,$0$!$! !#3, A inp+t!$ts B ts+dprecei-e ##,$0$!$# !#3, A inp+t#$ts B torts inp+t!$ts n+88$ts A tsored!$ts B torts inp+t#$ts n+88$ts A tsored#$ts B tsc2rm+*er 24#000000 tsored!$ts 243000000 tsored#$ts A m+*ed$ts B tspcrrestamp m+*ed$ts '000000 A stamped$ts B ts+dpsend stamped$ts ##,$0$!$#$3 !#3, '000000
he obv#ous problem #& such approach #s that the #$ the #&com#&. tra&sport stream have both the same +'D l#ke the +'D $or the +A the output stream w#ll be #&co&s#ste&t, so #t #s better to replace tables, $or e%ample:
ts+dprecei-e ##,$0$!$! !#3, A inp+t!$ts B ts+dprecei-e ##,$0$!$# !#3, A inp+t#$ts B torts inp+t!$ts n+88$ts A tsored!$ts B torts inp+t#$ts n+88$ts A tsored#$ts B tsc2rm+*er 24#000000 tsored!$ts 243000000 tsored#$ts A m+*ed$ts B tsmodder m+*ed$ts O0 pat$ts A modded$ts B tspcrrestamp modded$ts '000000 A stamped$ts B ts+dpsend stamped$ts ##,$0$!$#$3 !#3, '000000
3eal l#$e usa.e re8u#re $ar more comple% set1ups but are bas#call- us#&. the same tools as show& up to &ow, -ou w#ll probabl- &eed to $#lter some packets w#th tsmask or cha&.e p#d &umber w#th tsmodder a&d so o&, #t all depe&ds $rom the #&com#&. streams. '$ -ou ca& co&$#.ure #&com#&. streams to be o&l- co&te&t p#ds, l#ke aud#o, v#deo a&d telete%t, the $#&al setup wo&?t d#$$er $rom the mult#ple%#&. e%ample o$ mpts tutor#al where aud#o a&d v#deo ts $#les are replaced b- p#pes.
6/
http://www.avalpa.com
6;
http://www.avalpa.com
Appendix B9
2courtes- F#k#ped#a4 Modulat#o& B+,W
Coding rate/ Guard interval 1/4 1/8 1/16 1/32 1/2 G+HI6 1+1FH 1+A11 6+7<F 2/3 6+6<1 I+<I< I+A76 A+7G< 3/4 I+G61 A+FHG A+IAF H+7GA 5/6 A+FHG H+F@6 H+I1A @7+71< 7/8 A+I7H H+6I6 @7+FG6 @7+116 Modulat#o& 1C1BAM Coding rate/ Guard interval 1/4 1/8 1/16 1/32 1/2 H+H1< @@+71H @@+I7H @F+76G 2/3 @<+FI@ @G+IG1 @1+6@F @6+7A6 3/4 @G+HFH @6+1AA @I+16G @A+7H6 5/6 @6+1AA @A+G<@ @H+1@6 F7+@7I 7/8 @I+G@A @H+<1< F7+GH@ F@+@@F Modulat#o& C/1BAM Coding rate/ Guard interval 1/4 1/8 1/16 1/32 1/2 @G+HFH @6+1AA @I+16G @A+7H6 2/3 @H+H76 FF+@@A F<+G@H FG+@FA 3/4 FF+<HG FG+AAF F6+<G6 FI+@GG 5/6 FG+AAF FI+6GI FH+FI< <7+@67 7/8 F6+@F6 FH+7FH <7+I<I <@+66A
6C
http://www.avalpa.com
UITB(U:/. !A. //. T/ST($ST/,,I.G !((% T/ST/. !A. M0$#&U.*TI/S !((% IGITA,/ T/,/!ISI/(.T!A.G/%S about how 5pe&Caster has bee& used $or M<+ co&$orma&ce test An open source software framework for !B#K transmission
Acm paper prese&ted 7o#&tl- w#th $tw. elecommu&#cat#o&s 3esearch Ce&ter !#e&&a, !#e&&a, Austr#a at 1Cth ACM #&ter&at#o&al co&$ere&ce o& Mult#med#a !a&couver, Br#t#sh Columb#a, Ca&ada
6D
http://www.avalpa.com
Appendix
66
http://www.avalpa.com