mythburn Namespace Reference

Classes

class  FontDef

Functions

def simple_fix_rtl
def write
def fatalError
def nonfatalError
def quoteString
def getTempPath
def getCPUCount
def getEncodingProfilePath
def doesFileExist
def quoteFilename
def getText
def getThemeFile
def getFontPathName
def getItemTempPath
def validateTheme
def isResolutionOkayForDVD
def deleteAllFilesInFolder
def checkCancelFlag
def runCommand
def secondsToFrames
def encodeMenu
def findEncodingProfile
def getThemeConfigurationXML
def getLengthOfVideo
def getAudioParams
def getVideoParams
def getAspectRatioOfVideo
def calcSyncOffset
def getFormatedLengthOfVideo
def frameToTime
def createVideoChapters
def createVideoChaptersFixedLength
def getDefaultParametersFromMythTVDB
def saveSetting
def clearArchiveItems
def getOptions
def expandItemText
def getScaledAttribute
def intelliDraw
def paintBackground
def paintButton
def paintText
def paintImage
def checkBoundaryBox
def loadFonts
def getFileInformation
def WriteXMLToFile
def preProcessFile
def encodeAudio
def multiplexMPEGStream
def getStreamInformation
def getVideoSize
def runMythtranscode
def generateProjectXCutlist
def runProjectX
def renameProjectXFiles
def ts2pts
def checkSubtitles
def extractVideoFrame
def extractVideoFrames
def encodeVideoToMPEG2
def encodeNuvToMPEG2
def runDVDAuthor
def CreateDVDISO
def BurnDVDISO
def deMultiplexMPEG2File
def runM2VRequantiser
def calculateFileSizes
def total_mv2_brl
def performMPEG2Shrink
def createDVDAuthorXML
def createDVDAuthorXMLNoMainMenu
def createDVDAuthorXMLNoMenus
def createEmptyPreviewFolder
def generateVideoPreview
def drawThemeItem
def createMenu
def createChapterMenu
def createDetailsPage
def isMediaAVIFile
def processAudio
def selectStreams
def selectSubtitleStream
def selectAspectRatio
def getVideoCodec
def getFileType
def getStreamList
def isFileOkayForDVD
def processFile
def doProcessFile
def doProcessFileProjectX
def copyRemote
def processJob
def usage
def main

Variables

string VERSION = "0.1.20111228-1"
 debug_keeptempfiles = False
 debug_secondrunthrough = False
 You can use this debug flag when testing out new themes pick some small recordings, run them through as normal with debug_keeptempfiles = True (see above) set this variable to True and then re-run the scripts the temp.
string defaultEncodingProfile = "SP"
 useSyncOffset = True
 addCutlistChapters = False
 encodetoac3 = True
int DVD_SL = 0
int DVD_DL = 1
int DVD_RW = 2
int FILE = 3
tuple dvdPAL = (720,576)
tuple dvdNTSC = (720,480)
tuple dvdPALdpi = (75,80)
tuple dvdNTSCdpi = (81,72)
string dvdPALHalfD1 = "352x576"
string dvdNTSCHalfD1 = "352x480"
string dvdPALD1 = "%sx%s"
string dvdNTSCD1 = "%sx%s"
tuple dvdrsize = (4482,8106)
int frameratePAL = 25
float framerateNTSC = 29.97
float aspectRatioThreshold = 1.4
string temppath = ""
string logpath = ""
string scriptpath = ""
string sharepath = ""
string videopath = ""
string defaultsettings = ""
string videomode = ""
string gallerypath = ""
string musicpath = ""
string dateformat = ""
string timeformat = ""
string dbVersion = ""
string preferredlang1 = ""
string preferredlang2 = ""
 useFIFO = True
 alwaysRunMythtranscode = False
 copyremoteFiles = False
int thumboffset = 10
 usebookmark = True
 clearArchiveTable = True
int nicelevel = 17
int drivespeed = 0
string mainmenuAspectRatio = "16:9"
string chaptermenuAspectRatio = "Video"
int chapterLength = 5
string jobfile = "mydata.xml"
string progresslog = ""
tuple progressfile = open("/dev/null", 'w')
string dvddrivepath = "/dev/dvd"
 docreateiso = False
 doburn = True
 erasedvdrw = False
 mediatype = DVD_SL
string savefilename = ''
string installPrefix = ""
 jobDOM = None
 themeDOM = None
string themeName = ''
dictionary themeFonts = {}
int cpuCount = 1
tuple DB = MythTV.MythDB()
tuple MVID = MythTV.MythVideo(db=DB)
tuple configHostname = DB.gethostname()
 fix_rtl = simple_fix_rtl
int VIDEO_INDEX = 0
int VIDEO_CODEC = 1
int VIDEO_ID = 2
int AUDIO_INDEX = 0
int AUDIO_CODEC = 1
int AUDIO_ID = 2
int AUDIO_LANG = 3
int SUBTITLE_INDEX = 0
int SUBTITLE_CODEC = 1
int SUBTITLE_ID = 2
int SUBTITLE_LANG = 3

Function Documentation

def mythburn::simple_fix_rtl (   str  ) 

Definition at line 193 of file mythburn.py.

def mythburn::write (   text,
  progress = True 
)
def mythburn::fatalError (   msg  ) 
Display an error message and exit app

Definition at line 269 of file mythburn.py.

def mythburn::nonfatalError (   msg  ) 
Display a warning message

Definition at line 282 of file mythburn.py.

def mythburn::quoteString (   str  ) 
Return the input string with single quotes escaped.

Definition at line 292 of file mythburn.py.

def mythburn::getTempPath (  ) 
This is the folder where all temporary files will be created.

Definition at line 299 of file mythburn.py.

def mythburn::getCPUCount (  ) 
return the number of CPU's

Definition at line 306 of file mythburn.py.

def mythburn::getEncodingProfilePath (  ) 
This is the folder where all encoder profile files are located.

Definition at line 329 of file mythburn.py.

def mythburn::doesFileExist (   file  ) 
Returns true/false if a given file or path exists.

Definition at line 336 of file mythburn.py.

def mythburn::quoteFilename (   filename  ) 

Definition at line 343 of file mythburn.py.

def mythburn::getText (   node  ) 
Returns the text contents from a given XML element.

Definition at line 351 of file mythburn.py.

def mythburn::getThemeFile (   theme,
  file 
)
Find a theme file - first look in the specified theme directory then look in the
   shared music and image directories

Definition at line 361 of file mythburn.py.

def mythburn::getFontPathName (   fontname  ) 

Definition at line 381 of file mythburn.py.

def mythburn::getItemTempPath (   itemnumber  ) 

Definition at line 387 of file mythburn.py.

def mythburn::validateTheme (   theme  ) 

Definition at line 393 of file mythburn.py.

def mythburn::isResolutionOkayForDVD (   videoresolution  ) 

Definition at line 402 of file mythburn.py.

def mythburn::deleteAllFilesInFolder (   folder  ) 
Does what it says on the tin!.

Definition at line 411 of file mythburn.py.

def mythburn::checkCancelFlag (  ) 
Checks to see if the user has cancelled this run

Definition at line 420 of file mythburn.py.

def mythburn::runCommand (   command  ) 

Definition at line 433 of file mythburn.py.

def mythburn::secondsToFrames (   seconds  ) 
Convert a time in seconds to a frame position

Definition at line 446 of file mythburn.py.

def mythburn::encodeMenu (   background,
  tempvideo,
  music,
  musiclength,
  tempmovie,
  xmlfile,
  finaloutput,
  aspectratio 
)

Definition at line 459 of file mythburn.py.

def mythburn::findEncodingProfile (   profile  ) 
Returns the XML node for the given encoding profile

Definition at line 495 of file mythburn.py.

def mythburn::getThemeConfigurationXML (   theme  ) 
Loads the XML file from disk for a specific theme

Definition at line 533 of file mythburn.py.

def mythburn::getLengthOfVideo (   index  ) 
Returns the length of a video file (in seconds)

Definition at line 546 of file mythburn.py.

def mythburn::getAudioParams (   folder  ) 
Returns the audio bitrate and no of channels for a file from its streaminfo.xml

Definition at line 567 of file mythburn.py.

def mythburn::getVideoParams (   folder  ) 
Returns the video resolution, fps and aspect ratio for the video file from the streamindo.xml file

Definition at line 587 of file mythburn.py.

def mythburn::getAspectRatioOfVideo (   index  ) 
Returns the aspect ratio of the video file (1.333, 1.778, etc)

Definition at line 623 of file mythburn.py.

def mythburn::calcSyncOffset (   index  ) 
Returns the sync offset between the video and first audio stream

Definition at line 643 of file mythburn.py.

def mythburn::getFormatedLengthOfVideo (   index  ) 

Definition at line 671 of file mythburn.py.

def mythburn::frameToTime (   frame,
  fps 
)

Definition at line 684 of file mythburn.py.

def mythburn::createVideoChapters (   itemnum,
  numofchapters,
  lengthofvideo,
  getthumbnails 
)
Returns numofchapters chapter marks even spaced through a certain time period

Definition at line 698 of file mythburn.py.

def mythburn::createVideoChaptersFixedLength (   itemnum,
  segment,
  lengthofvideo 
)
Returns chapter marks at cut list ends, 
   or evenly spaced chapters 'segment' seconds through the file

Definition at line 745 of file mythburn.py.

def mythburn::getDefaultParametersFromMythTVDB (  ) 
Reads settings from MythTV database

Definition at line 780 of file mythburn.py.

def mythburn::saveSetting (   name,
  data 
)

Definition at line 840 of file mythburn.py.

def mythburn::clearArchiveItems (  ) 
Remove all archive items from the archiveitems DB table

Definition at line 847 of file mythburn.py.

def mythburn::getOptions (   options  ) 

Definition at line 857 of file mythburn.py.

def mythburn::expandItemText (   infoDOM,
  text,
  itemnumber,
  pagenumber,
  keynumber,
  chapternumber,
  chapterlist 
)
Replaces keywords in a string with variables from the XML and filesystem

Definition at line 881 of file mythburn.py.

def mythburn::getScaledAttribute (   node,
  attribute 
)
Returns a value taken from attribute in node scaled for the current video mode

Definition at line 916 of file mythburn.py.

def mythburn::intelliDraw (   drawer,
  text,
  font,
  containerWidth 
)
Based on http://mail.python.org/pipermail/image-sig/2004-December/003064.html

Definition at line 927 of file mythburn.py.

def mythburn::paintBackground (   image,
  node 
)

Definition at line 974 of file mythburn.py.

def mythburn::paintButton (   draw,
  bgimage,
  bgimagemask,
  node,
  infoDOM,
  itemnum,
  page,
  itemsonthispage,
  chapternumber,
  chapterlist 
)

Definition at line 994 of file mythburn.py.

def mythburn::paintText (   draw,
  image,
  text,
  node,
  color = None,
  x = None,
  y = None,
  width = None,
  height = None 
)
Takes a piece of text and draws it onto an image inside a bounding box.

Definition at line 1077 of file mythburn.py.

def mythburn::paintImage (   filename,
  maskfilename,
  imageDom,
  destimage,
  stretch = True 
)
Paste the image specified in the filename into the specified image

Definition at line 1159 of file mythburn.py.

def mythburn::checkBoundaryBox (   boundarybox,
  node 
)

Definition at line 1235 of file mythburn.py.

def mythburn::loadFonts (   themeDOM  ) 

Definition at line 1259 of file mythburn.py.

def mythburn::getFileInformation (   file,
  folder 
)

Definition at line 1305 of file mythburn.py.

def mythburn::WriteXMLToFile (   myDOM,
  filename 
)

Definition at line 1444 of file mythburn.py.

def mythburn::preProcessFile (   file,
  folder,
  count 
)
Pre-process a single video/recording file.

Definition at line 1454 of file mythburn.py.

def mythburn::encodeAudio (   format,
  sourcefile,
  destinationfile,
  deletesourceafterencode 
)

Definition at line 1492 of file mythburn.py.

def mythburn::multiplexMPEGStream (   video,
  audio1,
  audio2,
  destination,
  syncOffset 
)
multiplex one video and one or two audio streams together

Definition at line 1516 of file mythburn.py.

def mythburn::getStreamInformation (   filename,
  xmlFilename,
  lenMethod 
)
create a stream.xml file for filename

Definition at line 1616 of file mythburn.py.

def mythburn::getVideoSize (   xmlFilename  ) 
Get video width and height from stream.xml file

Definition at line 1634 of file mythburn.py.

def mythburn::runMythtranscode (   chanid,
  starttime,
  destination,
  usecutlist,
  localfile 
)
Use mythtranscode to cut commercials and/or clean up an mpeg2 file

Definition at line 1658 of file mythburn.py.

def mythburn::generateProjectXCutlist (   chanid,
  starttime,
  folder 
)
generate cutlist_x.txt for ProjectX

Definition at line 1697 of file mythburn.py.

def mythburn::runProjectX (   chanid,
  starttime,
  folder,
  usecutlist,
  file 
)
Use Project-X to cut commercials and demux an mpeg2 file

Definition at line 1731 of file mythburn.py.

def mythburn::renameProjectXFiles (   folder,
  pxbasename 
)

Definition at line 1794 of file mythburn.py.

def mythburn::ts2pts (   time  ) 

Definition at line 1915 of file mythburn.py.

def mythburn::checkSubtitles (   spumuxFile  ) 

Definition at line 1926 of file mythburn.py.

def mythburn::extractVideoFrame (   source,
  destination,
  seconds 
)

Definition at line 1972 of file mythburn.py.

def mythburn::extractVideoFrames (   source,
  destination,
  thumbList 
)

Definition at line 2004 of file mythburn.py.

def mythburn::encodeVideoToMPEG2 (   source,
  destvideofile,
  video,
  audio1,
  audio2,
  aspectratio,
  profile 
)
Encodes an unknown video source file eg. AVI to MPEG2 video and AC3 audio, use mythffmpeg

Definition at line 2019 of file mythburn.py.

def mythburn::encodeNuvToMPEG2 (   chanid,
  starttime,
  mediafile,
  destvideofile,
  folder,
  profile,
  usecutlist 
)
Encodes a nuv video source file to MPEG2 video and AC3 audio, using mythtranscode & mythffmpeg

Definition at line 2117 of file mythburn.py.

def mythburn::runDVDAuthor (  ) 

Definition at line 2250 of file mythburn.py.

def mythburn::CreateDVDISO (   title  ) 

Definition at line 2261 of file mythburn.py.

def mythburn::BurnDVDISO (   title  ) 

Definition at line 2280 of file mythburn.py.

def mythburn::deMultiplexMPEG2File (   folder,
  mediafile,
  video,
  audio1,
  audio2 
)

Definition at line 2363 of file mythburn.py.

def mythburn::runM2VRequantiser (   source,
  destination,
  factor 
)

Definition at line 2418 of file mythburn.py.

def mythburn::calculateFileSizes (   files  ) 
Returns the sizes of all video, audio and menu files

Definition at line 2444 of file mythburn.py.

def mythburn::total_mv2_brl (   files,
  rate 
)

Definition at line 2490 of file mythburn.py.

def mythburn::performMPEG2Shrink (   files,
  dvdrsize 
)

Definition at line 2511 of file mythburn.py.

def mythburn::createDVDAuthorXML (   screensize,
  numberofitems 
)
Creates the xml file for dvdauthor to use the MythBurn menus.

Definition at line 2595 of file mythburn.py.

def mythburn::createDVDAuthorXMLNoMainMenu (   screensize,
  numberofitems 
)
Creates the xml file for dvdauthor to use the MythBurn menus.

Definition at line 2974 of file mythburn.py.

def mythburn::createDVDAuthorXMLNoMenus (   screensize,
  numberofitems 
)
Creates the xml file for dvdauthor containing no menus.

Definition at line 2988 of file mythburn.py.

def mythburn::createEmptyPreviewFolder (   videoitem  ) 

Definition at line 3167 of file mythburn.py.

def mythburn::generateVideoPreview (   videoitem,
  itemonthispage,
  menuitem,
  starttime,
  menulength,
  previewfolder 
)
generate thumbnails for a preview in a menu

Definition at line 3178 of file mythburn.py.

def mythburn::drawThemeItem (   page,
  itemsonthispage,
  itemnum,
  menuitem,
  bgimage,
  draw,
  bgimagemask,
  drawmask,
  highlightcolor,
  spumuxdom,
  spunode,
  numberofitems,
  chapternumber,
  chapterlist 
)
Draws text and graphics onto a dvd menu, called by 
   createMenu and createChapterMenu

Definition at line 3218 of file mythburn.py.

def mythburn::createMenu (   screensize,
  screendpi,
  numberofitems 
)
Creates all the necessary menu images and files for the MythBurn menus.

Definition at line 3435 of file mythburn.py.

def mythburn::createChapterMenu (   screensize,
  screendpi,
  numberofitems 
)
Creates all the necessary menu images and files for the MythBurn menus.

Definition at line 3648 of file mythburn.py.

def mythburn::createDetailsPage (   screensize,
  screendpi,
  numberofitems 
)
Creates all the necessary images and files for the details page.

Definition at line 3851 of file mythburn.py.

def mythburn::isMediaAVIFile (   file  ) 

Definition at line 3981 of file mythburn.py.

def mythburn::processAudio (   folder  ) 
encode audio to ac3 for better compression and compatability with NTSC players

Definition at line 3990 of file mythburn.py.

def mythburn::selectStreams (   folder  ) 
Choose the streams we want from the source file

Definition at line 4034 of file mythburn.py.

def mythburn::selectSubtitleStream (   folder  ) 
Choose the subtitle stream we want from the source file

Definition at line 4186 of file mythburn.py.

def mythburn::selectAspectRatio (   folder  ) 
figure out what aspect ratio we want from the source file

Definition at line 4245 of file mythburn.py.

def mythburn::getVideoCodec (   folder  ) 
Get the video codec from the streaminfo.xml for the file

Definition at line 4286 of file mythburn.py.

def mythburn::getFileType (   folder  ) 
Get the overall file type from the streaminfo.xml for the file

Definition at line 4308 of file mythburn.py.

def mythburn::getStreamList (   folder  ) 

Definition at line 4331 of file mythburn.py.

def mythburn::isFileOkayForDVD (   file,
  folder 
)
return true if the file is dvd compliant

Definition at line 4356 of file mythburn.py.

def mythburn::processFile (   file,
  folder,
  count 
)
Process a single video/recording file ready for burning.

Definition at line 4389 of file mythburn.py.

def mythburn::doProcessFile (   file,
  folder,
  count 
)
Process a single video/recording file ready for burning.

Definition at line 4401 of file mythburn.py.

def mythburn::doProcessFileProjectX (   file,
  folder,
  count 
)
Process a single video/recording file ready for burning.

Definition at line 4613 of file mythburn.py.

def mythburn::copyRemote (   files,
  tmpPath 
)
go through the list of files looking for files on remote filesytems
   and copy them to a local file for quicker processing

Definition at line 4780 of file mythburn.py.

def mythburn::processJob (   job  ) 
Starts processing a MythBurn job, expects XML nodes to be passed as input.

Definition at line 4805 of file mythburn.py.

def mythburn::usage (  ) 

Definition at line 5026 of file mythburn.py.

def mythburn::main ( void   ) 

Definition at line 5037 of file mythburn.py.


Variable Documentation

string mythburn::VERSION = "0.1.20111228-1"

Definition at line 40 of file mythburn.py.

Definition at line 45 of file mythburn.py.

You can use this debug flag when testing out new themes pick some small recordings, run them through as normal with debug_keeptempfiles = True (see above) set this variable to True and then re-run the scripts the temp.

files will not be deleted and it will run through very much quicker!

Definition at line 53 of file mythburn.py.

Definition at line 56 of file mythburn.py.

Definition at line 59 of file mythburn.py.

Definition at line 63 of file mythburn.py.

Definition at line 66 of file mythburn.py.

Definition at line 94 of file mythburn.py.

Definition at line 95 of file mythburn.py.

Definition at line 96 of file mythburn.py.

int mythburn::FILE = 3
tuple mythburn::dvdPAL = (720,576)

Definition at line 99 of file mythburn.py.

tuple mythburn::dvdNTSC = (720,480)

Definition at line 100 of file mythburn.py.

tuple mythburn::dvdPALdpi = (75,80)

Definition at line 101 of file mythburn.py.

tuple mythburn::dvdNTSCdpi = (81,72)

Definition at line 102 of file mythburn.py.

Definition at line 104 of file mythburn.py.

Definition at line 105 of file mythburn.py.

Definition at line 106 of file mythburn.py.

Definition at line 107 of file mythburn.py.

tuple mythburn::dvdrsize = (4482,8106)

Definition at line 110 of file mythburn.py.

Definition at line 112 of file mythburn.py.

float mythburn::framerateNTSC = 29.97

Definition at line 113 of file mythburn.py.

Definition at line 116 of file mythburn.py.

Definition at line 119 of file mythburn.py.

Referenced by createTempFile().

Definition at line 120 of file mythburn.py.

Definition at line 121 of file mythburn.py.

Definition at line 122 of file mythburn.py.

Definition at line 123 of file mythburn.py.

Definition at line 124 of file mythburn.py.

Referenced by VideoModeSettings::VideoModeSettings().

Definition at line 125 of file mythburn.py.

Referenced by VideoModeSettings::VideoModeSettings().

Definition at line 126 of file mythburn.py.

Definition at line 127 of file mythburn.py.

Definition at line 128 of file mythburn.py.

Referenced by Parse::ParseItem().

Definition at line 131 of file mythburn.py.

Definition at line 132 of file mythburn.py.

Definition at line 133 of file mythburn.py.

Definition at line 134 of file mythburn.py.

Definition at line 135 of file mythburn.py.

Definition at line 136 of file mythburn.py.

Definition at line 137 of file mythburn.py.

Definition at line 138 of file mythburn.py.

Definition at line 139 of file mythburn.py.

Definition at line 140 of file mythburn.py.

Definition at line 143 of file mythburn.py.

Definition at line 147 of file mythburn.py.

Definition at line 150 of file mythburn.py.

Referenced by TV::DVDJumpBack(), and TV::DVDJumpForward().

string mythburn::jobfile = "mydata.xml"

Definition at line 153 of file mythburn.py.

Definition at line 156 of file mythburn.py.

tuple mythburn::progressfile = open("/dev/null", 'w')

Definition at line 157 of file mythburn.py.

Definition at line 160 of file mythburn.py.

Definition at line 163 of file mythburn.py.

Definition at line 164 of file mythburn.py.

Definition at line 165 of file mythburn.py.

Definition at line 166 of file mythburn.py.

Referenced by MythMediaDevice::DetectMediaType().

Definition at line 167 of file mythburn.py.

Definition at line 169 of file mythburn.py.

Definition at line 172 of file mythburn.py.

Definition at line 175 of file mythburn.py.

Definition at line 176 of file mythburn.py.

Referenced by ThemeChooser::Load().

dictionary mythburn::themeFonts = {}

Definition at line 179 of file mythburn.py.

Definition at line 182 of file mythburn.py.

tuple mythburn::DB = MythTV.MythDB()

Definition at line 184 of file mythburn.py.

tuple mythburn::MVID = MythTV.MythVideo(db=DB)

Definition at line 185 of file mythburn.py.

tuple mythburn::configHostname = DB.gethostname()

Definition at line 187 of file mythburn.py.

mythburn::fix_rtl = simple_fix_rtl

Definition at line 201 of file mythburn.py.

Definition at line 4025 of file mythburn.py.

Definition at line 4026 of file mythburn.py.

Definition at line 4027 of file mythburn.py.

Definition at line 4029 of file mythburn.py.

Definition at line 4030 of file mythburn.py.

Definition at line 4031 of file mythburn.py.

Definition at line 4032 of file mythburn.py.

Definition at line 4181 of file mythburn.py.

Definition at line 4182 of file mythburn.py.

Definition at line 4183 of file mythburn.py.

Definition at line 4184 of file mythburn.py.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends
Generated on Fri Feb 10 06:42:29 2012 for MythTV by  doxygen 1.6.3