public:ffmpeg-based_interval_timer_for_sport_and_exercise
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionLast revisionBoth sides next revision | ||
public:ffmpeg-based_interval_timer_for_sport_and_exercise [2018/02/07 01:47] – created fangfufu | public:ffmpeg-based_interval_timer_for_sport_and_exercise [2018/02/15 10:30] – fangfufu | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== FFmpeg-based Interval Timer for Sport and Exercise ====== | ====== FFmpeg-based Interval Timer for Sport and Exercise ====== | ||
- | I unfortunately | + | I am the one of the cycling captain of UEA Triathlon Club for the academic year of 2017-2018. |
- | After digging through FFmpeg documentation [(https:// | + | I used to use a Matlab-based |
- | Here I present | + | After digging through FFmpeg documentation [(https:// |
- | ===== Program listing ===== | + | I have to say FFmpeg is one of my most abused software. Last time I used FFmpeg to upload arbitrary file to Youtube [(https://github.com/ |
- | <code bash> | + | |
- | #!/bin/bash | + | |
- | # The file number counter | + | You can download it at [[https://github.com/fangfufu/make_interval_timer_video]]. |
- | let counter=0 | + | |
- | + | ||
- | function cleanup { | + | |
- | rm seg-*.mp4 filelist.txt | + | |
- | } | + | |
- | + | ||
- | # calling convention:duration text | + | |
- | function segment { | + | |
- | let min=$1/60 | + | |
- | let sec=$1-${min}*60 | + | |
- | ffmpeg -f lavfi -i color=c=white: | + | |
- | -vf " | + | |
- | r=30: x=(w-tw)/2: y=h-h*0.75: fontcolor=black:, | + | |
- | drawtext=text=' | + | |
- | r=30: x=(w-tw)/2: y=h-h*0.5: fontcolor=black:, | + | |
- | drawtext=timecode=' | + | |
- | r=30: x=(w-tw)/2: y=h-h*0.25: fontcolor=black:" | + | |
- | -t ${1} -preset slow -tune stillimage -y \ | + | |
- | seg-${counter}.mp4 | + | |
- | echo "file seg-${counter}.mp4" | + | |
- | let counter++ | + | |
- | } | + | |
- | + | ||
- | function output { | + | |
- | ffmpeg -f concat -i filelist.txt -c copy ${1} | + | |
- | cleanup | + | |
- | } | + | |
- | + | ||
- | cleanup | + | |
- | + | ||
- | segment 300 "Easy, gradually build up" | + | |
- | segment 600 "10 mile TT effort" | + | |
- | segment 15 " | + | |
- | segment 600 " | + | |
- | segment 600 "10 mile TT effort" | + | |
- | segment 20 " | + | |
- | segment 600 " | + | |
- | segment 600 "10 mile TT effort" | + | |
- | segment 25 " | + | |
- | segment 300 "Cool down" | + | |
- | + | ||
- | output UEA-Triathlon-2018-02-07.mp4 | + | |
- | + | ||
- | </ | + | |
===== Example output ===== | ===== Example output ===== | ||
- | [[https:// | + | [[https:// |
public/ffmpeg-based_interval_timer_for_sport_and_exercise.txt · Last modified: 2018/03/31 00:38 by 127.0.0.1