| Both sides previous revisionPrevious revisionNext revision | Previous revision |
| ffmpeg_notes [2021-06-02 08:01] – nik | ffmpeg_notes [2023-08-27 12:27] (current) – [general exploration] nik |
|---|
| ==== Ffmpeg - various notes ==== | ==== Ffmpeg - various notes ==== |
| | |
| | ==== general exploration ==== |
| | |
| | [[https://ffmpeg.lav.io/|FFmpeg Explorer]] is a tool to help you explore FFmpeg filters. |
| |
| ==== add audio track to a video ==== | ==== add audio track to a video ==== |
| ''for file in `/bin/ls -1`; do ffmpeg -i $file -filter "setpts=6.0*PTS" -r 30 -an $file.30fps.mp4 ; done'' | ''for file in `/bin/ls -1`; do ffmpeg -i $file -filter "setpts=6.0*PTS" -r 30 -an $file.30fps.mp4 ; done'' |
| |
| ====video -> image sequence==== | ====video → image sequence==== |
| |
| ...timelapsed (1 frame every 4 seconds) | ...timelapsed (1 frame every 4 seconds) |
| ''ffmpeg -i IMG_4566.MOV -r 0.25 IMG_4566_seq/output_%05d.png'' | ''ffmpeg -i IMG_4566.MOV -r 0.25 IMG_4566_seq/output_%05d.png'' |
| |
| | ====image sequence → video==== |
| | |
| | ''ffmpeg -i %05d.jpg -c:v libx265 -r 25 out.mkv'' |
| ==== concat ==== | ==== concat ==== |
| |
| a list of files (e.g. named files.txt)\\ | create a list of files (e.g. named files.txt)\\ |
| ''file 'dust_and_shadow_28min.mp4' ''\\ | ''file 'dust_and_shadow_28min.mp4' ''\\ |
| ''file 'dust_and_shadow_black.mp4' ''\\ | ''file 'dust_and_shadow_black.mp4' ''\\ |
| ''ffmpeg -f concat -i files.txt -c copy dust_and_shadow_30min.mp4'' | ''ffmpeg -f concat -i files.txt -c copy dust_and_shadow_30min.mp4'' |
| |
| also -> https://stackoverflow.com/questions/7333232/how-to-concatenate-two-mp4-files-using-ffmpeg | alternatively, partial automation...\\ |
| | ''ls *.mp4 | while read each; do echo "file '$each'" >> files.txt; done\\ |
| | ffmpeg -f concat -i files.txt -c copy 000-qualia-RN101.mkv'' |
| |
| | also -> https://stackoverflow.com/questions/7333232/how-to-concatenate-two-mp4-files-using-ffmpeg |
| ====ffmpeg filters ==== | ====ffmpeg filters ==== |
| |