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

How to dynamically add SEI extended data transmission in real time during RTSP/RTMP live streaming #1393

Open
sheng930920 opened this issue Feb 5, 2024 · 1 comment

Comments

@sheng930920
Copy link

Hello, after looking at the source code, it seems that I did not find the corresponding api to add SEI. How to dynamically add SEI extended data transmission in real time during the RTSP/RTMP live streaming process? Will you consider adding this function in the future?

@pedroSG94
Copy link
Owner

Hello,

As you said, I haven't a method to add SEI to video buffers. You can create a callback here to modify the video buffer as you need:
https://github.com/pedroSG94/RootEncoder/blob/master/library/src/main/java/com/pedro/library/rtmp/RtmpCamera2.java#L142

You can create a class like that and add a callback to get the video buffer, modify it to add SEI and return the result that should be send to rtmpClient. Remember modify MediaCodec.BufferInfo with the new size of the buffer.

I found a method to add SEI to h264 buffer that you can implement:
https://wangtaot.github.io/2020/06/03/Android%E6%8E%A8%E6%B5%81rtmp%E6%8F%92%E5%85%A5SEI/#%E6%96%B0%E5%A2%9E%E7%9A%84muxSEI%E6%96%B9%E6%B3%95

You can use this post as guide but SrsFlvMuxer is not a part of this library anymore so you will need add that method as I suggested you

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

No branches or pull requests

2 participants