如何使用ffmpeg记录特定窗口? [英] How to record a specific window using ffmpeg?

查看:1547
本文介绍了如何使用ffmpeg记录特定窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用ffmpeg使用以下代码记录窗口:

I use ffmpeg to record a window using this code:

ffmpeg.exe
-f dshow 
-y 
-i video="screen-capture-recorder":audio="virtual-audio-capturer":audio="Microphone (USB Audio Device)" 
-framerate 15 
-vcodec libx264 
-crf 0 
-preset ultrafast 
-acodec pcm_s16le 
-vf crop=Width:Height:Left:Top 
output.flv

但是问题是我可能会移动窗口,这导致记录了我想要的没有窗口的区域.

But the problem is i might move the window, this leads to recording an area without the window i want.

如何捕获能够移动的特定窗口?

How can i capture a specific window that I am able to move it?

我还使用了gdigrab而不是dshow来捕获我的窗口(例如,Skype):

I also used gdigrab to capture my window (Skype for instance) instead of dshow:

ffmpeg.exe
-y
-f dshow
-i audio="virtual-audio-capturer":audio="Microphone (USB Audio Device)"
-f gdigrab
-draw_mouse 0
-i title="Skype"
-framerate 30
-vcodec libx264
-crf 0
-preset ultrafast
-acodec pcm_s16le
output.flv

但是会议是黑的...

But the conference is black...

推荐答案

此处:

默认情况下,它捕获主台式机显示器的全屏" (所有窗户,从那里重叠,如果有vista +,则带有空气,没有 透明窗口(如果非航空).

By default, it captures the "full screen" of the main desktop monitor (all windows, overlapping, from there, with aero if vista+, without transparent windows if non aero).

要进行其他配置,请运行提供的配置设置 实用程序/快捷方式"或在开始运行之前调整注册表设置 (仅限高级用户):

To configure it differently, run the provided "configuration setup utilities/shortcuts" or adjust registry settings before starting a run (advanced users only):

HKEY_CURRENT_USER \ Software \ screen-capture-recorder

HKEY_CURRENT_USER\Software\screen-capture-recorder

具有尊重start_XXX等的DWORD键...(请参阅随附的文件 {installdir} \ configuration_setup_utility \ setup_screen_tracker_params.rb 有关可用的注册表项值的完整列表,请参阅 https: //github.com/rdp/screen-capture-recorder-to-video-windows-free/blob/master/configuration_setup_utility/setup_screen_tracker_params.rb#L9 )

with DWORD keys respected of start_XXX etc …​ (see the included file {installdir}\configuration_setup_utility\setup_screen_tracker_params.rb for the full list of registry key values available, or see https://github.com/rdp/screen-capture-recorder-to-video-windows-free/blob/master/configuration_setup_utility/setup_screen_tracker_params.rb#L9 )

ex:请参阅configuration_setup_utility \ incoming.reg文件(尽管NB 这些值以十六进制表示,所以编辑该文件有点乏味-我 始终只使用regedit或随附的脚本实用程序,而不要 手动进行编辑.)

ex: see configuration_setup_utility\incoming.reg file (though NB that those values are in hex, so editing that file is a bit tedious-- I always just use regedit or the accompanying script utilities and don’t edit it by hand).

要重置"值,请删除其键.

To "reset" a value delete its key.

您可以在 ="nofollow noreferrer">此处:

  • capture_height
  • capture_width
  • start_x
  • start_y
  • default_max_fps
  • stretch_to_width
  • stretch_to_height
  • stretch_mode_high_quality_if_1
  • hwnd_to_track
  • disable_aero_for_vista_plus_if_1
  • track_new_x_y_coords_each_frame_if_1
  • capture_mouse_default_1
  • capture_foreground_window_if_1
  • dedup_if_1
  • millis_to_sleep_between_poll_for_dedupe_changes
  • capture_transparent_windows_includes_mouse_in_non_aero_if_1_causes_annoying_mouse_flicker
  • hwnd_to_track_with_window_decoration
  • capture_height
  • capture_width
  • start_x
  • start_y
  • default_max_fps
  • stretch_to_width
  • stretch_to_height
  • stretch_mode_high_quality_if_1
  • hwnd_to_track
  • disable_aero_for_vista_plus_if_1
  • track_new_x_y_coords_each_frame_if_1
  • capture_mouse_default_1
  • capture_foreground_window_if_1
  • dedup_if_1
  • millis_to_sleep_between_poll_for_dedupe_changes
  • capture_transparent_windows_including_mouse_in_non_aero_if_1_causes_annoying_mouse_flicker
  • hwnd_to_track_with_window_decoration

这篇关于如何使用ffmpeg记录特定窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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