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

[RSDK-9843] Support mpeg4 to address codecInfo error on some RTSP streams #75

Merged
merged 8 commits into from
Jan 28, 2025

Conversation

hexbabe
Copy link
Collaborator

@hexbabe hexbabe commented Jan 27, 2025

RSDK-9843

Adds new model viam:viamrtsp:rtsp-mpeg4. Adds support for mpeg4 including codec detection with agnostic model. Adds integration test.

Manual Testing

  • h264 camera (10.1.12.67) with and without passthrough
  • h265 camera (10.1.12.67)
  • resize stream resolution

@hexbabe hexbabe marked this pull request as ready for review January 27, 2025 18:06
@hexbabe hexbabe requested review from randhid and seanavery January 27, 2025 18:21
Copy link
Collaborator

@seanavery seanavery left a comment

Choose a reason for hiding this comment

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

Looking good to me!

Wondering if we have any physical MPEG4 cams in the office to test out on..

rtsp.go Outdated

// Initialize the rawDecoder with MPEG4 config data
if f.Config != nil {
// Prepend MPEG4 Visual Object Sequence (VOS) and Video Object (VO) start codes if not present
Copy link
Collaborator

Choose a reason for hiding this comment

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

What do we mean by "if not present" here?

Copy link
Collaborator Author

@hexbabe hexbabe Jan 27, 2025

Choose a reason for hiding this comment

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

lol there's no conditional in the code to justify using "if" here (anymore). I'll delete that

C.avcodec_close(codecCtx)
return nil, errors.New("av_malloc() failed for extradata")
}
C.memcpy(unsafe.Pointer(codecCtx.extradata), unsafe.Pointer(&extraData[0]), C.size_t(codecCtx.extradata_size))
Copy link
Collaborator

@seanavery seanavery Jan 27, 2025

Choose a reason for hiding this comment

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

Nicely done -- did not realize this how you set the global headers for MPEG4 decoder.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I didn't either! I tried to make h264/5 also use this global headers flow, but I think NAL units work differently i.e. every frame

@hexbabe
Copy link
Collaborator Author

hexbabe commented Jan 27, 2025

Looking good to me!

Wondering if we have any physical MPEG4 cams in the office to test out on..

We do not :,)

Waiting on some people to tell us what camera we should buy if that's an option for actually testing this feature

@hexbabe hexbabe changed the title [RSDK-9675] Support mpeg4 to address codecInfo error on some RTSP streams [RSDK-9843] Support mpeg4 to address codecInfo error on some RTSP streams Jan 28, 2025
@hexbabe hexbabe merged commit 515d0d1 into viam-modules:main Jan 28, 2025
10 checks passed
@hexbabe hexbabe deleted the RSDK-9675 branch January 28, 2025 19:09
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.

3 participants