-
Notifications
You must be signed in to change notification settings - Fork 20
Script:Script
A script block is the top-level of a script. It contains one or more profiles.
Example:
script {
profile('Empty Profile') { }
}
Define a profile. See the Profile page for more details.
The following variables are available within PMSEncoder scripts. Each variable name is followed by its scope (i.e. the topmost block in which it is defined) in parentheses.
The list of transcoder args for this request. By default this is a copy of $DEFAULT_TRANSCODER_ARGS
.
This is a list of the default transcoder arguments. The current value is defined in the [[builtin pmsencoder.conf
|http://github.com/chocolateboy/pmsencoder/blob/plugin/src/main/resources/pmsencoder.groovy]] as :
def nbcores = $PMS.getConfiguration().getNumberOfCpuCores()
// the default MEncoder args - these can be redefined in a user script
$DEFAULT_MENCODER_ARGS = [
'-prefer-ipv4',
'-oac', 'lavc',
'-of', 'lavf',
'-lavfopts', 'format=dvd',
'-ovc', 'lavc',
'-lavcopts', "vcodec=mpeg2video:vbitrate=4096:threads=${nbcores}:acodec=ac3:abitrate=128",
'-ofps', '25',
'-cache', '16384', // default cache size; default minimum percentage is 20%
'-vf', 'harddup'
]
Globally double the cache size:
script {
$DEFAULT_TRANSCODER_ARGS -= [ '-cache', '16384' ]
$DEFAULT_TRANSCODER_ARGS += [ '-cache', '32768' ]
// ...
}
This is the PMS singleton. See the PMS documentation/source for available methods.
Example:
script {
def nbcores = $PMS.getConfiguration().getNumberOfCpuCores()
profile ('YouTube Extreme HD') {
pattern {
match { nbcores > 4 }
}
action { ... }
}
}
The URI of the current web page or video. This is the videostream
URI from WEB.conf
or the enclosure URI from the Web feed.
script {
profile ('Example') {
pattern {
match { $URI == 'http://www.example.com' }
}
action { ... }
}
}
A list of integers corresponding to YouTube formats (full list here).