How to play .aac audio format in android.
I tried using ffmpeg convert audio format and play in android-ndk. But im not able to implement.
Please let me know any ideas or any ref link to follow
You can check this native aac player implementation. It is ffmpeg-based, and I heard it is fairly light on CPU.
http://code.google.com/p/aacplayer-android/
Related
Is it possible to convert the format of the media source when playing a video with exoplayer? I thought that I could use FFMPEG to convert the format, but I do not really know how exoplayer works and the problem is that the media source is not a file, but a stream. It is avi format, which unfortunately is not supported by exoplayer, and I could not find any working player for android that has avi support.
I see there is a ffmpeg extension for exoplayer, but I do not know if that will solve my problem and I have no idea about NDK and compiling c++ for android and the instructions are very unclear. If someone could explain how to do it or give me a guide that would be nice. This is the link to the exoplayer extension:
ffmpeg extension
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 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.
I am pretty new at streaming video, so please bear with me. :)
I am trying to port an m3u8 stream over from iPhone to Android. Looking in the m3u8 feed, I found some .ts files. From what I can tell, .ts files are, themselves, wrappers that contain the video stream (Elementary Stream).
Is it possible to play a .ts file in Android? (The docs only list 3gp and mp4 as supported formats.)
Is there a way to extract the Elementary Stream and just process the video feed? If that is in 3gp or mp4, I should be ok.
Will Stagefright handle .ts? Is Stagefright even available? I read that there are/were some problems with it.
(As a further caveat, I am not getting much help from my server guys. They are pushing for a Flash player solution, including a proprietary player. They will not provide me with a 3gp or an mp4 feed, but I'm hoping I can find that in the .ts file.)
I'm open to other suggestions. Thanks for your patience with this newbie. :)
There is a standard for that called HTTP Live Streaming. Android 3.0 supports this protocol to some extent which means you can pass the URL of the m3u8 playlist to the MediaPlayer and the player should be able to stream it over HTTP. Stagefright is bundled with Android 3.0.
You can browse its source code here.
Also, this thread might interest you: it summarizes support for HTTP Live Streaming.
Android stagefright in Gingerbread and prior versions does not support playback of .ts (transport stream) or elementary stream. As you have rightly pointed out, it only supports MP4/3GP/MP3 file formats.
You can play .ts video file in android by using NDK based project. Dolphine player is best open source player for android and also supports various formats of video.
You got the .ts link from m3u file. Now you can fetch binary data from .ts file and store this binary data in file, then play this file by using video player.
I want to play the flv files in Android. So what I thought is to convert the flv file to mp4 or 3gp(for which there is a decoder in Android). OpenCore can be used to convert. I have looked into opencore code, there is a class in opencore "/android/external/opencore/fileformats/mp4/composer" to create the mp4 file. It has apis like
AddTrack
AddSampleToTrack
I should give the input as frames, but in Flv I will get the Sorenson Video and Mp3 audio frame(after doing some trivial string operations to remove the headers). Can I use these directly as input to above apis or is there any good way to convert flv to mp4? And also I have looked into "/android/external/opencore/nodes/pvmp4ffcomposernode" but it reads from ports not able to know how to send input to this class.
Let me know your thoughts.
I have solved using ffmpeg.
I have ported ffmpeg and libfaac to Android. It works great.