You are on page 1of 87

Avalpa Broadcast Server user manual

Avalpa Broadcast Server


User Manual
document release 2.1
suited for OpenCaster version 3.1
date 01/03/11
1 http://www.avalpa.com
Avalpa Broadcast Server user manual
Dedicated to Anna, Asli & en!o
"#an$s to%
2 http://www.avalpa.com
Avalpa Broadcast Server user manual
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......................................................................................................
Cop/ri+#t and 0arrant/......................................................................................1
OpenCaster, t#e soft0are................................................................................1
Avalpa Broadcast Server, t#e manual.............................................................1
2irst )nstallation..................................................................................................3
4o+in into t#e s/stem......................................................................................3
Settin+ up a fi-ed )5 address..........................................................................3
Confi+ure multicast routin+............................................................................3
Scope of t#e user manual and intended audience............................................10
6o0 to read t#e manual................................................................................10
)nterestin+ and (asic readin+s......................................................................11
Avalpa Broadcast Server (asic concepts and usa+e.........................................12
7our first transport stream +oes (roadcast..................................................12
'ultiple-in+ a Sin+le 5ro+ram "ransport Stream from local files...............20
8eneratin+ 5S)/S) (asic ta(les......................................................................22
"ool dv(snoop................................................................................................2.
"ransport stream (itrate...............................................................................21
)5 net0or$ tools............................................................................................23
Avalpa Broadcast Server for advanced datacastin+.........................................29
,58................................................................................................................29
"elete-t support............................................................................................33
DS'CC carousels and data castin+..............................................................31
D:B;SS&....................................................................................................31
)nteractive ": support..................................................................................<0
"ool oc;update.s#.......................................................................................<0
'65/'6,8* si+nallin+............................................................................<1
6(("v si+nallin+.......................................................................................<*
&pdate an o(=ect carousel 0it# runnin+ applications...............................<.
Si+nallin+ Stream ,vents..........................................................................<3
DS'CC;receive.............................................................................................*3
'ultiple-in+ a 'ultiple 5ro+ram "ransport Stream from local files............*<
B)SS;, and CSA output support....................................................................*3
Avalpa Broadcast Server%Avalpa >e( ,58 8&).................................................0
eference.......................................................................................................0
3 http://www.avalpa.com
Avalpa Broadcast Server user manual
Avalpa Broadcast Server for audio/video pla/out..............................................1
)ntroduction to in+estion................................................................................1
,-tractin+ 5ro+ram and ,lementar/ Streams% ts2pes...................................3
Anal/sin+ mpe+2 video files% esvideoinfo......................................................<
"ool v(v........................................................................................................
Anal/sin+ audio elementar/ streams% esaudioinfo.........................................1
6o0 to encode mpe+2 di+ital video files 0it# ffmpe+ and m=tools...............3
6o0 to encode di+ital audio files 0it# ffmpe+...............................................9
6o0 to capture D: input...............................................................................11
6o0 to +enerate silence................................................................................12
Audio and video real case in+estion stud/ ...................................................13
Audio and video initial s/nc#roni!ation....................................................1<
,ncodin+ 0it# -2.<.......................................................................................1*
5la/ out sc#edulin+ from command line.......................................................1.
e;multiple-in+ input transport streams..........................................................32
"ool tsorts .....................................................................................................32
Appendi- A% Acron/ms, +lossar/ and references..............................................3<
Appendi- B% D:B;" transmission parameters and net (itrates........................3*
Appendi- C% elated readin+s .........................................................................3.
Appendi- D% 'pe+2 transport stream overvie0...............................................31
ADB Global, Adobe, Computer Modules, Dekec, 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
Avalpa Broadcast Server user manual
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+
Avalpa Digital Engineering
Avalpa #s a& 'tal#a& compa&- work#&. #& the d#.#tal telev#s#o& market s#&ce a lo&. t#me w#th
a 8u#te broad ra&.e o$ products a&d serv#ces $or broadcaster, .reat sk#lls, creat#v#t- a&d a&
ope& m#&d att#tude. Avalpa http://www.avalpa.com/ #s the ma#& developer o$ 5pe&Caster
a&d wrote th#s ma&ual too9 Avalpa o$$er#&. #&clude also:
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&.
Co&tacts:
a.ve&tur#:avalpa.com C05
l.pallara:avalpa.com C5
#&$o:avalpa.com $or .e&eral 8uest#o&s or order#&. #&$o.
Use cases: some examples
Avalpa Broadcast ,erver ca& tra&sm#t sta&dalo&e d#rectl- over a local)residential)hotel
television !B network or inte"rated into a broadcaster !B headend a&d comes
use$ul #& ma&- wa-s:
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
; http://www.avalpa.com
Avalpa Broadcast Server user manual
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 %45 #&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 5A. Ma&- others sce&ar#os are
poss#ble=
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/;?1
ope&caster1demo1roll he tra&sport stream #s read- to be broadcast w#th a D!B1
modulator us#&. @AM 1A, .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 132B1CCC 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$ 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&Dt re8u#re a comple% s-stem set1up a&d/or a DB or th#rd part#es hardware #&te.rat#o&.
Avalpa Broadcast Server however IS .(T (.-8 what you "et installin" (pen*aster
on your -inux pc9
14 Avalpa Broadcast ,erver also $eatures AE0, Avalpa :eb /$G, $or eve&t #&$ormat#o&
#&sert#o& a&d .e&erat#o& based o& Apache a&d M-,@), check
http://www.avalpa.com/assets/$reeso$t/ope&caster/AvalpaBroadcastEeb0+GMa&ual 1
v1.C.pd$ $or #ts ma&ual
24 Support for installation and inte"ration with third parties is far faster as the
hardware co&$#.urat#o& #s sta&dard
34 Software and hardware is carefully tested and customi;ed 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 alread- deplo-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, Eellav, DeltaCast,
,r1,-stems ...
Co&tact #&$o:avalpa.com $or #&$ormat#o& about s-stem #&te.rat#o&.
A http://www.avalpa.com
Avalpa Broadcast Server user manual
*opyri"ht and warranty
OpenCaster, the software
OpenCaster software is Copyright (C) 2008-2010 by Avalpa Digital
Engineering SRL. OpenCaster software is free sot!are" yo# $an
re%istrib#te it an%&or 'o%iy it #n%er the ter's o the ()*
(eneral +#bli$ Li$ense as p#blishe% by the ,ree Sot!are
,o#n%ation" either version 2 o the Li$ense- or (at yo#r option)
any later version. .he OpenCaster software is %istrib#te% in the
hope that it !ill be #se#l- b#t WITHOUT ANY WARRANTY" !itho#t
even the i'plie% !arranty o /ERC0A).A12L2.3 or ,2.)ESS ,4R A
+AR.2C*LAR +*R+4SE. See the ()* (eneral +#bli$ Li$ense or 'ore
%etails. 3o# sho#l% have re$eive% a $opy o the ()* (eneral +#bli$
Li$ense along !ith the OpenCaster software" i not- !rite to the
,ree Sot!are ,o#n%ation- 2n$.- 51 ,ran6lin St- ,ith ,loor-
1oston- /A 02110-1701 *SA
Avalpa Broadcast Server, the manual
h#s ma&ual #s cop-r#.hted Avalpa 2CC612C1C a&d l#ce&sed w#th
*reative *ommons Attribution#.oncommercial#Share Alike <+7
B http://www.avalpa.com
Avalpa Broadcast Server user manual
&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.
ogin into the s!stem
,o$tware w#ll usuall- ru& us#&. Avalpa user so -ou ca& lo. #& as FAvalpaG a&d the
password #s FAvalpaG $or a&- &eed about d#.#tal telev#s#o&. >ou ca& also access the server
as a super user us#&. FrootG user a&d FAvalpaG password $or s-stem set up l#ke #p address.
'$ -ou are lo.#& $rom a )#&u% s-stem -ou ca& s#mpl- use ssh, #$ -ou are lo.#& $rom a
w#&dows s-stem -ou ca& use a&- ssh cl#e&t l#ke +u>: http://www.putt-.or./
Setting up a fixed "# address
'$ -ou wa&t to cha&.e the '+ address -ou &eed to lo.#& as root a&d ed#t the $#le
F/etc/&etwork/#&ter$acesG.
mc -e /etc/network/interfaces
h#s l#&e e&ables dhcp:
iface eth0 inet dhcp
a&d ca& be replaced b- a stat#c #p address th#s wa-:
iface eth0 inet dhcp
iface eth0 inet static
address !"#$!%&$0$!
netmask #''$#''$#''$0
(atewa) !"#$!%&$0$!
A$ter the $#le #s saved 2"2 the& "1C4 -ou have to restart the &etwork #ssu#&.:
/etc/init$d/networkin( restart
A$ter restart#&. -ou ca& 7ust e%#t:

e*it
Configure multicast routing
Be$ore do#&. a&- mult#cast #t w#ll be &ecessar- to set up a route, $or e%ample:
ro+te add -net ##,$0$0$0 netmask #,0$0$0$0 de- eth0
6 http://www.avalpa.com
Avalpa Broadcast Server user manual
o co&trol #t ru& $rom a&other pc:
pin( -t ! -c # ##,$0$0$!
#t should show up -our local mult#cast1capable hosts:
.IN/ ##,$0$0$! 0##,$0$0$!1 '%0&,1 2)tes of data$
%, 2)tes from !"#$!%&$#$#034 icmp5se67! tt87#'' time70$&## ms
%, 2)tes from !"#$!%&$#$#034 icmp5se67# tt87#'' time70$9#, ms
--- ##,$0$0$! pin( statistics ---
# packets transmitted: # recei-ed: 0; packet 8oss: time !000ms
rtt min/a-(/ma*/mde- 7 0$9#,/0$993/0$&##/0$0," ms
? http://www.avalpa.com
Avalpa Broadcast Server user manual
Scope of the user manual and intended audience
h#s ma&ual deals w#th the ph#losoph- a&d the pr#&c#ples beh#&d the server des#.& a&d tr-
to smooth the path $or the user to .et 8u#ckl- ac8ua#&ted w#th the tools a&d how the- are
supposed to be used a&d #&teract each other.
he user ma&ual $#rst a#m #s to tar.et tech&#c#a&s a&d spec#al#sts #& broadcaster a&d
so$tware developme&t compa&#es who are look#&. $or a rel#able a&d accou&table basel#&e
$or d#.#tal telev#s#o& adva&ced serv#ces. Ee reall- l#ke to share most o$ th#s so$tware as we
bel#eve, $or a d#.#tal telev#s#o& market to .row, thereDs more &eed o$ d#$$ere&t serv#ces the&
tech&olo.#es so w#th a shared commo& prove& set o$ bas#c tools, we ca& all $ocus
resources a&d propose &ew co&te&ts a&d serv#ces o& top o$ a& ope&l- ava#lable
tech&olo.-.
he&, the $#&al .oal, $or th#s ma&ual, #s to show clearl- that ma&a.#&. th#s d#.#tal telev#s#o&
stu$$ #s &ot that eas- a&d that -ou, the user, should trust Avalpa #$ -ou th#&k -ou should
$ocus o& -our core bus#&ess a&d leave to pro$ess#o&als to deal w#th the .or- deta#ls o$ the
tech&olo.-. EhoDs better the& Avalpa people w#th re.ard to sk#lls, comm#tme&t a&d
w#ll#&.&ess to make w#&1w#& solut#o&s w#th customers H
$ow to read the manual
h#s ma&ual #s prov#ded A, ',, a&d &oth#&. #s .uara&teed.
Ee have wr#tte& th#s stu$$ #& .ood $a#th a&d we bel#eve there are &ot a lot o$ m#stakes.
'$ #t happe&s -ou to catch o&e, please report to ope&caster:avalpa.com so we ca& $#% #t
$or -ou a&d $or -ou mates #& th#s cra*- adve&ture o& d#.#tal telev#s#o& revolut#o&. Eould&Dt
-ou l#ke that other people would make the same cho#ce. 3#.htH
It is stron"ly su""ested to don=t skip any chapters of >Avalpa Broadcast basic
concepts and usa"e? in the manual because we assume at every followin" chapter
that the reader is confident with the content of these basic chapters+
0ver- chapter also states where to $#&d tutor#al $#les.
The 8ine written in this format are command 8ine to 2e t)ped as is in the termina8
<*amp8e4
tsrfsend samp8e$ts -mt O=>? -mC @A?!% -m/ !/, -mc #/3 -mf '9&
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
1C http://www.avalpa.com
Avalpa Broadcast Server user manual
Beware, -ou ca& .et some u&des#rable e$$ect #$ -ou do&Dt
u&dersta&d #&struct#o&s a&d $ollow them care$ull-
<elp= h#s part #s &ot completel- up to date or $#&#shed9 ma-be
-ou ca& help us, would -ou l#keH
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:
I5Cutor#als/sample.tsJ
"nteresting and %asic readings
Ee bel#eve #tDs &ot health- to ru& th#s so$tware a&d read th#s book #$ -ou do&Dt
have alread- some #dea o$ the d#.#tal telev#s#o& tech&olo.-, so at least please
read Appe&d#% b- pro$. A&to&#o Kavarro $rom Ave#ro L&#vers#t- $or a&
#&troduct#o&, $or a more deeper overv#ew have a look at FA Gu#de to M+0G
"u&dame&tals a&d +rotocols A&al-s#sG $reel- ava#lable b- ektro&#%.
Good books to .et #&to the deta#ls are: FD#.#tal !#deo a&d Aud#o Broadcast#&. ech&olo.-G
b- E."#sher a&d F'&teract#ve ! sta&dardsG b- ,teve Morr#s,
he ma#& spec#$#cat#o& 5pe&Caster re$ers to #s:
IS()I/* @<A@A#@ Information technolo"y ## Generic codin" of movin" pictures and
associated audio information9 Systems
As the spec#$#cat#o&s are a b#t dr- a&d do&Dt reall- e%pla#& the co&te%t we su..est -ou to
read them a$ter -ou are alread- 8u#te co&$#de&t w#th the overall p#cture, however #tDs 8u#te
use$ul to have #t o& -our desk to check the e%act mea&#&. o$ ever- parameter used b-
5pe&Caster that str#ctl- $ollows the &ame used #& the spec#$#cat#o& $or ever- var#able.
11 http://www.avalpa.com
Avalpa Broadcast Server user manual
Avalpa Broadcast Server basic concepts and usa"e
)etDs be.#& w#th the s#mplest wa- to stream someth#&. Fout #& the a#rG. '& the &e%t
para.raphs weDll move $rom eas- e%erc#ses to more comple% o&es, e%pla#&#&. #& .reat
deta#l what are tr-#&. to ach#eve a&d wh- we are do#&. that wa-.
Do&Dt $or.et to lo.#& as >avalpa? user and password >avalpa?, a$ter that -ou
are read- $or -our $#rst tutor#al
&our first transport stream goes %roadcast
Istart1hereJ
A ra&sport ,tream 2,4 #s made o$ packets, a packet #s the m#&#mum u&#t that ca&&ot be
spl#tted, has a $#%ed le&.th o$ 166 b-tes a&d alwa-s starts w#th a s-&ch b-te 2C%/B4.
0ach table or eleme&tar- stream #& a tra&sport stream #s #de&t#$#ed b- a 131b#t +'D. A
demult#ple%er e%tracts eleme&tar- streams $rom the tra&sport stream #& part b- look#&. $or
packets #de&t#$#ed b- the same +'D. '& most appl#cat#o&s, t#me1d#v#s#o& mult#ple%#&. w#ll be
used to dec#de how o$te& a part#cular +'D appears #& the tra&sport stream.
ra&sport stream br#&.s also a lo.#c represe&tat#o& o$ the carr#ed co&te&t, ma#&l- w#th the
co&cept o$ pro.rams. A s#&.le pro.ram #s descr#bed b- a +ro.ram Map able 2+M4 wh#ch
has a u&#8ue +'D, a&d the eleme&tar- streams assoc#ated w#th that pro.ram have +'Ds
l#sted #& the +M. "or #&sta&ce, a tra&sport stream used #& d#.#tal telev#s#o& m#.ht co&ta#&
three pro.rams, to represe&t three telev#s#o& Fcha&&elsG. ,uppose each cha&&el co&s#sts
o$ o&e v#deo stream, o&e or two aud#o streams, a&d a&- &ecessar- metadata. A rece#ver
w#sh#&. to decode a part#cular Mcha&&elM merel- has to decode the pa-loads o$ each +'D
assoc#ated w#th #ts pro.ram. 't ca& d#scard the co&te&ts o$ all other +'Ds.
o make sure -ou ca& broadcast a&d rece#ve a tra&sport stream check -our set up w#th the
sample , prese&t#&. o&l- o&e v#deo w#th o&e aud#o.
A$ter lo.#& cha&.e #&to d#rector- start1here:
cd start-here
'$ -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&
#$ -our server #s e8u#pped w#th D!B1A,' $rom -ou w#ll have:
tsasisend samp8e$ts -r !3#9!000
12 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&Dt have e&ou.h t#me to
tu&e a&d search the serv#ce o& the set top bo% so letDs #&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 FclockG 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&Dt see a&- .l#tch.
13 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 C.6./ are reported to do&Dt 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 properl-
stamped #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 F$#$oG 2F"#rst '& "#rst 5utG4
$#$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 DND 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 ;B6 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
Avalpa Broadcast Server user manual
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.
1; http://www.avalpa.com
Avalpa Broadcast Server user manual
letDs check the serv#ce Avalpa 1:
-ou w#ll probabl- &ot#ce a lot o$ arte$acts a&d the colour bars wo&Dt tur& smoothl- over
Avalpa lo.o, letDs check whatDs happe&#&. w#th some a&al-ser tool.
1A http://www.avalpa.com
Avalpa Broadcast Server user manual
Ee w#ll show, as e%ample, some scree&shots $rom ,treamPpert a&al-*er b- Dektec, here
the- come:
1B http://www.avalpa.com
Avalpa Broadcast Server user manual
someth#&. seems wro&. w#th the +C3, thatDs 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#&. FtsstampG 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&
2132B1CCC #$ -ou recall was the b#t rate we are modulat#&.4
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. Ee w#ll
16 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 odd= Ee 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&...
1? http://www.avalpa.com
Avalpa Broadcast Server user manual
'ultiplexing a Single #rogram (ransport Stream from local files
I$#rst1$#le1mu%J
o broadcast a tra&sport stream $rom aud#o a&d v#deo $rames -ou &eed to e&code aud#o
a&d v#deo.
Ee w#ll d#scuss later how to e&code aud#o a&d v#deo because #tDs a more adva&ced top#c,
$or &ow letDs $ocus o& mult#ple%#&..
he ma&dator- sta&dard $or $ree v#ew re8u#res the $ollow#&. s#.&all#&. tables: +A, +M,
,D a&d K' $or a D!B stream.
Kow that -ou .ot all the streams $rom the sample tutor#al, -ou &eed to mu% them to.ether
be$ore output them, tscbrmu%er #s the tool $or th#s task.
tscbrmu%er .ets as #&put a .ts $#le a&d #ts ow& b#trate, $or e%ample:
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+*ed$ts
K.B. -ou &eed to stop tscbrmu%er w#th a s#.&al 2C3)1C4 or #t w#ll .o o& $#ll#&. -our hard
d#sk, thatDs 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/?A?1A 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#&. streamsH 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- ;CC 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 ??Q 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&Dt &eed to stop
#t later o&, b#t1rates ca&Dt 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 $#% thatH
2C 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 2C%""4 w#th $#%ed +'D 61?1, 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& 1CMbps but th#s #s
7ust a& e%ample=
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/.C.1.2:BCC1 , 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#sk= <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.
21 http://www.avalpa.com
Avalpa Broadcast Server user manual
)enerating #S"*S" %asic ta%les
Ips#1.e&erat#o&J
)etDs cha&.e our tra&sport stream, $or e%ample we wa&t to cha&.e the serv#ce &ame $rom
MAvalpa 1M to M5pe&Caster 1M.
he &ame o$ the serv#ce #s #& the ,D table so we w#ll &eed to .e&erate a &ew sdt.ts.
sdt.ts #s .e&erated b- a tools Msec2tsM thats e&capsulate sect#o&s #&to ts packets, #t works
th#s wa-:
sec#ts !9 C firstsdt$sec A firstsdt$ts
sdt.sec #s the sect#o& o$ the sdt, 1B #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 oi$ial val#e sho#l% be %e'an%e% to %vb org
ori(ina85network5id 7 !: 8 %e'o val#e- an oi$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 inor'ation is broa%$aste%- 1 broa%$aste%
<IT5present5fo88owin(5f8a( 7 0: 8 0 no ne9t event inor'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
h#s p-tho& scr#pt ca& be e%ecuted w#th
$/firstsdt$p)
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"1C4 a&d e&ter the
$ollow#&. comma&d:
$/firstsdt$p)
22 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
Ehat w#ll happe& to the old o&eH #$ -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, thatDs 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 3CC /A6M -ou w#ll $#&d the descr#pt#o& o$ ever-
s#&.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&Dt &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 oi$ial val#e sho#l% be %e'an%e% to %vb org
a-a8pa5ori(ina85transport5stream5id 7 ! 8 %e'o val#e- an oi$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 2nor'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
23 http://www.avalpa.com
Avalpa Broadcast Server user manual
!ill $o'pare its version !ith the ne! one an% #p%ate the table
section5n+m2er 7 0:
8ast5section5n+m2er 7 0:
1
8
8 +rogra' Asso$iation .able (2S4&2EC 17818-1 2.:.:.7)
8
pat 7 pro(ram5association5section0
transport5stream5id 7 a-a8pa5transport5stream5id:
pro(ram58oop 7 D
pro(ram58oop5item0
pro(ram5n+m2er 7 a-a8pa!5ser-ice5id:
.I> 7 a-a8pa!5pmt5pid:
1:
pro(ram58oop5item0
pro(ram5n+m2er 7 0: 8 spe$ial progra' or the )2.
.I> 7 !%:
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
!ill $o'pare its version !ith the ne! one an% #p%ate the table
section5n+m2er 7 0:
8ast5section5n+m2er 7 0:
1
8
8 Servi$e Des$ription .able (E.S2 E) 700 :;8 5.2.7)
8 this is a basi$ SD. !ith the 'ini'#' %es$iptors- 4penCaster has a big library rea%y to #se
8
sdt 7 ser-ice5description5section0
transport5stream5id 7 a-a8pa5transport5stream5id:
ori(ina85network5id 7 a-a8pa5ori(ina85transport5stream5id:
ser-ice58oop 7 D
ser-ice58oop5item0
ser-ice5I> 7 a-a8pa!5ser-ice5id:
<IT5sched+8e5f8a( 7 0: 8 no $#rrent even inor'ation is broa%$aste%- 1 broa%$aste%
<IT5present5fo88owin(5f8a( 7 0: 8 no ne9t event inor'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 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:
-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
8
8 +rogra' /ap .able (2S4&2EC 17818-1 2.:.:.8)
8 this is a basi$ +/. the the 'ini'#' %es$iptors- 4penCaster has a big library rea%y to #se
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
2/ http://www.avalpa.com
Avalpa Broadcast Server user manual
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:
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.
2; http://www.avalpa.com
Avalpa Broadcast Server user manual
(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
Dvbs&oop w#ll show -ou #&$ormat#o& about the +A:
.I>4 0 00*00001 D7 assi(ned for4 IFO !3&!&-! .ro(ram Association Ta28e 0.AT1E
/+ess ta28e from ta28e id$$$
.AT-decodin($$$$
Ta28e5I>4 0 00*001 D7 .ro(ram Association Ta28e 0.AT1E
section5s)nta*5indicator4 ! 00*0!1
0fi*ed14 0 00*001
reser-ed5!4 3 00*031
Fection58en(th4 !9 00*00!!1
Transport5Ftream5I>4 ! 00*000!1
reser-ed5#4 3 00*031
Hersion5n+m2er4 ! 00*0!1
c+rrent5ne*t5indicator4 ! 00*0!1 D7 -a8id nowE
Fection5n+m2er4 0 00*001
Iast5Fection5n+m2er4 0 00*001
.ro(ram5n+m2er4 ! 00*000!1
reser-ed4 9 00*091
.ro(ram5map5.I>4 !03! 00*0,091

.ro(ram5n+m2er4 0 00*00001
reser-ed4 9 00*091
Network5.I>4 !% 00*00!01
CRC4 %!,&,&&!0 00*#,a'd"#a1
2A http://www.avalpa.com
Avalpa Broadcast Server user manual
(ransport stream %itrate
Istart1hereJ
o lear& a b#t rate o$ a tra&sport stream $#le -ou ca& use tspcrmeasure #& th#s wa-:
tspcrmeas+re samp8e$ts ,000000
Ehere /CCCCCC #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&#%Ds MA )a-ma&Ds 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.
2B http://www.avalpa.com
Avalpa Broadcast Server user manual
"# networ+ tools
Istart1hereJ
5pe&Caster 2.C $or the $#rst t#me $eatured some tools to se&d a tra&sport stream over a& '+
&etwork a&d the#r usa.e #s ver- s#mple to e%plo#t. As #& ever- real word problem, there are
some #ssues -ou should be co&cer&ed o$.
)etDs see a& e%ample:
tstcprecei-e 900! A recei-ed$ts
Jindin( the socket$$$
h#s comma&d w#ll start a process wa#t#&. $or a& #&com#&. co&&ect#o& o& port BCC1 that
ca& be made $rom a&other pc:
tstcpsend samp8e$ts !"#$!%&$!$# 900! 3000000
Ehere 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&Dt 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 #tDs a r#sk to use LD+ as a
Fco&tr#but#o& l#&kG betwee& 5pe&Caster tools w#thout #mpleme&t#&. some recover-
strate.-. 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 &ecessar-
al.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: FMult#ple%#&. a ,#&.le +ro.ram ra&sport
,treamG.
'&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, thatDs wh-
$or &ow we str#ctl- supports LD+ o&l-.
26 http://www.avalpa.com
Avalpa Broadcast Server user manual
Avalpa Broadcast Server for advanced datacastin"
E#)
Ie#tJ
A& #&terest#&. s#.&all#&. #s the 0', 0ve&t '&$ormat#o& able, these tables are rece#ved b-
the bo% a&d used to .e&erate the 0lectro&#c +ro.ram Gu#de.
<ave a look at e#tco&$#..p-, #t #s a template, so -ouDll &eed to cha&.e the date a&d the t#me
$rom the p-tho& co&$#. to -our curre&t t#me so the decoder w#ll show the eve&ts as the- are
com#&. #& a short t#me.
D$$$E
8
8 Event 2nor'ation .able (E.S2 E) 700 :;8 5.2.:)
8
eit 7 e-ent5information5section0
ta28e5id 7 <IT5ACTUAI5TF5.R<F<NT5=OIIOWIN/:
ser-ice5id 7 a-a8pa!5ser-ice5id:
transport5stream5id 7 a-a8pa5transport5stream5id:
ori(ina85network5id 7 a-a8pa5ori(ina85transport5stream5id:
e-ent58oop 7 D
e-ent58oop5item0
e-ent5id 7 !:
start5)ear 7 !0&: 8 sin$e 1<00
start5month 7 %:
start5da) 7 !0:
start5ho+rs 7 0*00: 8 #se he9 li6e %e$i'als
start5min+tes 7 0*00:
start5seconds 7 0*00:
d+ration5ho+rs 7 0*#3:
d+ration5min+tes 7 0*00:
d+ration5seconds 7 0*00:
r+nnin(5stat+s 7 ,:8servi$e is r#nning-1 not r#nning-2 starts in a e! se$on%s-7 pa#se
free5CA5mode 7 0: 8 servi$e is not s$ra'ble%- 1 'eans at least a strea' is s$ra'ble%
e-ent5descriptor58oop 7 D
short5e-ent5descriptor 0
IFO%3"58an(+a(e5code 7 GitaG:
e-ent5name 7 Gep( e-ent nameG:
te*t 7 Gthis is an ep( e-ent te*t e*amp8eG:
1
E:
1:
E:
-ersion5n+m2er 7 !:
section5n+m2er 7 0:
8ast5section5n+m2er 7 !: 8 pay attention here- !e have another se$tion ater this=
8ast5se(ment5section5n+m2er 7 !:
1
eit5fo88ow 7 e-ent5information5section0
ta28e5id 7 <IT5ACTUAI5TF5.R<F<NT5=OIIOWIN/:
ser-ice5id 7 a-a8pa!5ser-ice5id:
transport5stream5id 7 a-a8pa5transport5stream5id:
ori(ina85network5id 7 a-a8pa5ori(ina85transport5stream5id:
e-ent58oop 7 D
e-ent58oop5item0
e-ent5id 7 #:
2? http://www.avalpa.com
Avalpa Broadcast Server user manual
start5)ear 7 !0&: 8 sin$e 1<00
start5month 7 0%:
start5da) 7 !0:
start5ho+rs 7 0*#3:
start5min+tes 7 0*30:
start5seconds 7 0*00:
d+ration5ho+rs 7 0*!#:
d+ration5min+tes 7 0*00:
d+ration5seconds 7 0*00:
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 servi$e is not s$ra'ble%- 1 'eans at least a strea' is s$ra'ble%
e-ent5descriptor58oop 7 D
short5e-ent5descriptor 0
IFO%3"58an(+a(e5code 7 GitaG:
e-ent5name 7 Gep( e-ent name #G:
te*t 7 Gthis is the fo88owin( te*t e*amp8eG:
1
E:
1:
E:
-ersion5n+m2er 7 !:
section5n+m2er 7 !: 8 this is the se$on% se$tion
8ast5section5n+m2er 7 !:
8ast5se(ment5section5n+m2er 7 !:
1
D$$$E
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. hatDs 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&Dt 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&
)etDs have a look at the decoder #&$ormat#o&s:
3C http://www.avalpa.com
Avalpa Broadcast Server user manual
31 http://www.avalpa.com
Avalpa Broadcast Server user manual
a&d to the a&al-ser too:
All .ree& l#.hts= 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.
32 http://www.avalpa.com
Avalpa Broadcast Server user manual
(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, letDs 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.
3ACC #s the &umber o$ +, clocks $or the $#rst +0, packet wh#le 16CC #s the #&creme&t o$
the +, clock ever- +0, packet, 16CC #s actuall- ;C +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 1?B6.
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:
Fpes packet s#*e w#thout A b-te header #s 11// G
th#s mea&s:
11// R A S 11;C b-tes per packet
11;C / 16/ 2, packet pa-load4 S B , packet ever- +0, packet
B T 166 T 6 1U 1C;26 per +0,
#$ +0, .oes at 3ACC mea&s: 1C;26 T 2?CCCC / 3ACC4 1U 2A32CC bps
"or the prev#ous e%ample we have:
B3C R A 1U B3A / 16/ 1U / T 166 T 6 1U AC1A T 2?CCCC / 16CC4 1U 3CC6CC bps
,o the $#&al processes la-out assum#&. the telete%t packets are alread- .e&erated a&d
33 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: 1CC, 2C2, 3C2 a&d /C/ +a.e 1CC 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
Avalpa Broadcast Server user manual
3; http://www.avalpa.com
Avalpa Broadcast Server user manual
0ver- pa.es #s made o$ telete%t packets, each packet #s a& u&#t. he $#rst packet #s the
header l#&e packets a&d looks l#ke th#s:
<JUTe8ete*t0
data5+nit5id 7 0*0#: 0*0# non-s+2tit8e: 0*03 s+2tit8es: 0*==
st+ffin(
fie8d5parit) 7 0!: which fie8d odd or e-enK
8ine5offset 7 0*9: this is the first +sef+8 ana8o( 8ine to insert
the information
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
1:
+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:
3A http://www.avalpa.com
Avalpa Broadcast Server user manual
DS'CC carousels and data casting
D,MCC #s o&e o$ the sta&dard to broadcast $#les over tra&sport streams.
he most commo& uses are to broadcast decoder so$tware up.rades D!B1,,L a&d/or
appl#cat#o&s $or #&teract#ve telev#s#o& l#ke M<+/5CA+2tru2wa-4/M<0G;/...
o #mpleme&t carousels #&to 5pe&Caster arch#tecture a d#rector- has to be marshalled #&to
a tra&sport stream a&d the tra&sport stream $#le &eed to be recreated ever- t#me the
d#rector- cha&.e, l#ke +,' tables.
'$ the carousel #s created properl- -ou w#ll 7ust &eed to add #t to all the other tra&sport
streams #&to -our mult#ple%#&. loop.
o add more carousels -ou w#ll &eed 7ust to add them l#ke a&- other tra&sport stream $#le to
the mult#ple%#&..
!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 #tDs &ot e%pected to work
out o$ the bo% $or a&- decoder, #tDs 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:
't #s also &ecessar- to add the dsmcc descr#ptor to the pmt:
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
3B http://www.avalpa.com
Avalpa Broadcast Server user manual
e8ementar)5.I> 7 a-a8pa!5dsmcc5pid:
e8ement5info5descriptor58oop 7 D
stream5identifier5descriptor0
component5ta( 7 dsmccJ5association5ta(:
1:
E
1
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 FmoduleG, 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,' , 1C2 CCA

>F?CC description

(! 7 /ro+p0
.ATH7G>II-!$secG:
transactionId 7 0*&000000#:
down8oadId 7 0*0000000!:
28ockFiLe 7 ,0%%:
36 http://www.avalpa.com
Avalpa Broadcast Server user manual
-ersion 7 !:
1
(!$set0
compati2i8it)>escriptor 7 comp5desc!$pack01:
mod+8es 7 D
?od+8e0
IN.UT7Gocdir!/RootRe8ook#!00G:
mod+8eId 7 0*000!:
mod+8eHersion 7 0*00:
descriptors 7 Dname5descriptor0name7Ga 2inG1E:
1:
?od+8e0
IN.UT7Gocdir!/RootRe8ook#!0!G:
mod+8eId 7 0*000#:
mod+8eHersion 7 0*00:
descriptors 7 Dname5descriptor0name7Ga 2inG1E:
1:
DPE
(# 7 /ro+p0
.ATH7G>II-#$secG:
transactionId 7 0*&000000,:
down8oadId 7 0*0000000#:
28ockFiLe 7 ,0%%:
-ersion 7 !:
1
(#$set0
compati2i8it)>escriptor 7 Ghe88oG:
mod+8es 7 D
?od+8e0
IN.UT7G2i(-fi8e$rawG:
mod+8eId 7 0*00!0:
mod+8eHersion 7 0*00:
descriptors 7 Dname5descriptor0name7Ganother 2inG1E:
1:
E:
1
dsi 7 F+per/ro+p0
.ATH 7 G/G:
transactionId 7 0*&0000000:
-ersion 7 !:
1
dsi$set0
compati2i8it)>escriptor 7 GQ000Q000G: as specified in etsi !0# 00%
1
dsi$add/ro+p0(!1
dsi$add/ro+p0(#1
"#&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
3? http://www.avalpa.com
Avalpa Broadcast Server user manual
"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: C%B 2114
the vers#o& o$ the modules a&d sect#o&s o$ the carousel #s: ;
the p#d o$ the stream #s: 2CC3
the #d o$ the carousel to use #& the +M #s: B
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 /CAA 2ma%#mum4
the update $la. #s set o$$
the head o$ the carousel 2D,'/D''/,GE w#ll be se&t o&ce at carousel start a&d o&ce
/C 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#rector-
oc-+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. Ee &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
A4 the decoder e%ecutes the appl#cat#o&
,o letDs have a look at mhpco&$#..p- o& how to act#ve th#s, $#rst o$ all the +M $or the
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
/1 http://www.avalpa.com
Avalpa Broadcast Server user manual
AIT5-ersion 7 !: 8 $#rrent ait version
1:
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$iying DS/CC properites
association5ta(5descriptor0
association5ta( 7 0*J: 8 this asso$iation tag i%entiys the $aro#sel- it is
#se% also !hile generating the DS/CC !ith o$-#p%ate.sh an% reeren$e% by the A2.
+se 7 0: 8 so'e %ea#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 %ierent n#'ber ro'
asso$iation&$o'ponent tag- b#t it has a si'iliar p#rpo#seA i%entiying 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$iying this is DS/CC-/0+ - 2;2
or 'heg5
I>5se8ector52)tes 7 GG: 8 or 'heg5 yo# nee% sele$tor bytes BC001C001C000C000B-
1:
E
1
E:
D$$$E
.+B+ To add another AIT stream or another SM** you will have to add more
streamBloopBitems D
'& mhpco&$#..p- -ou ca& also $#&d a& A' e%ample that w#ll .e&erate a& $#rsta#t.ts tra&sport
stream $#le, letDs have a look at #t:
8 Appli$ation 2nor'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 +roile an% /0+ version
-ersion5maNor 7 !:
-ersion5minor 7 0:
-ersion5micro 7 #:
/2 http://www.avalpa.com
Avalpa Broadcast Server user manual
ser-ice52o+nd5f8a( 7 !: 8 the appli$ation is e9pe$te% to %ie on servi$e $hange-
0 !ill !ait ater the servi$e $hange to re$eive all the A2.s an% $he$6 i the sa'e app is signalle%
or not
-isi2i8it) 7 3: 8 the appli$ations is visible to the #ser- 1 the appli$ation is
visible only to other appli$ations
app8ication5priorit) 7 !: 8 is lo!set- !hen 'ore than 1 app. is e9e$#ting
transport5protoco858a2e8s 7 D!E: 8 $aro#sel 2%
1:
app8ication5name5descriptor0app8ication5name 7 GTe*t inp+t e*amp8eG1:
d-25N5app8ication5descriptor0parameters 7 DGfi8e4//!/samp8e&GE1: 8 9let para'eters
d-25N5app8ication58ocation5descriptor0
2ase5director) 7 G/G: 8 base %ire$tory- i set to B&helloB the 9let !ill a$t as
B&helloB is its root %ire$tory
c8ass5path5e*tension 7 GG: 8 an a%%itiona $lasspath insi%e the $aro#sel
initia85c8ass 7 GWiLardG: 8 the starting $lass
1:
E:
1:
E:
1
Kow e%ecute:
$/mhpconfi($p)
to .e&erate $#rsta#t.ts a&d others s#.&all#&. tables a&d e%ecute
oc-+pdate$sh ocdir! 0*J ' #003 ! # 0 0 ,0%% ! #
to .e&erate ocd#r1.ts so -ou are read- to mult#ple% -our $#rst ,#&.le +ro.ram ra&sport
,tream w#th a& #&teract#ve appl#cat#o&:
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&
/3 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&:
<ere -ou ca& see the %let dur#&. e%ecut#o&.
// http://www.avalpa.com
Avalpa Broadcast Server user manual
0bbTv si"nallin"
IhbbtvJ, Ihbbtv1dsmccJ
A& e%ample o$ <bbv 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, letDs 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#l1B shows a& e%ample where the <bb! appl#cat#o& #s se&t over D,MCC
/; http://www.avalpa.com
Avalpa Broadcast Server user manual
Update an obEect carousel with runnin" applications
ImhpJ
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 FEr#te someth#&.=G to FEr#te
someth#&.= Lpdate=G. >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:
/A http://www.avalpa.com
Avalpa Broadcast Server user manual
A& #&terest#&. $eatures o$ )#&u% ker&el s#&ce 2.A.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
/B http://www.avalpa.com
Avalpa Broadcast Server user manual
Si"nallin" Stream /vents
Imhp1streameve&tsJ
<ave -ou ever asked how ca& -ou s-&chro&#*e a ru&&#&. appl#cat#o& to a v#deo pro.ram
o&1.o#&.. <ow ca& -ou se&d a s#.&al to a& #&teract#ve appl#cat#o& at a& e%act po#&t #& t#me,
whe& that eve&t #s reall- happe&#&. o& the v#deo streamH
he a&swer #s: ,tream 0ve&t Fdo #t &owG=
h#s adva&ced top#c chapter re.ards e%actl- how to s#.&al #&teract#ve appl#cat#o&s a&d
,tream 0ve&t ma&a.eme&t.
,tream eve&ts are s#.&als se&t o& a part#cular +'D to the #&teract#ve appl#cat#o& a&d the-
are actuall- de$#&ed as all the other tables, have a look at the ,tream 0ve&t de$#&ed #&
mhpco&$#.2.p-:
D$$$E

Ftream <-ent

ste 7 stream5e-ent5section0
e-ent5id 7 !:
stream5e-ent5descriptor58oop 7 D
stream5e-ent5do5it5now5descriptor0
e-ent5id 7 !:
pri-ate5data 7 Ge-ent ! pri-ate dataG:
1:
E:
-ersion5n+m2er 7 !:
section5n+m2er 7 0:
8ast5section5n+m2er 7 0:
1
D$$$E
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 <bbv supports stream eve&ts w#th the same .e&erat#o& process.
/6 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& Mest ,tream 0ve&tM:

'$ -ou e%ecute the appl#cat#o&, #t w#ll start a&d wa#t $or the ,tream 0ve&t:
/? http://www.avalpa.com
Avalpa Broadcast Server user manual
;C http://www.avalpa.com
Avalpa Broadcast Server user manual
'$ -ou d#d&Dt &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&Dt 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& #tDs 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
to stop se&d#&. the eve&t 7ust put the &ull.ts back
cp n+88$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 #tDs &ecessar- to create a ,tream 0ve&t 5b7ect #&to the $#le s-stem -ou wa&t to
broadcast, thatDs 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 %eine% into +/. or the Strea' Event
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: 8 na'e o the events
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
<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% $$
;1 http://www.avalpa.com
Avalpa Broadcast Server user manual
-rw-r--r-- ! 8orenLo 8orenLo #! #009-!#-0, !#4!9 here5is5caro+se8#
drw*r-*r-* # 8orenLo 8orenLo ,0"% #009-!#-0, !#4!9 test$e-ent
-rw-r--r-- ! 8orenLo 8orenLo 39"% #009-!#-0, !#4!9 Testste$c8ass
8orenLoWn2-8pa88ara4X/OpenCaster/e*amp8e-confi(V 8s -8a ocdir#/test$e-ent/
tota8 #0
drw*r-*r-* # 8orenLo 8orenLo ,0"% #009-!#-0, !#4!9 $
drw*r-*r-* 3 8orenLo 8orenLo ,0"% #009-!#-0, !#4!9 $$
-rw-r--r-- ! 8orenLo 8orenLo 9 #009-!#-0, !#4!9 $eid
-rw-r--r-- ! 8orenLo 8orenLo #" #009-!#-0, !#4!9 $ename
-rw-r--r-- ! 8orenLo 8orenLo & #009-!#-0, !#4!9 $tap
Ehe& 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.p-
hese 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.p-
D$$$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-
;2 http://www.avalpa.com
Avalpa Broadcast Server user manual
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 22CC3 #& the e%ample4 #&to a
tra&sport stream $#le, the seco&d w#ll output the dsmcc $#les-stem #& the outputd#r d#rector-
however to process the dsmcc #t &eeds to k&ow the +'D 22CC34 a&d the compo&e&t ta.
2C%B4.
1CC #s a cache value, #t spec#$#es that #t ca& store up to 1CC sect#o&s eve& #$ #tDs &ot sure #$
the- belo&. to the curre&t dsmcc or &ot.
;3 http://www.avalpa.com
Avalpa Broadcast Server user manual
'ultiplexing a 'ultiple #rogram (ransport Stream from local files
ImptsJ
o broadcast two or more pro.rams at the same t#me 2the ver- co&cept o$ a mult#ple%
creat#&. a Fmult# pro.ram tra&sport streamG AWA M+,4, -ou bas#call- add more aud#o.ts
a&d more v#deo.ts $#le to tscbrmu%er a&d s#.&al the streams w#th the ps# table, $or a
complete e%ample dow&load:
hese p-tho& scr#pts e&ds w#th a s-stem comma&d #&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.
Aud#o a&d v#deo are alread- mult#ple%ed #&to mptsavT.ts $#les.
<ave a look at mptsco&$#..p-, e%ecute #t w#th ./mptsco&$#..p- a&d the& start mu%#&. a&d
pla-#&.: 2remember -ou &eed a $#$o: mk$#$o m-$#rst$#$o.ts4
tsc2rm+*er 24#300000 first-ideo$ts 24!&&000 firsta+dio$ts 24#300000 second-ideo$ts 24!&&000
seconda+dio$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
tsrfsend m)firstfifo$ts -mt O=>? -mC @A?!% -m/ !/, -mc #/3 -mf '9&
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
Avalpa Broadcast Server user manual
;; http://www.avalpa.com
Avalpa Broadcast Server user manual
"#&all- letDs check the a&al-ser a.a#& $or the serv#ces a&d the#r +C3:
;A http://www.avalpa.com
Avalpa Broadcast Server user manual
;B http://www.avalpa.com
Avalpa Broadcast Server user manual
B"SS-E and CSA output support
IcsaJ
Avalpa Broadcast ,erver ca& scramble the tra&sport stream us#&. C,A a&d support B',,1
0 mode 1.
scr-pt w#ll scramble -our tra&sport stream, however #t re8u#res l#bdvbcsa prov#ded b- th#rd
part#es a&d &ot #&stalled o& the server b- de$ault.
o #&stall the so$tware proceed as $ollow:
mkdir 8i2d-2csa
cd 8i2d-2csa
s-n co s-n4//s-n$-ideo8an$or(/8i2d-2csa
cd 8i2d-2csa/tr+nk
a+toconf
$/confi(+re
make
s+ 0insert root password: defa+8t is A-a8pa1
make insta88
e*it
cd /home/OpenCaster/software/too8s/tscr)pt
make
s+ 0insert root password: defa+8t is A-a8pa1
make insta88
e*it
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:
;6 http://www.avalpa.com
Avalpa Broadcast Server user manual
letDs tr- some output:
r+n once on8)
$/2issconfi($p)
tscr)pt ke)s$cw first-ideo$ts A first-ideocr)pted$ts
tscr)pt ke)s$cw firsta+dio$ts A firsta+diocr)pted$ts
mkfifo m)firstfifo$ts
mkfifo m)secondfifo$ts
a8wa)s r+nnin(
tsc2rm+*er 24#300000 first-ideocr)pted$ts 24!&&000 firsta+diocr)pted$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&
he co&trol word used #s C%CC C%CC C%CC C%CC C%C1 C%C2 C%C3 C%A
h#s wo&Dt 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+
;? http://www.avalpa.com
Avalpa Broadcast Server user manual
Avalpa Broadcast Server9Avalpa :eb /$G GUI
.eference
Alread- #&stalled o& the Avalpa Broadcast ,erver there #s a 0letro&#c +ro.ram GL'
.e&erator tha& ca& co&$#.ured b- web. A complete ma&ual #s ava#lable #& 'tal#a& a&d
0&.l#sh tra&slat#o& #s o& the wa-, #& the mea&wh#le a $ew top#cs are alread- covered.
Check out the .u#de at:
http://www.avalpa.com/assets/$reeso$t/ope&caster/AvalpaBroadcastEeb0+GMa&ual 1
v1.C.pd$
<ere #s a& actual scree&shot:
AC http://www.avalpa.com
Avalpa Broadcast Server user manual
Avalpa Broadcast Server for audio)video playout
Avalpa Broadcast ,erver e&ables -ou to set up a pla- out s-stem o$ a se8ue&ce o$ pre1
e&coded $#les, the $ollow#&. chapters descr#be aud#o/v#deo pla-out s-stem, -ou ca& sk#p
th#s sect#o& #$ -ou are #&terested #& such usa.e
h#s shot shows the pla- out s-stem #& act#o&, stra#.ht $rom a Fbud.etG tv set, he&ce the
#&terlac#&., mo#reD a&d hor#*o&tal sca&l#&e art#$acts==
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#sD tools are prese&ted to make sure
Avalpa Broadcast ,erver #s $#lled w#th proper #&put $rom the e&coders.
A1 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 i"ital aka ac<
olby i"ital $lus
TS 2on test5
hF6G 2on test5
Most o$ audio encoders usuall- wo&Dt 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&codersD co&$#.urat#o& a&d match them w#th
Avalpa Broadcast ,erverDs 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&. <2A/ 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. Eork#&. 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.
A2 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.
Extracting #rogram and Elementar! Streams: ts/pes
I$#rst1$#le1mu%J
Avalpa Broadcast ,erver comes w#th some tools to a&al-se +ro.ram a&d 0leme&tar-
,tream, these are the bas#c operat#o&s &eeded to val#date -our #&put $#les be$ore us#&.
them #& the pla- out, th#s sect#o& w#ll #&troduce -ou also the bas#c co&cepts -ou have to
master #$ -ou wa&t a smooth pla- out work#&. w#thout problems o& a&- decoder.
tsFpes w#ll e%tract $rom a tra&sport stream the pro.ram eleme&tar- stream descr#bed w#th
a +'D, $or e%ample:
ts#pes first-ideo$ts #0%, A -ideoo+tp+t$pes
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
5uput #s someth#&. l#ke:
D$$$E
pes header4 00 00 0! e0: -ideo stream n+m2er 0: header 8en(th4 ': .resentation Time Ftamp is4
"&"!00: !0$""00 sec$
pes header4 00 00 0! e0: -ideo stream n+m2er 0: header 8en(th4 ': .resentation Time Ftamp is4
""#900: !!$0300 sec$
pes header4 00 00 0! e0: -ideo stream n+m2er 0: header 8en(th4 !0: .resentation Time Ftamp is4
!009!00: !!$!"00 sec$: >ecode Time Ftamp is4 ""%300: !!$0900 sec$
pes header4 00 00 0! e0: -ideo stream n+m2er 0: header 8en(th4 ': .resentation Time Ftamp is4
""""00: !!$!!00 sec$
D$$$E
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 ?C<* 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&tar-
stream.
he tool takes as #&put a pro.ram eleme&tar- stream $#le a&d a stream header #d, -ou ca&
A3 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 C%eC 222/4, thatDs a t-p#cal v#deo #d wh#le t-p#cal aud#o #d #s C%cC
21?24
ts#pes firsta+dio$ts #0%& A a+dioo+tp+t$pes
pes#es a+dioo+tp+t$pes !"# A a+dio$es
Anal!sing mpeg/ video files: esvideoinfo
I$#rst1$#le1mu%J
he comma&d:
es-ideompe(#info -ideo$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: -2-
de8a)4 ##,!,
frame siLe4 9&"'&
.ostion 3%0,#,#: pict+re !#0 start header4 tempora8 reference4 0: pict+re codin( t)pe4 J-=rame: -2-
de8a)4 !%'3"
frame siLe4 !9%"9
.ostion 3%#!"3": pict+re !#! start header4 tempora8 reference4 !: pict+re codin( t)pe4 J-=rame: -2-
de8a)4 !&0!'
frame siLe4 !&##3
.ostion 3%,0!%#: pict+re !## start header4 tempora8 reference4 ': pict+re codin( t)pe4 .-=rame: -2-
de8a)4 !",#&
frame siLe4 303&'
.ostion 3%90',9: pict+re !#3 start header4 tempora8 reference4 3: pict+re codin( t)pe4 J-=rame: -2-
de8a)4 !"3&#
frame siLe4 !&!3&
.ostion 3%&&%&': pict+re !#, start header4 tempora8 reference4 ,: pict+re codin( t)pe4 J-=rame: -2-
de8a)4 #0&0%
frame siLe4 #3,#%
.ostion 39!#!!!: pict+re !#' start header4 tempora8 reference4 &: pict+re codin( t)pe4 .-=rame: -2-
de8a)4 #!'"'
frame siLe4 #""&,
.ostion 39,#0"': pict+re !#% start header4 tempora8 reference4 %: pict+re codin( t)pe4 J-=rame: -2-
de8a)4 #!'"9
frame siLe4 !9!&"
.ostion 39'"#&,: pict+re !#9 start header4 tempora8 reference4 9: pict+re codin( t)pe4 J-=rame: -2-
de8a)4 #3!3,
frame siLe4 #09!"
.ostion 39&0003: pict+re !#& start header4 tempora8 reference4 !!: pict+re codin( t)pe4 .-=rame: -2-
de8a)4 #,#,&
frame siLe4 30"&0
.ostion 3&!0"&3: pict+re !#" start header4 tempora8 reference4 ": pict+re codin( t)pe4 J-=rame: -2-
de8a)4 #,!30
frame siLe4 ##&,,
D$$$E
,ome o$ these parameters are releva&t because the- w#ll be use$ul $or mult#ple%#&., so
A/ http://www.avalpa.com
Avalpa Broadcast Server user manual
letDs have a short descr#pt#o& o$ releva&t parameters #& the &e%t chapter.
'& M+0G12, three Dp#cture t-pesD are de$#&ed. he p#cture t-pe de$#&es wh#ch pred#ct#o&
modes ma- be used to code each block.
D'&traD 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.#&.
D+red#ct#veD 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.
DB#d#rect#o&all-1pred#ct#veD 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 Dd#spla-D order to
Db#tstreamD 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 DGroup o$
+#cturesD or G5+. A t-p#cal G5+ #& d#spla- order #s:
J! J# I3 J, J' .% J9 J& ." J!0 J!! .!#
he correspo&d#&. b#tstream order #s:
I3 J! J# .% 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 ma-
be 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$ ;CQ 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 F*app#&.G 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 C./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
A; 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 Mmpe"FvideovbvM, thatDs !#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#&. F$ou&d C errorsG 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 thatDs &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&Dt work properl- eve& #$ vbv does&Dt 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 Fcbr1&essG,
#$ 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.
AA http://www.avalpa.com
Avalpa Broadcast Server user manual
Anal!sing audio elementar! streams: esaudioinfo
I$#rst1$#le1mu%J
Avalpa Broadcast ,erver comes also w#th MesaudioinfoM tool to a&al-se mpe. aud#o
eleme&tar- stream, usa.e #s s#mple:
esa+dioinfo a+dio$es
A t-p#cal output $or ever- aud#o $rame #s alread- 8u#te verbose:
D$$$E
a+dio header packet !,9': position4"&3&!#
a+dio -ersion4 ?.</ Hersion ! 0IFO/I<C !!!9#-31
a+dio 8a)er4 Ia)er II
protection 2it4 Not protected
2it rate inde*4 ##,k2ps
samp8in( rate4 ,&000HL
paddin(4 =rame is not padded
a+dio frame from headers 0form+8a can ha-e ro+nds14 %9# 2)tes: '39% 2its
channe8 mode4 Ftereo
cop)ri(hts4 A+dio is not cop)ri(hted
ori(ina84 Ori(ina8 media
emphasis4 None
a+dio frame siLe from stream meas+red4 %9# 2)tes: '39% 2its
D$$$E
M+0G11 Aud#o )a-er '' #s a& aud#o codec de$#&ed b- ',5/'0C 111B213. Eh#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, thatDs wh- #s e%pressed #&
<*, wh#le $rame s#*e #s the d#me&s#o& #& b-tes o$ all the aud#o $rame. /6CCC <* #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
AB http://www.avalpa.com
Avalpa Broadcast Server user manual
$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&tar-
stream v#deo
1b, 1ma%rate, 1m#&rate b#trate #& kbps, thatDs 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 #tDs vbvVbu$$erVs#*e T 1C2/ T 1A: 163;CC6, however #&
ma&- e&coders vbv $or mpe. 2 v#deo codec #s o$te& e%pressed #& 1AWb#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#&. #tDs 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& a&al-se the output w#th:
pesinfo -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
2CA/ #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, ;2BCCCC #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#
A6 http://www.avalpa.com
Avalpa Broadcast Server user manual
$ow to encode digital audio files with ffmpeg
A&other e%ample w#th $$mpe.:
M$$mpe. 1# #&put.mp. 1ac 2 1v& 1acodec mp2 1$ mp2 1ab 126CCC 1ar /6CCC aud#o.mp2M
1# #&put $#le
1ac 2, stereo
1v& &o v#deo
1acodec mpe.2 aud#o la-er 2
1$ output $ormat mpe.2 aud#o
1ab aud#o b#t rate #& bps
1ar #s the aud#o sample rate
>ou ca& a&al-*e the output w#th:
esa+dioinfo a+dio$mp#
>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
/6CCC sample rate, should be k&ow& or ca& be lear& w#th esaud#o#&$o, a ptsVstep #s
11;2 / sampleVrate T ?CCCC, 11;2 #s $#%ed $or mpe.2 la-er 2 so $or /6kh* comes 21AC
11;2 aud#o $rame s#*e, -ou ca& read #t w#th esaud#o#&$o, #tDs #& b-tes 2KB th#s 11;2 #s b-
cha&ce 11;2 as the &umber o$ samples4
3ACC $#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
>ou ca& e&capsulate the aud#o #&to a ts w#th:
pesa+dio#ts #0%& !!'# ,&000 9%& -! 0 a+dio$pes A a+dio$ts
2CA6 #s the p#d &umber
11;2 #s the &umber o$ sampler per $rame
/6CCC #s the sample rate
BA6 #s the es $rame s#*e
11 d#sable aud#o descr#pt#o& header
C the aud#o wo&Dt 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 ?CCCC pts t#cks, sample rate #s /6CCC h*, 1 $rame #s 11;2 samples. so:
A? http://www.avalpa.com
Avalpa Broadcast Server user manual
2?CCCC T 11;24 / /6CCC S 21AC #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.C6 , packets, w#th padd#&. o& th#rd packet so 3 packets T 166 b-tes S ;A/
b-tes S /;12 b#t per pes aud#o $rame.
/;12 b#t $or 21AC t#cks -ou co&vert w#th bps #t comes:
2/;12 T ?CCCC4 / 21AC S 166CCC bps
Ehe& 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 1ACkbps -ou w#ll
$#&d out that the , b#t rate #s the same= Check 5pe&Caster 30ADM0 $or
smarter mpe.2 aud#o b#t rates.
BC http://www.avalpa.com
Avalpa Broadcast Server user manual
$ow to capture D, input
h#s chapter assumes -ou co&&ected a d#.#tal v#deo camera or a d#.#tal v#deo pla-er to the
$#rew#re o$ the server.
o record the D! -ou have to use the comma&d:
d-(ra2 recorded$d-
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, 3C m#&utes a&d 1C 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-

B1 http://www.avalpa.com
Avalpa Broadcast Server user manual
$ow to generate silence
,omet#mes #t #s use$ul to .e&erate s#le&t aud#o tracks, $or th#s purpose a s#mple e%ample
us#&. so% a&d $$mpe. #s .#ve&:
dd if7/de-/Lero of7si8ence$raw 2s7!!'# co+nt7,
so* -t raw -r ,&000 -s -w -c # si8ence$raw si8ence$wa-
ffmpe( --n -f s!%8e -a2 !#&k -ar ,&000 -ac # -i si8ence$wa- -acodec mp# si8ence$mp#
'& th#s case 11;2 #s the &umber o$ samples o$ a s#&.le mpe.2 aud#o $rame so #& th#s wa-
we 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.

B2 http://www.avalpa.com
Avalpa Broadcast Server user manual
Audio and video real case ingestion stud!
Ie&cod#&./lo.oVtv.p&.J
)etDs be.#& w#th a se8ue&ce o$ comma&ds that w#ll eve&tuall- .#ve -ou some e&coded $#les
that ca& be used w#th Avalpa Broadcast ,erver. 5$ course th#s #s 7ust a& e%ample, #tDs
better to st#ck w#th #t $or the be.#&&ers, otherw#se -ou are o& -our ow&:
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
B3 http://www.avalpa.com
Avalpa Broadcast Server user manual
he $#le ed.pes.le&.th #s .e&erated b- esv#deo2pes a&d #tDs the le&.th o$ the v#deo #& +,
t#cks, #& th#s case we w#ll .et that ed.pes.le&.th #s ;B26A6CC, t#cks o$ ?CWh* so 1 $rame #s
?CCCC/2; $rame per seco&d S 3ACC pts t#cks a&d ;B26A6CC/3ACC S 1;?13 $rames / 2; $ps
S A3A.;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 1C;3C26/, 1 $rame #s 11;2 sample a&d sample rate #s
/6CCC so 1C;3C26/ / 236/R1/4 S 2A/;6 $rames T 11;2 / /6CCC S A3/.??2 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
Audio and video initial synchroni;ation
he $#rst +, value #s #mporta&t $or s-&chro&#*at#o& betwee& aud#o a&d v#deo, thatDs
because #t #s &ecessar- to s-&ch the prese&tat#o& o$ the $#rst v#deo $rame a&d the $#rst
aud#o $rame.
"#rst o$ all letDs make sure w#th pes#&$o that +, o$ the $#rst v#deo $rame matches the +,
o$ the $#rst aud#o $rame, better #$ the- both are 3ACC t#cks o$ the ?C W<X clock thatDs C.C/
ms thatDs 1 v#deo $rame at 2; $rame per seco&d, #$ -ou properl- ru& esaud#o2pes a&d
esv#deo2pes $rom the prev#ous #&struct#o&s -ou should have a v#deo.pes start#&. l#ke th#s:
pes header4 00 00 0! e0: -ideo stream n+m2er 0: header 8en(th4 !0: .resentation Time Ftamp is4 3%00:
0$0,00 sec$: >ecode Time Ftamp is4 0: 0$0000 sec$
pes header4 00 00 0! e0: -ideo stream n+m2er 0: header 8en(th4 !0: .resentation Time Ftamp is4
!,,00: 0$!%00 sec$: >ecode Time Ftamp is4 3%00: 0$0,00 sec$
A&d a& aud#o.pes start#&. w#th:
pes header4 00 00 0! c0: a+dio stream n+m2er 0: pes siLe 3"#: header 8en(th4 ': .resentation Time
Ftamp is4 3%00: 0$0,00 sec$
pes header4 00 00 0! c0: a+dio stream n+m2er 0: pes siLe 3"#: header 8en(th4 ': .resentation Time
Ftamp is4 '9%0: 0$0%,0 sec$
pes header4 00 00 0! c0: a+dio stream n+m2er 0: pes siLe 3"#: header 8en(th4 ': .resentation Time
Ftamp is4 9"#0: 0$0&&0 sec$
B/ http://www.avalpa.com
Avalpa Broadcast Server user manual
Encoding with x/12
h#s sect#o& w#ll show how to use %2A/ to e&code h2A/ v#deo #&stead o$ mpe.2 v#deo. he
curre&t e%ample w#ll show how to broadcast a 1C6Cp2/ v#deo.
he v#deo $ormat #s actuall- a &o& commo& cho#ce $or 3" broadcast#&. a&d &ot
sta&dard#*ed $or D!B but #t su#tes local &etworks use cases, !5D, a&d #t #s the s#mpler
e%ample o& how to start as #t does&Dt re8u#re telec#&e tech&#8ues:
ffmpe( -i 2i(52+ck52+nn)5!0&0p5h#%,$mo- Rmo-ie7OpenCaster/t+toria8s/encodin(H>/8o(o5t-$pn( DwmETDinE
DwmE o-er8a)70404040 Do+tER -f )+-,mpe(pipe - Y $/*#%, --8e-e8 ,$0 --na8-hrd c2r ---2--2+fsiLe #000
--2itrate 9#00 --ke)int !# ---2--init 0 -o 22$*#%,$hd$-ideo$pes
pes-ideo#ts #0%% #,43& 29#00000 9%00000 0 22$*#%,$hd$-ideo$pes A -ideo$ts
ffmpe( -i 2i(52+ck52+nn)5!0&0p5h#%,$mo- --n -acodec ac3 -ar ,&000 -a2 ,,&k a+dio#,p$ac3
s#&ce we are deal#&. w#th <D, letDs also put ;.1 aud#o=
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:

$#&all- tscbrmu%er rates are:
D$$E 249%00000 -ideo$ts 24,90000 a+dio$ts D$$$E
B; http://www.avalpa.com
Avalpa Broadcast Server user manual
#la! out scheduling from command line
I$#rst1$#le1mu%J
<ere #s the $#rst e%ample o$ aud#o a&d v#deo pla- out scr#pt, we assume -ou alread-
e&coded the $#le as e%pla#&ed #& FAud#o a&d v#deo real case e&cod#&. w#th $$mpe.G, the $#le
&ames w#ll be ed.v#deo.pes, ed.aud#o.pes, ed.pes.le&.th a&d s#m#lar $or the other D!D
e&cod#&.s: bb.v#deo.pes bb.aud#o.pes bb.pes.le&.th bb2.v#deo.pes bb2.aud#o.pes a&d
$#&all- bb2.pes.le&.th
mkfifo -ideo$ts
mkfifo a+dio$ts
mkfifo m+*ed$ts
mkfifo stamped$ts
pes-ideo#ts #0%, #' !!# #"00000 ! ed$-ideo$pes 22$-ideo$pes 22#$-ideo$pes A -ideo$ts B
pesa+dio#ts #0%& !!'# ,&000 3&, ! ed$a+dio$pes 22$a+dio$pes 22#$a+dio$pes A a+dio$ts B
tsc2rm+*er 24#&00000 -ideo$ts 24!&&000 a+dio$ts 24300& firstpat$ts 24300& firstpmt$ts 24!'00
firstsdt$ts 24!,00 firstnit$ts 24!0!9,0&, n+88$ts A m+*ed$ts B
tspcrstamp m+*ed$ts !3#9!000 A stamped$ts B
tsrfsend stamped$ts -mt O=>? -mC @A?!% -m/ !/, -mc #/3 -mf '9&
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.
At ever- co&&ect#o& some #&terest#&. #&$ormat#o&s are pr#&ted:
pesa+dio#ts4 c8osin( ed$a+dio$pes$$$ c8osed
pesa+dio#ts warnin(4 missed ed$a+dio$pes$8en(th fi8e
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!%,,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$
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$
Ee are out o$ s-&chro&#*at#o&= he $#rst value #s the t#me #& +, t#cks 2?C W<X4 the seco&d
#s the $#rst t#me #& seco&ds 2;B1A//CC / ?CCCC4.
h#s problem #s also s#.&alled b- a war&#&. messa.e:
BA http://www.avalpa.com
Avalpa Broadcast Server user manual
pesa+dio#ts warnin(4 missed ed$a+dio$pes$8en(th fi8e
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$
As -ou ca& read &ow:
22$a+dio$pes new presented a+dio frame wi88 2e at '9#"0,00: %3%$'%00 sec$
22$-ideo$pes new presented -ideo frame is at4 '9#"0,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&:
BB http://www.avalpa.com
Avalpa Broadcast Server user manual
!W a$e +C3 A&al-s#s
!W a$e 1,D A&al-s#s
B6 http://www.avalpa.com
Avalpa Broadcast Server user manual
,treamGuru r1C1 2?C
,treamPpert +C3 a&al-s#s
B? http://www.avalpa.com
Avalpa Broadcast Server user manual
D!M1CC 3ohde N ,chwar* +C3 a&al-s#s
6C 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 startedH Ee 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 a+dio#$pes
rm -ideo#$pes
8n -s 22$a+dio$pes a+dio#$pes
8n -s 22$-ideo$pes -ideo#$pes
61 http://www.avalpa.com
Avalpa Broadcast Server user manual
%e#multiplexin" input transport streams
3e1mult#ple%#&. #s a ver- commo& sce&ar#o #& ma&- D!B &etworks a&d ca& be ach#ved
also w#thout Avalpa Broadcast ,erver ded#cated D!B hardware #$ 5pe&Caster #s correctl-
#&stalled, co&$#.ured a&d ma&a.ed.
The available inputs for this function are local files for $SI and U$ multicast
"roups with transport stream over U$' output must be multicast too
Check the chapter F'p &etwork toolsG be$ore co&t#&ue $or a br#e$ e%pla&at#o& o$ the des#.&
cho#ces.
(ool tsorts
ImptsJ
Tsorts tool w#ll l#ste& to #&put &etwork a&d .rab a packet $rom #t #$ #tDs read- or replace #t
w#th a &ull packet #$ there was a tra&sm#ss#o& problem a&d the packet could&Dt 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,
letDs 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/.C.1.1 123/ a&d 3mbps $or
22/.C.1.2 123/, tscbrmu%er w#ll #&crease the b#t rate to 132B1CC match#&. a modulat#o&
scheme.
62 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&Dt 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.
63 http://www.avalpa.com
Avalpa Broadcast Server user manual
Appendix A9 Acronyms' "lossary and references
he most $re8ue&t acro&-ms a&d someth#&. about #t
A': Appl#cat#o& '&$ormat#o& able 20,' , 1C2 6124
CB3: Co&sta&t B#t 3ate
D!B: D#.#tal !#deo Broadcast#&. 2http://www.dvb.or./4
D!B1A,': D!B1As-&chro&ous ,er#al '&ter$ace 20K ;CC631?4
D,M1CC: D#.#tal ,tora.e Med#a Comma&d a&d Co&trol 2',5/'0C 136161A, 0K 3C1 1?24
0,': 0uropea& elecommu&#cat#o&s ,ta&dards '&st#tute, the sta&dard#*at#o& bod- $or
ma&- d#.#tal telev#s#o& sta&dards 2http://www.ets#.or. 4
G5+: Group 5$ +#ctures, a se8ue&ce o$ $rames o& a v#deo stream compressed to.ether,
usuall- 12 or 1;
'+: '&ter&et +rotocol 2r$c B?14
M<+: Mult#med#a <ome +lat$orm 20,' , 1C2 6124
M+0: Mult# +rotocol 0&capsulat#o& 2',5/'0C 136161A, 0K 3C1 1?24
M<0G;:2',5/'0C 13;221;4
M+0G: Mot#o& +#cture 0%pert Group 2http://mult#med#a.telecom#tal#alab.com/4
M+,: Mult# +ro.ram ra&sport ,tream, a M+0G2 , carr-#&. more the& o&e serv#ce.
K': Ketwork '&$ormat#o& ablet 2',5/'0C 13616114
K!5D: Kear !#deo o& Dema&d
+A: +ro.ram Assoc#at#o& able 2',5/'0C 13616114
+'D: +ro.ram 'De&t#$#er 2',5/'0C 13616114
+M: +ro.ram Map able 2',5/'0C 13616114
+,: +rese&tat#o& #me ,tamp 2',5/'0C 13616124
+,': +ro.ram ,#.&all#&. '&$ormat#o& 2',5/'0C 13616114
,B: ,et op Bo%, the decoder.
,+,: ,#&.le +ro.ram ra&sport ,tream 2',5/'0C 13616114
,: ra&sport ,tream 2',5/'0C 13616114
!B3: !ar#able B#t 3ate
!5D: !#deo 5& Dema&d
+0,: +ro.ram 0leme&tar- ,tream 2',5/'0C 13616114
0,: 0leme&tar- ,tream 2',5/'0C 13616114
6/ http://www.avalpa.com
Avalpa Broadcast Server user manual
Appendix B9 !B#T transmission parameters and net bitrates
Ava#lable b#trates 2Mb#t/s4 $or a D!B1 s-stem #& 6 M<* cha&&els
2courtes- E#k#ped#a4
Modulat#o& @+,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& 1A1@AM
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& A/1@AM
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
6; http://www.avalpa.com
Avalpa Broadcast Server user manual
Appendix *9 %elated readin"s
,ome #&terest#&. read#&.s $rom Academ- related to Avalpa Broadcast ,erver are:
(pen Source /nd#F#/nd !B#0 Mobile T! services and network infrastructure J
The !B#0 pilot in enmark
about how 5pe&Caster has bee& used #&to dvb1h #&te.rat#o&
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 1Ath ACM #&ter&at#o&al co&$ere&ce o& Mult#med#a !a&couver, Br#t#sh
Columb#a, Ca&ada
6A http://www.avalpa.com
Avalpa Broadcast Server user manual
Appendix 9 Mpe"F transport stream overview
Ava#lable $rom courtes- o$ +ro$. A&to&#o Kavarro $rom Ave#ro L&#vers#t-
6B http://www.avalpa.com

You might also like