Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to record a specific window using ffmpeg?

Tags:

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?


Edit: 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...

like image 393
Matin Lotfaliee Avatar asked Aug 20 '14 04:08

Matin Lotfaliee


People also ask

How do I record with ffmpeg?

-f x11grab is what actually tells FFmpeg to record your screen. You shouldn't change that. -i :0.0+0,0 is where you specify the x and y offset of the top left corner of the area that you want to record. For example, use :0.0+100,200 to have an x offset of 100 and an y offset of 200.

What is screen capture recorder?

Screen recorder, screen recording software, screencasting software, and screen capture software are different names for the same tool that lets you to record a computer screen's output. While screen capture tools differ in price and functionality, most share several features, such as: adjustable video frame.


1 Answers

This example works for me:

ffmpeg -f gdigrab -framerate 30 -i title="german.avi - VLC media player" -b:v 3M  germ.flv

where "title" means actual title of a target window.

Hope this will help.

like image 95
RdB Avatar answered Sep 21 '22 22:09

RdB