A
Austin Songer, CISSP
Guest
- Thread Author
- #1
gistfile1.txt
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
Show hidden characters
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
Show hidden characters
| /** |
| Scaling |
| - Scale can be used as is which will set the height to 560 but keep aspect ratio for width. |
| - Other options include setting both with & height |
| - Watch out for sizing errors when not divisible by 2 |
| **/ |
| /** MP4 1st pass **/ |
| ffmpeg -i input.mov -vcodec libx264 -vprofile high -preset veryslow -b:v 225k -maxrate 300k -bufsize 1000k -vf scale=-1:560 -threads 2 -pass 1 -an -f mp4 /dev/null |
| /** MP4 with audio 2nd pass **/ |
| ffmpeg -i input.mov -vcodec libx264 -vprofile high -preset veryslow -b:v 225k -maxrate 300k -bufsize 1000k -vf scale=-1:560 -threads 2 -pass 2 -acodec libvo_aacenc -b:a 128k -f mp4 output_file.mp4 |
| /** MP4 without audio 2nd pass **/ |
| ffmpeg -i input.mov -vcodec libx264 -vprofile high -preset veryslow -b:v 225k -maxrate 300k -bufsize 1000k -vf scale=-1:560 -threads 2 -pass 2 -an -f mp4 output_file.mp4 |
| /* Generate single image from first frame of video, scale and save as jpg */ |
| ffmpeg -i input.mov -vframes 1 -vf scale=-1:560 testimg.jpg |
| /** webm 1st pass **/ |
| ffmpeg -i input.mov -codec:v libvpx -quality good -cpu-used 0 -b:v 225k -qmin 10 -qmax 42 -maxrate 300k -bufsize 1000k -threads 2 -vf scale=-1:560 -an -pass 1 -f webm /dev/null |
| /** webm 2st pass with audio **/ |
| ffmpeg -i input.mov -codec:v libvpx -quality good -cpu-used 0 -b:v 225k -qmin 10 -qmax 42 -maxrate 300k -bufsize 1000k -threads 2 -vf scale=-1:560 -codec:a libvorbis -b:a 128k -pass 2 -f webm output.webm |
| /** webm 2st pass without audio **/ |
| ffmpeg -i input.mov -codec:v libvpx -quality good -cpu-used 0 -b:v 225k -qmin 10 -qmax 42 -maxrate 300k -bufsize 1000k -threads 2 -vf scale=-1:560 -pass 2 -f webm output.webm |