-
Notifications
You must be signed in to change notification settings - Fork 212
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
fix: Do not scale width by sarRatio, we already generate a pasp box with sarRatio information. #393
Changes from all commits
e2113ca
4564ba8
92232eb
d05e056
5ac2046
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -150,6 +150,9 @@ PROFILES_WITH_OPTIONAL_SPS_DATA = { | |
86: true, | ||
118: true, | ||
128: true, | ||
|
||
// TODO: the three profiles below don't | ||
// appear to have sps data in the specificiation anymore? | ||
138: true, | ||
139: true, | ||
134: true | ||
|
@@ -210,10 +213,11 @@ H264Stream = function() { | |
trackId: trackId, | ||
pts: currentPts, | ||
dts: currentDts, | ||
data: data | ||
data: data, | ||
nalUnitTypeCode: data[0] & 0x1f | ||
}; | ||
|
||
switch (data[0] & 0x1f) { | ||
switch (event.nalUnitTypeCode) { | ||
case 0x05: | ||
event.nalUnitType = 'slice_layer_without_partitioning_rbsp_idr'; | ||
break; | ||
|
@@ -232,7 +236,6 @@ H264Stream = function() { | |
case 0x09: | ||
event.nalUnitType = 'access_unit_delimiter_rbsp'; | ||
break; | ||
|
||
default: | ||
break; | ||
} | ||
|
@@ -365,7 +368,7 @@ H264Stream = function() { | |
picHeightInMapUnitsMinus1, | ||
frameMbsOnlyFlag, | ||
scalingListCount, | ||
sarRatio, | ||
sarRatio = [1, 1], | ||
aspectRatioIdc, | ||
i; | ||
|
||
|
@@ -470,8 +473,9 @@ H264Stream = function() { | |
profileIdc: profileIdc, | ||
levelIdc: levelIdc, | ||
profileCompatibility: profileCompatibility, | ||
width: Math.ceil((((picWidthInMbsMinus1 + 1) * 16) - frameCropLeftOffset * 2 - frameCropRightOffset * 2) * sarScale), | ||
width: (((picWidthInMbsMinus1 + 1) * 16) - frameCropLeftOffset * 2 - frameCropRightOffset * 2), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We shouldn't need to Math.ceil if we are not scaling now. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the original reason that we did scaling is because we did not encode a |
||
height: ((2 - frameMbsOnlyFlag) * (picHeightInMapUnitsMinus1 + 1) * 16) - (frameCropTopOffset * 2) - (frameCropBottomOffset * 2), | ||
// sar is sample aspect ratio | ||
sarRatio: sarRatio | ||
}; | ||
}; | ||
|
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.
default to a 1 to 1 aspect ratio, ie width and height are exact values.