Documentation ¶
Index ¶
- Variables
- func BuildContentFeatures(mediaType string, seek string, transcode bool) (string, error)
- func CheckFFmpeg(ffmpeg string) error
- func ClockTimeToSeconds(strtime string) (int, error)
- func ConvertFilename(s string) string
- func DurationForMedia(ffmpeg string, f string) (string, error)
- func ExtractSub(ffmpeg string, n int, f string) (string, error)
- func FormatClockTime(strtime string) (string, error)
- func GetMimeDetailsFromFile(f io.ReadCloser) (string, error)
- func GetMimeDetailsFromStream(s io.ReadCloser) (string, error)
- func GetSubs(ffmpeg string, f string) ([]string, error)
- func HostPortIsAlive(h string) bool
- func RandomString() (string, error)
- func SecondsToClockTime(secs int) (string, error)
- func ServeTranscodedStream(w io.Writer, input interface{}, ff *exec.Cmd, ffmpegPath, subs string, ...) error
- func StreamURL(ctx context.Context, s string) (io.ReadCloser, error)
- func URLtoListenIPandPort(u string) (string, error)
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidSeekFlag = errors.New("invalid seek flag") ErrInvalidClockFormat = errors.New("invalid clock format") )
var (
ErrBadStatus = errors.New("streamURL bad status code")
)
var (
ErrInvalidInput = errors.New("invalid ffmpeg input")
)
var ErrNoSubs = errors.New("no subs")
ErrNoSubs - No subs detected
Functions ¶
func BuildContentFeatures ¶
BuildContentFeatures builds the content features string for the "contentFeatures.dlna.org" header.
func CheckFFmpeg ¶ added in v1.17.0
func ClockTimeToSeconds ¶
ClockTimeToSeconds converts relative time to seconds.
func ConvertFilename ¶
ConvertFilename is a helper function that percent-encodes a string.
func ExtractSub ¶ added in v1.17.0
ExtractSub - Save the extracted sub into a temp file. Return the path of that file.
func FormatClockTime ¶
FormatClockTime converts clock time to a more expected format of clock time.
func GetMimeDetailsFromFile ¶
func GetMimeDetailsFromFile(f io.ReadCloser) (string, error)
GetMimeDetailsFromFile returns the media file mime details.
func GetMimeDetailsFromStream ¶
func GetMimeDetailsFromStream(s io.ReadCloser) (string, error)
GetMimeDetailsFromStream returns the media URL mime details.
func HostPortIsAlive ¶
HostPortIsAlive - We use this function to periodically health check the selected device and decide if we want to keep the entry in the list or to remove it.
func RandomString ¶
RandomString generates a random string which we then use as callback path in our webserver.
func SecondsToClockTime ¶
SecondsToClockTime converts seconds to seconds relative time.
func ServeTranscodedStream ¶
func ServeTranscodedStream(w io.Writer, input interface{}, ff *exec.Cmd, ffmpegPath, subs string, seekSeconds int) error
ServeTranscodedStream passes an input file or io.Reader to ffmpeg and writes the output directly to our io.Writer.
func URLtoListenIPandPort ¶
URLtoListenIPandPort for a given internal URL, find the correct IP/Interface to listen to.
Types ¶
This section is empty.