-
-
Notifications
You must be signed in to change notification settings - Fork 785
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
insert black screen for streaming as video #1305
Comments
Maybe we can try with this: Other way could be remove set force render to false to avoid render screen if it is not updated (keep in mind that few servers need receive video and audio so this way maybe produce disconnection if the screen is not updated) Also, if you have the device connected to the logcat or just connected charging. Disconnect it because this produce heat |
Thanks so much, but this is not suitable for me. I can now insert the black screen by streaming a prepared black screen mp4. However, is it possible to loop the mp4 when the mp4 is finished? I am now using RtspFromFile and FromFileBase to do the streaming. Thanks in advance |
Yes, you can use this method to loop: |
hi pedro, I have tried the setloopmode but the video seems did not loop. I called rtspfromfile.prepareVideo and then call rtspfromfile.setLoopMode and then call rtspfromfile.startStream. May I know if I have done anything wrong? Thanks so much. |
Hello, This should be solved now. Try with app sample adding loop mode and let me know if it is working |
Hi pedro, Thank you so much. I have tried setting loop mode. I found that the seekbar was able to loop if i preparevideo and prepareaudio, but only the audio loop but not the video. But if I preparevideo only (as my file only contain video), both the seekbar and the video did not loop. May I know what can I do so work with only video file for looping? Thanks |
Hello, Do you have a file to test your cases? |
Dear Pedro, I am using this black.mp4. I got the problem. Thanks black.mp4 |
Hello, Fixed here: I tested with your video using rtmpfromfile example after add this fix and it is working fine. Remember add loop mode and setOnlyVideo: rtmpFromFile.setLoopMode(true);
rtmpFromFile.getStreamClient().setOnlyVideo(true); Also, I did a full black video but of 20s to test loop: blackshort.mp4And other video of 20s with a count that help you to know if loop work fine output.mp4 |
Hi pedro, I found it works. thanks so much. Now i put the code this way if (prepare()) { just wanna confirm the setLoopMode and setOnlyVideo should be put before or after prepare()? But I want to ask is that a must to have prepareaudio even if the mp4 has no sound? coz if I preparevideo only the loop does not work. Thanks |
This should works in both cases. You can call it anytime before startStream/startRecord
This shouldn't be necessary so I will check it |
I was testing this with your video and my videos and it is working fine. Do you have this error always? Can you reproduce the problem using my videos? I only removed this line: And added this to the class:
|
i can work with my video and your video now. Thank you very much. |
hi pedro,
I am using display service and displayBase to capture the screen and send it out to rtsp server. However, I found that the phone get very hot. So i would like to replace with black screen whenever necessary to save battery and lower the temperature.
I learnt that there is a function muteVideo, but it use the same amount of battery and increase temperature.
May I know is there a way to insert black screen without using too much battery and generating too much heat?
Thanks in advance.
The text was updated successfully, but these errors were encountered: