I have a heterogenous set of videos (codecs, dimensions, size) that I would like to crop off the top using ffmpeg. I've used this code successfully for year without any trouble (example here crops off 64px):
ffmpeg -i in.avi -y -pix_fmt yuv420p -an -qscale 1 -vcodec libx264 -vf crop=in_w:in_h-64:0:64 out.mp4
However, I've now run into a case that it does not work correctly, and I suspect it has something to do with SAR and DAR. I have a clip that shows pixel dimensions of 960x720 [SAR 960:720 DAR 16:9], original looks close to this:
When I use the above command, I end up with a video that ffprobe/ffmpeg says is 960x656 [SAR 4:3 DAR 80:41], but when I view it on a web browser or quicktime it is displayed as 1280x656:
How can I modify the command to account for this use case, without breaking the cropping of all other clips? Here's what I've unsuccessfully tried:
ffmpeg -i in.avi -y -pix_fmt yuv420p -an -qscale 1 -vcodec libx264 -vf scale=960:656,setsar=1 -vf crop=in_w:in_h-64:0:64 out.mp4
ffmpeg -i in.avi -y -pix_fmt yuv420p -an -qscale 1 -vcodec libx264 -vf setsar=sar=0 -vf setdar=dar=0 -vf crop=in_w:in_h-64:0:64 out.mp4