Skip to content

3052/dash

Repository files navigation

DASH

Some things are hidden for a reason, and if you see them, you'll be changed forever, but I wanted to be changed forever.

Miranda July

Go language, I need a package for DASH (MPD) files

  1. standard library only
  2. use a separate file for each type
  3. only send new or updated files
  4. package is named "dash"
  5. package will include a parse method, byte slice input
  6. BaseURL is a single element not a slice
  7. support these elements and attributes
    • MPD
      • @mediaPresentationDuration
      • BaseURL
      • Period
        • @duration
        • @id
        • BaseURL
        • AdaptationSet
          • @codecs
          • @height
          • @lang
          • @mimeType
          • @width
          • ContentProtection
            • @schemeIdUri
            • cenc:pssh
          • Role
            • @value
          • SegmentTemplate
            • @duration
            • @endNumber
            • @initialization
            • @media
            • @presentationTimeOffset
            • @startNumber
            • @timescale
            • SegmentTimeline
              • S
                • @d
                • @r
          • Representation
            • @bandwidth
            • @codecs
            • @height
            • @id
            • @mimeType
            • @width
            • BaseURL
            • SegmentTemplate
            • ContentProtection
            • SegmentBase
              • @indexRange
              • Initialization
                • @range
            • SegmentList
              • Initialization
                • @sourceURL
              • SegmentURL
                • @media
  8. add navigation
    1. from AdaptationSet to Period
    2. from Initialization to SegmentList
    3. from Period to MPD
    4. from Representation to AdaptationSet
    5. from SegmentList to Representation
    6. from SegmentTemplate to AdaptationSet
    7. from SegmentTemplate to Representation
    8. from SegmentURL to SegmentList
  9. resolve BaseURL using
    1. MPD URL
    2. all parent BaseURL
  10. resolve Initialization@sourceURL using
  11. MPD URL
  12. all parent BaseURL
  13. resolve SegmentTemplate@initialization using
  14. MPD URL
  15. all parent BaseURL
  16. resolve SegmentTemplate@media using
  17. MPD URL
  18. all parent BaseURL
  19. resolve SegmentURL@media using
  20. MPD URL
  21. all parent BaseURL
  22. resolve function should return *url.URL
  23. add method to get all Representation, group by id
  24. add method to get codecs
  25. add method to get height
  26. add method to get width
  27. add method to get mimeType
  28. AdaptationSet.Role is single element not slice
  29. add method to get SegmentTemplate
  30. add method to replace SegmentTemplate@initialization
  • $RepresentationID$
  1. add method to replace SegmentTemplate@media
  • $Number$
  • $Number%02d$
  • $Number%03d$
  • $Number%04d$
  • $Number%05d$
  • $Number%06d$
  • $Number%07d$
  • $Number%08d$
  • $Number%09d$
  • $RepresentationID$
  1. add method to replace SegmentTemplate@media
  • $RepresentationID$
  • $Time$
  1. SegmentTemplate@startNumber is 1 if missing
  2. SegmentTemplate@timescale is 1 if missing
  3. Period@duration is MPD@mediaPresentationDuration if missing
  4. add method to get Time values from SegmentTimeline
  5. add method to get Number values from SegmentTimeline
  6. add method to get Number values from SegmentTemplate@startNumber to SegmentTemplate@endNumber
  7. add method to get Number values from Ceil( AsSeconds(Period@duration) / (SegmentTemplate@duration / SegmentTemplate@timescale) )
  8. add a method that returns the SegmentTemplate URLs
  9. use SegmentTemplate@presentationTimeOffset as initial $Time$
  10. add method to get time.Duration
    time.ParseDuration(strings.ToLower(
       strings.TrimPrefix(Period@duration, "PT"),
    ))
    
  11. add method to get unique ContentProtection from
  • AdaptationSet
  • Representation
  1. include test file in same package
  • test will read all ".mpd" files in the "testdata" folder
  • user will provide test files
  • for each file, get the slice of replaced SegmentTemplate@media URLs
  • only get one slice of URLs per mimeType
  • print slice length, and first and last URLs
  1. add Representation.String method. each value on its own line
  2. Representation@bandwidth
  3. Representation.GetWidth
  4. Representation.GetHeight
  5. Representation.GetCodecs
  6. Representation.GetMimeType
  7. AdaptationSet@lang
  8. Role@value
  9. Period@id
  10. Representation@id

contact

email
[email protected]
Discord username
10308

About

MPD

Resources

License

Stars

Watchers

Forks

Languages