Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23218

How to clone last frame when using overlay in ffmpeg?

$
0
0

I use this code to slide previous and next pages up, this is no problems, can I remove png file 1970~1979-last.png and use the last frame of video file 1970~1979.mp4 to instead it?

script-01.txt

color=white:864x504[c];[0:v]scale=864:504:force_original_aspect_ratio=decrease,pad=864:504:-1:-1,setsar=1[s0];[1:v]scale=864:504:force_original_aspect_ratio=decrease,pad=864:504:-1:-1,setsar=1[s1];[c][s0]overlay=y=0-h*t[c];[c][s1]overlay=y='if(between(t,0,18),max(H-h*t,0),max(0-h*(t-18),0-H))'[v],[v]tpad=stop_mode=clone:stop_duration=10[s2];[s2]drawtext=fontfile='/WINDOWS/Fonts/Arial.ttf':text='%{eif\:18-t\:d}':box=1:boxborderw=10:boxcolor=orange@0.4:x=w-tw-10:y=10:fontsize=24:fontcolor=red:enable='between(t,8,18)';

script-01.bat

ffmpeg -hide_banner -loglevel fatal ^    -loop 1 -i "C:\myimages\1970~1979-last.png" ^    -i "C:\myvideos\years\1980~1989.mp4" ^    -filter_complex_script script-01.txt ^    -t 18 -y v01.mp4

I got it what I only need video files and capture last frame by pipe line to next step, so that the last frame image never neede! Though the first slide has little problem when countdown finished!

script-01.bat

ffmpeg -hide_banner -loglevel fatal ^    -sseof -0.03 -i "C:\myvideos\years\1970~1979.mp4" ^    -vframes 1 -c:v png -f image2pipe - | ffmpeg  ^    -hide_banner -loglevel fatal -i - ^    -i "C:\myvideos\years\1980~1989.mp4" ^    -filter_complex_script script-01.txt ^    -t 18 -y v01.mp4

Viewing all articles
Browse latest Browse all 23218

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>