| 1 | package ffprobescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/ |
| 2 | |
| 3 | import ( |
| 4 | "timescip-go gomod github.com/golang/go/src go1.13 time/" |
| 5 | ) |
| 6 | |
| 7 | // StreamType represents a media stream type like video, audio, subtitles, etc |
| 8 | type StreamTypescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/StreamType# string |
| 9 | |
| 10 | const ( |
| 11 | // StreamAny means any type of stream |
| 12 | StreamAnyscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/StreamAny. StreamTypescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/StreamType# = "" |
| 13 | // StreamVideo is a video stream |
| 14 | StreamVideoscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/StreamVideo. StreamTypescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/StreamType# = "video" |
| 15 | // StreamAudio is an audio stream |
| 16 | StreamAudioscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/StreamAudio. StreamTypescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/StreamType# = "audio" |
| 17 | // StreamSubtitle is a subtitle stream |
| 18 | StreamSubtitlescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/StreamSubtitle. StreamTypescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/StreamType# = "subtitle" |
| 19 | // StreamData is a data stream |
| 20 | StreamDatascip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/StreamData. StreamTypescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/StreamType# = "data" |
| 21 | // StreamAttachment is an attachment stream |
| 22 | StreamAttachmentscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/StreamAttachment. StreamTypescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/StreamType# = "attachment" |
| 23 | ) |
| 24 | |
| 25 | // ProbeData is the root json data structure returned by an ffprobe. |
| 26 | type ProbeDatascip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/ProbeData# struct { |
| 27 | Streamsscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/ProbeData#Streams. []*Streamscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Stream# `json:"streams"` |
| 28 | Formatscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/ProbeData#Format. *Formatscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Format# `json:"format"` |
| 29 | Chaptersscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/ProbeData#Chapters. []*Chapterscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Chapter# `json:"chapters"` |
| 30 | } |
| 31 | |
| 32 | // Format is a json data structure to represent formats |
| 33 | type Formatscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Format# struct { |
| 34 | Filenamescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Format#Filename. string `json:"filename"` |
| 35 | NBStreamsscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Format#NBStreams. int `json:"nb_streams"` |
| 36 | NBProgramsscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Format#NBPrograms. int `json:"nb_programs"` |
| 37 | FormatNamescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Format#FormatName. string `json:"format_name"` |
| 38 | FormatLongNamescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Format#FormatLongName. string `json:"format_long_name"` |
| 39 | StartTimeSecondsscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Format#StartTimeSeconds. float64 `json:"start_time,string"` |
| 40 | DurationSecondsscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Format#DurationSeconds. float64 `json:"duration,string"` |
| 41 | Sizescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Format#Size. string `json:"size"` |
| 42 | BitRatescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Format#BitRate. string `json:"bit_rate"` |
| 43 | ProbeScorescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Format#ProbeScore. int `json:"probe_score"` |
| 44 | TagListscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Format#TagList. Tagsscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Tags# `json:"tags"` |
| 45 | Tagsscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Format#Tags. *FormatTagsscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/FormatTags# `json:"-"` // Deprecated: Use TagList instead |
| 46 | } |
| 47 | |
| 48 | // Stream is a json data structure to represent streams. |
| 49 | // A stream can be a video, audio, subtitle, etc type of stream. |
| 50 | type Streamscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Stream# struct { |
| 51 | Indexscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Stream#Index. int `json:"index"` |
| 52 | IDscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Stream#ID. string `json:"id"` |
| 53 | CodecNamescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Stream#CodecName. string `json:"codec_name"` |
| 54 | CodecLongNamescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Stream#CodecLongName. string `json:"codec_long_name"` |
| 55 | CodecTypescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Stream#CodecType. string `json:"codec_type"` |
| 56 | CodecTimeBasescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Stream#CodecTimeBase. string `json:"codec_time_base"` |
| 57 | CodecTagStringscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Stream#CodecTagString. string `json:"codec_tag_string"` |
| 58 | CodecTagscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Stream#CodecTag. string `json:"codec_tag"` |
| 59 | RFrameRatescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Stream#RFrameRate. string `json:"r_frame_rate"` |
| 60 | AvgFrameRatescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Stream#AvgFrameRate. string `json:"avg_frame_rate"` |
| 61 | TimeBasescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Stream#TimeBase. string `json:"time_base"` |
| 62 | StartPtsscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Stream#StartPts. int `json:"start_pts"` |
| 63 | StartTimescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Stream#StartTime. string `json:"start_time"` |
| 64 | DurationTsscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Stream#DurationTs. uint64 `json:"duration_ts"` |
| 65 | Durationscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Stream#Duration. string `json:"duration"` |
| 66 | BitRatescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Stream#BitRate. string `json:"bit_rate"` |
| 67 | BitsPerRawSamplescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Stream#BitsPerRawSample. string `json:"bits_per_raw_sample"` |
| 68 | NbFramesscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Stream#NbFrames. string `json:"nb_frames"` |
| 69 | Dispositionscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Stream#Disposition. StreamDispositionscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/StreamDisposition# `json:"disposition,omitempty"` |
| 70 | TagListscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Stream#TagList. Tagsscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Tags# `json:"tags"` |
| 71 | Tagsscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Stream#Tags. StreamTagsscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/StreamTags# `json:"-"` // Deprecated: Use TagList instead |
| 72 | FieldOrderscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Stream#FieldOrder. string `json:"field_order,omitempty"` |
| 73 | Profilescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Stream#Profile. string `json:"profile,omitempty"` |
| 74 | Widthscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Stream#Width. int `json:"width"` |
| 75 | Heightscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Stream#Height. int `json:"height"` |
| 76 | HasBFramesscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Stream#HasBFrames. int `json:"has_b_frames,omitempty"` |
| 77 | SampleAspectRatioscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Stream#SampleAspectRatio. string `json:"sample_aspect_ratio,omitempty"` |
| 78 | DisplayAspectRatioscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Stream#DisplayAspectRatio. string `json:"display_aspect_ratio,omitempty"` |
| 79 | PixFmtscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Stream#PixFmt. string `json:"pix_fmt,omitempty"` |
| 80 | Levelscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Stream#Level. int `json:"level,omitempty"` |
| 81 | ColorRangescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Stream#ColorRange. string `json:"color_range,omitempty"` |
| 82 | ColorSpacescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Stream#ColorSpace. string `json:"color_space,omitempty"` |
| 83 | ColorTransferscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Stream#ColorTransfer. string `json:"color_transfer,omitempty"` |
| 84 | ColorPrimariesscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Stream#ColorPrimaries. string `json:"color_primaries,omitempty"` |
| 85 | SampleFmtscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Stream#SampleFmt. string `json:"sample_fmt,omitempty"` |
| 86 | SampleRatescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Stream#SampleRate. string `json:"sample_rate,omitempty"` |
| 87 | Channelsscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Stream#Channels. int `json:"channels,omitempty"` |
| 88 | ChannelLayoutscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Stream#ChannelLayout. string `json:"channel_layout,omitempty"` |
| 89 | BitsPerSamplescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Stream#BitsPerSample. int `json:"bits_per_sample,omitempty"` |
| 90 | SideDataListscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Stream#SideDataList. SideDataListscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataList# `json:"side_data_list,omitempty"` |
| 91 | } |
| 92 | |
| 93 | // StreamDisposition is a json data structure to represent stream dispositions |
| 94 | type StreamDispositionscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/StreamDisposition# struct { |
| 95 | Defaultscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/StreamDisposition#Default. int `json:"default"` |
| 96 | Dubscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/StreamDisposition#Dub. int `json:"dub"` |
| 97 | Originalscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/StreamDisposition#Original. int `json:"original"` |
| 98 | Commentscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/StreamDisposition#Comment. int `json:"comment"` |
| 99 | Lyricsscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/StreamDisposition#Lyrics. int `json:"lyrics"` |
| 100 | Karaokescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/StreamDisposition#Karaoke. int `json:"karaoke"` |
| 101 | Forcedscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/StreamDisposition#Forced. int `json:"forced"` |
| 102 | HearingImpairedscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/StreamDisposition#HearingImpaired. int `json:"hearing_impaired"` |
| 103 | VisualImpairedscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/StreamDisposition#VisualImpaired. int `json:"visual_impaired"` |
| 104 | CleanEffectsscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/StreamDisposition#CleanEffects. int `json:"clean_effects"` |
| 105 | AttachedPicscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/StreamDisposition#AttachedPic. int `json:"attached_pic"` |
| 106 | } |
| 107 | |
| 108 | // Chapters is a json data structure to represent chapters. |
| 109 | type Chapterscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Chapter# struct { |
| 110 | IDscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Chapter#ID. int `json:"id"` |
| 111 | TimeBasescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Chapter#TimeBase. string `json:"time_base"` |
| 112 | StartTimeSecondsscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Chapter#StartTimeSeconds. float64 `json:"start_time,string"` |
| 113 | EndTimeSecondsscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Chapter#EndTimeSeconds. float64 `json:"end_time,string"` |
| 114 | TagListscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Chapter#TagList. Tagsscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Tags# `json:"tags"` |
| 115 | } |
| 116 | |
| 117 | // StartTime returns the start time of the chapter as a time.Duration |
| 118 | func (c *Chapterscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Chapter#) StartTimescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Chapter#StartTime().() timescip-go gomod github.com/golang/go/src go1.13 time/.Durationscip-go gomod github.com/golang/go/src go1.13 time/Duration# { |
| 119 | return timescip-go gomod github.com/golang/go/src go1.13 time/.Durationscip-go gomod github.com/golang/go/src go1.13 time/Duration#(c.StartTimeSecondsscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Chapter#StartTimeSeconds. * float64(timescip-go gomod github.com/golang/go/src go1.13 time/.Secondscip-go gomod github.com/golang/go/src go1.13 time/Second.)) |
| 120 | } |
| 121 | |
| 122 | // EndTime returns the end timestamp of the chapter as a time.Duration |
| 123 | func (c *Chapterscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Chapter#) EndTimescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Chapter#EndTime().() timescip-go gomod github.com/golang/go/src go1.13 time/.Durationscip-go gomod github.com/golang/go/src go1.13 time/Duration# { |
| 124 | return timescip-go gomod github.com/golang/go/src go1.13 time/.Durationscip-go gomod github.com/golang/go/src go1.13 time/Duration#(c.EndTimeSecondsscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Chapter#EndTimeSeconds. * float64(timescip-go gomod github.com/golang/go/src go1.13 time/.Secondscip-go gomod github.com/golang/go/src go1.13 time/Second.)) |
| 125 | } |
| 126 | |
| 127 | // Title returns the value of the "title" tag of the chapter |
| 128 | func (c *Chapterscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Chapter#) Titlescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Chapter#Title().() string { |
| 129 | title, _ := c.TagListscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Chapter#TagList..GetStringscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Tags#GetString().("title") |
| 130 | return title |
| 131 | } |
| 132 | |
| 133 | // StartTime returns the start time of the media file as a time.Duration |
| 134 | func (f *Formatscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Format#) StartTimescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Format#StartTime().() (duration timescip-go gomod github.com/golang/go/src go1.13 time/.Durationscip-go gomod github.com/golang/go/src go1.13 time/Duration#) { |
| 135 | return timescip-go gomod github.com/golang/go/src go1.13 time/.Durationscip-go gomod github.com/golang/go/src go1.13 time/Duration#(f.StartTimeSecondsscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Format#StartTimeSeconds. * float64(timescip-go gomod github.com/golang/go/src go1.13 time/.Secondscip-go gomod github.com/golang/go/src go1.13 time/Second.)) |
| 136 | } |
| 137 | |
| 138 | // Duration returns the duration of the media file as a time.Duration |
| 139 | func (f *Formatscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Format#) Durationscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Format#Duration().() (duration timescip-go gomod github.com/golang/go/src go1.13 time/.Durationscip-go gomod github.com/golang/go/src go1.13 time/Duration#) { |
| 140 | return timescip-go gomod github.com/golang/go/src go1.13 time/.Durationscip-go gomod github.com/golang/go/src go1.13 time/Duration#(f.DurationSecondsscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Format#DurationSeconds. * float64(timescip-go gomod github.com/golang/go/src go1.13 time/.Secondscip-go gomod github.com/golang/go/src go1.13 time/Second.)) |
| 141 | } |
| 142 | |
| 143 | // StreamType returns all streams which are of the given type |
| 144 | func (p *ProbeDatascip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/ProbeData#) StreamTypescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/ProbeData#StreamType().(streamType StreamTypescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/StreamType#) (streams []Streamscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Stream#) { |
| 145 | for _, s := range p.Streamsscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/ProbeData#Streams. { |
| 146 | if s == nil { |
| 147 | continue |
| 148 | } |
| 149 | switch streamType { |
| 150 | case StreamAnyscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/StreamAny.: |
| 151 | streams = append(streams, *s) |
| 152 | default: |
| 153 | if s.CodecTypescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Stream#CodecType. == string(streamType) { |
| 154 | streams = append(streams, *s) |
| 155 | } |
| 156 | } |
| 157 | } |
| 158 | return streams |
| 159 | } |
| 160 | |
| 161 | // FirstVideoStream returns the first video stream found |
| 162 | func (p *ProbeDatascip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/ProbeData#) FirstVideoStreamscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/ProbeData#FirstVideoStream().() *Streamscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Stream# { |
| 163 | return p.firstStreamscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/ProbeData#firstStream().(StreamVideoscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/StreamVideo.) |
| 164 | } |
| 165 | |
| 166 | // FirstAudioStream returns the first audio stream found |
| 167 | func (p *ProbeDatascip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/ProbeData#) FirstAudioStreamscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/ProbeData#FirstAudioStream().() *Streamscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Stream# { |
| 168 | return p.firstStreamscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/ProbeData#firstStream().(StreamAudioscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/StreamAudio.) |
| 169 | } |
| 170 | |
| 171 | // FirstSubtitleStream returns the first subtitle stream found |
| 172 | func (p *ProbeDatascip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/ProbeData#) FirstSubtitleStreamscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/ProbeData#FirstSubtitleStream().() *Streamscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Stream# { |
| 173 | return p.firstStreamscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/ProbeData#firstStream().(StreamSubtitlescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/StreamSubtitle.) |
| 174 | } |
| 175 | |
| 176 | // FirstDataStream returns the first data stream found |
| 177 | func (p *ProbeDatascip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/ProbeData#) FirstDataStreamscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/ProbeData#FirstDataStream().() *Streamscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Stream# { |
| 178 | return p.firstStreamscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/ProbeData#firstStream().(StreamDatascip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/StreamData.) |
| 179 | } |
| 180 | |
| 181 | // FirstAttachmentStream returns the first attachment stream found |
| 182 | func (p *ProbeDatascip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/ProbeData#) FirstAttachmentStreamscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/ProbeData#FirstAttachmentStream().() *Streamscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Stream# { |
| 183 | return p.firstStreamscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/ProbeData#firstStream().(StreamAttachmentscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/StreamAttachment.) |
| 184 | } |
| 185 | |
| 186 | func (p *ProbeDatascip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/ProbeData#) firstStreamscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/ProbeData#firstStream().(streamType StreamTypescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/StreamType#) *Streamscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Stream# { |
| 187 | for _, s := range p.Streamsscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/ProbeData#Streams. { |
| 188 | if s == nil { |
| 189 | continue |
| 190 | } |
| 191 | if s.CodecTypescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Stream#CodecType. == string(streamType) { |
| 192 | return s |
| 193 | } |
| 194 | } |
| 195 | return nil |
| 196 | } |