- Detect file extension. There are a couple of options: - It could be an image, if so check if image extension has transparency - It could be a GIF, assume it has transparency and use png. - It could be a video, if its a video do these: - `ffprobe -v error -select_streams v:0 -show_entries stream=pix_fmt -of csv=p=0 [input_file]` - If it has alpha data, use png - If it doesnt, use jpg - ffprobe should only be ran if the cache was not found
ffprobe -v error -select_streams v:0 -show_entries stream=pix_fmt -of csv=p=0 [input_file]