I have a small video clip and an audio file. The problem is how to write code to merge them into a single file. i have never written code for multimedia applications for android and don't know if the merging is possible with android media framework. Is there any third party library to do that?
Can we right a merging code in Java and call it in Android?
Please guide me through this. Thanks
You can try INDE Media for Mobile, tutorials are here: https://software.intel.com/en-us/articles/intel-inde-media-pack-for-android-tutorials
It has a sample demonstating how to substitute audio track in mp4 video file by another audio track from another mp4 file. It's here: https://github.com/INDExOS/media-for-mobile/blob/master/Android/samples/effects/src/com/intel/inde/mp/effects/SubstituteAudioEffect.java
In sample app it's under Audio Effect:
Related
I have two MP4 audio files and one MP4 video file. I need to combine them to reproduce the video and the two sounds at same time (Parallel, Not concatenate), in order to get an only MP4 file.
For example, I have an MP4 audio file with voice, another with music, and another with video. I need that they play all together like a videoclip.
I have been trying to add several audio tracks to movie with MP4Parser with:
video.addTrack(audioTrack1);
video.addTrack(audioTrack2);
But when I play it, I only can hear one of them. Maybe MP4Parser is working correctly and I didn't understand this functionality, for this cause I need an answer about it.
Is it possible to do this with MP4Parser or I am wrong and it is impossible?
If it is possible, please could you give me a working example code?
Thank you in advance.
I want to cut audio and merge an audio file with video programmatically in android.
I don't know how to work with FFMPEG , can anyone tell me how to start with or another solution?
Any Help?
Use mp4parser library
library
https://github.com/sannies/mp4parser
test
https://github.com/vicmns/mp4parser-android-test
I have a requirement where I need to extract ID3 tags from a MPEG2 TS(HLS STREAM). MPEG2 has a limited support in android in regards to playing the file. But my concern is to extract the ID3 tags(playing the file is not necessary). Hence I am not concerned with the codecs(encoding and decoding).
I have explored the following options:
libstagefright and OpenMax : A playback engine implemented by Google from Android 2.0.
It has a MediaExtractor is responsible for retrieving track data and the corresponding meta data from the underlying file system or http stream. But according to this post Adding video codec to Android I need to build my own firmware or my own media player.I am hoping I don't have to go down that path. More info on stagefright and openMax can be found here:
An overview of Stagefright player
Android’s Stagefright Media Player Architecture
Custom Wrapper Codec Integration into Android
How to integrate a decoder to multimedia framework
Compiling and using FFMPEG: A complete, cross-platform solution to record, convert and stream audio and video. We can demultiplex ts files with this library as mentioned here:
FFmpeg - Extracting video and audio from transport stream file (.ts).
But I am not sure if I will be able to extract the ID3 tags from the HLS Stream. libavformat might be able to do this but I still need to come up with a mechanism for signaling the read metadata to my application.
Compiling vlc for android: I have compiled vlc for android and made some modifications inside the transport module in demux component for extracting the tags, but it is not able to play all the streams that I am supplying to it.
After looking through these options , I am still at a fix in how to achieve this. I don't want to create a media player as I will not be playing the files nor do I want to build my own firmware. Using ffmpeg seems to be the most viable option, but I want to try this without using any third-party or open source library. My questions are:
Is it even possible to create a demultiplexer from scratch that will work on android?
If possible then ,how to go about it ?
Any options that I have missed?
I am new to this. Any help would be greatly appreciated..Thanks
In android, there is a support to extract ID3 tags. Please refer to ID3 module for further details.
Integration of ID3 into MP3 extractor can be found here.
From a quick check, I have found that ID3 is supported from Froyo onwards.
I am developing an app. that will stream the video recorded from camera and stored as mp4 in sdcard...
I know there something called as RTSP which is used for that...
Please tell me where to start . .and is there any library that will do this for me...
I do not understand why you want to stream a local mp4 file, but maybe I misunderstood you problem. RTSP is used for live streaming, but you want to play a local mp4 file.
If you want to capture video and save it as mp4 onto a SD card, you need to use the Android MediaRecorder. Here a link to a simple example.
If you just want to playback a local mp4 file. Have a look at the Android API Demos.
These are part of the Android SDK installation and contain a good example of how to playback local media files.
I am trying to apply new audio pitch for my video file.
I want to replace audio of my existing video by android code. Is it possible in android. can any one help me to do this
Is there any Android library support this facility to change audio for video file?
Any Help is appreciated...!!!
Thanks in Advance
This is not the exact solution but you can try it:
When you play the video file set its volume to zero.
At the same time use the service in which you can play any audio you want.
As service runs at background it has no effect on your video streaming.
When your video end,end your service.
And remember to set volume of your audio file.
You can change video pitch easily by following these steps :-
Add this library in your android project : https://gitlab.com/soundtouch/soundtouch.
follow this link for integrate this library process : https://stackoverflow.com/a/52425255/7899427.
After successfully integrate this library first of all extract audio file in WAV audio format. You can use ffmpeg library for do this.
Than using the soundtouch library you can change the audio file pitch and tempo rate and export new audio file in WAV format.
After complete these steps merge that converted audio file with video file.
Now will get the converted audio file with same video file.
Happy coding.