Created
          May 29, 2025 18:01 
        
      - 
      
- 
        Save virtuosonic/50cc54995eae07e22facbe6bd995df75 to your computer and use it in GitHub Desktop. 
    compress video with ffmpeg
  
        
  
    
      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 | |
| # check $1 and $2 | |
| if [ -z "$1" ] || [ -z "$2" ]; then | |
| echo "Usage: $0 <input_file> <output_file>" | |
| exit 1 | |
| fi | |
| # check if $1 is a file | |
| if [ ! -f "$1" ]; then | |
| echo "Error: $1 is not a file" | |
| exit 1 | |
| fi | |
| ffmpeg -i $1 -c:v libx264 -crf 18 -preset veryslow -c:a copy $2 | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment