MythTV  0.25-pre
Classes | Functions | Variables
mythburn Namespace Reference

Classes

class  FontDef
 class to hold a font definition More...

Functions

def simple_fix_rtl
def write
def fatalError
 Display an error message and exit.
def nonfatalError
def quoteString
 Return the input string with single quotes escaped.
def getTempPath
 Directory where all temporary files will be created.
def getCPUCount
 Try to work out how many cpus we have available.
def getEncodingProfilePath
 Get the directory where all encoder profile files are located.
def doesFileExist
 Returns true/false if a given file or path exists.
def quoteFilename
 Escape quotes in a filename.
def getText
 Returns the text contents from a given XML element.
def getThemeFile
 Try to find a theme file.
def getFontPathName
 Returns the path where we can find our fonts.
def getItemTempPath
 Creates a file path where the temp files for a video file can be created.
def validateTheme
 Returns True if the theme.xml file can be found for the given theme.
def isResolutionOkayForDVD
 Returns True if the given resolution is a DVD compliant one.
def deleteAllFilesInFolder
 Romoves all the files from a directory.
def checkCancelFlag
 Check to see if the user has cancelled the DVD creation process.
def runCommand
 Runs an external command checking to see if the user has cancelled the DVD creation process.
def secondsToFrames
 Convert a time in seconds to a frame number.
def encodeMenu
 Creates a short mpeg file from a jpeg image and an ac3 sound track.
def findEncodingProfile
 Return an xml node from a re-encoding profile xml file for a given profile name.
def getThemeConfigurationXML
 Load the theme.xml file for a DVD theme.
def getLengthOfVideo
 Gets the duration of a video file from its stream info file.
def getAudioParams
 Gets the audio sample rate and number of channels of a video file from its stream info file.
def getVideoParams
 Gets the video resolution, frames per second and aspect ratio of a video file from its stream info file.
def getAspectRatioOfVideo
 Gets the aspect ratio of a video file from its stream info file.
def calcSyncOffset
 Calculates the sync offset between the video and first audio stream.
def getFormatedLengthOfVideo
 Gets the length of a video file and returns it as a string.
def frameToTime
 Convert a frame number to a time string.
def createVideoChapters
 Creates a set of chapter points evenly spread thoughout a file Optionally grabs the thumbnails from the file.
def createVideoChaptersFixedLength
 Creates some fixed length chapter marks.
def getDefaultParametersFromMythTVDB
 Reads a load of settings from DB.
def saveSetting
 Save a setting to the settings table in the DB.
def clearArchiveItems
 Remove all archive items from the archiveitems DB table.
def getOptions
 Load the options from the options node passed in the job file.
def expandItemText
 Substitutes some text from a theme file with the required values.
def getScaledAttribute
 Scale a theme position/size depending on the current video mode.
def intelliDraw
 Splits some text into lines so it will fit into a given container.
def paintBackground
 Paints a background rectangle onto an image.
def paintButton
 Paints a button onto an image.
def paintText
 Paint some theme text on to an image.
def paintImage
 Paint an image on the background image.
def checkBoundaryBox
 Check if boundary box need adjusting.
def loadFonts
 Load the font defintions from a DVD theme file.
def getFileInformation
 Creates an info xml file from details in the job file or from the DB.
def WriteXMLToFile
 Write an xml file to disc.
def preProcessFile
 Pre-process a single video/recording file.
def encodeAudio
 Re-encodes an audio stream to ac3.
def multiplexMPEGStream
 Recombines a video and one or two audio streams back together adding in the NAV packets required to create a DVD.
def getStreamInformation
 Creates a stream xml file for a video file.
def getVideoSize
 Gets the video width and height from a file's stream xml file.
def runMythtranscode
 Run a file though the lossless encoder optionally removing commercials.
def generateProjectXCutlist
 Create a projectX cut list for a recording.
def runProjectX
 Use Project-X to cut commercials and/or demux an mpeg2 file.
def renameProjectXFiles
 find the required stream files and rename them
def ts2pts
 convert time stamp to pts
def checkSubtitles
 check the given spumux.xml file for consistancy
def extractVideoFrame
 Grabs a sequence of consecutive frames from a file.
def extractVideoFrames
 Grabs a list of single frames from a file.
def encodeVideoToMPEG2
 Re-encodes a file to mpeg2.
def encodeNuvToMPEG2
 Re-encodes a nuv file to mpeg2 optionally removing commercials.
def runDVDAuthor
 Runs DVDAuthor to create a DVD file structure.
def CreateDVDISO
 Creates an ISO image from the contents of a directory.
def BurnDVDISO
 Burns the contents of a directory to create a DVD.
def deMultiplexMPEG2File
 Splits a file into the separate audio and video streams using mythreplex.
def runM2VRequantiser
 Run M2VRequantiser.
def calculateFileSizes
 Calculates the total size of all the video, audio and menu files.
def total_mv2_brl
 returns total size of bitrate-limited m2v files
def performMPEG2Shrink
 Uses requantiser if available to shrink the video streams so they will fit on a DVD.
def createDVDAuthorXML
 Creates the DVDAuthor xml file used to create a standard DVD with menus.
def createDVDAuthorXMLNoMainMenu
 Creates the DVDAuthor xml file used to create a DVD with no main menu.
def createDVDAuthorXMLNoMenus
 Creates the DVDAuthor xml file used to create an Autoplay DVD.
def createEmptyPreviewFolder
 Creates the directory to hold the preview images for an animated menu.
def generateVideoPreview
 Generates the thumbnail images used to create animated menus.
def drawThemeItem
 Draws text and graphics onto a dvd menu.
def createMenu
 creates the main menu for a DVD
def createChapterMenu
 creates a chapter menu for a file on a DVD
def createDetailsPage
 creates the details page for a file on a DVD
def isMediaAVIFile
 checks if a file is an avi file
def processAudio
 checks to see if an audio stream need to be converted to ac3
def selectStreams
def selectSubtitleStream
def selectAspectRatio
 gets the video aspect ratio from the stream info xml file
def getVideoCodec
 gets video stream codec from the stream info xml file
def getFileType
 gets file container type from the stream info xml file
def getStreamList
 get the list of required stream ids for a file
def isFileOkayForDVD
 check if file is DVD compliant
def processFile
 process a single file ready for burning using either mythtranscode/mythreplex or ProjectX as the cutter/demuxer
def doProcessFile
 process a single file ready for burning using mythtranscode/mythreplex to cut and demux
def doProcessFileProjectX
 process a single file ready for burning using projectX to cut and demux
def copyRemote
 copy files on remote filesystems to the local filesystem
def processJob
 processes one job
def usage
 show usage
def main
 The main starting point for mythburn.py.

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
 chooses which streams from a file to include on the DVD
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
 chooses which subtitle stream from a file to include on the DVD
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 
)
Simple place to channel all text output through

Definition at line 257 of file mythburn.py.

Referenced by analyze_audio(), BurnDVDISO(), checkCancelFlag(), checkSubtitles(), clearArchiveItems(), copyRemote(), createChapterMenu(), createDetailsPage(), createDVDAuthorXML(), createDVDAuthorXMLNoMainMenu(), createDVDAuthorXMLNoMenus(), CreateDVDISO(), createMenu(), createVideoChapters(), createVideoChaptersFixedLength(), deMultiplexMPEG2File(), ThreadedFileWriter.DiskLoop(), doProcessFile(), doProcessFileProjectX(), drawThemeItem(), encodeAudio(), encodeNuvToMPEG2(), encodeVideoToMPEG2(), extractVideoFrame(), extractVideoFrames(), fatalError(), FIFOWriter.FIFOWriteThread(), findEncodingProfile(), finish_mpg(), generateProjectXCutlist(), generateVideoPreview(), hardwareprofile.distros.mythtv_data.uuiddb._UuidDb.get_priv_uuid(), getAspectRatioOfVideo(), getCPUCount(), getDefaultParametersFromMythTVDB(), getFileInformation(), getFileType(), getOptions(), getStreamInformation(), getVideoCodec(), getVideoParams(), getVideoSize(), MythSystemIOHandler.HandleWrite(), isFileOkayForDVD(), lirc_send_command(), loadFonts(), FileLogger.logmsg(), main(), multiplexMPEGStream(), mythfile_write(), nonfatalError(), paintButton(), paintImage(), paintText(), performMPEG2Shrink(), preProcessFile(), processAudio(), processJob(), pxsubtitle(), hardwareprofile::smolt.read_uuid(), renameProjectXFiles(), ring_read_file(), runDVDAuthor(), runM2VRequantiser(), runMythtranscode(), runProjectX(), selectAspectRatio(), selectStreams(), selectSubtitleStream(), setup_multiplex(), sup2dast(), TVRec.SwitchRecordingRingBuffer(), TVRec.TuningNewRecorder(), usage(), validateTheme(), DeviceReadBuffer.WakePoll(), MythSocketThread.WakeReadyReadThread(), cTPDU.Write(), hardwareprofile.smolt._HardwareProfile.write_admin_token(), AudioOutputOSS.WriteAudio(), AudioOutputPulseAudio.WriteAudio(), MSocketDevice.writeBlock(), MSocketDevice.writeData(), MPEG2fixup.WriteData(), writeout_ext(), writeout_padding(), writeout_video(), and MPEG2fixup.WriteYUV().

def mythburn.fatalError (   msg)
def mythburn.nonfatalError (   msg)
Display a warning message

Definition at line 282 of file mythburn.py.

Referenced by multiplexMPEGStream().

def mythburn.quoteString (   str)

Return the input string with single quotes escaped.

Return the input string with single quotes escaped.

Definition at line 292 of file mythburn.py.

Referenced by fatalError().

Directory where all temporary files will be created.

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

Definition at line 299 of file mythburn.py.

Referenced by BurnDVDISO(), calculateFileSizes(), createChapterMenu(), createDetailsPage(), createDVDAuthorXML(), createDVDAuthorXMLNoMenus(), CreateDVDISO(), createMenu(), encodeVideoToMPEG2(), getItemTempPath(), processJob(), and runDVDAuthor().

Try to work out how many cpus we have available.

return the number of CPU's

Definition at line 306 of file mythburn.py.

Referenced by main().

Get the directory where all encoder profile files are located.

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

Definition at line 329 of file mythburn.py.

Referenced by findEncodingProfile().

def mythburn.doesFileExist (   file)
def mythburn.quoteFilename (   filename)
def mythburn.getText (   node)

Returns the text contents from a given XML element.

Returns the text contents from a given XML element.

Definition at line 351 of file mythburn.py.

Referenced by checkBoundaryBox(), createDVDAuthorXML(), createVideoChapters(), createVideoChaptersFixedLength(), doProcessFile(), doProcessFileProjectX(), drawThemeItem(), encodeVideoToMPEG2(), expandItemText(), findEncodingProfile(), getFileInformation(), and loadFonts().

def mythburn.getThemeFile (   theme,
  file 
)

Try to find a 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.

Referenced by createChapterMenu(), createDetailsPage(), createDVDAuthorXML(), createDVDAuthorXMLNoMenus(), createMenu(), drawThemeItem(), expandItemText(), generateVideoPreview(), getThemeConfigurationXML(), paintButton(), and validateTheme().

def mythburn.getFontPathName (   fontname)

Returns the path where we can find our fonts.

Definition at line 381 of file mythburn.py.

Referenced by loadFonts().

def mythburn.getItemTempPath (   itemnumber)
def mythburn.validateTheme (   theme)

Returns True if the theme.xml file can be found for the given theme.

Definition at line 393 of file mythburn.py.

Referenced by processJob().

def mythburn.isResolutionOkayForDVD (   videoresolution)

Returns True if the given resolution is a DVD compliant one.

Definition at line 402 of file mythburn.py.

Referenced by isFileOkayForDVD().

Romoves all the files from a directory.

Does what it says on the tin!.

Definition at line 411 of file mythburn.py.

Referenced by createEmptyPreviewFolder(), and processJob().

Check to see if the user has cancelled the DVD creation process.

Checks to see if the user has cancelled this run

Definition at line 420 of file mythburn.py.

Referenced by BurnDVDISO(), CreateDVDISO(), multiplexMPEGStream(), performMPEG2Shrink(), runCommand(), and runDVDAuthor().

def mythburn.runCommand (   command)
def mythburn.secondsToFrames (   seconds)

Convert a time in seconds to a frame number.

Convert a time in seconds to a frame position

Definition at line 446 of file mythburn.py.

Referenced by createChapterMenu(), createDetailsPage(), createMenu(), and generateVideoPreview().

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

Creates a short mpeg file from a jpeg image and an ac3 sound track.

Definition at line 459 of file mythburn.py.

Referenced by createChapterMenu(), createDetailsPage(), and createMenu().

def mythburn.findEncodingProfile (   profile)

Return an xml node from a re-encoding profile xml file for a given profile name.

Returns the XML node for the given encoding profile

Definition at line 495 of file mythburn.py.

Referenced by encodeNuvToMPEG2(), and encodeVideoToMPEG2().

Load the theme.xml file for a DVD theme.

Loads the XML file from disk for a specific theme

Definition at line 533 of file mythburn.py.

Referenced by processJob().

def mythburn.getLengthOfVideo (   index)

Gets the duration of a video file from its stream info file.

Returns the length of a video file (in seconds)

Definition at line 546 of file mythburn.py.

Referenced by createChapterMenu(), createDVDAuthorXML(), createDVDAuthorXMLNoMenus(), getFormatedLengthOfVideo(), performMPEG2Shrink(), and total_mv2_brl().

def mythburn.getAudioParams (   folder)

Gets the audio sample rate and number of channels of a video file from its stream info file.

Returns the audio bitrate and no of channels for a file from its streaminfo.xml

Definition at line 567 of file mythburn.py.

Referenced by encodeNuvToMPEG2().

def mythburn.getVideoParams (   folder)

Gets the video resolution, frames per second and aspect ratio of a video file from its stream info file.

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.

Referenced by encodeNuvToMPEG2(), and getFileInformation().

Gets the aspect ratio of a video file from its stream info file.

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

Definition at line 623 of file mythburn.py.

Referenced by createChapterMenu(), createDetailsPage(), createDVDAuthorXML(), and createDVDAuthorXMLNoMenus().

def mythburn.calcSyncOffset (   index)

Calculates the sync offset between the video and first audio stream.

Returns the sync offset between the video and first audio stream

Definition at line 643 of file mythburn.py.

Referenced by processJob().

Gets the length of a video file and returns it as a string.

Definition at line 671 of file mythburn.py.

Referenced by expandItemText().

def mythburn.frameToTime (   frame,
  fps 
)

Convert a frame number to a time string.

Definition at line 684 of file mythburn.py.

Referenced by getFileInformation().

def mythburn.createVideoChapters (   itemnum,
  numofchapters,
  lengthofvideo,
  getthumbnails 
)

Creates a set of chapter points evenly spread thoughout a file Optionally grabs the thumbnails from the file.

Returns numofchapters chapter marks even spaced through a certain time period

Definition at line 698 of file mythburn.py.

Referenced by createChapterMenu(), and createDVDAuthorXML().

def mythburn.createVideoChaptersFixedLength (   itemnum,
  segment,
  lengthofvideo 
)

Creates some fixed length chapter marks.

Returns chapter marks at cut list ends, 
   or evenly spaced chapters 'segment' seconds through the file

Definition at line 745 of file mythburn.py.

Referenced by createDVDAuthorXML(), and createDVDAuthorXMLNoMenus().

Reads a load of settings from DB.

Reads settings from MythTV database

Definition at line 780 of file mythburn.py.

Referenced by main().

def mythburn.saveSetting (   name,
  data 
)

Save a setting to the settings table in the DB.

Definition at line 840 of file mythburn.py.

Referenced by fatalError(), and main().

Remove all archive items from the archiveitems DB table.

Remove all archive items from the archiveitems DB table

Definition at line 847 of file mythburn.py.

Referenced by main().

def mythburn.getOptions (   options)

Load the options from the options node passed in the job file.

Definition at line 857 of file mythburn.py.

Referenced by main().

def mythburn.expandItemText (   infoDOM,
  text,
  itemnumber,
  pagenumber,
  keynumber,
  chapternumber,
  chapterlist 
)

Substitutes some text from a theme file with the required values.

Replaces keywords in a string with variables from the XML and filesystem

Definition at line 881 of file mythburn.py.

Referenced by drawThemeItem(), paintButton(), and processJob().

def mythburn.getScaledAttribute (   node,
  attribute 
)

Scale a theme position/size depending on the current video mode.

Returns a value taken from attribute in node scaled for the current video mode

Definition at line 916 of file mythburn.py.

Referenced by checkBoundaryBox(), drawThemeItem(), generateVideoPreview(), loadFonts(), paintBackground(), paintButton(), paintImage(), and paintText().

def mythburn.intelliDraw (   drawer,
  text,
  font,
  containerWidth 
)

Splits some text into lines so it will fit into a given container.

Based on http://mail.python.org/pipermail/image-sig/2004-December/003064.html

Definition at line 927 of file mythburn.py.

Referenced by paintText().

def mythburn.paintBackground (   image,
  node 
)

Paints a background rectangle onto an image.

Definition at line 974 of file mythburn.py.

Referenced by drawThemeItem().

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

Paints a button onto an image.

Definition at line 994 of file mythburn.py.

Referenced by drawThemeItem().

def mythburn.paintText (   draw,
  image,
  text,
  node,
  color = None,
  x = None,
  y = None,
  width = None,
  height = None 
)

Paint some theme text on to an image.

Takes a piece of text and draws it onto an image inside a bounding box.

Definition at line 1077 of file mythburn.py.

Referenced by drawThemeItem(), and paintButton().

def mythburn.paintImage (   filename,
  maskfilename,
  imageDom,
  destimage,
  stretch = True 
)

Paint an image on the background image.

Paste the image specified in the filename into the specified image

Definition at line 1159 of file mythburn.py.

Referenced by drawThemeItem().

def mythburn.checkBoundaryBox (   boundarybox,
  node 
)

Check if boundary box need adjusting.

Definition at line 1235 of file mythburn.py.

Referenced by drawThemeItem().

def mythburn.loadFonts (   themeDOM)

Load the font defintions from a DVD theme file.

Definition at line 1259 of file mythburn.py.

Referenced by processJob().

def mythburn.getFileInformation (   file,
  folder 
)

Creates an info xml file from details in the job file or from the DB.

Definition at line 1305 of file mythburn.py.

Referenced by preProcessFile().

def mythburn.WriteXMLToFile (   myDOM,
  filename 
)

Write an xml file to disc.

Definition at line 1444 of file mythburn.py.

Referenced by checkSubtitles().

def mythburn.preProcessFile (   file,
  folder,
  count 
)

Pre-process a single video/recording file.

Pre-process a single video/recording file.

Definition at line 1454 of file mythburn.py.

Referenced by processJob().

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

Re-encodes an audio stream to ac3.

Definition at line 1492 of file mythburn.py.

Referenced by processAudio().

def mythburn.multiplexMPEGStream (   video,
  audio1,
  audio2,
  destination,
  syncOffset 
)

Recombines a video and one or two audio streams back together adding in the NAV packets required to create a DVD.

multiplex one video and one or two audio streams together

Definition at line 1516 of file mythburn.py.

Referenced by processJob().

def mythburn.getStreamInformation (   filename,
  xmlFilename,
  lenMethod 
)

Creates a stream xml file for a video file.

create a stream.xml file for filename

Definition at line 1616 of file mythburn.py.

Referenced by doProcessFile(), doProcessFileProjectX(), and preProcessFile().

def mythburn.getVideoSize (   xmlFilename)

Gets the video width and height from a file's stream xml file.

Get video width and height from stream.xml file

Definition at line 1634 of file mythburn.py.

Referenced by isFileOkayForDVD(), and preProcessFile().

def mythburn.runMythtranscode (   chanid,
  starttime,
  destination,
  usecutlist,
  localfile 
)

Run a file though the lossless encoder optionally removing commercials.

Use mythtranscode to cut commercials and/or clean up an mpeg2 file

Definition at line 1658 of file mythburn.py.

Referenced by doProcessFile().

def mythburn.generateProjectXCutlist (   chanid,
  starttime,
  folder 
)

Create a projectX cut list for a recording.

generate cutlist_x.txt for ProjectX

Definition at line 1697 of file mythburn.py.

Referenced by runProjectX().

def mythburn.runProjectX (   chanid,
  starttime,
  folder,
  usecutlist,
  file 
)

Use Project-X to cut commercials and/or demux an mpeg2 file.

Use Project-X to cut commercials and demux an mpeg2 file

Definition at line 1731 of file mythburn.py.

Referenced by doProcessFileProjectX().

def mythburn.renameProjectXFiles (   folder,
  pxbasename 
)

find the required stream files and rename them

Definition at line 1794 of file mythburn.py.

Referenced by runProjectX().

def mythburn.ts2pts (   time)

convert time stamp to pts

Definition at line 1915 of file mythburn.py.

Referenced by checkSubtitles().

def mythburn.checkSubtitles (   spumuxFile)

check the given spumux.xml file for consistancy

Definition at line 1926 of file mythburn.py.

Referenced by runProjectX().

def mythburn.extractVideoFrame (   source,
  destination,
  seconds 
)

Grabs a sequence of consecutive frames from a file.

Definition at line 1972 of file mythburn.py.

Referenced by doProcessFile(), and doProcessFileProjectX().

def mythburn.extractVideoFrames (   source,
  destination,
  thumbList 
)

Grabs a list of single frames from a file.

Definition at line 2004 of file mythburn.py.

Referenced by createVideoChapters().

def mythburn.encodeVideoToMPEG2 (   source,
  destvideofile,
  video,
  audio1,
  audio2,
  aspectratio,
  profile 
)

Re-encodes a file to mpeg2.

Encodes an unknown video source file eg. AVI to MPEG2 video and AC3 audio, use mythffmpeg

Definition at line 2019 of file mythburn.py.

Referenced by doProcessFile(), and doProcessFileProjectX().

def mythburn.encodeNuvToMPEG2 (   chanid,
  starttime,
  mediafile,
  destvideofile,
  folder,
  profile,
  usecutlist 
)

Re-encodes a nuv file to mpeg2 optionally removing commercials.

Encodes a nuv video source file to MPEG2 video and AC3 audio, using mythtranscode & mythffmpeg

Definition at line 2117 of file mythburn.py.

Referenced by doProcessFile(), and doProcessFileProjectX().

Runs DVDAuthor to create a DVD file structure.

Definition at line 2250 of file mythburn.py.

Referenced by processJob().

def mythburn.CreateDVDISO (   title)

Creates an ISO image from the contents of a directory.

Definition at line 2261 of file mythburn.py.

Referenced by processJob().

def mythburn.BurnDVDISO (   title)

Burns the contents of a directory to create a DVD.

Definition at line 2280 of file mythburn.py.

Referenced by processJob().

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

Splits a file into the separate audio and video streams using mythreplex.

Definition at line 2363 of file mythburn.py.

Referenced by doProcessFile().

def mythburn.runM2VRequantiser (   source,
  destination,
  factor 
)

Run M2VRequantiser.

Definition at line 2418 of file mythburn.py.

Referenced by performMPEG2Shrink().

def mythburn.calculateFileSizes (   files)

Calculates the total size of all the video, audio and menu files.

Returns the sizes of all video, audio and menu files

Definition at line 2444 of file mythburn.py.

Referenced by performMPEG2Shrink().

def mythburn.total_mv2_brl (   files,
  rate 
)

returns total size of bitrate-limited m2v files

Definition at line 2490 of file mythburn.py.

Referenced by performMPEG2Shrink().

def mythburn.performMPEG2Shrink (   files,
  dvdrsize 
)

Uses requantiser if available to shrink the video streams so they will fit on a DVD.

Definition at line 2511 of file mythburn.py.

Referenced by processJob().

def mythburn.createDVDAuthorXML (   screensize,
  numberofitems 
)

Creates the DVDAuthor xml file used to create a standard DVD with menus.

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

Definition at line 2595 of file mythburn.py.

Referenced by processJob().

def mythburn.createDVDAuthorXMLNoMainMenu (   screensize,
  numberofitems 
)

Creates the DVDAuthor xml file used to create a DVD with no main menu.

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

Definition at line 2974 of file mythburn.py.

Referenced by processJob().

def mythburn.createDVDAuthorXMLNoMenus (   screensize,
  numberofitems 
)

Creates the DVDAuthor xml file used to create an Autoplay DVD.

Creates the xml file for dvdauthor containing no menus.

Definition at line 2988 of file mythburn.py.

Referenced by processJob().

def mythburn.createEmptyPreviewFolder (   videoitem)

Creates the directory to hold the preview images for an animated menu.

Definition at line 3167 of file mythburn.py.

Referenced by createChapterMenu(), createDetailsPage(), and createMenu().

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

Generates the thumbnail images used to create animated menus.

generate thumbnails for a preview in a menu

Definition at line 3178 of file mythburn.py.

Referenced by createChapterMenu(), createDetailsPage(), and createMenu().

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.

Draws text and graphics onto a dvd menu, called by 
   createMenu and createChapterMenu

Definition at line 3218 of file mythburn.py.

Referenced by createChapterMenu(), createDetailsPage(), and createMenu().

def mythburn.createMenu (   screensize,
  screendpi,
  numberofitems 
)

creates the main menu for a DVD

Creates all the necessary menu images and files for the MythBurn menus.

Definition at line 3435 of file mythburn.py.

Referenced by processJob().

def mythburn.createChapterMenu (   screensize,
  screendpi,
  numberofitems 
)

creates a chapter menu for a file on a DVD

Creates all the necessary menu images and files for the MythBurn menus.

Definition at line 3648 of file mythburn.py.

Referenced by processJob().

def mythburn.createDetailsPage (   screensize,
  screendpi,
  numberofitems 
)

creates the details page for a file on a DVD

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

Definition at line 3851 of file mythburn.py.

Referenced by processJob().

def mythburn.isMediaAVIFile (   file)

checks if a file is an avi file

Definition at line 3981 of file mythburn.py.

def mythburn.processAudio (   folder)

checks to see if an audio stream need to be converted to ac3

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

Definition at line 3990 of file mythburn.py.

Referenced by doProcessFile(), and doProcessFileProjectX().

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

Definition at line 4034 of file mythburn.py.

Referenced by doProcessFile(), doProcessFileProjectX(), getStreamList(), and renameProjectXFiles().

Choose the subtitle stream we want from the source file

Definition at line 4186 of file mythburn.py.

Referenced by getStreamList().

def mythburn.selectAspectRatio (   folder)

gets the video aspect ratio from the stream info xml file

figure out what aspect ratio we want from the source file

Definition at line 4245 of file mythburn.py.

Referenced by doProcessFile(), and doProcessFileProjectX().

def mythburn.getVideoCodec (   folder)

gets video stream codec from the stream info xml file

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

Definition at line 4286 of file mythburn.py.

Referenced by doProcessFile(), and isFileOkayForDVD().

def mythburn.getFileType (   folder)

gets file container type from the stream info xml file

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

Definition at line 4308 of file mythburn.py.

Referenced by deMultiplexMPEG2File(), doProcessFile(), doProcessFileProjectX(), and renameProjectXFiles().

def mythburn.getStreamList (   folder)

get the list of required stream ids for a file

Definition at line 4331 of file mythburn.py.

Referenced by runProjectX().

def mythburn.isFileOkayForDVD (   file,
  folder 
)

check if file is DVD compliant

return true if the file is dvd compliant

Definition at line 4356 of file mythburn.py.

Referenced by doProcessFile(), and doProcessFileProjectX().

def mythburn.processFile (   file,
  folder,
  count 
)

process a single file ready for burning using either mythtranscode/mythreplex or ProjectX as the cutter/demuxer

Process a single video/recording file ready for burning.

Definition at line 4389 of file mythburn.py.

Referenced by processJob().

def mythburn.doProcessFile (   file,
  folder,
  count 
)

process a single file ready for burning using mythtranscode/mythreplex to cut and demux

Process a single video/recording file ready for burning.

Definition at line 4401 of file mythburn.py.

Referenced by processFile().

def mythburn.doProcessFileProjectX (   file,
  folder,
  count 
)

process a single file ready for burning using projectX to cut and demux

Process a single video/recording file ready for burning.

Definition at line 4613 of file mythburn.py.

Referenced by processFile().

def mythburn.copyRemote (   files,
  tmpPath 
)

copy files on remote filesystems to the local filesystem

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.

Referenced by processJob().

def mythburn.processJob (   job)

processes one job

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

Definition at line 4805 of file mythburn.py.

Referenced by main().

def mythburn.usage ( )

show usage

Definition at line 5026 of file mythburn.py.

def mythburn.main ( void  )

The main starting point for mythburn.py.

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.

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.

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(), and MediaMonitor.GetMedias().

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.

Definition at line 201 of file mythburn.py.

Referenced by intelliDraw().

chooses which streams from a file to include on the DVD

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.

chooses which subtitle stream from a file to include on the DVD

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