I wish to add a frame to the end of a video just after it has been captured so I can make a timelapse video as the images are acquired.
So the idea is to take an image, use ffpmeg to make the video by adding each image just after it is aqcuired.
I've seen many questions about adding a set length of time of a logo type image or how to compile a whole bunch of single images to a video but not this.
Anyone got a good idea of what to try?
It´s possible to save a video on React-Native using cameraRoll, for images with saveImageWithTag() it´s easy but i can´t found documentation for videos.
It is very easy to save a video to CameraRoll, I did it with the following line of code.
saveVideoToCameraRoll = async (uri) => {
await CameraRoll.saveToCameraRoll(uri, 'video')
}
NB: Obviously this function expects a uri or filePath of your video.
I am currently able to convert a series of images to video, but I do also need to add transitions / animation in between them.
String[] ffmpegCommand = {"/data/data/mypackage/app_bin/ffmpeg", "-y",
"-qscale", "1", "-r", "" + framerate, "-i", "/data/data/mypackage/app_ipImg/image%3d.jpg",
"-t", "" + (((total_images) * delay_of_each_frame_in_seconds) + 4), //"-s",heightwidth,
"-vcodec", "libx264", "-s", "640x480",
Environment.getExternalStorageDirectory() + "/photo_directory/myVideo.mp4"};
The above command is working for me to create video from image series
But
Now, I do want to add fade or other transition / animation to be displayed in final video before each of the frames.
I googled a lot, but didn't find any solution to this trouble, yet.
Please suggest me the way.
Thanks in advance.
I would suggest you to find more information about Frame Blending or Motion interpolation.
This is for example used in timelapse videos to smooth the render.
To blend frames, use ffmpeg with the tblend filter.
For example the following command can help :
ffmpeg -i {input} -vf "tblend=average,framestep=2,setpts=0.50*PTS" -r {srcfps} -{encoding parameters} {output}. Replace {input} by your input file, {output} by the name of the output file, {srcfps} by your source frames per second, and -{encoding parameters} the parameters you tell ffmpeg to output.
You could also add minterpolate filter to the filter stack to add some motion blur.
To generate new frames based on motion, the Butterflow project can help : https://github.com/dthpham/butterflow
Features
Makes motion interpolated videos (increase a video's frame rate by rendering intermediate frames based on motion, uses a combination of pixel-warping and blending).
Makes smooth motion videos (simple blending between frames).
Leverages interpolated frames to make fluid slow motion videos.
Two approaches
1) Create a video for each image/slide and add the fade-in fade-out to each one, then add the videos together. This link explains how to create a fade effect for images.
2) Use the a mixture of filters along with the -loop option as explained in this link.
I'd like to add a poster to my audio player previews just like with the video mode of the mediaelement.js player.
I've checked all the shortcodes and there doesn't seem to be anything for this. Basically all I want is a static image immediately above the audio player that is visible before and during playing.
The reason I want this to be an 'all-in-one' player is because my WP theme allows me to create posts in the 'audio' format so that the audio player appears at the top of my category view of recent posts. It'd be awesome to add that image for each post and have it part of the audio player. Kind of like video but with less overhead.
Thanks in advance.
I have been trying to play FLV videos in ShadowBox.
According to the FAQ,
I am using Shadowbox.init(); on page load.
And then later on
Shadowbox.open({
content: http://mysite.com/video.flv,
title: 'video',
player: 'flv'
});
But to no avail. The video doesnt even stream in the background, I get to see only a black box. However, when I use player: 'swf', the video atleast streams in the background, but doesnt play.
Any help ?
It's working now.. !!
With the same code written above..!