Any suggestion on how to encode a videoclip starting from a set of images in Android? I've tried JCodec but it is not documented and I was unable to use it. Any other alternative?
I think JCodec is properly documented. I had used it successfully in a project few days back. Download the sample app from the below link and you will get an idea.
JCodec android sample project
Related
For days I am trying to find a working library that can decode the video stream of the Parrot AR Drone 2.0. The problem is actually that FFmpeg isn't working in Xamarin Android and the Xuggle-Xuggler is only for Java which makes it really difficult.
Furthermore, I tried to use FFmpeg, but everytime I got errors like this: DllImport error loading lbavcodec-55': 'dlopen failed: libavcodec-55" not found'. I have seen a lot of possible solutions but nothing works. I also tried to compile some .dll files which contains the FFmpeg source code, but unfortunately the same errors as before.
I just want create a TCP video stream to "192.168.1.1:5555". After that I want to use a possible decode class/library which could decode the bytes to frames or something like that and put it on the view using a VideoView, so the frames will be shown on the smartphone.
Has anyone experience with this? Or does someone know a working library for decoding the TCP video stream of the drone?
Thanks.
Good news, because I just solved the problem.
There is a possiblity to use FFMpeg, but you need to compile this specially for your platform. Actually this is in Windows a little bit harder than in Ununtu/Linux. However, I tried to implement a pre-compiled library into Xamarin Android, but there were errors like DllImport error loading lbavcodec-55': 'dlopen failed: libavcodec-55" not found', so that didn't work. Xuggle-Xuggler is a video decoder as well, but specially made for Java only and I am working in Xamarin Android, so I had to find something else.
After several weeks I saw a project which uses OpenCV. This could decode the video stream of the drone. However, there was this guy: https://github.com/AJRdev/ARDrone-Android-GEII who made the video stream in two different ways. Namely via OpenCV and a library called "Vitamio".
What I did was trying to use the Vitamio library which Xamarin Android supports. Because there is this Xamarin Android version known https://components.xamarin.com/gettingstarted/vitamiobinding, but that's an old version, so I decided to use the Vitamio library which can be found here: https://github.com/shaxxx/Xamarin.Vitamio. I am using this library because it's using .AAR which contains the same files as the Vitamio library in the project I was talking about before and the most important, no errors appeared :)
Unfortuantely there is no information on the internet about the Parrot AR Drone 2.0 using Xamarin Android. So, if there is someone with this problem, then you could use the source-code of the official app called "Freeflight 2.4", because that one is specially made for Android. However, there is a lot of code in the Freeflight 2.4 app which takes a lot of time to get the video stream part, but I did not have the time, so I chose for an easier way as I explained before.
After the implementation you should be able to see the video on your smartphone!
Good luck!
I am working on video editing in android. After alot of research and
development the only possible solution for real time video editing
found is FFMpeg (Other libraries like Vitamio just impose change
on video while running instead of changing the video). Want to find
soltuion where FFMpeg can easily integrate into android studio
project. Want to do Crop, trim, concatenation and other possible
process on video.
Any one know any solution or library which helps to merge an image with video file? I researched some libraries as OpenCV, FFmpeg, but they seem not help my case.
I have successfully integrated Ffmpeg in one of my apps and added a watermark image on my video.
These links can be used to compile ffmpeg for Android.
Link 1
Link 2 (better and clearer approach)
Or, if you want to keep away from the hassle you can buy a paid wrapper by indie-developers (although i won't recommend it):
one such example is ffmpeg4android
I am working on an app for android that creates video file from a video at start and then set of images, and saves it.
Is there any way to accomplish that?
I tried JCodec and it has broken libraries, untrusted code on the web and lack of knowledge about this library.
I tried FFMpeg and it is unsupported enough on android and involves working with NDK.
I tried to create an animation with AnimationDrawable and save this animation as a video, but I can't find a way to save animation as video except using the feature of KITKAT 4.4, but it requires connecting to a computer and having a root.
Is there any other solutions or a trusted and explained way to do this using the ways above?
Thank in advance
I would vote for FFMPEG. You don't need NDK or other sourcery if you can afford a prebuilt solution, like FFmpeg 4 Android.
I was able to build ffmpeg library by using rock player build script.
Now I have this .so file, how do I play video? And I want to display this video inside a small LinearLayout in my Activity.
Is it possible?
Update:
I know that it's easy to play video using VideoView or MediaPlayer + SurfaceView. I just wanted to understand more about ffmpeg library and how to display the frames inside an Android Activity.
Have a look at this player: https://github.com/bbcallen/ijkplayer
Basically what you need to do is build a JNI interface through to the MediaPlayer class (or possibly ExoPlayer in newer Android though I haven't done this yet).
If you look at the repo link you will see that this needs to be done on top of ffplay more than ffmpeg as the former is the player and the latter the decode/encode/package tool.
There are a few ways of doing this. You should have a look at Dolphin Player, an open source media player for Android. Its actually rather complex, you could also look at the VLC source code which makes use of FFMPEG but VLC is an extensive very complete wrapper to play videos.
See for example an Android app in github: https://github.com/havlenapetr/FFMpeg. This project may be somewhat outdated, but its part that is responsible for video display is quite understandable. You can look for more recent contributions on github.