Article 5HB95 Need to detect if a video has black borders

Need to detect if a video has black borders

by
GPGAgent
from LinuxQuestions.org on (#5HB95)
I can detect the black borders on a video and create a crop= parameter for ffmpeg like this:Code:# detect the cropping parameters
FFREPORT=file=CROPDATA.txt:level=32 ffmpeg -hide_banner -loglevel quiet -ss $1 -i $2 -vframes 2 -vf "cropdetect=24:16:0" -f null -

# Extract the cropping paramaters for the -vf switch
CROP=`awk '/crop=/ {print $14}' CROPDATA.txt`
This works just fine Code:$ echo $CROP
crop=976:720:156:0What I want to do is to check the last two crop parameters x and y and if both are zero the vdio has no black borders.

How can I extract these two values, 156 and 0.

What i would do is add these together and if their sum is zero then there is no border. If it's greater thatn one there is a border and my script can take the appropriate action

Seems simple, but I can't figure it out!latest?d=yIl2AUoC8zA latest?i=VaCJf8wd7wU:jfnpTVXibnU:F7zBnMy latest?i=VaCJf8wd7wU:jfnpTVXibnU:V_sGLiP latest?d=qj6IDK7rITs latest?i=VaCJf8wd7wU:jfnpTVXibnU:gIN9vFwVaCJf8wd7wU
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments