Linux: How to list all video files with exactly 720p resolution

command linefindlinuxresolutionvideo

I have several video files with different resolutions. Now I want to list only the video filenames with e.g. 720p resolution. I prefer one liners on the bash command line and I can receive helpful video informations including resolution when I execute:

avconv -i video.mp4

but this combination:

find -exec sh -c 'if [[ "$(avconv -i {}") == *720* ]] ; then echo 720 found; fi;'

produces the error: exec – missing argument.

I'm honest, I have hardly fights with bash command structures, especially combined commands.
So, what is wrong in my combined command string?

Thank you.

Best Answer

Maybe this command accommplishes what you are looking for:

for i in *.mp4; do if [[ $(avconv -i $i) =~ .*720.* ]]; then echo $i; fi; done
Related Question