################################################################################ # I use this commands to encode video for the Stream Video Player which uses # the PHP Pseudo Streaming Technique in order to work. # # This commands work only if you have installed the last FFmpeg and FLVMeta # binaries (executables), if you don’t have them installed you can install # them using this guide: # # http://rodrigopolo.com/about/wp-stream-video/ffmpeg-binary-installers-for-win-mac-and-linux # # This commands have to be typed on the "Terminal" on Linux or Macintosh or # the "Command Prompt" on Windows. # # Please take note that the "#" sign or the "rem" word is used to # comment (ignore) command lines and the "&&" is used to # concatenate (combine) two command lines. # # If you need assistance don’t hesitate to contact me on my website: # http://rodrigopolo.com/contact # ################################################################################ # SD HQ (512kbps) ffmpeg -y -threads 8 -i Input-For-Encoding.mp4 -s 640x352 -aspect 16:9 -r 24 -b 360k -bt 416k -vcodec libx264 -pass 1 -vpre fastfirstpass -an pre-SD-HQ-512kbps.flv && ffmpeg -y -threads 8 -i Input-For-Encoding.mp4 -s 640x352 -aspect 16:9 -r 24 -b 360k -bt 416k -vcodec libx264 -pass 2 -vpre hq -acodec libfaac -ac 2 -ar 44100 -ab 64k pre-SD-HQ-512kbps.flv # HD (2mbps) ffmpeg -y -threads 8 -i Input-For-Encoding.mp4 -s 1280x720 -aspect 16:9 -r 24 -b 1536k -bt 1792k -vcodec libx264 -pass 1 -vpre fastfirstpass -an pre-HD-2Mbps.flv && ffmpeg -y -threads 8 -i Input-For-Encoding.mp4 -s 1280x720 -aspect 16:9 -r 24 -b 1536k -bt 1792k -vcodec libx264 -pass 2 -vpre hq -acodec libfaac -ac 2 -ar 44100 -ab 128k pre-HD-2Mbps.flv # iPhone (This iPhone preset only exists on the FFmpeg installs I give in my site) ffmpeg -y -threads 8 -i Input-For-Encoding.mp4 -s 480x272 -aspect 16:9 -r 24 -vcodec libx264 -pass 1 -b 360k -bt 416k -vpre iphone -f mp4 -an iPhone-512kbps.mp4 && ffmpeg -y -threads 8 -i Input-For-Encoding.mp4 -s 480x272 -aspect 16:9 -r 24 -vcodec libx264 -pass 2 -b 360k -bt 416k -vpre iphone -f mp4 -acodec libfaac -ac 2 -ar 44100 -ab 64k iPhone-512kbps.mp4 # Preview ffmpeg -i Input-For-Encoding.mp4 -ss 78.5 -s 480x272 -vframes 1 -an -f image2 preview.jpg # Inject SD HQ flvmeta pre-SD-HQ-512kbps.flv SD-HQ-512kbps.flv # Inject HD flvmeta pre-HD-2Mbps.flv HD-2Mbps.flv ################################################################################ # Same commands without the "&&" concatenation ################################################################################ # SD HQ (512kbps) ffmpeg -y -threads 8 -i Input-For-Encoding.mp4 -s 640x352 -aspect 16:9 -r 24 -b 360k -bt 416k -vcodec libx264 -pass 1 -vpre fastfirstpass -an pre-SD-HQ-512kbps.flv ffmpeg -y -threads 8 -i Input-For-Encoding.mp4 -s 640x352 -aspect 16:9 -r 24 -b 360k -bt 416k -vcodec libx264 -pass 2 -vpre hq -acodec libfaac -ac 2 -ar 44100 -ab 64k pre-SD-HQ-512kbps.flv # HD (2mbps) ffmpeg -y -threads 8 -i Input-For-Encoding.mp4 -s 1280x720 -aspect 16:9 -r 24 -b 1536k -bt 1792k -vcodec libx264 -pass 1 -vpre fastfirstpass -an pre-HD-2Mbps.flv ffmpeg -y -threads 8 -i Input-For-Encoding.mp4 -s 1280x720 -aspect 16:9 -r 24 -b 1536k -bt 1792k -vcodec libx264 -pass 2 -vpre hq -acodec libfaac -ac 2 -ar 44100 -ab 128k pre-HD-2Mbps.flv # iPhone (This iPhone preset only exists on the FFmpeg installs I give in my site) ffmpeg -y -threads 8 -i Input-For-Encoding.mp4 -s 480x272 -aspect 16:9 -r 24 -vcodec libx264 -pass 1 -b 360k -bt 416k -vpre iphone -f mp4 -an iPhone-512kbps.mp4 ffmpeg -y -threads 8 -i Input-For-Encoding.mp4 -s 480x272 -aspect 16:9 -r 24 -vcodec libx264 -pass 2 -b 360k -bt 416k -vpre iphone -f mp4 -acodec libfaac -ac 2 -ar 44100 -ab 64k iPhone-512kbps.mp4 # Preview ffmpeg -i Input-For-Encoding.mp4 -ss 78.5 -s 480x272 -vframes 1 -an -f image2 preview.jpg # Inject SD HQ flvmeta pre-SD-HQ-512kbps.flv SD-HQ-512kbps.flv # Inject HD flvmeta pre-HD-2Mbps.flv HD-2Mbps.flv