Documentation ¶
Overview ¶
Copyright © 2018 Patrick Nuckolls <nuckollsp at gmail>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Index ¶
- Constants
- Variables
- func CowardlyCreateDir(dirname string) error
- func ForceSuperuser(value bool)
- func GetDefaultSettingsDir() string
- func IsSuperUser() bool
- func MaybePanic(err error)
- func PrintError(in ...interface{})
- func PrintVerbose(in ...interface{})
- func Println(in ...interface{})
- func SetSettingsDir(settingsDirIn string)
- func SettingsDir(relPath ...string) string
- func SettingsWriteFile(data []byte, relPath ...string) error
- type Arch
- type Computer
- type OS
- type SystemType
- type TranscodeSettings
Constants ¶
const ( Linux OS = "linux" Windows OS = "windows" OSx OS = "darwin" Amd64 Arch = "amd64" I386 Arch = "386" )
Any additional architectures/OS's need to be added here
const BuildType = "unix"
Variables ¶
var (
AlwaysPanic bool
)
Functions ¶
func CowardlyCreateDir ¶
Will ask for user confirmation for creating folders outside SettingsDir, or to create SettingsDir. Otherwise will error out
func ForceSuperuser ¶
func ForceSuperuser(value bool)
func GetDefaultSettingsDir ¶
func GetDefaultSettingsDir() string
Returns full path to the default settings directory location ~/.local/share/transcodebot on unix's if normal user
func IsSuperUser ¶
func IsSuperUser() bool
func MaybePanic ¶
func MaybePanic(err error)
Procedure:
MaybePanic
Purpose:
To panic if an error appears Really exists to help with debugging
Parameters:
the error: err
Produces:
Side effects: panic Or nothing
Preconditions:
No additional
Postconditions:
panic if AlwaysPanic
func PrintError ¶
func PrintError(in ...interface{})
func SetSettingsDir ¶
func SetSettingsDir(settingsDirIn string)
Sets internal settings directory. Will panic if called more than once.
func SettingsDir ¶
Procedure:
SettingsDir
Purpose:
To safely return an absolute path under SettingsDir()
Parameters:
Additional path elements: relPath ...string
Produces:
output string
Preconditions:
SetSettingsDir has been called
Postconditions:
output = $settingsDir/$relPath/$relPath/$relPath...
func SettingsWriteFile ¶
Safely write data bytes to a file inside the settings directory.
Types ¶
type Arch ¶
type Arch string
Operating system system architecture Should be limited to those that Go can target
type SystemType ¶
Basic system information
func (SystemType) ToString ¶
func (system SystemType) ToString() string
type TranscodeSettings ¶
type TranscodeSettings struct { //Optionally short-circuit all of the built in logic and specify the command manually, and ignore all other options. //Pseudocode of what happens if this option is not zero-length: //for line in RawffmpegOptions: // Sys.Execute("ffmpeg -nostdin -i $inputfile $line") RawffmpegOptions []string //If false, error if a stream is found that cannot be converted HandleUnuseableStreams bool //If true and HandleUnuseableStreams is true, throw out streams that can't be converted to a target type //If false, pass through the stream to the output unmolested TossUnuseableStreams bool //The containing file type, i.e. webm, mkv, mp4, mov ContainerType string //Video Codec to use VideoCodec string //Subpixel format PixFormat string //Speed parameter for the primary (second in two pass) encoding pass PrimaryPassSpeed uint8 //Whether to do two-pass encoding TwoPass bool //Speed parameter for the log (first and possibly omitted) pass PreliminaryPassSpeed uint8 //Audio codec to use AudioCodec string //Subtitle codec to use SubtitleCodec string }
Settings to pass to ffmpeg to use for transcoding Most of these settings line up with something in the ffmeg documentation, and