bash – 使用终端的VLC屏幕捕获

前端之家收集整理的这篇文章主要介绍了bash – 使用终端的VLC屏幕捕获前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我试图捕获我的屏幕作为视频,发现VLC可能是最好的解决方案.我要做的是使用终端捕获特定应用程序,然后停止捕获.现在,我可以使用以下命令捕获终端:
/Applications/VLC.app/Contents/MacOS/VLC -I dummy screen:// --screen-fps=25 --quiet --sout "#transcode{vcodec=h264,vb072}:standard{access=file,mux=mp4,dst="Desktop/vlc-output-terminal.mp4"}"

这很棒,它的作品.问题是,如何使用终端退出录音?现在,我必须在终端上执行Control C才能退出.我看过vlc://在线退出,但我不知道如何使用该命令.

还有没有人知道是否可以使用VLC捕获特定的应用程序,还是整个屏幕是唯一的选择?

@H_301_8@
录制时如何不退出

Ctrl C杀死进程(在这种情况下为VLC),信号为SIGINT.

当您捕获屏幕时,vlc://退出选项将不起作用,因为流是永无止境的源.

正确的方式 – RC (Remote Control)

您可以使用TCP套接字或UNIX套接字连接到VLC.

> TCP套接

To be able to remote connect to your VLC using a TCP socket (telnet-like connetion),use –rc-host your_host:port. Then,by connecting (using telnet or netcat) to the host on the given port,you will get the command shell.

> UNIX套接

To use a UNIX socket (local socket,this does not work for Windows),use –rc-unix /path/to/socket. Commands can then be passed using this UNIX socket.

要启用VLC的remote control接口,您需要添加选项

--extraintf rc --rc-quiet

如何退出

> TCP套接

回声退出| nc your_host端口
> UNIX套接

回声退出| nc -U / path / to / socket

>执行VLC

vlc \
screen:// --one-instance \
-I dummy --dummy-quiet \
--extraintf rc \
--rc-host localhost:8082 \
--rc-quiet \
--screen-follow-mouse \
--screen-mouse-image="mouse_pointer.png" \
--screen-left=0 --screen-top=0 --screen-width=800 --screen-height=600 \
--no-video :screen-fps=15 :screen-caching=300 \
--sout "#transcode{vcodec=h264,vb=800,fps=5,scale=1,acodec=none}:duplicate{dst=std{access=file,dst='/Videos/screen.mp4'}}"

>正常关闭VLC

echo quit | nc localhost 8082

如果您的计算机上没有nc (netcat),也可以使用下面的Python代码.

import socket
s = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
s.connect(('localhost',8082))
s.sendall('quit\n')
s.shutdown(socket.SHUT_WR)

如何捕获具体应用

您不能选择要记录的应用程序,但可以指定子画面的坐标,宽度和高度.

Options

> –screen-top integer子菜单的顶边坐标.默认值:0> –screen-left integer子菜单的左边缘坐标.默认值:0> –screen-width integer子菜单的宽度.默认值:<全屏宽>> –screen-height integer子菜单的高度.默认值:<全屏高>

原文链接:https://www.f2er.com/bash/383940.html

猜你在找的Bash相关文章