Documentation
¶
Index ¶
- Variables
- func CArray(buffer []byte) unsafe.Pointer
- func CFree(ptr unsafe.Pointer)
- func CInt(val int) C.int
- func FFMPEGInitialise() error
- func GetAuthorizedProtocols() []string
- func InitialiseDemuxers() error
- func TimebaseRescale(val int, tbIn int, tbOut int) int
- type AtomBuilder
- type Builder
- type DASHAtomParser
- type DASHDemuxer
- type DASHManifest
- type DASHXMLAdaptionSet
- type DASHXMLInitialization
- type DASHXMLPeriod
- type DASHXMLRepresentation
- type DASHXMLSegment
- type DASHXMLSegmentBase
- type DASHXMLSegmentTemplate
- type Demuxer
- type DemuxerConstructor
- type EncryptionInfo
- type FFMPEGDemuxer
- type HTTPRequest
- type Range
- type Sample
- type SampleEncryption
- type SmoothAtomParser
- type SmoothChunk
- type SmoothDemuxer
- type SmoothProtectionHeader
- type SmoothQualityLevel
- type SmoothStreamIndex
- type SmoothStreamingMedia
- type SmoothTrackInfo
- type SubSampleEncryption
- type Track
- func (t *Track) Bandwidth() int
- func (t *Track) BufferDepth() float64
- func (t *Track) BuildAdaptationSet() string
- func (t *Track) BuildChunk(path string) (float64, error)
- func (t *Track) BuildInit(path string) error
- func (t *Track) BuildRepresentation() string
- func (t *Track) Clean()
- func (t *Track) CleanDirectory(path string)
- func (t *Track) CleanForLive()
- func (t *Track) ComputePrivateInfos()
- func (t *Track) Duration() float64
- func (t *Track) Height() int
- func (t *Track) InitialiseBuild(path string) error
- func (t *Track) IsAudio() bool
- func (t *Track) MaxChunkDuration() float64
- func (t *Track) MinBufferTime() float64
- func (t *Track) Print()
- func (t *Track) SetTimeFields()
- func (t *Track) Width() int
Constants ¶
This section is empty.
Variables ¶
var (
DurationRegexp = regexp.MustCompile(`P((?P<year>[\d\.]+)Y)?((?P<month>[\d\.]+)M)?((?P<day>[\d\.]+)D)?(T((?P<hour>[\d\.]+)H)?((?P<minute>[\d\.]+)M)?((?P<second>[\d\.]+)S)?)?`)
)
var (
PlayReadyRegexp = regexp.MustCompile(`^.+<KID>([^<]+)</KID>.+$`)
)
Functions ¶
func FFMPEGInitialise ¶
func FFMPEGInitialise() error
Called when starting the program, initialise FFMPEG demuxers
func GetAuthorizedProtocols ¶
func GetAuthorizedProtocols() []string
func InitialiseDemuxers ¶
func InitialiseDemuxers() error
Initialise specifics for each demuxer interface
Types ¶
type AtomBuilder ¶
Function type used for atom generation
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Structure used to build chunks
func (*Builder) Initialise ¶
func (b *Builder) Initialise()
Initialise builder building function map
type DASHAtomParser ¶
type DASHAtomParser func(d *DASHDemuxer, reader io.ReadSeeker, size int, t *Track)
type DASHDemuxer ¶
type DASHDemuxer struct {
// contains filtered or unexported fields
}
Demuxer structure foàr DASH streaming parsing
func (*DASHDemuxer) ExtractChunk ¶
func (d *DASHDemuxer) ExtractChunk(tracks *[]*Track, isLive bool) bool
Extract samples from one chunk for each track declared
func (*DASHDemuxer) GetTracks ¶
func (d *DASHDemuxer) GetTracks(tracks *[]*Track) error
Retrieve all tracks from a DASH source
type DASHManifest ¶
type DASHManifest struct {
XMLName xml.Name `xml:"MPD"`
Duration string `xml:"mediaPresentationDuration,attr"`
Period DASHXMLPeriod
}
type DASHXMLAdaptionSet ¶
type DASHXMLAdaptionSet struct {
XMLName xml.Name `xml:"AdaptationSet"`
Group string `xml:"group,attr"`
MimeType string `xml:"mimeType,attr"`
MinWidth int `xml:"minWidth,attr"`
MaxWidth int `xml:"maxWidth,attr"`
MinHeight int `xml:"minHeight,attr"`
Maxheight int `xml:"maxHeight,attr"`
Template DASHXMLSegmentTemplate
Representations []DASHXMLRepresentation `xml:"Representation"`
}
type DASHXMLInitialization ¶
type DASHXMLPeriod ¶
type DASHXMLPeriod struct {
XMLName xml.Name `xml:"Period"`
BaseURL string `xml:"BaseURL"`
AdaptationSets []DASHXMLAdaptionSet `xml:"AdaptationSet"`
}
type DASHXMLRepresentation ¶
type DASHXMLRepresentation struct {
XMLName xml.Name `xml:"Representation"`
Id string `xml:"id,attr"`
Bandwidth string `xml:"bandwidth,attr"`
Codecs string `xml:"codecs,attr"`
AudioSamplingRate string `xml:"audioSamplingRate,attr"`
Width int `xml:"width,attr"`
Height int `xml:"height,attr"`
Sar int `xml:"sar,attr"`
Base DASHXMLSegmentBase
BaseURL string `xml:"BaseURL">`
}
type DASHXMLSegment ¶
type DASHXMLSegmentBase ¶
type DASHXMLSegmentBase struct {
XMLName xml.Name `xml:"SegmentBase"`
Timescale int `xml:"timescale,attr"`
Range string `xml:"indexRange,attr"`
Initialization []DASHXMLInitialization `xml:"Initialization"`
}
type DASHXMLSegmentTemplate ¶
type Demuxer ¶
type Demuxer interface {
Open(path string) error
GetTracks(tracks *[]*Track) error
Close()
ExtractChunk(tracks *[]*Track, isLive bool) bool
}
func OpenDemuxer ¶
Open a file from a path and initialize a demuxer structure
type DemuxerConstructor ¶
type DemuxerConstructor func() Demuxer
type EncryptionInfo ¶
type EncryptionInfo struct {
// contains filtered or unexported fields
}
Strcture used to store encryption specific info of the track
type FFMPEGDemuxer ¶
type FFMPEGDemuxer struct {
// contains filtered or unexported fields
}
Structure used to reference FFMPEG C AVFormatContext structure
func (*FFMPEGDemuxer) AppendSample ¶
func (d *FFMPEGDemuxer) AppendSample(track *Track, stream *C.AVStream)
Append a sample to a track
func (*FFMPEGDemuxer) Close ¶
func (d *FFMPEGDemuxer) Close()
Close demuxer and free FFMPEG specific data
func (*FFMPEGDemuxer) ExtractChunk ¶
func (d *FFMPEGDemuxer) ExtractChunk(tracks *[]*Track, isLive bool) bool
Extract one chunk for each track from input, size of the chunk depends on the first
video track found.
func (*FFMPEGDemuxer) GetTracks ¶
func (d *FFMPEGDemuxer) GetTracks(tracks *[]*Track) error
Retrieve tracks from previously opened file using FFMPEG
func (*FFMPEGDemuxer) Open ¶
func (d *FFMPEGDemuxer) Open(path string) error
Open FFMPEG specific demuxer
type HTTPRequest ¶
type HTTPRequest struct {
Url string
Headers []struct {
// contains filtered or unexported fields
}
}
type Range ¶
type Range struct {
// contains filtered or unexported fields
}
Structure representing range in a segment base DASH
type Sample ¶
type Sample struct {
// contains filtered or unexported fields
}
Structure used to store a Sample for chunk generation
type SampleEncryption ¶
type SampleEncryption struct {
// contains filtered or unexported fields
}
Structure used to store encryption parameters of a sample
type SmoothAtomParser ¶
type SmoothAtomParser func(d *SmoothDemuxer, reader io.ReadSeeker, size int, t *Track)
type SmoothChunk ¶
type SmoothDemuxer ¶
type SmoothDemuxer struct {
// contains filtered or unexported fields
}
Demuxer structure for smooth streaming parsing
func (*SmoothDemuxer) ExtractChunk ¶
func (d *SmoothDemuxer) ExtractChunk(tracks *[]*Track, isLive bool) bool
Extract samples from one chunk for each track declared
func (*SmoothDemuxer) GetTracks ¶
func (d *SmoothDemuxer) GetTracks(tracks *[]*Track) error
Retrieve all tracks from a smooth source
func (*SmoothDemuxer) Open ¶
func (d *SmoothDemuxer) Open(path string) error
Initialise smooth demuxer structure
type SmoothProtectionHeader ¶
type SmoothQualityLevel ¶
type SmoothQualityLevel struct {
XMLName xml.Name `xml:"QualityLevel"`
Index int `xml:"Index,attr"`
Bitrate int `xml:"Bitrate,attr"`
MaxWidth int `xml:"MaxWidth,attr"`
MaxHeight int `xml:"MaxHeight,attr"`
FourCC string `xml:"FourCC,attr"`
CodecPrivateData string `xml:"CodecPrivateData,attr"`
AudioTag int `xml:"AudioTag,attr"`
SamplingRate int `xml:"SamplingRate,attr"`
BitsPerSample int `xml:"BitsPerSample,attr"`
PacketSize int `xml:"PacketSize,attr"`
Channels int `xml:"Channels,attr"`
}
type SmoothStreamIndex ¶
type SmoothStreamIndex struct {
XMLName xml.Name `xml:"StreamIndex"`
Type string `xml:"Type,attr"`
Url string `xml:"Url,attr"`
Name string `xml:"Name,attr"`
Chunks int `xml:"Chunks,attr"`
QualityLevels int `xml:"QualityLevels,attr"`
MaxWidth int `xml:"MaxWidth,attr"`
MaxHeight int `xml:"MaxHeight,attr"`
DisplayWidth int `xml:"DisplayWidth,attr"`
DisplayHeight int `xml:"DisplayHeight,attr"`
QualityInfos []SmoothQualityLevel `xml:"QualityLevel"`
ChunksInfos []SmoothChunk `xml:"c"`
}
type SmoothStreamingMedia ¶
type SmoothStreamingMedia struct {
XMLName xml.Name `xml:"SmoothStreamingMedia"`
MajorVersion int `xml:"MajorVersion,attr"`
MinorVersion int `xml:"MinorVersion,attr"`
Timescale int `xml:"TimeScale,attr"`
Duration int `xml:"Duration,attr"`
IsLive bool `xml:"IsLive,attr"`
LookaheadCount int `xml:"LookaheadCount,attr"`
StreamIndexes []SmoothStreamIndex `xml:"StreamIndex"`
Protection []SmoothProtectionHeader `xml:"Protection>ProtectionHeader"`
}
type SmoothTrackInfo ¶
type SmoothTrackInfo struct {
// contains filtered or unexported fields
}
Structure used to hold track specific information for smooth streaming
type SubSampleEncryption ¶
type SubSampleEncryption struct {
// contains filtered or unexported fields
}
Structure used to store encryption parts of a sample
type Track ¶
type Track struct {
// contains filtered or unexported fields
}
Structure representing a track inside an input file
func (*Track) BuildAdaptationSet ¶
Build track adaptation part of the manifest
func (*Track) BuildChunk ¶
Build a chunk for the track
func (*Track) BuildRepresentation ¶
Build track representation part of the manifest
func (*Track) CleanDirectory ¶
Clean track directory for unreferenced file in manifest
func (*Track) CleanForLive ¶
func (t *Track) CleanForLive()
Partially clean internal list in order to generate an up to date manifest
func (*Track) ComputePrivateInfos ¶
func (t *Track) ComputePrivateInfos()
Extract codec info and compute bandwidth
func (*Track) InitialiseBuild ¶
Initialise build for the track
func (*Track) MaxChunkDuration ¶
Return largest duration of segments in track
func (*Track) MinBufferTime ¶
Return largest duration of segments in track
func (*Track) SetTimeFields ¶
func (t *Track) SetTimeFields()
Set creationTime and modificationTime in Track structure