如何使用FFMPEG捕获浏览器的选项卡内容 [英] How to use FFMPEG to capture a browser's tab content

查看:489
本文介绍了如何使用FFMPEG捕获浏览器的选项卡内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在一个项目中,我需要记录将在不同浏览器的选项卡中播放的HTML5动画.

I'm working on a project where I need to record HTML5 animations that are going to play in different browser's tabs.

所以我已经读了一点,显然可以使用FFMPEG来完成,也许可以使用gdigrab设备来完成: https://www.ffmpeg.org/ffmpeg-devices.html#gdigrab

So I've been reading a bit, and apparently it could be done using FFMPEG, maybe using the gdigrab device: https://www.ffmpeg.org/ffmpeg-devices.html#gdigrab

您甚至可以从特定窗口抓取(例如,使用title = Calculator 记录像calc.exe)

Where you can even grab from a specific window (like record calc.exe using title=Calculator)

我想使用此逻辑来捕获多个浏览器选项卡中的每个内容. (或至少一个),但我不知道Firefox/Chrome标签的标题"或它们是否甚至可以用作Windows.

I want to use this logic to capture each of the multiple browser tabs contents. (or at least one) But I don't know the Firefox/Chrome tabs "title" or if they even work as windows.

我还需要录制音频,所以我需要将计算机的输出设备与选项卡中的视频混合使用.

I'd also need to record audio, so I would need to either mix the computer's output device with the video from the tab.

如果有人对我该如何做有更多的信息,我将不胜感激.

If anyone has more information on how I could do this, I would greatly appreciate it.

谢谢

推荐答案

选项卡位于浏览器的应用程序逻辑中,因此我认为您不能将选项卡作为目标.如果将选项卡作为单独的窗口分离,则可以捕获它.您需要显示在任务管理器中的字符串.这是窗口标题.

Tabs are within the browser's application logic so I don't think you can target a tab. If you detach the tab as a separate window, you can capture it. You need the string that shows up in Task Manager. This is the Window Title.

首次运行tasklist /v /fi "imagename eq firefox.exe" /fo list | findstr Window

这将产生一组由firefox.exe控制的所有单独窗口的行

This will produce a set of lines of all the separate windows controlled by firefox.exe

假设您要捕获当前页面,则findstr输出为

Suppose you wanted to capture this current page, the findstr output would be

Window Title: firefox - How to use FFMPEG to capture a browser's tab content - Stack Overflow - Mozilla Firefox

然后运行

ffmpeg -f gdigrab -i title="firefox - How to use FFMPEG to capture a browser's tab content - Stack Overflow - Mozilla Firefox" -pix_fmt yuv420p tabgrab.mp4

您可以在录制时移动窗口,但是如果您调整窗口大小,录制将在该点结束.如果该窗口中还有其他选项卡,而您切换到它们,则它们将被捕获.因此,最好将所需的选项卡隔离到其自己的窗口中.

You can move the window while recording but if you resize it, the recording will end at that point. If there are other tabs in that window, and you switch to them, they will get captured. So, best to isolate the desired tab into its own window.

对于音频,您将需要使用 directshow 输入设备.请参阅文档以及有关如何列出它们的示例.

For audio, you will need to use a directshow input device. See docs and the examples on how to list them.

这篇关于如何使用FFMPEG捕获浏览器的选项卡内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆