User Tools

Site Tools


public:ffmpeg-based_interval_timer_for_sport_and_exercise

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
public:ffmpeg-based_interval_timer_for_sport_and_exercise [2018/02/09 18:06] fangfufupublic:ffmpeg-based_interval_timer_for_sport_and_exercise [2018/02/09 18:19] fangfufu
Line 12: Line 12:
 <code bash> <code bash>
 #!/bin/bash #!/bin/bash
 +# Copyright <2017> <Fufu Fang>
 +
 +# Permission is hereby granted, free of charge, to any person obtaining a copy 
 +# of this software and associated documentation files (the "Software"), to deal 
 +# in  the Software without restriction, including without limitation the rights 
 +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 
 +# copies of the Software, and to permit persons to whom the Software is 
 +# furnished to do so, subject to the following conditions:
 +
 +# The above copyright notice and this permission notice shall be included in all 
 +# copies or substantial portions of the Software.
 +
 +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
 +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
 +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
 +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
 +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 
 +# SOFTWARE.
  
 # The content of the set # The content of the set
Line 86: Line 105:
  
 function cleanup { function cleanup {
-    rm seg-*.mp4 filelist.txt intro.txt+    rm -f seg-*.mp4 filelist.txt intro.txt
 } }
  
Line 106: Line 125:
     sec=${2}     sec=${2}
     textNow=${3}     textNow=${3}
-    textNext=$(echo "Next -" ${min}m ${sec}s ${4})+    textNext=$(echo "Next -" ${4})
     ffmpeg -f lavfi -i color=c=white:size=${resolution}:rate=${framerate} \     ffmpeg -f lavfi -i color=c=white:size=${resolution}:rate=${framerate} \
     -vf "\     -vf "\
Line 140: Line 159:
     textNow=$(echo $thisLine|cut -d ' ' -f 2-)     textNow=$(echo $thisLine|cut -d ' ' -f 2-)
  
-    let segNext=${1}+1 +    let nextSeg=${1}+1 
-    textNext=$(echo ${turbo[${segNext}]}|cut -d ' ' -f 2-+    nextLine=$(echo ${turbo[${nextSeg}]}|tr ':' 'm') 
-    videoSegment $min $sec "$textNow" "$textNext"+    videoSegment $min $sec "${textNow}" "${nextLine}"
 } }
 ################################################################################ ################################################################################
public/ffmpeg-based_interval_timer_for_sport_and_exercise.txt · Last modified: 2018/03/31 00:38 by 127.0.0.1