Last active
December 7, 2021 02:46
-
-
Save orm011/226fc7ab8f26c9bb659a16432153812f to your computer and use it in GitHub Desktop.
ffmpeg recipe
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cheaply convert container only, given compatible internal codecs | |
ffmpeg -i ../panama_loop/WtoxxHADnGk_0820.ts -map 0 -c copy WtoxxHADnGk_0820.mp4 | |
# extract every 150th frame (5s) (random ordering of files). jpeg preserve quality | |
ls ../panama_loop_mp4/ | shuf | xargs -L 1 -I {} -P 20 bash -c "mkdir -p {} && ffmpeg -i ../panama_loop_mp4/{} -vf 'select=not(mod(n\,150))' -q:v 2 {}/frame_%06d.jpg" | |
## need to add -vsync vpf above to avoid the same frame showing up multiple times | |
ls ../panama_loop_mp4/ | shuf | xargs -L 1 -I{} -P 120 bash -c "mkdir -p {} && ffmpeg -filter_threads 1 -i ../panama_loop_mp4/{} -threads 1 -vf 'select=not(mod(n\,300)), scale=1008:-1' -vsync vfr -f image2 -q:v 2 -threads 1 -an {}/frame_%06d.jpg" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment