Documentation
¶
Index ¶
- func CleanupOldContent(baseDirectory string)
- func GetCodecs(ffmpegPath string) []string
- func StartThumbnailGenerator(chunkPath string, variantIndex int)
- func StopThumbnailGenerator()
- type Codec
- type FileWriterReceiverService
- type FileWriterReceiverServiceCallback
- type HLSHandler
- type HLSVariant
- func (v *HLSVariant) SetAudioBitrate(bitrate string)
- func (v *HLSVariant) SetCPUUsageLevel(level int)
- func (v *HLSVariant) SetVideoBitrate(bitrate int)
- func (v *HLSVariant) SetVideoFramerate(framerate int)
- func (v *HLSVariant) SetVideoScalingHeight(height int)
- func (v *HLSVariant) SetVideoScalingWidth(width int)
- type Libx264Codec
- func (c *Libx264Codec) DisplayName() string
- func (c *Libx264Codec) ExtraArguments() string
- func (c *Libx264Codec) ExtraFilters() string
- func (c *Libx264Codec) GetPresetForLevel(l int) string
- func (c *Libx264Codec) GlobalFlags() string
- func (c *Libx264Codec) Name() string
- func (c *Libx264Codec) PixelFormat() string
- func (c *Libx264Codec) VariantFlags(v *HLSVariant) string
- type NvencCodec
- func (c *NvencCodec) DisplayName() string
- func (c *NvencCodec) ExtraArguments() string
- func (c *NvencCodec) ExtraFilters() string
- func (c *NvencCodec) GetPresetForLevel(l int) string
- func (c *NvencCodec) GlobalFlags() string
- func (c *NvencCodec) Name() string
- func (c *NvencCodec) PixelFormat() string
- func (c *NvencCodec) VariantFlags(v *HLSVariant) string
- type OmxCodec
- func (c *OmxCodec) DisplayName() string
- func (c *OmxCodec) ExtraArguments() string
- func (c *OmxCodec) ExtraFilters() string
- func (c *OmxCodec) GetPresetForLevel(l int) string
- func (c *OmxCodec) GlobalFlags() string
- func (c *OmxCodec) Name() string
- func (c *OmxCodec) PixelFormat() string
- func (c *OmxCodec) VariantFlags(v *HLSVariant) string
- type QuicksyncCodec
- func (c *QuicksyncCodec) DisplayName() string
- func (c *QuicksyncCodec) ExtraArguments() string
- func (c *QuicksyncCodec) ExtraFilters() string
- func (c *QuicksyncCodec) GetPresetForLevel(l int) string
- func (c *QuicksyncCodec) GlobalFlags() string
- func (c *QuicksyncCodec) Name() string
- func (c *QuicksyncCodec) PixelFormat() string
- func (c *QuicksyncCodec) VariantFlags(v *HLSVariant) string
- type Transcoder
- func (t *Transcoder) AddVariant(variant HLSVariant)
- func (t *Transcoder) SetAppendToStream(append bool)
- func (t *Transcoder) SetCodec(codecName string)
- func (t *Transcoder) SetIdentifier(output string)
- func (t *Transcoder) SetInput(input string)
- func (t *Transcoder) SetInternalHTTPPort(port string)
- func (t *Transcoder) SetOutputPath(output string)
- func (t *Transcoder) SetStdin(rtmp *io.PipeReader)
- func (t *Transcoder) Start()
- func (t *Transcoder) Stop()
- type VaapiCodec
- func (c *VaapiCodec) DisplayName() string
- func (c *VaapiCodec) ExtraArguments() string
- func (c *VaapiCodec) ExtraFilters() string
- func (c *VaapiCodec) GetPresetForLevel(l int) string
- func (c *VaapiCodec) GlobalFlags() string
- func (c *VaapiCodec) Name() string
- func (c *VaapiCodec) PixelFormat() string
- func (c *VaapiCodec) VariantFlags(v *HLSVariant) string
- type Video4Linux
- func (c *Video4Linux) DisplayName() string
- func (c *Video4Linux) ExtraArguments() string
- func (c *Video4Linux) ExtraFilters() string
- func (c *Video4Linux) GetPresetForLevel(l int) string
- func (c *Video4Linux) GlobalFlags() string
- func (c *Video4Linux) Name() string
- func (c *Video4Linux) PixelFormat() string
- func (c *Video4Linux) VariantFlags(v *HLSVariant) string
- type VideoSize
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanupOldContent ¶
func CleanupOldContent(baseDirectory string)
CleanupOldContent will delete old files from the private dir that are no longer being referenced in the stream.
func StartThumbnailGenerator ¶
StartThumbnailGenerator starts generating thumbnails.
func StopThumbnailGenerator ¶
func StopThumbnailGenerator()
StopThumbnailGenerator will stop the periodic generating of a thumbnail from video.
Types ¶
type Codec ¶
type Codec interface { Name() string DisplayName() string GlobalFlags() string PixelFormat() string ExtraArguments() string ExtraFilters() string VariantFlags(v *HLSVariant) string GetPresetForLevel(l int) string }
Codec represents a supported codec on the system.
type FileWriterReceiverService ¶
type FileWriterReceiverService struct {
// contains filtered or unexported fields
}
FileWriterReceiverService accepts transcoder responses via HTTP and fires the callbacks.
func (*FileWriterReceiverService) SetupFileWriterReceiverService ¶
func (s *FileWriterReceiverService) SetupFileWriterReceiverService(callbacks FileWriterReceiverServiceCallback)
SetupFileWriterReceiverService will start listening for transcoder responses.
type FileWriterReceiverServiceCallback ¶
type FileWriterReceiverServiceCallback interface { SegmentWritten(localFilePath string) VariantPlaylistWritten(localFilePath string) MasterPlaylistWritten(localFilePath string) }
FileWriterReceiverServiceCallback are to be fired when transcoder responses are written to disk.
type HLSHandler ¶
type HLSHandler struct {
Storage models.StorageProvider
}
HLSHandler gets told about available HLS playlists and segments.
func (*HLSHandler) MasterPlaylistWritten ¶
func (h *HLSHandler) MasterPlaylistWritten(localFilePath string)
MasterPlaylistWritten is fired when a HLS master playlist is written to disk.
func (*HLSHandler) SegmentWritten ¶
func (h *HLSHandler) SegmentWritten(localFilePath string)
SegmentWritten is fired when a HLS segment is written to disk.
func (*HLSHandler) VariantPlaylistWritten ¶
func (h *HLSHandler) VariantPlaylistWritten(localFilePath string)
VariantPlaylistWritten is fired when a HLS variant playlist is written to disk.
type HLSVariant ¶
type HLSVariant struct {
// contains filtered or unexported fields
}
HLSVariant is a combination of settings that results in a single HLS stream.
func (*HLSVariant) SetAudioBitrate ¶
func (v *HLSVariant) SetAudioBitrate(bitrate string)
SetAudioBitrate will set the output framerate of this variant's audio.
func (*HLSVariant) SetCPUUsageLevel ¶
func (v *HLSVariant) SetCPUUsageLevel(level int)
SetCPUUsageLevel will set the hardware usage of this variant.
func (*HLSVariant) SetVideoBitrate ¶
func (v *HLSVariant) SetVideoBitrate(bitrate int)
SetVideoBitrate will set the output bitrate of this variant's video.
func (*HLSVariant) SetVideoFramerate ¶
func (v *HLSVariant) SetVideoFramerate(framerate int)
SetVideoFramerate will set the output framerate of this variant's video.
func (*HLSVariant) SetVideoScalingHeight ¶
func (v *HLSVariant) SetVideoScalingHeight(height int)
SetVideoScalingHeight will set the scaled video height of this variant.
func (*HLSVariant) SetVideoScalingWidth ¶
func (v *HLSVariant) SetVideoScalingWidth(width int)
SetVideoScalingWidth will set the scaled video width of this variant.
type Libx264Codec ¶
type Libx264Codec struct { }
Libx264Codec represents an instance of the Libx264 Codec.
func (*Libx264Codec) DisplayName ¶
func (c *Libx264Codec) DisplayName() string
DisplayName returns the human readable name of the codec.
func (*Libx264Codec) ExtraArguments ¶
func (c *Libx264Codec) ExtraArguments() string
ExtraArguments are the extra arguments used with this codec in the transcoder.
func (*Libx264Codec) ExtraFilters ¶
func (c *Libx264Codec) ExtraFilters() string
ExtraFilters are the extra filters required for this codec in the transcoder.
func (*Libx264Codec) GetPresetForLevel ¶
func (c *Libx264Codec) GetPresetForLevel(l int) string
GetPresetForLevel returns the string preset for this codec given an integer level.
func (*Libx264Codec) GlobalFlags ¶
func (c *Libx264Codec) GlobalFlags() string
GlobalFlags are the global flags used with this codec in the transcoder.
func (*Libx264Codec) PixelFormat ¶
func (c *Libx264Codec) PixelFormat() string
PixelFormat is the pixel format required for this codec.
func (*Libx264Codec) VariantFlags ¶
func (c *Libx264Codec) VariantFlags(v *HLSVariant) string
VariantFlags returns a string representing a single variant processed by this codec.
type NvencCodec ¶
type NvencCodec struct { }
NvencCodec represents an instance of the Nvenc Codec.
func (*NvencCodec) DisplayName ¶
func (c *NvencCodec) DisplayName() string
DisplayName returns the human readable name of the codec.
func (*NvencCodec) ExtraArguments ¶
func (c *NvencCodec) ExtraArguments() string
ExtraArguments are the extra arguments used with this codec in the transcoder.
func (*NvencCodec) ExtraFilters ¶
func (c *NvencCodec) ExtraFilters() string
ExtraFilters are the extra filters required for this codec in the transcoder.
func (*NvencCodec) GetPresetForLevel ¶
func (c *NvencCodec) GetPresetForLevel(l int) string
GetPresetForLevel returns the string preset for this codec given an integer level.
func (*NvencCodec) GlobalFlags ¶
func (c *NvencCodec) GlobalFlags() string
GlobalFlags are the global flags used with this codec in the transcoder.
func (*NvencCodec) PixelFormat ¶
func (c *NvencCodec) PixelFormat() string
PixelFormat is the pixel format required for this codec.
func (*NvencCodec) VariantFlags ¶
func (c *NvencCodec) VariantFlags(v *HLSVariant) string
VariantFlags returns a string representing a single variant processed by this codec.
type OmxCodec ¶
type OmxCodec struct { }
OmxCodec represents an instance of the Omx codec.
func (*OmxCodec) DisplayName ¶
DisplayName returns the human readable name of the codec.
func (*OmxCodec) ExtraArguments ¶
ExtraArguments are the extra arguments used with this codec in the transcoder.
func (*OmxCodec) ExtraFilters ¶
ExtraFilters are the extra filters required for this codec in the transcoder.
func (*OmxCodec) GetPresetForLevel ¶
GetPresetForLevel returns the string preset for this codec given an integer level.
func (*OmxCodec) GlobalFlags ¶
GlobalFlags are the global flags used with this codec in the transcoder.
func (*OmxCodec) PixelFormat ¶
PixelFormat is the pixel format required for this codec.
func (*OmxCodec) VariantFlags ¶
func (c *OmxCodec) VariantFlags(v *HLSVariant) string
VariantFlags returns a string representing a single variant processed by this codec.
type QuicksyncCodec ¶
type QuicksyncCodec struct { }
QuicksyncCodec represents an instance of the Intel Quicksync Codec.
func (*QuicksyncCodec) DisplayName ¶
func (c *QuicksyncCodec) DisplayName() string
DisplayName returns the human readable name of the codec.
func (*QuicksyncCodec) ExtraArguments ¶
func (c *QuicksyncCodec) ExtraArguments() string
ExtraArguments are the extra arguments used with this codec in the transcoder.
func (*QuicksyncCodec) ExtraFilters ¶
func (c *QuicksyncCodec) ExtraFilters() string
ExtraFilters are the extra filters required for this codec in the transcoder.
func (*QuicksyncCodec) GetPresetForLevel ¶
func (c *QuicksyncCodec) GetPresetForLevel(l int) string
GetPresetForLevel returns the string preset for this codec given an integer level.
func (*QuicksyncCodec) GlobalFlags ¶
func (c *QuicksyncCodec) GlobalFlags() string
GlobalFlags are the global flags used with this codec in the transcoder.
func (*QuicksyncCodec) PixelFormat ¶
func (c *QuicksyncCodec) PixelFormat() string
PixelFormat is the pixel format required for this codec.
func (*QuicksyncCodec) VariantFlags ¶
func (c *QuicksyncCodec) VariantFlags(v *HLSVariant) string
VariantFlags returns a string representing a single variant processed by this codec.
type Transcoder ¶
type Transcoder struct { TranscoderCompleted func(error) // contains filtered or unexported fields }
Transcoder is a single instance of a video transcoder.
func NewTranscoder ¶
func NewTranscoder() *Transcoder
NewTranscoder will return a new Transcoder, populated by the config.
func (*Transcoder) AddVariant ¶
func (t *Transcoder) AddVariant(variant HLSVariant)
AddVariant adds a new HLS variant to include in the output.
func (*Transcoder) SetAppendToStream ¶
func (t *Transcoder) SetAppendToStream(append bool)
SetAppendToStream enables appending to the HLS stream instead of overwriting.
func (*Transcoder) SetCodec ¶
func (t *Transcoder) SetCodec(codecName string)
SetCodec will set the codec to be used for the transocder.
func (*Transcoder) SetIdentifier ¶
func (t *Transcoder) SetIdentifier(output string)
SetIdentifier enables appending a unique identifier to segment file name.
func (*Transcoder) SetInput ¶
func (t *Transcoder) SetInput(input string)
SetInput sets the input stream on the filesystem.
func (*Transcoder) SetInternalHTTPPort ¶
func (t *Transcoder) SetInternalHTTPPort(port string)
SetInternalHTTPPort will set the port to be used for internal communication.
func (*Transcoder) SetOutputPath ¶
func (t *Transcoder) SetOutputPath(output string)
SetOutputPath sets the root directory that should include playlists and video segments.
func (*Transcoder) SetStdin ¶
func (t *Transcoder) SetStdin(rtmp *io.PipeReader)
SetStdin sets the Stdin of the ffmpeg command.
func (*Transcoder) Start ¶
func (t *Transcoder) Start()
Start will execute the transcoding process with the settings previously set.
func (*Transcoder) Stop ¶
func (t *Transcoder) Stop()
Stop will stop the transcoder and kill all processing.
type VaapiCodec ¶
type VaapiCodec struct { }
VaapiCodec represents an instance of the Vaapi codec.
func (*VaapiCodec) DisplayName ¶
func (c *VaapiCodec) DisplayName() string
DisplayName returns the human readable name of the codec.
func (*VaapiCodec) ExtraArguments ¶
func (c *VaapiCodec) ExtraArguments() string
ExtraArguments are the extra arguments used with this codec in the transcoder.
func (*VaapiCodec) ExtraFilters ¶
func (c *VaapiCodec) ExtraFilters() string
ExtraFilters are the extra filters required for this codec in the transcoder.
func (*VaapiCodec) GetPresetForLevel ¶
func (c *VaapiCodec) GetPresetForLevel(l int) string
GetPresetForLevel returns the string preset for this codec given an integer level.
func (*VaapiCodec) GlobalFlags ¶
func (c *VaapiCodec) GlobalFlags() string
GlobalFlags are the global flags used with this codec in the transcoder.
func (*VaapiCodec) PixelFormat ¶
func (c *VaapiCodec) PixelFormat() string
PixelFormat is the pixel format required for this codec.
func (*VaapiCodec) VariantFlags ¶
func (c *VaapiCodec) VariantFlags(v *HLSVariant) string
VariantFlags returns a string representing a single variant processed by this codec.
type Video4Linux ¶
type Video4Linux struct{}
Video4Linux represents an instance of the V4L Codec.
func (*Video4Linux) DisplayName ¶
func (c *Video4Linux) DisplayName() string
DisplayName returns the human readable name of the codec.
func (*Video4Linux) ExtraArguments ¶
func (c *Video4Linux) ExtraArguments() string
ExtraArguments are the extra arguments used with this codec in the transcoder.
func (*Video4Linux) ExtraFilters ¶
func (c *Video4Linux) ExtraFilters() string
ExtraFilters are the extra filters required for this codec in the transcoder.
func (*Video4Linux) GetPresetForLevel ¶
func (c *Video4Linux) GetPresetForLevel(l int) string
GetPresetForLevel returns the string preset for this codec given an integer level.
func (*Video4Linux) GlobalFlags ¶
func (c *Video4Linux) GlobalFlags() string
GlobalFlags are the global flags used with this codec in the transcoder.
func (*Video4Linux) PixelFormat ¶
func (c *Video4Linux) PixelFormat() string
PixelFormat is the pixel format required for this codec.
func (*Video4Linux) VariantFlags ¶
func (c *Video4Linux) VariantFlags(v *HLSVariant) string
VariantFlags returns a string representing a single variant processed by this codec.