Documentation ¶
Index ¶
- func Dummy(format string, acodec string, vcodec string) (io.Reader, error)
- func DurationToPosition(d time.Duration) string
- type AudioCodec
- type Codec
- type FFmpeg
- type Format
- type Input
- type Map
- type Metadata
- type Output
- type Printer
- type ProbeFormat
- type ProbeInfo
- func (pi ProbeInfo) AudioCodec() string
- func (pi ProbeInfo) Duration() time.Duration
- func (pi ProbeInfo) FindStreamType(codecType string) (ProbeStream, bool)
- func (pi ProbeInfo) FormatName() string
- func (pi ProbeInfo) String() string
- func (pi ProbeInfo) SubtitleCodec() string
- func (pi *ProbeInfo) UnmarshalJSON(text []byte) error
- func (pi ProbeInfo) VideoCodec() string
- type ProbeStream
- type Reader
- type Stream
- type SubtitleCodec
- type URL
- type VideoCodec
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DurationToPosition ¶
DurationToPosition time.Duration to ffmpeg position format
Types ¶
type AudioCodec ¶
type AudioCodec string
type FFmpeg ¶
type FFmpeg struct { Streams []Stream Stderr io.Writer DebugLog Printer // contains filtered or unexported fields }
FFmpeg instance
type Map ¶
type Map struct { Input Input // many streams can use same the input Specifier string // 0, a:0, v:0, etc Codec Codec CodecFlags []string }
Map input stream to output stream
type Metadata ¶
type Metadata struct { Album string `json:"album"` // name of the set this work belongs to // main creator of the set/album, if different from artist. // e.g. "Various Artists" for compilation albums. AlbumArtist string `json:"album_artist"` Artist string `json:"artist"` // main creator of the work Comment string `json:"comment"` // any additional description of the file. Composer string `json:"composer"` // who composed the work, if different from artist. Copyright string `json:"copyright"` // name of copyright holder. CreationTime string `json:"creation_time"` // date when the file was created, preferably in ISO 8601. Date string `json:"date"` // date when the work was created, preferably in ISO 8601. Disc string `json:"disc"` // number of a subset, e.g. disc in a multi-disc collection. Encoder string `json:"encoder"` // name/settings of the software/hardware that produced the file. EncodedBy string `json:"encoded_by"` // person/group who created the file. Filename string `json:"filename"` // original name of the file. Genre string `json:"genre"` // <self-evident>. // main language in which the work is performed, preferably // in ISO 639-2 format. Multiple languages can be specified by // separating them with commas. Language string `json:"language"` // artist who performed the work, if different from artist. // E.g for "Also sprach Zarathustra", artist would be "Richard // Strauss" and performer "London Philharmonic Orchestra". Performer string `json:"performer"` Publisher string `json:"publisher"` // name of the label/publisher. ServiceName string `json:"service_name"` // name of the service in broadcasting (channel name). ServiceProvider string `json:"service_provider"` // name of the service provider in broadcasting. Title string `json:"title"` // name of the work. Track string `json:"track"` // number of this work in the set, can be in form current/total. VariantBitrate string `json:"variant_bitrate"` // the total bitrate of the bitrate variant that the current stream is part of }
from libavformat/avformat.h json tag is used for metadata key name also
type ProbeFormat ¶
type ProbeFormat struct { Filename string `json:"filename"` FormatName string `json:"format_name"` FormatLongName string `json:"format_long_name"` StartTime string `json:"start_time"` Duration string `json:"duration"` Size string `json:"size"` BitRate string `json:"bit_rate"` ProbeScore uint `json:"probe_score"` Tags Metadata `json:"tags"` }
type ProbeInfo ¶
type ProbeInfo struct { Format ProbeFormat `json:"format"` Streams []ProbeStream `json:"streams"` Raw map[string]interface{} `json:"-"` }
ProbeInfo ffprobe result
func Probe ¶
func Probe(ctx context.Context, i Input, debugLog Printer, stderr io.Writer) (pi ProbeInfo, err error)
Probe run ffprobe with context
func (ProbeInfo) FindStreamType ¶
func (pi ProbeInfo) FindStreamType(codecType string) (ProbeStream, bool)
func (ProbeInfo) SubtitleCodec ¶
SubtitleCodec probed audio codec
func (*ProbeInfo) UnmarshalJSON ¶
type ProbeStream ¶
type ProbeStream struct { Index uint `json:"index"` CodecName string `json:"codec_name"` CodecLongName string `json:"codec_long_name"` CodecType string `json:"codec_type"` CodecTimeBase string `json:"codec_time_base"` CodecTagString string `json:"codec_tag_string"` CodecTag string `json:"codec_tag"` SampleFmt string `json:"sample_fmt"` SampleRate string `json:"sample_rate"` Channels uint `json:"channels"` ChannelLayout string `json:"channel_layout"` BitsPerSample uint `json:"bits_per_sample"` RFrameRate string `json:"r_frame_rate"` AvgFrameRate string `json:"avg_frame_rate"` TimeBase string `json:"time_base"` StartPts int64 `json:"start_pts"` StartTime string `json:"start_time"` DurationTs uint64 `json:"duration_ts"` Duration string `json:"duration"` BitRate string `json:"bit_rate"` }
type SubtitleCodec ¶
type SubtitleCodec string
type VideoCodec ¶
type VideoCodec string
Click to show internal directories.
Click to hide internal directories.