Created
October 26, 2016 20:19
-
-
Save jpriebe/9acdc3beb50547449bd47f4fb46de214 to your computer and use it in GitHub Desktop.
Example script to encode video from a Decklink Mini Recorder using h264_qsv
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
#!/bin/sh | |
cat << EOF > test.filter-script | |
[0:v]kerndeint,format=pix_fmts=nv12,split=2[split1-1][split1-2]; | |
[split1-1]scale=-2:720,split=3[scale-720-1][scale-720-2][scale-720-3]; | |
[split1-2]scale=-2:540,split=2[scale-540-1][scale-540-2]; | |
[scale-720-1]fps=1/60[stills-1]; | |
[0:a]asplit=4[audio-1][audio-2][audio-3][audio-4] | |
EOF | |
/usr/bin/ffmpeg \ | |
-probesize 10000k \ | |
-r 30000/1001 \ | |
-f decklink -i 'DeckLink Mini Recorder (1)@11' -y \ | |
-filter_complex_script test.filter-script \ | |
-map '[scale-720-2]' -map '[audio-1]' \ | |
-pix_fmt yuv420p \ | |
-c:v h264_qsv -profile:v baseline -preset veryfast \ | |
-b:v 2200k -minrate 2200k -maxrate 2200k \ | |
-c:a aac -ac 2 -b:a 192k -ar 44100 \ | |
-flags +global_header 'test-high.mp4' \ | |
-map '[stills-1]' \ | |
-updatefirst 1 \ | |
-qscale:v 10 \ | |
'test-still.jpg' \ | |
-map '[scale-720-3]' -map '[audio-2]' \ | |
-pix_fmt yuv420p \ | |
-c:v h264_qsv -profile:v baseline -preset veryfast \ | |
-b:v 4000k -minrate 4000k -maxrate 4000k \ | |
-c:a aac -ac 2 -b:a 320k -ar 44100 \ | |
-flags +global_header 'test-super.mp4' \ | |
-map '[scale-540-1]' -map '[audio-3]' \ | |
-pix_fmt yuv420p \ | |
-c:v h264_qsv -profile:v baseline -preset veryfast \ | |
-b:v 1280k -minrate 1280k -maxrate 1280k \ | |
-c:a aac -ac 2 -b:a 160k -ar 44100 \ | |
-flags +global_header 'test-medium.mp4' \ | |
-map '[scale-540-2]' -map '[audio-4]' \ | |
-pix_fmt yuv420p \ | |
-c:v h264_qsv -profile:v baseline -preset veryfast \ | |
-b:v 416k -minrate 416k -maxrate 416k \ | |
-c:a aac -ac 2 -b:a 96k -ar 44100 \ | |
-flags +global_header 'test-low.mp4' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment