I know how to capture video on android device, but i would like to capture video and add some other information on it e.g. some funny timeclock and save it all to file so the person watching the video will see the exact time of capturing. I would also like to add some watermark.
Do you know how can i do it or is it possible on android device? I read the API but couldnt find anything that could help me.
I was being asked this question a short time ago, and as a backup we came up with some sort of backup plan: send your stuff to a server and let that (using ffmpeg?) do the watermark, save the file, and send a link back to the phone.. Maybe that's a route to take?
edit:
There seems to be an android port possible for FFMPEG. see for instance this link: http://gitorious.org/~olvaffe/ffmpeg/ffmpeg-android
I haven't had the time to compile it myself, but it seems you can either use the normal FFMPEG and the NDK, or use this version to compile for android. It's a bit more work, but looks do-able.
I actually don't think that's possible. You can fetch video frames from a camera preview, but there's no good way to encode them to video. The standard video encoder (MediaRecorder) can only record the actual direct camera input into a video file.
Related
I am looking for a way to tag the start and end of a song(s) in a video file.
I am targeting below video formats for now.
1) 3GPP (.3gp)
2) MPEG-4 (.mp4)
I referred to the article http://bigflake.com/mediacodec/ and Android Extract Decode Encode Mux Audio and was able to get an idea for extracting demuxed, encoded audio data, however i am not sure how to identify the start of a music (not normal audio) in this audio file.
Target OS is Marshmallow.
Please suggest if this is possible, the answer i am looking for may need audio signal processing, unless there is an easier way to do it.
A theoretical way would be to use Transloadit, a program that would turn a song into a waveform. Then create a program (I think Python would do decently well) that can identify the start of the waveform and load it into a library. Then, in that library, you place the songs and their charts together, and if a song plays, you can then also run Python, which would detect the location of the source of current music and find the chart there and get the corresponding song name.
This will take a lot of time.
Transloadit waveform generator
Using PIL (Python Image Library) to detect image on screen from StackOverflow - first answer will help you.
If you need help with the libraries, then just ask me.
I'm sorry, but I don't have any major Android knowledge cough cough none.
Sorry, but you might need to search up some tutorials or try to use Python.
Hello guys I have a question
I have to admit before I ask my question I never used Android Sdk before but I have coded java for couple of years.
I have a fm radio app.It's an internet radio and I want to record it's output. Is it possible to use an external app to record some other app's output? And if yes, It also has some pre recorded shows which you can listen within the app. They do not get saved into my device when I listen however is it possible to download those shows? Like finding source of the audio and downloading it using my external app.
I'm pretty sure that the recorded shows are downloaded from the internet. I know some audio grabbers as browser extensions in Pc. So I'm asking, if such thing is possible in Android as well.
See below:
https://stackoverflow.com/a/25741006/850347
Seems to be currently there is no way to achieve this. I have read this article and it suggests to recompile the Android source code with some changes.
Or, you can use visualizer.
https://stackoverflow.com/a/25816052/850347
The closest API available to you for these purposes is Visualizer. Which only captures "partial and low quality audio content".
Is it possible and if so "how" would one create a "fake" Camera in an Android application. By "fake" I mean an all software creation that simply looks like a regular Camera to the OS but in actuality takes a Bitmap or byte array as its input data. I want to use such a device with a MediaRecorder to create h.264 videos.
Things this could be used for:
Image slideshow video creation
Screen capture to video file
Caveats: No rooting and no ROM modification
I think what you are looking for is a way to encode videos to H.264 in a way similar to what MediaRecorder does but not from the camera. You do not particularly care whether this is done with a "fake camera" or in some other way, correct? In that case...
You can use the MediaCodec API available in Android 4.1 and later. You can just give it a series of images and it will create video encoded with (where available) the hardware encoder. Some sample code: Create video from screen grabs in android and Encoding H.264 from camera with Android MediaCodec
If you are expecting to affect other apps with your "fake Camera", that is only possible by modifying the Android source code and rolling your own ROM mod.
Yes,you can!
No rooting and no ROM modification,the best way to do this is to build a virtual app that runs the other app as a plugin,so that you can modify anything in the target app. But there is so much work to do, the best news is that there are several open source projects to do this.
And so, the next thing is not so difficult,you only have to hook several libs so in /system/lib that affect the camera recording.
In fact, I have done this on my device, but I modified the system lib directly, it has to be rooted of course. But it works well on almost all apps except some apps that use the service to capture video.
We have to modify the service lib, but it is a little more difficult.
We are working on Android 3D Animation App.
We need to identify images, then save and encode the same to video using FFmpeg (Since Android API is not supporting). Once the video is generated, then audio is appended to the same.
We are facing 2 problems on this.
First is the memory leakage issue at the time of saving identified images for encoding. CPU of emulator is getting overloaded. Whether FFpmeg is called every time when an image is selected? How to resolve this issue?
Second (in case if we get through the first one) we are not able to encode the selected images, since this is generating green color video. What could be reason for this?
Whether is there any tool other than FFmpeg for video encoding from images to H264?
Whether images version (Rastar or Vector) will impact this video encoding?
Whether Android OS version is considered?
Any valuable inputs on this will be greatly appreciated.
Thanks
I played also with that idea using ffmpeg on an android phone, but I would suggest to do that on a server which has much more power. On a server you don't need to think about the cpu load of a smartphone.
In general for improving your ffmpeg run you need to publish the ffmpeg calls. ffmpeg is quiet complex where the order of the parameters directly correlates with the efficience.
I don't know which container format you preferer but maybe a simple mjpeg codec could work for you. AFIK there a just the jpeg frames connected to each other which should be much simple then encoding a video to h264/x264 (ffmpeg uses the last one).
A combination of both may be to generate a mjpeg stream which will be converted on the server side to a h264 video which may be downloaded to the client. but that really depends on the length of the video if you don't want to waste the traffic of your customers.
I am working on an Android app, that needs to do the following:
- capture a (animated) view to video including audio (from a mp3 file)
- encode the captured video (probably a bunch of raw image buffers) and audio to avi.
After searching, FFMPEG seems the most suitable. Does anybody have a sample code to accomplish what I need. I would really appreciate.
Whyhow
It's not clear what you mean by 'a (animated) view' to capture, but be aware that android apps running with normal permissions cannot access the raw framebuffer. The computation part of ffmpeg builds in the ndk without undue work and there's a lot you can read about on the web, but the output (or in your case input) drivers are a bit of a permissions problem. Also you should expect encoding to be much slower than real time unless you can somehow manage to leverage hardware acceleration features of your particular device's SOC.
if u are building your app for android then u can use .avi writer code. You can get this code from "Koders website". Search for "Koders site" on google .you will get the link. I have tested the .avi file writer code and its working fine.