Вы находитесь на странице: 1из 6

Software&security

Computergames

Lifetopics

Hillbillyphysics

Greatestsites

3Dart

Modelplanes

WorkingwithmultimediafilesPart1Flashdownload, convert,extractmusicfromFlashfiles
Thisisthefirstofthethreearticlesonhowtouseandmanipulatemultimedia formats:Flash,videoandaudio. Inthisfirstarticle,wewillconcentrateonFlashfiles:howtodownloadthemfrom websites,howtoconvertthemfromoneformattoanother,say.flvto.swfor.avi,howto extractmusicfromFlashmovies,andseveralmorecooltricks. Inthesecondarticle,wewilltalkaboutvideofiles:splittingandjoiningthem,changing encodingandcompression,fixingbitratediscrepanciesinaudioandvideo,andothertasks. Inthelastarticle,wewillmanipulateaudiofiles:convertbetweendifferentformats, like.mp3,.ogg,.wav,andothers,mixsounds,composecustompiecesbysplicing segmentsfromdifferenttracks,andmore. Ontopofallthat,wewillalsotalkaboutusefulmultimediaprogramsthatcanhelpusin ourcommondailytasks,namelyaudioandvideorecordingsoftware.Bestofall,everything I'mgoingtoshowisfree.Lastbutnottheleast,wewillseeexamplesforbothWindows andLinux. Soletusbegin.

Tableofcontents:
1. Flashcontent 2. 1. DownloadFlash 2. PlayingFlashcontent 3. ExtractaudiofromFlashmovies 4. Extractaudiofromonlinestreams 5. ConvertFlash(.flv)toanothervideoformat(like.avi) 6. ManipulateShockwaveFlash(SWF)files 7. ManipulateFlashVideoFile(FLV)MetaDatawithFLVTool2 3. Summary 4. Conclusion

Flashcontent
WeencounterFlashcontentquitealot.ThereareentirewebsitescreatedwithFlash.You haveFlashgames.Recently,oneofthemostpopularformatstostreamvideoandaudio onlinehasbecome,takeawildguess,yes,correctFlash.Awebsitealmostsynonymous withFlashisnosurprisehereYoutube,whichcontainsanendlesscollectionofFlash clips,justwaitingtobeseen.Andsometimes,downloaded,too. TobeabletowatchFlashcontentinsideyourbrowser,youwillrequireaFlashplugin. InstallingitonWindowsisrathertrivial.OnLinux,truthtobetold,thetaskisaseasy, butquiteafewpeoplearenotfamiliarwiththeprocedure. IfyouneedtoknowhowtoinstallaFlashplayerinsideyourbrowser,pleasecheckthis tutorial:InstallingFlashin(Ubuntu)LinuxTutorial.

DownloadFlash
Afteraminigatheringwithsomeofmyfriendsandacquaitances,Iwasamazedto discoverthatquiteafewpeopledonotknowthatFlashmoviesonYoutubeandother sitescanbedownloadedandlaterenjoyedonthelocalmachine. So,first,let'sseehowwecandownloadFlashcontentfromtheInternet. Tothisend,wewillneed1)webbrowser:Firefox2)aFirefoxextensioncalledVideo DownloadHelper. IfyouneedhelpwithFirefoxextensions,pleaserefertomyarticleFirefoxAddons ManagebrowseraddonsincentralizedmannerTutorial. AfterDownloadHelperisinstalled,youwillgetanewiconinyourbrowser,similartothe rightmostoneinthebelowscreenshot:

Wheneverthere'sFlashcontentavailablefordownload,theiconwillturnactiveitwill becomebiggerandcolored(yellow,red,blue),similartowhatyouseebelow:

So,onYoutube,oranyotherwebpageyouwishtodownloadFlashcontentfrom,clickon thesmalldownarrowtoseewhatchoicesyouhave.

Andthat'sit.Afteryoudownloadthefile,it'sonyourcomputer!Itwillbesavedinthe.flv (Flashvideo)format.Youcannowwatchitanytimeyouwant.Thequestionis,whatwith?

PlayingFlashcontent
WindowsuserswillsoonlearnthattheWindowsMediaPlayercan'tdothejob.However, there'sanumberofalternative,opensourceplayersthatwill. Thesimplest,mostsensiblechoiceistheVideoLAN(VLC)mediaplayer.Notonlywillitrun anastonishingarrayofformats(includingaudio,DVDandwhatnot)withoutrequiringany

additionalcodecs,it'slightandsimpleandcrossplatform.ItrunsonbothWindowsand Linux(andotherOS). Here'swhatitlookslikeonWindowsXP:

Andhere'sonLinux(Gnome,Ubuntu):

Andhere'smeplayingadownloadedFlashinit:

AnotherchoiceforWindowsusersistheFLVPlayer(currentlyatversion2.0):

So,we'vecoveredthewatchingpart.Whatabouttheaudio,though?

ExtractaudiofromFlashmovies
Let'ssayyoulikeMiamiVice,likeme.Let'ssayyouloveJanHammer'smusic,likeme.So youhavedownloadedtheCrockett'sThemeclip,butyou'dalsolovetohavejustthemusic track. Noproblems.Thiscanbedone,ratherquiteeasily. ffmpeg homepage Thisisthetoolofthetrade.Ihaveusedffmpegonseveraloccasions,tocreatemyFlash moviesinthegamearticle1942:PacificAirWarortoextractmusicfromtheintromoviein myarticleUFO:EnemyUnknown. Linuxuserswillhaveffmpegquiteoftenbundledintotheirdistributionofchoice.Windows userswillhavetodownloaditseparately.TheeasiestwaytoobtaintheWindowsversion isfromfreecodecs.com.Asalways,whendealingwithmultimediarelatedWindowsstuff, likecodecs,convertersandsuch,doexercisethenecessarycaution.Now... ffmpegisacommandlinetool.Ithasmanyoptions,regardingtoformats,bitrate, samplingetc,butwedonotreallyneedallthatrightnow.Ifyouwanttoextracthigh qualityaudiofromFlash(.flv)files,allyouneedtodoisrunthefollowingcommand:

ffmpeg i i n p u t . f l v ab128 ar44100output.mp3


Thetoolwilltakeaninputfile(specifiedbytheiflag)inthe.flvformatandcreatean outputinthe.mp3format,with128bitrate(specifiedbytheabflag)and44,100Hz samplingfrequency(specifiedbythearflagstandsforaudiorate). Here'sthetypicaloutputofffmpeginaction(onWindows):

Don'tworryaboutthetorrentoftext.Youneedpaynoattentiontoit.Intheend,you'll havethedesiredaudiofile(inanyformatyoulike).

Extractaudiofromonlinestreams
ffmpegisamightytool.Youcanalsouseittodownloadaudiofromonlinestreams,radio castsetc:

ffmpeg ihttp:///xxx.xxx.xxx.xxx/something ab128 ar44100sound.mp3 ConvertFlash(.flv)toanothervideoformat(like.avi)


Thisissomethingyoumaywanttodo,forwhateverreason.Again,ffmpegcanserveyou wellhere.It'srathersimple(evenmoresothanaudio):

ffmpeg i i n p u t . f l v o u t p u t . a v i

Ifyou'renotGUIdependantandyou'rewillingtoinvestsometimelearningallthetricks ffmpegcando,itshouldbetheoneandonlytoolyouwilleverneedtocreateandedit multimediafiles. Idorecommendyoureadtheffmpegdocumentation.

ManipulateShockwaveFlash(SWF)files
OK,we'veseenwhatwecandowith"ordinary"Flashvideo(.flv).Butwhataboutthose Flashfilescalled.swf?Whatdowedoaboutthem. Again,nottoworry.There'sawholerangeofgoodiesavailable. SWFTools homepage SWFToolsareacollectionofexcellentutilitiesthatallowyoutoconvertmovies,pictures, evenPDFfilestoSWFformat.Theusageisverysimilartoffpmeg,soifyou'recomfortable withffmpeg,youwon'thaveanyproblemsusinganyoftheSWFTools. Forexample,toconvertan.avifiletoa.swffile:

avi2swfinput.avioutput.swf
That'sthewholeofmagicthere'stoit. Youcandownloadtheentirebundleorusethetoolsindividually.Linuxuserswillalsohave thechancetodownloadsoftwarethroughthePackageManager,iftheenabledrepositories containit.

ManipulateFlashVideoFile(FLV)MetaDatawithFLVTool2
homepage YoumaywanttotagyourFLVfiles,whetheryoudownloadedthemorcreatedthemon yourown.Eitherway,FLVTool2providesyouwiththerequiredneeds.Likeffmpegand SWFTools,FLVTool2isacommandlineutility.Again,it'susageisverysimple. Ihavefoundtheexamplesonyondersitetobequiteuseful.Furthermore,formoredetails, youmaywanttoconsiderreadingthemanpage.FLVTools2canbefoundinmanyLinux distrorepositories.

Summary
Hereistheoverviewoftaskswejustundertook: First,wedownloadFirefox(incasewedidnothaveitinstalled,shameonyou).Then,we installedtheVideoDownloadHelperextension.Next,wedownloadaFlashvideointhe.flv format.Afterthat,weplayeditonourcomputer,eitherviaVideoLAN(VLC)orFLVPlayer. Afterthat,weextractedaudiofromthe.flvfileusingffmpeg.Forfun,wealsousedffmpeg todownloadonlinestreams.WealsoplayedwithShockwareFlash(.swf)filesusinga rangeofutilitiescalledtheSWFTools,whichallowedustoconvertavarietyoffiles, includingmovies,picturesandevenPDFdocumentstotheSWFformat.Lastly,weedited themetadataofFLVfiles. Herearethelinkstoallthesoftwaretoolsyouwillrequire: Firefox VideoDownloadHelperextension(addon) VideoLAN(VLC)mediaplayer FLVPlayer ffmpeg SWFTools FLVTool2

Conclusion
Flashmanipulationiseasyandfun.Ittakesverylittleefforttogetthejobdone.Don'tbe scaredaboutthecommandline.Afterall,youonlyneedtorun23simplecommands, whichyoudon'tevenhavetorememberbyheart.Justjumpinherewhenyoufeelthe need. Havefun! del.icio.usthisarticle digg thisarticle slashdotthisarticle

Top

Home

Termsofuse

Contactme

About

Copyright@Dedoimedo.com20062008allrightsreserved