Use ffmpeg native options to do scaling and padding math (#34)
* Use ffmpeg native options to do scaling and padding math * whitespace
This commit is contained in:
parent
4b3527ebef
commit
943489a9fd
12
reStream.sh
12
reStream.sh
@ -142,16 +142,8 @@ $landscape && video_filters="$video_filters,transpose=1"
|
|||||||
# for business). Send a PR is you can get a heigher resolution working.
|
# for business). Send a PR is you can get a heigher resolution working.
|
||||||
if $webcam; then
|
if $webcam; then
|
||||||
video_filters="$video_filters,format=pix_fmts=yuv420p"
|
video_filters="$video_filters,format=pix_fmts=yuv420p"
|
||||||
if $landscape; then
|
video_filters="$video_filters,scale=-1:720"
|
||||||
render_width=$((720 * height / width))
|
video_filters="$video_filters,pad=1280:0:-1:0:#eeeeee"
|
||||||
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"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# set each frame presentation time to the time it is received
|
# set each frame presentation time to the time it is received
|
||||||
|
Loading…
x
Reference in New Issue
Block a user