-
Notifications
You must be signed in to change notification settings - Fork 31
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
Support Sidx and Styp #18
Conversation
ReferenceID uint32 `mp4:"size=32"` | ||
TimeScale uint32 `mp4:"size=32"` | ||
EarliestPresentationTime uint32 `mp4:"size=32"` | ||
FirstOffset uint32 `mp4:"size=32"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If Sidx.Version
don't equal to 0, Sidx.EarliestPresentationTime
and Sidx.FirstOffset
have 64 bits.
So could you use ver
option as follows?
EarliestPresentationTimeV0 uint32 `mp4:"size=32,ver=0"`
FirstOffsetV0 uint32 `mp4:"size=32,ver=0"`
EarliestPresentationTimeV1 uint64 `mp4:"size=64,nver=0"`
FirstOffsetV1 uint64 `mp4:"size=64,nver=0"`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I was mistaken.
This PR accept only version 0 at line 8 (https://github.com/abema/go-mp4/pull/18/files#diff-6322880a133c5e374279625376187a10R8) , and is correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, If supporting both of version 0 and version 1, you can write as follows:
func init() {
AddBoxDef(&Sidx{}, 0, 1)
}
:
:
EarliestPresentationTimeV0 uint32 `mp4:"size=32,ver=0"`
FirstOffsetV0 uint32 `mp4:"size=32,ver=0"`
EarliestPresentationTimeV1 uint64 `mp4:"size=64,nver=0"`
FirstOffsetV1 uint64 `mp4:"size=64,nver=0"`
References []struct { | ||
TypeSize uint32 `mp4:"size=32"` | ||
SubSegmentDuration uint32 `mp4:"size=32"` | ||
SapStartsTypeDeltaTime uint32 `mp4:"size=32"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reference
entity has defined in spec as follows:
bit (1) reference_type;
unsigned int(31) referenced_size;
unsigned int(32) subsegment_duration;
bit(1) starts_with_SAP;
unsigned int(3) SAP_type;
unsigned int(28) SAP_delta_time;
So, I think that this struct may be written like following code.
ReferencedType bool `mp4:"size=1"`
ReferencedSize uint32 `mp4:"size=31"`
SubsegmentDuration uint32 `mp4:"size=32"`
StartsWithSAP bool `mp4:"size=1"`
SAPType uint8 `mp4:"size=3"`
SapStartsTypeDeltaTime uint32 `mp4:"size=28"`
Do you refer to older spec?
This PR is related to #13 |
I will take on this task in #35. |
@sunfish-shogi
Support box types styp and sidx used in MPEG-DASH