-
-
Save sgwd/158d85f51be0366b6f5a858e5e59f5e8 to your computer and use it in GitHub Desktop.
Revisions
-
billmei revised this gist
Jan 3, 2019 . 1 changed file with 12 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,15 @@ ### Convert sequence of GoPro Hero 6 Black JPEG images to MKV / MP4 video ``` ffmpeg \ -r 30000/1001 \ -pattern_type glob -i '*.JPG' \ -vf "crop=in_w:in_w*9/16,scale=3840:-2" \ -sws_flags lanczos \ -pix_fmt yuv420p \ -vcodec libx264 \ -crf 18 -preset slow \ output.mkv ``` - `-r 30000/1001` - 30 fps frame rate. Why divide by 1001? See [drop-frame timecode](https://en.wikipedia.org/wiki/SMPTE_timecode#Drop-frame_timecode). @@ -17,4 +25,6 @@ ffmpeg -r 30000/1001 -pattern_type glob -i '*.JPG' -vf "crop=in_w:in_w*9/16,scal This is not required as long as you use the `crop` option in `ffmpeg`, but is included for reference in case you want to crop the images with ImageMagick first before feeding them into `ffmpeg` (this is slower than using `ffmpeg` directly). ``` find . -name '*.JPG' -exec convert {} -resize '1920x1080^' -gravity center -crop '1920x1080+0+0' "{}_cropped.jpg" \; ``` -
billmei revised this gist
Jan 3, 2019 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,8 @@ ### Convert sequence of GoPro Hero 6 Black JPEG images to MKV / MP4 video ``` ffmpeg -r 30000/1001 -pattern_type glob -i '*.JPG' -vf "crop=in_w:in_w*9/16,scale=3840:-2" -sws_flags lanczos -pix_fmt yuv420p -vcodec libx264 -crf 18 -preset slow output.mkv ``` - `-r 30000/1001` - 30 fps frame rate. Why divide by 1001? See [drop-frame timecode](https://en.wikipedia.org/wiki/SMPTE_timecode#Drop-frame_timecode). - `-pattern_type glob -i '*.JPG'` - all JPG files in the current directory. Note this is case sensitive. -
billmei revised this gist
Jan 3, 2019 . 1 changed file with 5 additions and 4 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,17 +1,18 @@ ### Convert sequence of GoPro Hero 6 Black JPEG images to MKV / MP4 video `ffmpeg -r 30000/1001 -pattern_type glob -i '*.JPG' -vf "crop=in_w:in_w*9/16,scale=3840:-2" -sws_flags lanczos -pix_fmt yuv420p -vcodec libx264 -crf 18 -preset slow output.mkv` - `-r 30000/1001` - 30 fps frame rate. Why divide by 1001? See [drop-frame timecode](https://en.wikipedia.org/wiki/SMPTE_timecode#Drop-frame_timecode). - `-pattern_type glob -i '*.JPG'` - all JPG files in the current directory. Note this is case sensitive. - `-vf "crop=in_w:in_w*9/16,scale=3840:-2"` - 4k UHD. GoPro captures in 4000x3000, so need to crop it to 16:9 resolution. Change `3840` to `1920` if you want HD 1080p resolution. - `-sws_flags lanczos` - I want to scale Gaussian or lanczos, I think it’s better than bicubic. - `-pix_fmt yuv420p` - Required to support Quicktime. - `-vcodec libx264` - everyone is using this codec - but why? - `-crf 18 -preset slow` - Add this for better quality output. - `output.mkv` - Output filename. Change to `.mp4` if you want MP4. ### Bulk convert JPGs to 1920x1080, centered This is not required as long as you use the `crop` option in `ffmpeg`, but is included for reference in case you want to crop the images with ImageMagick first before feeding them into `ffmpeg` (this is slower than using `ffmpeg` directly). `find . -name '*.JPG' -exec convert {} -resize '1920x1080^' -gravity center -crop '1920x1080+0+0' "{}_cropped.jpg" \;` -
billmei revised this gist
Jan 3, 2019 . 1 changed file with 5 additions and 11 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,23 +1,17 @@ ### Convert sequence of GoPro Hero 6 Black JPEG images to MKV / MP4 video #### MKV is an open standard, so I prefer that to MP4, it does also seem to play back 4k 60 fps less choppy. `ffmpeg -r 30000/1001 -pattern_type glob -i '*.JPG' -vf "crop=in_w:in_w*9/16,scale=3840:-2" -sws_flags lanczos -pix_fmt yuv420p -vcodec libx264 -crf 18 -preset slow output.mkv` - `-r 30000/1001` - 30 fps frame rate. Why divide by 1001? See [drop-frame timecode](https://en.wikipedia.org/wiki/SMPTE_timecode#Drop-frame_timecode). - `-pattern_type glob -i '*.JPG'` - all JPG files in the current directory. - `-vf "crop=in_w:in_w*9/16,scale=3840:-2"` - 4k UHD. GoPro captures in 4000x3000, so need to crop it to 16:9 resolution. Change `3840` to `1920` if you want HD 1080p resolution. - `-sws_flags lanczos` - I want to scale Gaussian or lanczos, I think it’s better than bicubic. - `-pix_fmt yuv420p` - Seems everyone uses this because quicktime supports only that. - `-vcodec libx264` - everyone is using this codec - but why? - `-crf 18 -preset slow` - Add this for better quality output. ### Bulk convert JPGs to 1920x1080, centered `find . -name '*.JPG' -exec convert {} -resize '1920x1080^' -gravity center -crop '1920x1080+0+0' "{}_cropped.jpg" \;` -
Sybrand revised this gist
Nov 13, 2018 . 1 changed file with 6 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ ### Convert sequence of GoPro Hero 5 Black JPEG images to MKV / MP4 video #### MKV is an open standard, so I prefer that to MP4, it does also seem to play back 4k 60 fps less choppy. `ffmpeg -r 60 -pattern_type glob -i '*.JPG' -vf scale=3840:2160 -sws_flags lanczos -pix_fmt yuv420p -vcodec libx264 -crf 18 -preset slow timelapse_lanczos_crf18_slow.mkv` @@ -14,6 +14,10 @@ MKV is an open standard, so I prefer that to MP4. It does also seem to play back This does give you a "deprecated pixel format" warning. It would be nice to figure out how to get rid of that, but it seems to work fine. #### MP4 `ffmpeg -r 60 -pattern_type glob -i '*.JPG' -vf scale=1920:1080 -sws_flags lanczos -pix_fmt yuv420p -vcodec libx264 -crf 18 -preset slow timelapse_lanczos_crf18_slow_1080.mp4` ### Bulk convert JPGs to 1920x1080, centered `convert input.jpg -resize '1920x1080^' -gravity center -crop '1920x1080+0+0' output.jpg` -
Sybrand revised this gist
Nov 9, 2018 . No changes.There are no files selected for viewing
-
Sybrand revised this gist
Nov 9, 2018 . 1 changed file with 11 additions and 11 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,18 +1,18 @@ ### Convert sequence of GoPro Hero 5 Black JPEG images to MKV video MKV is an open standard, so I prefer that to MP4. It does also seem to play back 4k 60 fps less choppy. `ffmpeg -r 60 -pattern_type glob -i '*.JPG' -vf scale=3840:2160 -sws_flags lanczos -pix_fmt yuv420p -vcodec libx264 -crf 18 -preset slow timelapse_lanczos_crf18_slow.mkv` - `-r 60` - output frame rate. - `-pattern_type glob -i '*.JPG'` - all JPG files in the current directory. - `-vf scale=3840:2160` - 4k UHD. GoPro captures in 4000x3000, but I want to squeeze it into 4k. - `-sws_flags lanczos` - I want to scale Gaussian or lanczos, I think it’s better than bicubic. - `-pix_fmt yuv420p` - Seems everyone uses this because quicktime supports only that. - `-vcodec libx264` - everyone is using this codec - but why? - `-crf 18 -preset slow` - Add this for better quality output. This does give you a "deprecated pixel format" warning. It would be nice to figure out how to get rid of that, but it seems to work fine. ### Bulk convert JPGs to 1920x1080, centered -
porjo revised this gist
Nov 10, 2016 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,9 @@ ### Convert sequence of JPEG images to MP4 video `ffmpeg -r 24 -pattern_type glob -i '*.JPG' -i DSC_%04d.JPG -s hd1080 -vcodec libx264 timelapse.mp4` - `-r 24` - output frame rate - `-pattern_type glob -i '*.JPG'` - all JPG files in the current directory - `-i DSC_%04d.JPG` - e.g. DSC_0397.JPG - `-s hd1080` - 1920x1080 resolution -
porjo revised this gist
Nov 7, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -14,6 +14,6 @@ Add the following after `-vcodec libx264` to achieve better quality output `-crf 18 -preset slow` ### Bulk convert JPGs to 1920x1080, centered `convert input.jpg -resize '1920x1080^' -gravity center -crop '1920x1080+0+0' output.jpg` -
porjo revised this gist
Nov 7, 2016 . 1 changed file with 6 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -11,4 +11,9 @@ Add the following after `-vcodec libx264` to achieve better quality output `-crf 18 -preset slow` ### Bulk JPGs to 1920x1080, centered `convert input.jpg -resize '1920x1080^' -gravity center -crop '1920x1080+0+0' output.jpg` -
Ian Bishop revised this gist
Dec 31, 2014 . 1 changed file with 6 additions and 4 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -2,11 +2,13 @@ `ffmpeg -r 24 -start_number 32 -i DSC_%04d.JPG -s hd1080 -vcodec libx264 timelapse.mp4` - `-r 24` - output frame rate - `-start_number 32` - if filenames don't start at 0000, then specify start number - `-i DSC_%04d.JPG` - e.g. DSC_0397.JPG - `-s hd1080` - 1920x1080 resolution #### Slower, better quality Add the following after `-vcodec libx264` to achieve better quality output `-crf 18 -preset slow` -
Ian Bishop revised this gist
Dec 31, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -7,6 +7,6 @@ `-i DSC_%04d.JPG` - e.g. DSC_0397.JPG `-s hd1080` - 1920x1080 resolution #### Slower, better quality `-crf 18 -preset slow` -
Ian Bishop revised this gist
Dec 31, 2014 . 2 changed files with 12 additions and 6 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ ### Convert sequence of JPEG images to MP4 video `ffmpeg -r 24 -start_number 32 -i DSC_%04d.JPG -s hd1080 -vcodec libx264 timelapse.mp4` `-r 24` - output frame rate `-start_number 32` - if filenames don't start at 0000, then specify start number `-i DSC_%04d.JPG` - e.g. DSC_0397.JPG `-s hd1080` - 1920x1080 resolution # Slower, better quality `-crf 18 -preset slow` 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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +0,0 @@ -
Ian Bishop revised this gist
Dec 31, 2014 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,6 @@ ffmpeg -r 24 -start_number 32 -i DSC_%04d.JPG -s hd1080 -vcodec libx264 timelapse.mp4 # -r 24 - output frame rate # -start_number 32 - if filenames don't start at 0000, then specify start number # -i DSC_%04d.JPG - e.g. DSC_0397.JPG # -s hd1080 - 1920x1080 resolution -
Ian Bishop created this gist
Dec 31, 2014 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ ffmpeg -r 24 -start_number 32 -i DSC_%04d.JPG -s hd1080 -vcodec libx264 timelapse.mp4 # -r 24 - output frame rate # -i DSC_%04d.JPG - e.g. DSC_0397.JPG # -s hd1080 - 1920x1080 resolution