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

Stream video through rtmpClient not showing video #1753

Open
KingArmstring opened this issue Mar 16, 2025 · 3 comments
Open

Stream video through rtmpClient not showing video #1753

KingArmstring opened this issue Mar 16, 2025 · 3 comments

Comments

@KingArmstring
Copy link

This is 100% my fault but I really can't figure it out. I am sorry for bothering.
I have textureView with opengl, I am drawing frames on surfaces, and made my own encoder, got frames h246 out of it and tried sendVideo, make sure to send the sps and pps first, did not work. I did not send audio, so not sure if that is the reason but I set onlyVideo to true.

I tried the built in VideoEncoder, got frames out of it, use sendVideo and send it, it logs: wrote Video packet, size 11424 but I still can't see anything on either youtuber or fb. I can use your app to see video on them as long as video. I can't use the example provided because I want to be able to handle the shaders.

I am extremely sorry to ask that question as it is my fault but I can't really figure it out.

I tried to find like a steps to follow in the open issues but I couldn't. Please feel free to ignore my question if you are busy. Thanks in advance.

@pedroSG94
Copy link
Owner

Hello,

First of all, YouTube and Facebook need audio to work. If you only send video you will need send audio too.
No matter if the audio is a buffer of all 0 (silence) but the audio track is necessary.

About handle shaders, I'm not sure about your requirements but you can create a custom filter that allow you control the shader as you want

@KingArmstring
Copy link
Author

Many thanks for replying!

I realised that audio is necessary when I got your example running, everytime I remove sendAudio, I get no video. I tried sending 0 buffer(ByteBuffer.wrap(0)), it did not work, not even crashing or showing any errors like in video when I missed setting the sps and pps, I got some errors logged when enabling logging in rtmpClient, I did not know how to use the encoder you provided so I wrote mine and it is getting audio frames(or sizes around 300bytes per frame) but can't even see any error in logs, so I know why streaming is not working now, it is because I can't send audio. I made sure to rtmpClient.setAudioInfo(44100, true) once before sending anything.

To recape, rtmpClient.sendAudio(buf, bufInfo) is not showing neither error nor success, I get conection message "connected" tho burt surely no audio is being sent.

@KingArmstring
Copy link
Author

KingArmstring commented Mar 17, 2025

Wait, I got something, now I am seeing logs saying wrote audio and video, youtube senses my presenes but it shows a black screen. Should be easy to fix(hopefully :D)
I mean don't reply to me for the moment, don't want to waste ur time. Again can't find words to thank you for both your effort in the lib and your lovely support.

Btw, the issue was so funny, I left setOnlyVideo enabled :V

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