I am trying to run Example One from https://github.com/fyhertz/libstreaming-examples
It uses libstreaming-4.0.
I have forced it to use encodeWithMediaCodecMethod2(). This method uses the createInputSurface() method introduced in Android 4.3. This reduced the latency from 3 seconds to 1 second.
I am creating a video chat application (like Skype) and I need the video latency to be much lower than this.
I don't know where to go from here really.
Could anyone offer suggestions on how to get the latency down? Different libraries? techniques? maybe the NDK? I have done loads of research but I have had very little luck :(
Please help
Thanks
Thre are few open source projects
doubango
ffmpeg (you will need javacv - Java wrapper for C/C++ SDK)
Also thre is IMSDroid (open source 3GPP IMS Client for Android based on doubango) and FFMpeg's streaming guide about latency
Related
I am prototyping a fairly simple camera app to test out using MediaRecorder to create a custom camera activity with one snag, I want to set the aspect ratio of recorded videos to a 1x1. Through much research I have found that this is only possible by using a library like FFMPEG to crop each frame of the video to the size I desire.
I have read many tutorials and articles on different ways to build FFMPEG into Android, but most of them are either outdated and use older versions of both the Android NDK and FFMPEG, or more recent ones just do not work when followed. I tried following the popular http://www.roman10.net/how-to-build-ffmpeg-for-android/ and a few other similar ones that all lead to an error about a missing pkg-config file because FFMPEG is generally meant to be installed on linux or another OS apparently. I found some information about building FFMPEG in android by using a make-standalone-toolchain.sh file here http://software.intel.com/en-us/android/blogs/2013/12/06/building-ffmpeg-for-android-on-x86 and can't make heads or tails as to how to go about using this method.
This now leads into my question: What is the best/proven way currently to build and use FFMPEG within android applications? If the standalone toolchain method is the way to go, is there any material better than the one listed that is easier to follow? I would even be open to a reliable template application with the FFMPEG Libraries ready to go (if this is possible); although, I would much rather know how to build this into android for future use.
Thank you in advance for any advice or suggestions on this issue.
I have successfully build ffmpeg libraries using
https://code.google.com/p/dolphin-player/
You have to be on Ubuntu to build that.
This is the guide I liked the most: http://www.roman10.net/how-to-build-ffmpeg-with-ndk-r9/
If you need more options, you can take a look at these, which are equally good:
https://github.com/guardianproject/android-ffmpeg
https://github.com/halfninja/android-ffmpeg-x264
https://vec.io/posts/how-to-build-ffmpeg-with-android-ndk
EDIT: I updated the first link with a more recent article (it uses NDK r9).
I am an intern at company and my 'learning task' is to make Android application in Java, which takes H.264 format videos (at first they will be stored at SD card) and make like a very simple player, which would have the following features:
1.You can pause/play/fast-forward/fast-backward video
2.When you are at certain point of video and it is stopped, you can switch to the same time in a different video (same picture frame index i guess).
How could i do that? Is using Gstreamer a good way? I looked at the poor tutorial available on net and because of my lack of experience in video processing (I've never worked with video in Android applications) I have quite a hard time understanding what is pipelines, also the JNI and even setting up Gstreamer for Eclipse. Is there a better way of doing this? What should I get to know before starting to mess with this program?
Thanks, in advance!
All of your mentioned features are possible in Gstreamer, however, there is a learning curve.
To understand the GStreamer android tutorials, you must first go through the basic tutorials here: http://docs.gstreamer.com/display/GstSDK/Basic+tutorials
If you feel comfortable with the pipeline architecture, then go ahead and set up your android environment (which is no easy task by itself). Gstreamer is a very very powerful framework where you can do almost anything, if you're willing to make the effort to overcome the learning curve.
So i suggest to go ahead in gstreamer only if you have the time and patience, else go for a simpler solution. Unfortunately i'm not familiar with android, so i cannot suggest any. maybe a quick google search will help.
My application takes a long time to prepare and buffer an audio stream. I have read this question Why does it take so long for Android's MediaPlayer to prepare some live streams for playback?, however it just says people have experienced this issue, it does not state how to improve the problem.
I am experiencing this in all versions of Android, tested from 2.2 - 4.1.2.
The streams are in a suitable bit-rate for mobile and 3G connection. The same stream takes less than a second to start buffering in the equivalent iOS app.
Is there a way to specify the amount of time that should be buffered? I know that the Tune In radio application offers this feature ( https://play.google.com/store/apps/details?id=tunein.player ).
Thanks.
Edit: I've tested again and found that it only happens on devices running Gingerbread and above (>=2.3). I know that Android changed the underlying framework from OpenCore to StageFright. So how can I optimise the media framework? It just seems wrong that the old HTC Wildfire can prepare, stream and play, literally 10x faster than the brand new HTC One X and Nexus 7.
I have struggled with this question for months. Finally i found the solution.
The real problem is in the implementation of the MediaPlayer class. Particularly with the way MediaPlayer buffers the data. This is why the solution is to create your own buffering, save it to a temp file and feed that to MediaPlayer.
This tutorial and source code explain exactly how. http://androidstreamingtut.blogspot.nl/2012/08/custom-progressive-audio-streaming-with.html
By adapting this code, it is easy to create a much better streaming player.
Google Developers really screwed up here.
EDIT : This answer is rather old. Nowdays i would recommend not using MediaPlayer and use ExoPlayer instead. It is extendable, stable and can play many different types of media. You can find it here: https://github.com/google/ExoPlayer/
There really isn't much you can do since the Android MediaPlayer class doesn't provide access to lower level settings such as buffer size. The only alternative would be to make your own player using AudioTrack and a library like FFmpeg to do the decoding.
The one thing I'd recommend is to play around with encoding. For instance, for MP4s, ensure that the MOOV Atom is located at the beginning of the file (there are enough questions on S/O regarding how to do this with ffmpeg, etc). With MP3s, you can look at different codecs or bitrates for instance.
You can, for instance, try a number of audio files you find online, and if you see one that doesn't take a long time to buffer, try to encode your files in the same way.
I am trying to find out the best if any available for controlling ArtNet enabled stage lighting devices using Android using the ArtNet protocol.
I came across artnet4j but I am not sure if anyone has used it for the same purpose before. Please let me know if any has some hints.
The library i have got to work with Android is artnet4j. It is a java based library and does the job it is suppose to do.
For people in 2018 and later:
The initial release of artnet4j has a lot of bugs and unimplemented methods, which won't be fixed, because the project is not under development anymore. I am working on a project that is tackling all these issues (based on the original artnet4j code). Currently supported is:
Bind server to a custom network interface
Reuse of the socket address
Added ability to receive OpDmx packages
Send and receive via UDP broadcast.
Support for Art-Ext packages.
https://github.com/cansik/artnet4j
I advice you a great programm
lighting console lite or pro
https://play.google.com/store/apps/details?id=lightingconsolepro.lightingsoftware&feature=search_result#?t=W251bGwsMSwyLDEsImxpZ2h0aW5nY29uc29sZXByby5saWdodGluZ3NvZnR3YXJlIl0.
Try Lighting Console Lite or Pro.
According to the documentation, it allows you to send DMX over ARTNET
I've been looking for this for some time now but I couldn't find anything useful. Is there a way to reduce the size / resize of an existing video in android? I want to send it via the network.
Thanks a lot!
There is nothing built into Android for this. You are welcome to research third party code that might do this for you. Bear in mind that most Android devices run on low-power CPUs and have relatively slow flash memory, and so re-sizing a video may take a very long time.