Kurento Video Streaming - java

I want to access the video stream being recorded by Kurento in Real-Time.
In the default implementation, I can only get hold of the video once the call is completed, but how can I access the file as it is being created?

You should be able to connect a PlayerEndpoint or a media player to watch the recording in real time, if the recorded file is in VP8 format. On the other hand, if you are recording in .mp4 format, there is no way to do that because .mp4 stores certain information when the recording process ends. This is not particular to Kurento, but to .mp4

Related

Vlcj audio only player

I am creating a chat application where the user can send audio and video files.
For my video files I have successfully created an embedded video player in my app which will play any video.
But for my audio files I don't want to use an embedded video player with options vout=dummy instead I want to be optimized and use an DirectAudioPlayer for my purposes. I took a look at the MediaFactory create but i don't understand how am I suppose to retrieve these parameters for an specific file.
What I want is just one direct audio player in my application which I can reuse for multiple audio files or is this not possible?
You can use a HeadlessMediaPlayer.
This is basically the same as the EmbeddedMediaPlayer that you're already using, but with no API to do with displaying the video.
A word of caution though if you play a video through the HeadlessMediaPlayer, rather than just an audio file, LibVLC will open a native window and play the video - you can suppress this by passing "--no-video" via the MediaPlayerFactory.
The DirectAudioPlayer is used when you want to access the audio buffer in your application - i.e. "direct" access to the native audio buffer. You would then have to use JavaSound or something to actually play the audio. So I don't think this is what you want.

The recording video plays too fast

I made a Live Recording application using by MediaMuxer and MediaCodec.
And Recording format is .mp4. Video and audio is right. Playtime is same (use stopwatch). Video's and audio's sync is same.
My problem is the mp4 file that I record play too fast. I mean the video is like double speed. I don't know how to solve this problem.

Saving stream's video in server's database after finishing the live stream

I'm working on an app that has video streaming functionality. I'm trying to find some documentation on how can I save the stream's video in a server after they finish the live streams so the users can watch the replay later, but can't really find much.

Read current audio output - Android

I want to know if it is possible to access the audio that is currently playing on the Android device.
Example: if Spotify is running in the background, I want to access the audio to control some LEDs that are connected to my RaspberryPi.
I want to create some sort of equalizer that changes colors depending on the sound that is currently playing. I appreciate if some one could tell me if accessing the main audio output is possible or not.
Unless you are using a rooted phone, it's not possible to capture output of a random app on Android.
You can however create an app that plays media files and captures the output for the purpose of visualization with "Visualizer" effect. You can take a look on the sample here: https://android.googlesource.com/platform/development/+/master/samples/ApiDemos/src/com/example/android/apis/media/AudioFxDemo.java
(look for "Visualizer").
If you are using Raspberry Pi anyway, you can just play all your music through it, capture and analyze it there. You will need an external USB sound card though. See for example this post: http://www.g7smy.co.uk/2013/08/recording-sound-on-the-raspberry-pi/
There they just record and play audio back, but you can insert an analysis phase in between.

Android (Java) Real-time Audio Input (microphone AND USB) and Output

I would like to build an Android App to take audio data from two microphones, mix the sound with some from memory, and play the sound through headphones. This needs to be done in real-time. Could you please refer me to some tutorials or any references, for real-time audio input, mixing, and output with Java eclipse?
So far, I am able to record sound, save it, and then play it, but I cannot find any tutorials for real-time interfacing with sound-hardware this way.
Note: One microphone is connected to the 3.5 mm headphone jack of the Android through a splitter and the other is connected through a USB port.
Thanks!
There are two issues that I see here:
1) Audio input via USB.
Audio input can be done using android 3.2+ and libusb but it is not easy (You will need to get the USB descriptors from libusb, parse them yourself and send the right control transfers to the device etc). You can get input latency via USB in the order of 5-10 mS with some phones.
2) Audio out in real-time.
This is a perennial problem in Android and you are pretty much limited to the Galaxy Nexus at the moment if you want to approach real-time (using Native Audio output). However, if you master the USB you may be able to output with less latency as well.
I suppose if you go to the trouble of getting the USB to work, you can get a USB audio device with stereo in. If you had connected one mono mic to each of the input channels, then output via USB you would be very close to your stated goal. You might like to try "USB Audio Tester" or "usbEffects" apps to see what is currently possible.
In terms of coding the mixing and output etc, you will probably want one thread reading each separate input source and writing to a queue in small chunks (100-1000 samples at a time). Then have a separate thread reading off the queue(s) and mixing, placing the output onto another queue and finally a thread (possibly in native code if not doing output via USB) to read the mixed queue and do output.
The following Link http://code.google.com/p/loopmixer/ has a flavor for dealing with the audio itself.

Categories