How can I determine if a video is of good quality?

Hello.

I was thinking of categorizing HD clips into a folder and thought it could be done using the function below. The function returns the width and height of a video, so I thought I can use that to add those videos that are 720 or more into that HD folder.

Function: https://developer.mozilla.org/en-US/docs/Web/API/HTMLVideoElement/videoHeight

Does this work, or have I forgot to think about something else?
For example, if you have stretched / re-encoded a video to 720, then this will not be a good method for finding videos with good quality I guess.

Best regards
Neo

Hi @qrazyneo1, if you want to be really sure perhaps ffmpeg should come to the rescue but you will need a server to handle it. Otherwise you may be able to find a somewhat reliable formula combining resolution, file size and duration.

Hello Andres.
Thanks for your reply.

I took a look at it but have some trouble getting stderr into a text file.

The code below works from shell / promt, but not when I run it through php. However, it works through php if I ignore “2> out.txt”, which is the line that writes the output to the text file. (So it’s necessary)

exec(“C:/FFmpeg/bin/ffmpeg -i mypath-in -f mp4 -vcodec libx264 -preset ultrafast -profile:v main -acodec aac mypath-out 2> out.txt”)

Im using windows and apache/xampp has permission to everything (i guess) :slight_smile: