Comments (3)
did you set the Record_audio permission in the AndroidManifest.xml??
from libstreaming.
Yes, I have the permission
actually since then i have managed to make a localSocet and i can read the data from it ... so i have the InputStream from this socekt, i just don't know now how should i connect this with the started RtspServer.
this part of my code looks like this now: (a new thread):
private class SocketThread extends Thread{
LocalSocket receiver;
LocalServerSocket server;
LocalSocket sender;
@Override
public void run(){
System.out.println("--------IO Thread------ ");
// Sets the port of the RTSP server
Editor editor = PreferenceManager.getDefaultSharedPreferences(thisActiviry).edit();
editor.putString(RtspServer.KEY_PORT, String.valueOf(myPort));
editor.commit();
// Configures the SessionBuilder
SessionBuilder.getInstance()
.setSurfaceView(mSurfaceView)
.setPreviewOrientation(90)
.setContext(getApplicationContext())
.setAudioEncoder(SessionBuilder.AUDIO_AAC)
.setAudioQuality(new AudioQuality(44100,128000))
.setVideoEncoder(SessionBuilder.VIDEO_NONE)
.build();
try{
server = new LocalServerSocket(LOCAL_SOCKET_ADDRESS);
sender = new LocalSocket();
sender.connect(new LocalSocketAddress(LOCAL_SOCKET_ADDRESS));
myAudioRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
myAudioRecorder.setOutputFormat(MediaRecorder.OutputFormat.AAC_ADTS);
myAudioRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC);
myAudioRecorder.setOutputFile(sender.getFileDescriptor());
myAudioRecorder.prepare();
myAudioRecorder.start();
receiver = server.accept();
// Starts the RTSP server
thisActiviry.startService(new Intent(thisActiviry,RtspServer.class));
int ret = 0;
int j = 0;
while ((ret = receiver.getInputStream().read()) != -1 /*&& j < 25*/){
if (j % 1000 == 0)
System.out.println( j + ": ret =" + ret);
j++;
}
System.out.println("ret =" + ret);
}
catch (IOException e){
e.printStackTrace();
}
catch (IllegalStateException e){
e.printStackTrace();
}
}
}
Actually i can see in the CatLog that the client connects but due to no buffer it disconnects after a while. Also i can see that the mediarecorder put data to the LocalSocket beecause the reciever.getinputstream().read has values.
from libstreaming.
I'm still struggling with the same problem that i can't solve. I have the data stream from the Media Recorder but i have no idea how should i give these data to the RTSPserver. :(
from libstreaming.
Related Issues (20)
- MTU default 1300
- Does it have RTCP support?
- Does it have RTCP support? HOT 1
- Is there any receiver solution/example which decodes AAC format of audio? HOT 5
- Hi
- so if
- how to stream video over RTP Multicast
- Building cyber C HOT 1
- B HOT 2
- Urg
- Newbie
- hey bro HOT 2
- No
- Face recognition
- Streaming happens here:
- TrebEdit - Html Editor HOT 1
- T
- Hl
- Ccc
- Hello
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 libstreaming.