SimplebashscripttoconvertvideofilesintoGoogleChromecastsupportedformat.
Scriptidentifiesvideoandaudioformatofgivenfile(usingmediainfo)andconvertsitifnecessary(usingffmpeg).
Filenameofoutputvideofileis<original_filename>.mkvandoriginalvideofilegetsrenamedto<original_filename>.bak.
RequirementsmediainfoffmpegInstallrequirementsbyrunninge.g.apt-getinstallffmpegmediainfo(Debian)orbrewinstallffmpegmediainfo(MacOSwithHomebrew).
Usage./chromecastize.sh[--mp4|--mkv|--stereo|--delete-on-success|--force-vencode|--force-aencode|--config=/path/to/config]<videofile1>[videofile2...]Examples:./chromecastize.sh/Volumes/MyNAS-convertsallvideosonyourNAS(assumingthatit'smountedto/Volumes/MyNAS)./chromecastize.shHoliday.aviWedding.avi-convertsspecifiedvideofilesOptions:--mp4forcesconversiontoMPEG-4container--mkvforcesconversiontoMatroskacontainer--stereoforcesconversionfrommultichannelaudioto2channelstereo--delete-on-successdeletestheoriginalfileonsuccessinsteadofrenamingitto<original_filename>.bak--force-vencodeforcesre-encodingofthevideo,ifthecodecissupportedbuttheprofilelevelistoohigh--force-aencodeforcesre-encodingoftheaudio--config=/path/to/configspecifywheretostoreconfiguration.Whenomittedthedefaultfolder~/.chromecastizeisused.ChangingdefaultoptionsCopytheexampleconfig.shfiletoyourconfigfolder(defaultlocation:~/.chromecastize).Uncommenttheoptionswhichyouwishtochangebyremovingtheleading#symbol.AuthorsPetrKotek(didthescriptsaveyousometime?donationsappreciated:www.petrkotek.com)
评论