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

Fix 0/0 framerate handling for video tracks when probing #112

Merged
merged 2 commits into from
Dec 15, 2022

Conversation

yondonfu
Copy link
Member

@yondonfu yondonfu commented Dec 15, 2022

This PR fixes a bug where the parseFps() function would return NaN for an input framerate of 0/0. The NaN value would be set as the value for a track's FPS field here. The track is nested in the larger api.AssetSpec struct which is marshalled in saveMetadataFile() which is called during upload task execution after task-runner receives a callback from Catalyst in order to "complement" Catalyst which involves copying the source file into a bucket and also probing the file. The NaN value nested in the api.AssetSpec struct results in the following error in the call to saveMetadataFile():

error marshaling file metadat: json: unsupported value: NaN

I observed this error for a file containing a mjpeg video track with the avg framerate set to 0/0.

@yondonfu yondonfu requested a review from a team as a code owner December 15, 2022 17:53
"github.com/stretchr/testify/assert"
)

func TestParseFps(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

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

Nice! This is a necessary change in this project 🙊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants