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 getMysqlDBParameters
def getDatabaseConnection
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 runTcrequant
def calculateFileSizes
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.20090515-1-fixes"
 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
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
 encodetoac3 = False
 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 = ''
tuple configHostname = socket.gethostname()
string installPrefix = ""
 jobDOM = None
 themeDOM = None
string themeName = ''
dictionary themeFonts = {}
int cpuCount = 1
 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 176 of file mythburn.py.

def mythburn::write (   text,
  progress = True 
)

def mythburn::fatalError (   msg  ) 

Display an error message and exit app

Definition at line 252 of file mythburn.py.

def mythburn::nonfatalError (   msg  ) 

Display a warning message

Definition at line 265 of file mythburn.py.

def mythburn::quoteString (   str  ) 

Return the input string with single quotes escaped.

Definition at line 275 of file mythburn.py.

def mythburn::getTempPath (  ) 

This is the folder where all temporary files will be created.

Definition at line 282 of file mythburn.py.

def mythburn::getCPUCount (  ) 

return the number of CPU's

Definition at line 289 of file mythburn.py.

def mythburn::getEncodingProfilePath (  ) 

This is the folder where all encoder profile files are located.

Definition at line 312 of file mythburn.py.

def mythburn::getMysqlDBParameters (  ) 

Definition at line 319 of file mythburn.py.

def mythburn::getDatabaseConnection (  ) 

Returns a mySQL connection to mythconverg database.

Definition at line 350 of file mythburn.py.

def mythburn::doesFileExist (   file  ) 

Returns true/false if a given file or path exists.

Definition at line 357 of file mythburn.py.

def mythburn::quoteFilename (   filename  ) 

Definition at line 364 of file mythburn.py.

def mythburn::getText (   node  ) 

Returns the text contents from a given XML element.

Definition at line 372 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 382 of file mythburn.py.

def mythburn::getFontPathName (   fontname  ) 

Definition at line 402 of file mythburn.py.

def mythburn::getItemTempPath (   itemnumber  ) 

Definition at line 408 of file mythburn.py.

def mythburn::validateTheme (   theme  ) 

Definition at line 414 of file mythburn.py.

def mythburn::isResolutionOkayForDVD (   videoresolution  ) 

Definition at line 423 of file mythburn.py.

def mythburn::deleteAllFilesInFolder (   folder  ) 

Does what it says on the tin!.

Definition at line 432 of file mythburn.py.

def mythburn::checkCancelFlag (  ) 

Checks to see if the user has cancelled this run

Definition at line 441 of file mythburn.py.

def mythburn::runCommand (   command  ) 

Definition at line 454 of file mythburn.py.

def mythburn::secondsToFrames (   seconds  ) 

Convert a time in seconds to a frame position

Definition at line 467 of file mythburn.py.

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

Definition at line 480 of file mythburn.py.

def mythburn::findEncodingProfile (   profile  ) 

Returns the XML node for the given encoding profile

Definition at line 516 of file mythburn.py.

def mythburn::getThemeConfigurationXML (   theme  ) 

Loads the XML file from disk for a specific theme

Definition at line 554 of file mythburn.py.

def mythburn::getLengthOfVideo (   index  ) 

Returns the length of a video file (in seconds)

Definition at line 567 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 588 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 608 of file mythburn.py.

def mythburn::getAspectRatioOfVideo (   index  ) 

Returns the aspect ratio of the video file (1.333, 1.778, etc)

Definition at line 644 of file mythburn.py.

def mythburn::calcSyncOffset (   index  ) 

Returns the sync offset between the video and first audio stream

Definition at line 664 of file mythburn.py.

def mythburn::getFormatedLengthOfVideo (   index  ) 

Definition at line 692 of file mythburn.py.

def mythburn::frameToTime (   frame,
  fps 
)

Definition at line 705 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 719 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 766 of file mythburn.py.

def mythburn::getDefaultParametersFromMythTVDB (  ) 

Reads settings from MythTV database

Definition at line 801 of file mythburn.py.

def mythburn::saveSetting (   name,
  data 
)

Definition at line 870 of file mythburn.py.

def mythburn::clearArchiveItems (  ) 

Remove all archive items from the archiveitems DB table

Definition at line 889 of file mythburn.py.

def mythburn::getOptions (   options  ) 

Definition at line 906 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 930 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 965 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 976 of file mythburn.py.

def mythburn::paintBackground (   image,
  node 
)

Definition at line 1023 of file mythburn.py.

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

Definition at line 1043 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 1126 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 1208 of file mythburn.py.

def mythburn::checkBoundaryBox (   boundarybox,
  node 
)

Definition at line 1284 of file mythburn.py.

def mythburn::loadFonts (   themeDOM  ) 

Definition at line 1308 of file mythburn.py.

def mythburn::getFileInformation (   file,
  folder 
)

Definition at line 1354 of file mythburn.py.

def mythburn::WriteXMLToFile (   myDOM,
  filename 
)

Definition at line 1755 of file mythburn.py.

def mythburn::preProcessFile (   file,
  folder,
  count 
)

Pre-process a single video/recording file.

Definition at line 1765 of file mythburn.py.

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

Definition at line 1803 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 1827 of file mythburn.py.

def mythburn::getStreamInformation (   filename,
  xmlFilename,
  lenMethod 
)

create a stream.xml file for filename

Definition at line 1927 of file mythburn.py.

def mythburn::getVideoSize (   xmlFilename  ) 

Get video width and height from stream.xml file

Definition at line 1944 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 1968 of file mythburn.py.

def mythburn::generateProjectXCutlist (   chanid,
  starttime,
  folder 
)

generate cutlist_x.txt for ProjectX

Definition at line 1996 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 2036 of file mythburn.py.

def mythburn::renameProjectXFiles (   folder,
  pxbasename 
)

Definition at line 2099 of file mythburn.py.

def mythburn::ts2pts (   time  ) 

Definition at line 2222 of file mythburn.py.

def mythburn::checkSubtitles (   spumuxFile  ) 

Definition at line 2233 of file mythburn.py.

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

Definition at line 2279 of file mythburn.py.

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

Definition at line 2311 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 ffmpeg

Definition at line 2325 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 & ffmpeg

Definition at line 2423 of file mythburn.py.

def mythburn::runDVDAuthor (  ) 

Definition at line 2556 of file mythburn.py.

def mythburn::CreateDVDISO (   title  ) 

Definition at line 2567 of file mythburn.py.

def mythburn::BurnDVDISO (   title  ) 

Definition at line 2586 of file mythburn.py.

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

Definition at line 2669 of file mythburn.py.

def mythburn::runTcrequant (   source,
  destination,
  percentage 
)

Definition at line 2715 of file mythburn.py.

def mythburn::calculateFileSizes (   files  ) 

Returns the sizes of all video, audio and menu files

Definition at line 2730 of file mythburn.py.

def mythburn::performMPEG2Shrink (   files,
  dvdrsize 
)

Definition at line 2777 of file mythburn.py.

def mythburn::createDVDAuthorXML (   screensize,
  numberofitems 
)

Creates the xml file for dvdauthor to use the MythBurn menus.

Definition at line 2825 of file mythburn.py.

def mythburn::createDVDAuthorXMLNoMainMenu (   screensize,
  numberofitems 
)

Creates the xml file for dvdauthor to use the MythBurn menus.

Definition at line 3204 of file mythburn.py.

def mythburn::createDVDAuthorXMLNoMenus (   screensize,
  numberofitems 
)

Creates the xml file for dvdauthor containing no menus.

Definition at line 3218 of file mythburn.py.

def mythburn::createEmptyPreviewFolder (   videoitem  ) 

Definition at line 3397 of file mythburn.py.

def mythburn::generateVideoPreview (   videoitem,
  itemonthispage,
  menuitem,
  starttime,
  menulength,
  previewfolder 
)

generate thumbnails for a preview in a menu

Definition at line 3408 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 3448 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 3665 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 3878 of file mythburn.py.

def mythburn::createDetailsPage (   screensize,
  screendpi,
  numberofitems 
)

Creates all the necessary images and files for the details page.

Definition at line 4081 of file mythburn.py.

def mythburn::isMediaAVIFile (   file  ) 

Definition at line 4211 of file mythburn.py.

def mythburn::processAudio (   folder  ) 

encode audio to ac3 for better compression and compatability with NTSC players

Definition at line 4220 of file mythburn.py.

def mythburn::selectStreams (   folder  ) 

Choose the streams we want from the source file

Definition at line 4264 of file mythburn.py.

def mythburn::selectSubtitleStream (   folder  ) 

Choose the subtitle stream we want from the source file

Definition at line 4416 of file mythburn.py.

def mythburn::selectAspectRatio (   folder  ) 

figure out what aspect ratio we want from the source file

Definition at line 4475 of file mythburn.py.

def mythburn::getVideoCodec (   folder  ) 

Get the video codec from the streaminfo.xml for the file

Definition at line 4516 of file mythburn.py.

def mythburn::getFileType (   folder  ) 

Get the overall file type from the streaminfo.xml for the file

Definition at line 4538 of file mythburn.py.

def mythburn::getStreamList (   folder  ) 

Definition at line 4561 of file mythburn.py.

def mythburn::isFileOkayForDVD (   file,
  folder 
)

return true if the file is dvd compliant

Definition at line 4586 of file mythburn.py.

def mythburn::processFile (   file,
  folder,
  count 
)

Process a single video/recording file ready for burning.

Definition at line 4619 of file mythburn.py.

def mythburn::doProcessFile (   file,
  folder,
  count 
)

Process a single video/recording file ready for burning.

Definition at line 4631 of file mythburn.py.

def mythburn::doProcessFileProjectX (   file,
  folder,
  count 
)

Process a single video/recording file ready for burning.

Definition at line 4843 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 5010 of file mythburn.py.

def mythburn::processJob (   job  ) 

Starts processing a MythBurn job, expects XML nodes to be passed as input.

Definition at line 5035 of file mythburn.py.

def mythburn::usage ( void   ) 

Definition at line 5256 of file mythburn.py.

def mythburn::main ( void   ) 

Definition at line 5267 of file mythburn.py.


Variable Documentation

string mythburn::VERSION = "0.1.20090515-1-fixes"

Definition at line 41 of file mythburn.py.

Definition at line 46 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 54 of file mythburn.py.

Definition at line 57 of file mythburn.py.

Definition at line 60 of file mythburn.py.

Definition at line 64 of file mythburn.py.

Definition at line 80 of file mythburn.py.

Definition at line 81 of file mythburn.py.

Definition at line 82 of file mythburn.py.

int mythburn::FILE = 3

tuple mythburn::dvdPAL = (720,576)

Definition at line 85 of file mythburn.py.

tuple mythburn::dvdNTSC = (720,480)

Definition at line 86 of file mythburn.py.

tuple mythburn::dvdPALdpi = (75,80)

Definition at line 87 of file mythburn.py.

tuple mythburn::dvdNTSCdpi = (81,72)

Definition at line 88 of file mythburn.py.

string mythburn::dvdPALHalfD1 = "352x576"

Definition at line 90 of file mythburn.py.

string mythburn::dvdNTSCHalfD1 = "352x480"

Definition at line 91 of file mythburn.py.

string mythburn::dvdPALD1 = "%sx%s"

Definition at line 92 of file mythburn.py.

string mythburn::dvdNTSCD1 = "%sx%s"

Definition at line 93 of file mythburn.py.

tuple mythburn::dvdrsize = (4482,8106)

Definition at line 96 of file mythburn.py.

Definition at line 98 of file mythburn.py.

float mythburn::framerateNTSC = 29.97

Definition at line 99 of file mythburn.py.

Definition at line 102 of file mythburn.py.

string mythburn::temppath = ""

Definition at line 105 of file mythburn.py.

Referenced by createTempFile().

string mythburn::logpath = ""

Definition at line 106 of file mythburn.py.

string mythburn::scriptpath = ""

Definition at line 107 of file mythburn.py.

string mythburn::sharepath = ""

Definition at line 108 of file mythburn.py.

string mythburn::videopath = ""

Definition at line 109 of file mythburn.py.

Definition at line 110 of file mythburn.py.

Referenced by VideoModeSettings::VideoModeSettings().

string mythburn::videomode = ""

Definition at line 111 of file mythburn.py.

Referenced by VideoModeSettings::VideoModeSettings().

string mythburn::gallerypath = ""

Definition at line 112 of file mythburn.py.

string mythburn::musicpath = ""

Definition at line 113 of file mythburn.py.

string mythburn::dateformat = ""

Definition at line 114 of file mythburn.py.

Referenced by InfoDialog::getDateLabel().

string mythburn::timeformat = ""

string mythburn::dbVersion = ""

Definition at line 116 of file mythburn.py.

Definition at line 117 of file mythburn.py.

Definition at line 118 of file mythburn.py.

Definition at line 119 of file mythburn.py.

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.

Definition at line 125 of file mythburn.py.

Definition at line 126 of file mythburn.py.

Definition at line 127 of file mythburn.py.

Definition at line 130 of file mythburn.py.

Definition at line 134 of file mythburn.py.

Definition at line 137 of file mythburn.py.

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

string mythburn::jobfile = "mydata.xml"

Definition at line 140 of file mythburn.py.

string mythburn::progresslog = ""

Definition at line 143 of file mythburn.py.

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

Definition at line 144 of file mythburn.py.

string mythburn::dvddrivepath = "/dev/dvd"

Definition at line 147 of file mythburn.py.

Definition at line 150 of file mythburn.py.

Definition at line 151 of file mythburn.py.

Definition at line 152 of file mythburn.py.

Definition at line 153 of file mythburn.py.

Referenced by MythMediaDevice::DetectMediaType().

Definition at line 154 of file mythburn.py.

tuple mythburn::configHostname = socket.gethostname()

Definition at line 156 of file mythburn.py.

Definition at line 157 of file mythburn.py.

Definition at line 160 of file mythburn.py.

Definition at line 163 of file mythburn.py.

string mythburn::themeName = ''

Definition at line 164 of file mythburn.py.

dictionary mythburn::themeFonts = {}

Definition at line 167 of file mythburn.py.

Definition at line 170 of file mythburn.py.

mythburn::fix_rtl = simple_fix_rtl

Definition at line 184 of file mythburn.py.

Definition at line 4255 of file mythburn.py.

Definition at line 4256 of file mythburn.py.

Definition at line 4257 of file mythburn.py.

Referenced by mpeg_mux_init(), mpegvideo_probe(), put_system_header(), and swf_write_video().

Definition at line 4259 of file mythburn.py.

Definition at line 4260 of file mythburn.py.

Definition at line 4262 of file mythburn.py.

Definition at line 4411 of file mythburn.py.

Definition at line 4412 of file mythburn.py.

Definition at line 4413 of file mythburn.py.

Definition at line 4414 of file mythburn.py.


Generated on Sat Dec 18 05:16:14 2010 for MythTV by  doxygen 1.5.5