How to have a video Track from an image (Bitmap) on Android?
I need to add an image at end of my video.. for 5 seconds
Thanks
The terminology for what comes after a video is called a "Post Roll" (or before a video, "Pre Roll"). This will help you in future searching.
If you are attempting to use an Image as your Post Roll, this will not work as it says at the very bottom of their GitHub page.
So what can you do?
As they also say on that page, you can "Append Recordings with Same Encode Settings". So you can encode your image as a video with the:
SAME resolutions
SAME frame-rates
as your main video, then they will chain properly.
Related
I am writing an app to grab every frame from a video,so that I can do some cv processing.
According to Android `s API doc`s description,I should set Mediaplayer`s surface as ImageReader.getSurface(). so that I can get every video frame on the callback OnImageAvailableListener .And it really work on some device and some video.
However ,on my Nexus5(API24-25).I got almost green pixel when ImageAvailable.
I have checked the byte[] in image`s Yuv planes,and i discover that the bytes I read from video must some thing wrong!Most of the bytes are Y = 0,UV = 0,which leed to a strange imager full of green pixel.
I have make sure the Video is YUV420sp.Could anyone help me?Or recommend another way for me to grab frame ?(I have try javacv but the grabber is too slow)
I fix my question!!
when useing Image ,we should use getCropRect to get the valid area of the Image.
forexample ,i get image.width==1088 when I decode a 1920*1080 frame,I should use image.getCropImage() to get the right size of the image which will be 1920,1080
I am showing number of dailymotion videos in ListView, i want to try to make thumbnail image from dailymotion video, but i am not getting any way to make thumb.
Have you any idea about it!!!
https://api.dailymotion.com/video/{#id}?fields=thumbnail_medium_url,thumbnail_small_url,thumbnail_large_url
And you have following options and you can pass either one or all:
thumbnail_large_url (320px by 240px)
thumbnail_medium_url (160px by 120px)
thumbnail_small_url (80px by 60px)
https://api.dailymotion.com/video/x26ezrb?fields=thumbnail_medium_url,thumbnail_small_url,thumbnail_large_url
{
"thumbnail_medium_url": "http://s1.dmcdn.net/HRnTi/160x120-JQs.jpg",
"thumbnail_small_url": "http://s1.dmcdn.net/HRnTi/80x60-iBI.jpg",
"thumbnail_large_url": "http://s1.dmcdn.net/HRnTi/x240-oi8.jpg"
}
i have an activity where i display a video in Video view,Video view takes half of my screen, and i want in the other half to display frame by frame images(thumbnails) and to be able to trim the video in 10-15 seconds.
I have done a lot of research on google but i can't find a solution, please help it is very important ! where can i get a tutorial about this ?
this is how i show video on activity:
video_holder = (VideoView)findViewById(R.id.display_video);
Intent intent = getIntent();
String ur = intent.getStringExtra("videocrop");
Uri vid_uri = Uri.parse(ur);
video_holder.setVideoURI(vid_uri);
video_holder.start();
Try mp4parser library and you see ringdroid for audio
I am developping an Android application and I encouter problem to get thumbnail of video.
My question is simple. I know how to get thumbnail for Youtube or Dailymotion but is there a way to do the same for a video like this one : http://download.wavetlan.com/SVV/Media/HTTP/MP4/ConvertedFiles/MediaCoder/MediaCoder_test3_1m10s_MPEG4SP_VBR_516kbps_320x240_25fps_MPEG1Layer3_CBR_320kbps_Stereo_44100Hz.mp4
I want to get a frame at time T for every video.
I tried this :
Bitmap thumb = ThumbnailUtils.createVideoThumbnail(m_Video.getM_Urlvideo(),
MediaStore.Images.Thumbnails.MINI_KIND);
m_Video.getM_Urlvideo() is returning my video url..
It doesn't work, anyone has an idea ?
Thank you
I need to design a app.That when Record the Video through Camera,Show and Record the SystemTimeStamp above the Video.
Can it work with current Android Frameworks?
If can, How can i do this?
Thanks for anybody to read this!
Follow the procedure below.
1. Capture video byte array (of each frame).
2. Now create bitmap from byte array.
3. Use link below to overlay text over bitmap.
4. Save those bitmaps to create video.
Text Overlay bitmap.
You could follow a two-stage approach. First, record the video using the MediaRecorder API (which IMO is easier to use than MediaCodec - the Camera2 example is quite useful). Second, post-process the video with
Taner Şener's wonderful mobile-ffmpeg, where you can simply add millisecond timestamps in the lower right corner with a command like:
FFmpeg.execute("-i \"" + pathToVideo + "\" -vf drawtext=\"fontsize=60:fontcolor=yellow#0.8:box=1:boxcolor=black#0.8:boxborderw=10:text='%
{e\\:" + startMillis + "+t*1000}':x=(w-text_w+6.8*max_glyph_w):y=(h-text_h)\" \"" + pathToVideo.replace(".mp4", "_overlaid.mp4" + "\""));