ffmpeg -i input.mp4 -vf "crop=500:300:0:0" -c:v libx264 -crf 0 -c:a copy output.mp4
Where the crop
option is of the form: w:h:x:y
.
General notes on using and scripting Bash.
Here's a nice article on the topic of argument parsing in Bash: Bash: Argument Parsing
From the article:
#!/bin/bash | |
# Get a list of GPUs in a system | |
# | |
# Useful nvidia-smi Queries | |
# https://nvidia.custhelp.com/app/answers/detail/a_id/3751/~/useful-nvidia-smi-queries | |
# Get GPU names as a bach array, replace spaces with underscores | |
gpu_names=($(nvidia-smi --query-gpu=gpu_name --format=csv,noheader | tr -s ' ' '_')) | |
for name in "${gpu_names[@]}" |
Get the EC2 instance type from within an EC2 instance.
Modified from Getting the AWS instance ID from within the EC2 instance.
curl http://169.254.169.254/latest/meta-data/instance-type