Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Chapters to ProbeData struct #45

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions probedata.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,20 @@ const (

// ProbeData is the root json data structure returned by an ffprobe.
type ProbeData struct {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably nice to add a couple of util methods to the struct for accessing chapters

Streams []*Stream `json:"streams"`
Format *Format `json:"format"`
Streams []*Stream `json:"streams"`
Format *Format `json:"format"`
Chapters []*Chapters `json:"chapters"`
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would need the -show_chapters flag to be present in the ffprobe command, correct? If so, please add it.

}

// Chapters is a json data structure to represent chapters.
type Chapters struct {
ID int `json:"id"`
TimeBase string `json:"time_base"`
Start uint64 `json:"start"`
StartTime string `json:"start_time"`
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A util function for returning a time.Duration for this is probably a good idea. (see the one on Format)

End uint64 `json:"end"`
EndTime string `json:"end_time"`
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

TagList Tags `json:"tags"`
}

// Format is a json data structure to represent formats
Expand Down