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

add SetExtraData to CodecParameters to set extradata #56

Merged
merged 5 commits into from
Mar 29, 2024

Conversation

Cacsjep
Copy link
Contributor

@Cacsjep Cacsjep commented Mar 29, 2024

For publishing an rtmp stream extradata needs to be set (PPS, SPS h264).

Copy link
Owner

@asticode asticode left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

Out of curiosity, would you mind sharing the extradata you needed to publish your rtmp stream? 🤔

codec_parameters.go Outdated Show resolved Hide resolved
codec_parameters.go Outdated Show resolved Hide resolved
codec_parameters.go Show resolved Hide resolved
codec_parameters_test.go Outdated Show resolved Hide resolved
codec_parameters_test.go Outdated Show resolved Hide resolved
@Cacsjep
Copy link
Contributor Author

Cacsjep commented Mar 29, 2024

done =)

@Cacsjep
Copy link
Contributor Author

Cacsjep commented Mar 29, 2024

When pushing a h264 rtmp stream you need to set the H264 SPS/PPS as extra data, its like meta data, so that decoder knows how it can decode it correctly. =)

In my case a I got a h264 bytestream from a IP-Camera the first frame is an IDR Frame, this includes the SPS,PPS.

@asticode asticode merged commit f60ac38 into asticode:master Mar 29, 2024
3 checks passed
@asticode
Copy link
Owner

Thanks for the PR! ❤️

Let me know whether you need a tag 👍

@asticode
Copy link
Owner

When pushing a h264 rtmp stream you need to set the H264 SPS/PPS as extra data, its like meta data, so that decoder knows how it can decode it correctly. In my case a I got a h264 bytestream from a IP-Camera the first frame is an IDR Frame, this includes the SPS,PPS.

Ha you mean that you're using the Packet.FromData() method and therefore need to manually set the stream's codec parameters extradata whereas when using a FormatContext, it gets filled automatically?

@Cacsjep
Copy link
Contributor Author

Cacsjep commented Mar 29, 2024

Ha you mean that you're using the Packet.FromData() method and therefore need to manually set the stream's codec parameters extradata whereas when using a FormatContext, it gets filled automatically?

correct =)

@Cacsjep
Copy link
Contributor Author

Cacsjep commented Mar 29, 2024

Let me know whether you need a tag 👍

thanks no tag needed =)

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.

2 participants