From f1cb66b66392a980e1513efe8d75799b9c2d52d0 Mon Sep 17 00:00:00 2001 From: Murph Finnicum Date: Wed, 23 Dec 2020 06:04:51 -0800 Subject: [PATCH] Use ffmpeg native options to do scaling and padding math (#34) * Use ffmpeg native options to do scaling and padding math * whitespace --- reStream.sh | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/reStream.sh b/reStream.sh index 2309648..83015fd 100755 --- a/reStream.sh +++ b/reStream.sh @@ -148,16 +148,8 @@ $landscape && video_filters="$video_filters,transpose=1" # for business). Send a PR is you can get a heigher resolution working. if $webcam; then video_filters="$video_filters,format=pix_fmts=yuv420p" - if $landscape; then - render_width=$((720 * height / width)) - else - render_width=$((720 * width / height)) - fi - - # center - offset_left=$(((1280 - render_width) / 2)) - video_filters="$video_filters,scale=${render_width}x720" - video_filters="$video_filters,pad=1280:720:$offset_left:0:#eeeeee" + video_filters="$video_filters,scale=-1:720" + video_filters="$video_filters,pad=1280:0:-1:0:#eeeeee" fi # set each frame presentation time to the time it is received