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...
This example works for me:
where "title" means actual title of a target window.
Hope this will help.
It has mentioned in here:
And you can see in here that there are these registery options:
ffmpeg -rtbufsize 1500M -f dshow -i audio="virtual-audio-capturer" -f gdigrab -framerate 30 -draw_mouse 1 -i title=RecordWindow -pix_fmt yuv420p -profile:v baseline -y Huangbaohua.mp4
the RecordWindow is the title of a specified window.
I used this to record the prompt
But it works only with 100x20 (colxrow) fo the prompt or other divisible screen size, otherwise it gives me an error, this:
P.S.: I have this problem also with other windows that has not even width or height. I created a window with tkinter in Python and I get the error, then I gave the window some geometry (300x500) and it worked...
Strangely, the mouse is a little offset...