Documentation
¶
Overview ¶
Package transcode provides the ffmpeg transcoding functionality of the wavepipe media server.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidCodec is returned when an invalid transcoder codec is selected ErrInvalidCodec = errors.New("transcode: no such transcoder codec") // ErrInvalidQuality is returned when an invalid quality is selected for a given codec ErrInvalidQuality = errors.New("transcode: invalid quality for transcoder codec") // ErrTranscodingDisabled is returned when the transcoding subsystem is disabled, due // to not being able to find ffmpeg ErrTranscodingDisabled = errors.New("transcode: could not find ffmpeg, transcoding is disabled") // ErrMP3Disabled is returned when MP3 transcoding is disabled, due to ffmpeg not // containing the libmp3lame codec ErrMP3Disabled = errors.New("transcode: libmp3lame codec not found, MP3 transcoding is disabled") // ErrOGGDisabled is returned when OGG transcoding is disabled, due to ffmpeg not // containing the libvorbis codec ErrOGGDisabled = errors.New("transcode: libvorbis codec not found, OGG transcoding is disabled") )
var CodecSet = set.New()
CodecSet is the set of codecs which wavepipe detected for use with ffmpeg
var Enabled bool
Enabled determines whether transcoding is available and enabled for wavepipe
var ( // ErrFFmpegNotStarted is returned when ffmpeg is not started before attempting to // retrieve its output stream, or wait for it to exit ErrFFmpegNotStarted = errors.New("ffmpeg: transcoding process has not started") )
var FFmpegPath string
FFmpegPath is the path to the ffmpeg binary detected by the transcode manager
Functions ¶
This section is empty.
Types ¶
type FFmpeg ¶
type FFmpeg struct {
// contains filtered or unexported fields
}
FFmpeg represents the ffmpeg media encoder, and is used to provide a more flexible interface than chaining together command-line arguments
func (FFmpeg) Arguments ¶
Arguments outputs a slice of the ffmpeg arguments needed to output audio on stdout
func (*FFmpeg) Start ¶
Start invokes the ffmpeg media encoder using the path discovered by the transcode manager
type MP3CBROptions ¶
type MP3CBROptions struct {
// contains filtered or unexported fields
}
MP3CBROptions represents the options for a MP3 CBR transcoder
func (MP3CBROptions) FFmpegCodec ¶
func (m MP3CBROptions) FFmpegCodec() string
FFmpegCodec returns the codec used by ffmpeg
func (MP3CBROptions) FFmpegFlags ¶
func (m MP3CBROptions) FFmpegFlags() string
FFmpegFlags returns the flag used by ffmpeg to signify this encoding
func (MP3CBROptions) FFmpegQuality ¶
func (m MP3CBROptions) FFmpegQuality() string
FFmpegQuality returns the quality flag used by ffmpeg
func (MP3CBROptions) MIMEType ¶
func (m MP3CBROptions) MIMEType() string
MIMEType returns the MIME type of this item
func (MP3CBROptions) Quality ¶
func (m MP3CBROptions) Quality() string
Quality returns the quality used
type MP3Transcoder ¶
type MP3Transcoder struct {
Options Options
// contains filtered or unexported fields
}
MP3Transcoder represents a MP3 transcoding operation
func NewMP3Transcoder ¶
func NewMP3Transcoder(quality string) (*MP3Transcoder, error)
NewMP3Transcoder creates a new MP3 transcoder, and initializes its associated fields
func (MP3Transcoder) Codec ¶
func (m MP3Transcoder) Codec() string
Codec returns the selected codec used by the transcoder
func (MP3Transcoder) Command ¶
func (m MP3Transcoder) Command() []string
Command returns the command invoked by ffmpeg, for debugging
func (MP3Transcoder) MIMEType ¶
func (m MP3Transcoder) MIMEType() string
MIMEType returns the MIME type contained within the options
func (MP3Transcoder) Quality ¶
func (m MP3Transcoder) Quality() string
Quality returns the selected quality used by the transcoder
func (*MP3Transcoder) Start ¶
func (m *MP3Transcoder) Start(song *data.Song) (io.ReadCloser, error)
Start begins the transcoding process, and returns a stream which contains its output
func (*MP3Transcoder) Wait ¶
func (m *MP3Transcoder) Wait() error
Wait waits for the transcoding process to complete, returning an error if it fails
type MP3VBROptions ¶
type MP3VBROptions struct {
// contains filtered or unexported fields
}
MP3VBROptions represents the options for a MP3 VBR transcoder
func (MP3VBROptions) FFmpegCodec ¶
func (m MP3VBROptions) FFmpegCodec() string
FFmpegCodec returns the codec used by ffmpeg
func (MP3VBROptions) FFmpegFlags ¶
func (m MP3VBROptions) FFmpegFlags() string
FFmpegFlags returns the flag used by ffmpeg to signify this encoding
func (MP3VBROptions) FFmpegQuality ¶
func (m MP3VBROptions) FFmpegQuality() string
FFmpegQuality returns the quality flag used by ffmpeg
func (MP3VBROptions) MIMEType ¶
func (m MP3VBROptions) MIMEType() string
MIMEType returns the MIME type of this item
func (MP3VBROptions) Quality ¶
func (m MP3VBROptions) Quality() string
Quality returns the quality used
type OGGCBROptions ¶
type OGGCBROptions struct {
// contains filtered or unexported fields
}
OGGCBROptions represents the options for a OGG CBR transcoder
func (OGGCBROptions) FFmpegCodec ¶
func (m OGGCBROptions) FFmpegCodec() string
FFmpegCodec returns the codec used by ffmpeg
func (OGGCBROptions) FFmpegFlags ¶
func (m OGGCBROptions) FFmpegFlags() string
FFmpegFlags returns the flag used by ffmpeg to signify this encoding
func (OGGCBROptions) FFmpegQuality ¶
func (m OGGCBROptions) FFmpegQuality() string
FFmpegQuality returns the quality flag used by ffmpeg
func (OGGCBROptions) MIMEType ¶
func (m OGGCBROptions) MIMEType() string
MIMEType returns the MIME type of this item
func (OGGCBROptions) Quality ¶
func (m OGGCBROptions) Quality() string
Quality returns the quality used
type OGGTranscoder ¶
type OGGTranscoder struct {
Options Options
// contains filtered or unexported fields
}
OGGTranscoder represents a OGG transcoding operation
func NewOGGTranscoder ¶
func NewOGGTranscoder(quality string) (*OGGTranscoder, error)
NewOGGTranscoder creates a new OGG transcoder, and initializes its associated fields
func (OGGTranscoder) Codec ¶
func (m OGGTranscoder) Codec() string
Codec returns the selected codec used by the transcoder
func (OGGTranscoder) Command ¶
func (m OGGTranscoder) Command() []string
Command returns the command invoked by ffmpeg, for debugging
func (OGGTranscoder) MIMEType ¶
func (m OGGTranscoder) MIMEType() string
MIMEType returns the MIME type contained within the options
func (OGGTranscoder) Quality ¶
func (m OGGTranscoder) Quality() string
Quality returns the selected quality used by the transcoder
func (*OGGTranscoder) Start ¶
func (m *OGGTranscoder) Start(song *data.Song) (io.ReadCloser, error)
Start begins the transcoding process, and returns a stream which contains its output
func (*OGGTranscoder) Wait ¶
func (m *OGGTranscoder) Wait() error
Wait waits for the transcoding process to complete, returning an error if it fails
type OGGVBROptions ¶
type OGGVBROptions struct {
// contains filtered or unexported fields
}
OGGVBROptions represents the options for a OGG VBR transcoder
func (OGGVBROptions) FFmpegCodec ¶
func (m OGGVBROptions) FFmpegCodec() string
FFmpegCodec returns the codec used by ffmpeg
func (OGGVBROptions) FFmpegFlags ¶
func (m OGGVBROptions) FFmpegFlags() string
FFmpegFlags returns the flag used by ffmpeg to signify this encoding
func (OGGVBROptions) FFmpegQuality ¶
func (m OGGVBROptions) FFmpegQuality() string
FFmpegQuality returns the quality flag used by ffmpeg
func (OGGVBROptions) MIMEType ¶
func (m OGGVBROptions) MIMEType() string
MIMEType returns the MIME type of this item
func (OGGVBROptions) Quality ¶
func (m OGGVBROptions) Quality() string
Quality returns the quality used
type Options ¶
type Options interface {
Codec() string
Ext() string
FFmpegCodec() string
FFmpegFlags() string
FFmpegQuality() string
MIMEType() string
Quality() string
}
Options represents an audio codec and its quality settings, and includes methods to retrieve these settings