List every video file's codec

Introduction

Use this script to list every file in the directory, and it’s video codec. Try sending the stdout to a file to view the info in a spreadsheet.

Script

#!/bin/bash

# Field seperator fix for file names with spaces
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")

# Loop through every file
for file in $(ls)
do
	echo $file "|" $(ls -l --block-size=G $file | awk '{print $5}')  "|" $(ffprobe -v error -select_streams v:0 -show_entries stream=codec_name -of default=noprint_wrappers=1:nokey=1 $file)
done

IFS=$SAVEIFS