Export video from android application to SD card - android

I am using below demo for creating slow and fast motion video in android application.
https://github.com/google/grafika
I am able to play slow and fast motion video in application but now i want to export this video to SD card.
I use TextureView to show video in app.
I use this java file to control speed of video.
https://github.com/google/grafika/blob/master/src/com/android/grafika/SpeedControlCallback.java
How can i do this?
any help will be appreciated.

Hi you have to use a MediaMuxer, call AddTrack for the video track and write the data to this track to the muxer after encoding each frame. You can see some examples in grafika page, one of them could be this: https://github.com/google/grafika/blob/master/src/com/android/grafika/ContinuousCaptureActivity.java (here you canhow to do both displaying on screen and recording on SD)
and another one: https://github.com/google/grafika/blob/master/src/com/android/grafika/CameraCaptureActivity.java
Also you can find more examples here:
http://www.bigflake.com/mediacodec/
Thanks

Related

Playing videos from external Camera to Exoplayer without the usage of Streaming(RTMP,RTSP etc)

I have a situation wherein ,I want to capture video and audio from a external camera and view the media in any container format like (MP4,FLV,MKV etc) and play it in ExoPlayer or any ..Is this possible.??
And I am using a HiMedia Q10 Android Box..
...It would be really helpful if someone could suggest me with some ideas...!!

Record Screen video along with the audio

I want to implement screencast feature in my Android app, i.e. Recording the audio and the screen video at the same time and converting it to a .mp4 file.
I got to know that there are some Media Codecs inbuilt in the Android SDK, but the issue with those ones is that I will need to record video and the audio separately and then stitch both of the elements together to create a complete video.
I want to know if a library exists which can directly record both the Audio and Video without the need to stitch them later on.
Thanks in advance!
this project can help you get started here

Set cover image while record audio in android

Hello I am recording audio using MediaRecorder and save it in MP4 format. and upload to the server. as well record video as MP4 using camera and upload to server.
So while I am receive my uploaded item from server as uploaded url list. and I am playing all it in VideoView. video and audio play good. now here is the thing while I am playing video it's display video frame on video view but while playing audio it's black. basically audio and video file extension are MP4 so I can't make different while adding it in to VideoView other wise I'll add imageview and display some default image and hide VideoView.
so is there any way to record audio with cover image so while I am playing it in Video view so it display that cover image...
I know that using ffmpeg we can do this but I got lots of error while compiling it in my windows pc. so is there any way to add cover image while record audio with pure android api? sorry for bad english.
I google everything but I can't find any solution for convert audio file to video file with using image. So I have to go with FFMPEG.
So I add WritingMinds java FFMPEG in my project using gradle dependency. Then convert MP4 audio with cover image into the MP4 video.
There are some limitation in this precompile library. like it not work in android 24 and some commands like -speed, cpu-used, -deadline which are most important for all the operation(But still we can perform other operation). there are some disadvantage also like slow speed, and some features which required for specific operation are not include in the compile library. (So I gave advice to compile your own ffmpeg library for android project in linux or mac pc(windowns have lots of issues)).
I hope this will help someone who's this type of scenario :)

Creating video from Frames in Android

I am using Android MediaCodec : ExtractMpegFramesTest for grabbing frames from video but now i am not getting any useful information on google for How can i create video from frames.png in android?
You can try INDE Media Pack - https://software.intel.com/en-us/articles/intel-inde-media-pack-for-android-tutorials
It has transcoding\remuxing functionality as MediaComposer class and several sample effects like JpegSubstituteEffect - it shows how substitute video frame by a picture from jpg file. You can take black video as a refefence and put images on it with a possibility to set duration, add audio track with help of audio effect etc.

how to create video using mediaCodec?

Is it possible to create video of series of Images present on SdCard using MediaCodec? if yes, can anyone share me the link?
I want to import images from sdCard and create video from those images, any suggestions???
I want to do this programmatically. I've tried using jcodec library but the process is very slow and I want to fasten up a little bit more.
Is there any chances that MediaCodec can do that in my ADT and in much faster way.
Importing images from SdCard --> making a good quality .mp4 video (faster than jcodec way).
You can try INDE Media Pack - https://software.intel.com/en-us/articles/intel-inde-media-pack-for-android-tutorials
It has transcoding\remuxing functionality as MediaComposer class and several sample effects like JpegSubstituteEffect - it shows how substitute video frame by a picture from jpg file. You can take black video as a refefence and put images on it with a possibility to set duration, add audio track with help of audio effect etc.

Categories

Resources