Easy screen­casts

If a pic­ture’s worth a thou­sand words, are mov­ing pic­tures worth ex­po­nen­tially more, won­ders a philo­soph­i­cal Shashank Sharma…

Linux Format - - Tutorials -

Atech­no­log­i­cally chal­lenged friend called to say they couldn’t get Opera’s VPN fea­ture to work. To sug­gest desktop shar­ing was out of the ques­tion. Thank­fully, Byzanz of­fered an easy so­lu­tion – cre­at­ing a GIF screen­cast show­ing the ex­act steps to us­ing VPN on Opera.

With Byzanz, you can cre­ate a screen­cast of ei­ther the en­tire desktop or of the spec­i­fied area. You can even set the du­ra­tion for the screen­cast and have the nifty lit­tle tool save the out­put as ei­ther a GIF image, or as OGG The­ora or FLV flash file, if you also want to record au­dio with the screen­cast.

Another rea­son why screen­cast­ing may be pre­ferred over desktop shar­ing as a teach­ing tool is that the lat­ter re­quires both users to be at their re­spec­tive machines at the same time. On the other hand, a screen­cast can be used at one’s con­ve­nience. More im­por­tantly, whereas desktop shar­ing can be a drain on the band­width, a 60-sec­ond GIF screen­cast made with Byzanz adds up to only a few MBs.

Get­ting started

You’ll find Byzanz in the soft­ware repos­i­to­ries for most dis­tri­bu­tions such as OpenSUSE, Fedora, Ubuntu and oth­ers. It also doesn’t have a dif­fi­cult dependency tree and once again the soft­ware repos­i­to­ries will pro­vide what­ever few pack­ages that are needed.

Once in­stalled, you can use the byzanz-record com­mand to cre­ate the screen­cast. For each screen­cast, you must spec­ify the name of the out­put file, as well as the du­ra­tion for the screen­cast, in sec­onds. To cre­ate a 60-sec­ond screen­cast of the en­tire desktop you must run the byzanz-record -d 60

file­name.gif . The out­put files are stored in the cur­rent work­ing di­rec­tory by de­fault. You must ei­ther pro­vide the ab­so­lute path and file­name, if you want to store them else­where or switch to such di­rec­tory be­fore run­ning the byzanz-record com­mand.

By de­fault, the tool will record the en­tire desktop, but you can also re­strict the record­ing to a spec­i­fied por­tion of the screen. Should you choose the sec­ond op­tion, you’ll have to em­ploy trial and er­ror to mea­sure the por­tion of the screen you wish to record.

Tools like Byzanz can only record ei­ther the en­tire screen, or a rec­tan­gu­lar por­tion of it. The di­men­sions of the rec­tan­gle can be spec­i­fied us­ing the --height and --width com­mand op­tions. You can also do the same

us­ing -h and -w re­spec­tively: byzanz-record -d 60 -x 70 -y 0 -w 850 -h 800 lim­ited-size-screen­cast.gif . Here, we’ve used var­i­ous com­mand op­tions to re­spec­tively spec­ify the X and Y co­or­di­nates of the

screen. You can think of these as the top-left cor­ner of the rec­tan­gle. You must also pro­vide the di­men­sions of the rec­tan­gle to record, and this is done us­ing the

--width ( -w ) or the --height ( -h ) com­mand op­tions. This again would re­quire a num­ber of at­tempts be­fore you get the size of the rec­tan­gle right.

Be care­ful not to use the = sign be­fore pro­vid­ing the val­ues when work­ing with the dif­fer­ent com­mand op­tions such as -d , -x and -h . Fur­ther­more, be sure to use a sin­gle space be­tween the com­mand op­tion and the value, or Byzanz will re­port er­rors: $ byzanz-record -d14 -x 170 -y 0 -w 850 -h 750 -a record­desk­top-another.flv Wrong op­tion: Can­not parse in­te­ger value “-x” for -d us­age: byzanz-record [OP­TIONS] file­name

byzanz-record --help $ byzanz-record -d=14 -x 170 -y 0 -w 850 -h 750 -a record-desktop-another.flv Wrong op­tion: Can­not parse in­te­ger value “-x” for -d us­age: byzanz-record [OP­TIONS] file­name

byzanz-record --help In the ex­am­ples above, you’ll see that both the -d14 and -d=14 op­tions re­sulted in Byzanz re­port­ing an er­ror. Smart screen­cast As with the size of the rec­tan­gle to record, it’s also not al­ways pos­si­ble to know be­fore­hand the du­ra­tion of the screen­cast. One can’t al­ways know be­fore­hand if the task to be recorded in the screen­cast will take two min­utes to ac­com­plish or more. If you don’t get the du­ra­tion right, your screen­cast is likely to end be­fore the task is fin­ished. When that hap­pens, you’ll have to run a new in­stance of byzanz-record and go through the en­tire process again.

Of course, you can do a timed run the first time around, and then use Byzanz to record the screen­cast, but this time con­sum­ing method is un­likely to ap­peal to any­one. Thank­fully, the tool pro­vides an ex­cel­lent work­around with the -e (-- exec) com­mand op­tion. You can use this com­mand switch to run a spe­cific com­mand or pro­gram, and Byzanz will con­tinue to record the screen­cast un­til you close the pro­gram.

For ex­am­ple, if you wish to record the steps for en­abling VPN on Opera, you can run Opera with Byzanz, us­ing the byzanz-record -e opera test­file.gif com­mand. Here, in­stead of spec­i­fy­ing the du­ra­tion, or the di­men­sions of the rec­tan­gle to record, we’ve in­stead used the -e com­mand op­tion to spec­ify the pro­gram, in this case Opera. Byzanz will con­tinue to record the desktop un­til you close Opera. Also note that al­though you’ve spec­i­fied a pro­gram, Byzanz will record the en­tire desktop with the above com­mand. If you only want to record a sin­gle win­dow with

Byzanz, you can use the xwin­info com­mand to iden­tify its di­men­sions. From the ter­mi­nal, run the xwin­info and then click a win­dow such as the browser. The tool will then pro­vide the de­tails such as the upper-left X- and Y-co­or­di­nates as well as the width and height. You can use this in­for­ma­tion with var­i­ous com­mand op­tions of

Byzanz to re­strict the record­ing to the spec­i­fied por­tion. Another op­tion is to use the --de­lay com­mand op­tion, which can be used to de­fine the de­lay in sec­onds, af­ter which Byzanz should be­gin record­ing the screen. You can use the in­ter­ven­ing time to set up the desktop, and move around icons or launch a pro­gram. Other for­mats In­stead of gif, you can also save the screen­cast as a flv file or as Ogg The­ora Video (ogv). While gif an­i­ma­tions should suf­fice for most com­mon pur­poses, if you don’t like the slight loss of colour with gif, or need to record voice over with the screen­cast, you should con­sider one of the other file for­mats. The com­mand byzanz-record -d 60 -a au­dio

screen­cast.ogv can be used to record a OGV screen­cast, and thanks to the -a com­mand switch,

Byzanz knows to use the de­fault au­dio in­put de­vice to record au­dio as well. While ogv screen­cast ren­der the video per­fectly, un­for­tu­nately, de­spite all the proper codecs in­stalled, ogv videos only record au­dio for the first five sec­onds. The rest of the video had no sound, across mul­ti­ple tests. If in the same com­mand, you change the name of the out­put file to au­dio-screen­cast.

flv, Byzanz will cre­ate an FLV screen­cast in­stead, and you’ll find that au­dio works flaw­lessly with FLV.

Per­haps the lim­ited au­dio record­ing ex­plains the dif­fer­ent file sizes. A 10-sec­ond ogv video was a 2MB file, whereas the same length flv file was nearly 9MB.

If you’d rather not de­cide the out­put file be­fore­hand, you can use the .byzanz ex­ten­sion, in­stead of .flv, .ogv or .gif. The out­put file in this case can run into hun­dreds of MB, de­pend­ing on the task you per­form and du­ra­tion. The project iden­ti­fies such .byzanz files as de­bug files. You can then use byzanz-play­back to con­vert .byzanz files to one of the sup­ported for­mats per your con­ve­nience. Un­like ogv and flv out­put files, how­ever, you can’t use .byzanz to record au­dio: $ byzanz-record -d 14 -a record-desktop.byzanz Er­ror dur­ing record­ing: This for­mat does not sup­port record­ing au­dio. $ byzanz-record -d 14 record-desktop.byzanz $ byzanz-play­back record-desktop.byzanz record­desk­top.flv The byzanz-play­back com­mand is only use­ful for con­vert­ing a byzanz file to another out­put. You can’t use it to con­vert a flv file to gif or an ogv to flv. The com­mand ex­pects an in­put file, which is al­ways a byzanz file, and an out­put file name, which can be ei­ther a gif, flv or ogv, as can be seen from the last com­mand.

Byzanz won’t ap­peal to those who pre­fer graph­i­cal screen record­ing tools and there are sev­eral such al­ter­na­tives. How­ever, there are some user-con­trib­uted scripts that en­hance Byzanz – see the box­out.

Us­ing the xwin­info com­mand, you can quickly as­cer­tain the di­men­sions of a win­dow, if you don’t wish to screen­cast the en­tire desktop.

By de­fault, Byzanz doesn’t pro­duce any out­put. You must use the -v com­mand op­tion to make it ver­bose.

Newspapers in English

Newspapers from Australia

© PressReader. All rights reserved.