Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| tips:video [2018/04/03 20:10] – [camera motion] scipio | tips:video [2020/09/02 15:59] (current) – [from images to video] scipio | ||
|---|---|---|---|
| Line 26: | Line 26: | ||
| < | < | ||
| # 5 images per seconds | # 5 images per seconds | ||
| - | ffmpeg -y -framerate 5 -pattern_type glob -i ' | + | ffmpeg -y -framerate 5 -pattern_type glob -i ' |
| </ | </ | ||
| + | |||
| + | |||
| + | < | ||
| + | ffmpeg -r 30 -s 1080x1080 -i imgs/ | ||
| + | </ | ||
| + | * crf: quality, minor is better | ||
| + | |||
| + | ===== from video to images ===== | ||
| + | |||
| + | |||
| + | < | ||
| + | ffmpeg -i input.mp4 -qscale:v 2 imgs/ | ||
| + | </ | ||
| + | * qscale:v is quality, 2-15 minor is better | ||
| ===== MKV===== | ===== MKV===== | ||
| Line 88: | Line 102: | ||
| < | < | ||
| tomkv file1 file2 ... | tomkv file1 file2 ... | ||
| + | </ | ||
| + | |||
| + | ===== lates ===== | ||
| + | |||
| + | <code bash> | ||
| + | #!/bin/bash | ||
| + | |||
| + | CHATID=$1 | ||
| + | BASEpath='/ | ||
| + | |||
| + | [ -z " | ||
| + | |||
| + | |||
| + | for folder in $(find / | ||
| + | |||
| + | for video in $(find $folder -newer $folder.jpg -name " | ||
| + | i=$(echo " | ||
| + | preview=$BASEpath/ | ||
| + | |||
| + | ago_seconds=$(( $(date +%s) - $(stat -c %Y $video ) )) | ||
| + | if [ $ago_seconds -le 3600 ]; then | ||
| + | ago=" | ||
| + | else | ||
| + | ago=" | ||
| + | fi | ||
| + | echo "video $video is $ago" | ||
| + | |||
| + | ( ffmpeg -i $video -r 0.5 -c:v libx264 -an -t 30 -y $preview </ | ||
| + | ~/ | ||
| + | sleep 1 | ||
| + | done | ||
| + | done | ||
| </ | </ | ||