finnal
This commit is contained in:
@@ -378,10 +378,11 @@ void VideoStream()
|
||||
// 静音ffmpeg的统计输出,保留错误;避免污染日志
|
||||
// string commnd = "ffmpeg -nostats -hide_banner -loglevel error -f v4l2 -i /dev/video0 -c:v h264_rkmpp -rtsp_transport tcp -f rtsp rtsp://192.168.12.1:8554/stream 2>/dev/null";
|
||||
string commnd =
|
||||
"VIDEO_SIZE=$(xdpyinfo | awk '/dimensions:/ {print $2}'); "
|
||||
"DISPLAY_VAL=${DISPLAY:-:0.0}; "
|
||||
"export DISPLAY=${DISPLAY:-:0}; "
|
||||
"VIDEO_SIZE=$(DISPLAY=$DISPLAY xdpyinfo 2>/dev/null | awk '/dimensions:/ {print $2}'); "
|
||||
"if [ -z \"$VIDEO_SIZE\" ]; then VIDEO_SIZE=1920x1080; fi; "
|
||||
"ffmpeg -nostats -hide_banner -loglevel error "
|
||||
"-f x11grab -framerate 15 -video_size \"$VIDEO_SIZE\" -i \"$DISPLAY_VAL\" "
|
||||
"-f x11grab -framerate 15 -video_size \"$VIDEO_SIZE\" -i \"$DISPLAY\" "
|
||||
"-c:v h264_rkmpp -b:v 2000k -f rtsp rtsp://192.168.12.1:8554/stream 2>/dev/null";
|
||||
video_proc = bp::child("/bin/bash", bp::args = {"-c", commnd});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user