Created
          May 29, 2025 18:04 
        
      - 
      
- 
        Save virtuosonic/de3738762b3c43a9881aed34d76497e2 to your computer and use it in GitHub Desktop. 
    compress video with ffmpeg h265
  
        
  
    
      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 -vcodec libx265 -crf 18 -tag:v hvc1 -preset veryslow $2 | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment