Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Multi periods #33

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

Merged
soldiermoth merged 8 commits into zencoder:master from martinlindhe:multi-periods
Aug 11, 2017
Merged

Multi periods #33

soldiermoth merged 8 commits into zencoder:master from martinlindhe:multi-periods
Aug 11, 2017

Conversation

@martinlindhe
Copy link
Contributor

@martinlindhe martinlindhe commented Jun 21, 2017
edited
Loading

Hello and thanks for a cool project!

This PR adds support for multiple periods.
It extends upon the existing API, so it should not require any changes to existing client code.

Also included:

  • xml marshaller for the xml duration type "PT6M" = 6 minutes
  • an ExampleAddNewPeriod to show usage
  • removed internal pointers to *MPD, simplified some.
  • moved "invalid state" checks to separate func (m *MPD) Validate()
  • minor cleanup

example usage for multiple periods

	// a new MPD is created with a single Period
	m := NewMPD(DASH_PROFILE_LIVE, VALID_MEDIA_PRESENTATION_DURATION, VALID_MIN_BUFFER_TIME)
	as, _ := m.AddNewAdaptationSetVideo(DASH_MIME_TYPE_VIDEO_MP4, VALID_SCAN_TYPE, VALID_SEGMENT_ALIGNMENT, VALID_START_WITH_SAP)
	as.SetNewSegmentTemplate(1968, "$RepresentationID$/video-1.mp4", "$RepresentationID$/video-1/seg-$Number$.m4f", 0, 1000)
	as, _ = m.AddNewAdaptationSetAudio(DASH_MIME_TYPE_AUDIO_MP4, VALID_SEGMENT_ALIGNMENT, VALID_START_WITH_SAP, VALID_LANG)
	as.SetNewSegmentTemplate(1968, "$RepresentationID$/audio-1.mp4", "$RepresentationID$/audio-1/seg-$Number$.m4f", 0, 1000)
	// add a second period
	p := m.AddNewPeriod()
	p.SetDuration(3 * time.Minute)
	// you can add content to the Period
	as, _ = p.AddNewAdaptationSetVideo(DASH_MIME_TYPE_VIDEO_MP4, VALID_SCAN_TYPE, VALID_SEGMENT_ALIGNMENT, VALID_START_WITH_SAP)
	as.SetNewSegmentTemplate(1968, "$RepresentationID$/video-2.mp4", "$RepresentationID$/video-2/seg-$Number$.m4f", 0, 1000)
	// or directly to the MPD, which will use the current Period.
	as, _ = m.AddNewAdaptationSetAudio(DASH_MIME_TYPE_AUDIO_MP4, VALID_SEGMENT_ALIGNMENT, VALID_START_WITH_SAP, VALID_LANG)
	as.SetNewSegmentTemplate(1968, "$RepresentationID$/audio-2.mp4", "$RepresentationID$/audio-2/seg-$Number$.m4f", 0, 1000)

Copy link
Contributor

Thanks @martinlindhe! We're going to try and review this soon

martinlindhe reacted with thumbs up emoji

@soldiermoth soldiermoth merged commit 7f473e0 into zencoder:master Aug 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /