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.
Related
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.
I am making a simple video playback application in Android Studio. The video is approximately 600MB, and has an appropriate title (no spaces etc.). The video will be played back using VideoView.
Where should the video be saved? When it is placed in src/res/raw, (like other files I am using such as .wav for sound effects), it creates resource errors. Do I create a new folder called assets and store the videos there?
Noooo. You will not put that video in your apk. Will your app exceed 600mb size on playstore. See on google documentation.
Google Play currently requires that your APK file be no more than 100MB
Solution:
First try to compress your video, as you don't need high resolution video.
Put video on cloud (like Amazon s3 bucket).
Download this video file at run time in device from Amazon. And then play it anywhere from device storage.
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.
I need to display a video (which contains no audio track) but playing that video using VideoViewor MediaPlayer automatically interrupts any ongoing audio playback which may be currently active in another application.
My requirements are to:
play a video which contains no audio track
do not interfere with any ongoing audio playback
Is there a way to play such a video without hijacking the audio channel?
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