我这里有一条管道,我在一个窗口中运行两个流。我希望该窗口大小增加并占据全屏,以防止视频中发生裁剪。我怎样才能实现这个目标?
/usr/bin/gst-launch-1.0 -e videomixer name=mix background=0 sink_1::xpos=0 sink_1::ypos=0 sink_2::xpos=500 sink_2::ypos=0 ! autovideosink uridecodebin uri=https://gstreamer.freedesktop.org/data/media/sintel_trailer-480p.webm ! videoscale ! video/x-raw,width=500,height=400 ! mix.sink_1 uridecodebin uri=https://gstreamer.freedesktop.org/data/media/sintel_trailer-480p.webm ! videoscale ! video/x-raw,width=500,height=400 ! mix.sink_2
我预计更改单个流的尺寸会增加整个窗口的大小,但它只会裁剪视频。我该如何解决这个问题?
做出回答,因为评论不允许这么多字符......
对于 Linux 情况,您可以获取当前的屏幕分辨率并尝试将输出重新调整为该分辨率,例如:
WIDTH=$(xrandr | grep '*' | tr -s ' ' |&tee | cut -d' ' -f2 | cut -d'x' -f1)
HEIGHT=$(xrandr | grep '*' | tr -s ' ' |&tee | cut -d' ' -f2 | cut -d'x' -f2)
echo $WIDTH $HEIGHT
gst-launch-1.0 -e \
uridecodebin uri=https://gstreamer.freedesktop.org/data/media/sintel_trailer-480p.webm ! queue ! videoscale ! video/x-raw,width=500,height=400 ! mix.sink_0\
uridecodebin uri=https://gstreamer.freedesktop.org/data/media/sintel_trailer-480p.webm ! queue ! videoscale ! video/x-raw,width=500,height=400 ! mix.sink_1\
videomixer name=mix\
sink_0::xpos=0 sink_0::ypos=0 sink0::width=500 sink_0::height=400\
sink_1::xpos=500 sink_1::ypos=0 sink1::width=500 sink_1::height=400\
! video/x-raw,width=1000,height=400,pixel-aspectio=1/1 ! videoconvert ! videoscale ! video/x-raw,width=$WIDTH,height=$HEIGHT ! xvimagesink
# Example for NVIDIA platform case (Jetson):
gst-launch-1.0 -e \
uridecodebin uri=https://gstreamer.freedesktop.org/data/media/sintel_trailer-480p.webm ! queue ! nvvidconv ! video/x-raw,width=500,height=400 ! mix.sink_0\
uridecodebin uri=https://gstreamer.freedesktop.org/data/media/sintel_trailer-480p.webm ! queue ! nvvidconv ! video/x-raw,width=500,height=400 ! mix.sink_1\
videomixer name=mix\
sink_0::xpos=0 sink_0::ypos=0 sink0::width=500 sink_0::height=400\
sink_1::xpos=500 sink_1::ypos=0 sink1::width=500 sink_1::height=400\
! video/x-raw,width=1000,height=400,pixel-aspectio=1/1 ! nvvidconv ! "video/x-raw(memory:NVMM),format=NV12,width=$WIDTH,height=$HEIGHT" ! nv3dsink