Comments (5)
Hello,
Both cases are currently possible.
1 - You have a callback to detect connection fail. You can use that callback to start recording.
2 - Using StreamBase (RtmpStream, RtspStream, SrtStream, UdpStream or GenericStream class). You can change the audio and video source on fly.
You have an example changing video source on fly here:
https://github.com/pedroSG94/RootEncoder/blob/master/app/src/main/java/com/pedro/streamer/rotation/RotationActivity.kt#L70
https://github.com/pedroSG94/RootEncoder/tree/master/app/src/main/java/com/pedro/streamer/rotation
For internal audio you can use InternalSource and for microphone MicrophoneSource.
InternalSource need use a service to create the MediaProjection class like ScreenSource. You have an example using ScreenSource here:
https://github.com/pedroSG94/RootEncoder/blob/master/app/src/main/java/com/pedro/streamer/screen/ScreenService.kt
Note:
I'm not sure if you can use the same MediaProjection instance for ScreenSource and InternalSource
from rootencoder.
You can do it this way:
https://github.com/pedroSG94/RootEncoder/blob/master/app/src/main/java/com/pedro/streamer/rotation/CameraFragment.kt#L128
from rootencoder.
Hi,
So Thanks for the Reply, Internal Audio is working fine now and yes we can use the same MediaProjection instance for ScreenSource and InternalSource.
from rootencoder.
Also, Can u tell me how can I record to a local file. I mean is this possible with your library or should I just implement my own recorder
from rootencoder.
Thanks
from rootencoder.
Related Issues (20)
- Retry Error configure stream, setup video 451 HOT 1
- Repeatedly Creating RtspServerStream and Encountering 'Create VideoEncoder failed' Issue HOT 1
- When I recording a video, how can I record a new video with a custom rect in camera frame HOT 4
- screen destory HOT 1
- Hello I'm using OpenGlView and want to set the Hue of the camera how to write. HOT 1
- App crashing while migrating to Android 14 from Android 13 HOT 10
- Recording video with multiple part, screen stuck HOT 13
- How to keep streaming when rotating device HOT 6
- RTMP Authentication not working HOT 3
- Switching between Rtmp stream audio and video HOT 7
- How to play multiple files with RtspServerFromFile HOT 6
- Echo Problem HOT 9
- Hello! I would like to ask you if this library can achieve screen recording and push stream, not through the camera through the screen recording to push the device picture and sound to the server. HOT 3
- Unstable FPS HOT 3
- Where can I download previous versions? HOT 7
- import issue HOT 2
- i can't streaming HOT 5
- Pause Record to File for GenericStream/StreamBase HOT 4
- WHIP & RIST Support HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rootencoder.