To remove background of video, in order to play on keynote, I try many methods, from ffmpeg, website online tools. to iMovie.
Here is the final methods I use:
cd
- Input: png + pngs
- Codes:
ffmpeg -i background.png -r 10 -i network_%03d.png -filter_complex "[0]scale=2180:1120, overlay=560:30" my2_1.mp4 -y
, PERFECT!. - Remark: frame rate = 10
- Useful resources: just codes, PNG+PNGs
- Use R to derive start date and end date of each time window and write in txt.
- Use python to read txt and write SRT file as subtitle.
- Codes
ffmpeg -i my2_1.mp4 -vf "subtitles=timewindow.srt" -y my2_2.mp4
. - Useful refrence: Video subtitles using FFMPEG.
- Video tutorial for transparent website video for a golf ball on Mac. Output is mov. Tool: Adobe after effects(not free), Shutter Encoder. The very important step is done by Adobe after effects.
- Use ffmpeg to replace green background with transparent background.
- Use iMovie to combine video and png, replace green background with selected png.
- Videezy: video resources.
- Use ffmpeg to import images with alpha to a video with alpha in stackoverflow, codes are
ffmpeg -i network_%03d.png -vcodec png my2.mov
. Cannot display. - Online tool deposiphotos, which can transform black background to green background.
- Use ffmpeg to output alpha mov, found in CSDN, codes are
ffmpeg -f image2 -r 10 -i network_%03d.png -vf fps=25 -vcodec png my2.mov -y
. Cannot display. - Combind 2 videos and make one transparent, found in CSDN blog.
- Use ffmpeg to import images with alpha to generate video with alpha, found in CSDN, codes are
ffmpeg -r 10 -i network_%03d.png -vcodec qtrle my2.mov -y
, cannot play. ffmpeg -r 10 -i network_%03d.png -vcodec ffvhuff my2.avi -y, cannot play.
ffmpeg -r 10 -i network_%03d.png -vcodec huffyuv my2.avi -y`, cannot play. - Use ffmpeg to import images to make a mov and set framerate as 10, codes are
ffmpeg -r 10 -i network_%03d.png -pix_fmt yuva420p my3film.mov
. Can work but not transparent. - Different formats supporting video with alpha in IOS and Android, found in CSDN. Seems like IOS only supports H265 with alpha channel.
- Use ffmpeg, inputs are a mp4 and a png, output is mp4, codes use
colorchannelmixer
, found in Youtube. - RiskMakes personal website for ffmpeg.
- Use ffmpeg to remove green background and replace it with transparent background. Use vp9, output is webm. Codes are
ffmpeg -i my2film.mp4 -c:v vp9 -filter:v "chromakey=0x000000:0.1:0.2" my1.webm -y
. Cannot play. - Using ffmpeg to make an H.265 file compatible with Quicktime, found in RiskMakes website, codes are
ffmpeg -i input.mp4 -codec copy -tag:v hvc1 output.mp4
. My versionffmpeg -i my2.mov -codec copy -tag:v hvc1 my2_1.mov
cause error. - Use ffmpeg to create transparent timer.
- Use ffmpeg to create transparent scrolling credits.
- Use ffmpeg to convert pngs to a mp4, codes are
ffmpeg -r 10 -i network_%03d.png -pix_fmt yuv420p my1.mp4
. - Chinese tutorials for how to install and use ffmpeg, very clear.
- Encoder Apple ProRes supports alpha channel and can play on Quicktime, codes are
ffmpeg -r 10 -i network_%03d.png -c:v prores:v -profile 4 -pix_fmt yuv444p10 my1.mov -y
. orffmpeg -r 10 -i network_%03d.png -c:v prores_ks -profile:v 4 -pix_fmt yuv444p10 my1.mov -y
. Not transparent.
Create a background using one png ffmpeg -loop 1 -i background.png -c:v libx264 -t 17 -pix_fmt yuv420p -vf scale=1320:640 my2.mp4 -y
.
Add pngs to video:
ffmpeg -i my2.mp4 -i network_001.png -filter_complex "[0:v][1:v]overlay" -vcodec libx264 my2_1.mp4 -y
. png too bigffmpeg -i my2.mp4 -r 10 -i network_%03d.png -filter_complex "[0:v][1:v]overlay" -vcodec libx264 my2_1.mp4 -y
. only 1 pngffmpeg -i my2.mp4 -framerate 10 -pattern_type glob -i "network_%03d.png" -filter_complex "[1:v][0:v]scale2ref=iw:ih[ovr]; [ovr][0:v]blend=all_mode='overlay':all_opacity=0.7[v]" -map [v] my2_1.mp4 -y
as in here.ffmpeg -i my2.mp4 -i network_001.png -filter_complex "[0:v][1:v]overlay=50:50:enable='between(t,0,1)'" -pix_fmt yuv420p -c:a copy my2_1.mp4 -y
as in Youtube. Time in (0,1), scale not solved.ffmpeg -i my2.mp4 -i network_001.png -filter_complex "[1]scale=50:50;[0:v][1:v]overlay=50:50:enable='between(t,0,1)'" -pix_fmt yuv420p -c:a copy my2_1.mp4 -y
, scaled, but awful.ffmpeg -i background.png -i network_%03d.png -filter_complex "overlay" my2_1.mp4 -y
, works but no scaled, thanks to this.ffmpeg -i background.png -r 10 -i network_%03d.png -filter_complex "overlay" my2_1.mp4 -y
, change frame rate, works but no scaled.ffmpeg -i background.png -r 10 -i network_%03d.png -filter_complex "[1:v]scale=1080:1080, overlay" my2_1.mp4 -y
scale background, background on the topffmpeg -i background.png -r 10 -i network_%03d.png -filter_complex "[0:v]scale=1080:1080, overlay=50:50" my2_1.mp4 -y
scale pngs, pngs on the topffmpeg -i background.png -r 10 -i network_%03d.png -filter_complex "[0:v]scale=1080:1080, overlay" my2_1.mp4 -y
scale pngs, pngs on the topffmpeg -i background.png -r 10 -i network_%03d.png -filter_complex "[0]scale=2180:1120, overlay=560:30" my2_1.mp4 -y
PERFECT!ffmpeg -i background.png -r 10 -i network_%03d.png -filter_complex "[0:v]scale=720:740, overlay=(main_w-overlay_w)/4:(main_h-overlay_h)/4" my2_1.mp4 -y
, no movie