11-08-2022 08:08 AM
For me I use something like:
ffmpeg -f gdigrab -framerate 30 -i desktop output.mkv -f mjpeg tcp://127.0.0.1:7000
I then control it through a library that I found on LAVAG called Net_Proc which allows you to read stdout whilst the process is still running
https://lavag.org/topic/21111-interactive-command-line-using-net/
That will also allow you to kill the ffmpeg process (Although it can be a bit of a pain sometimes).
I am not an ffmpeg expert but I don't think you can pause a recording, but if ffmpeg does monitor stdin for commands you may be able to send those. If not you would have to modify ffMPEG and compile it yourself.
11-08-2022 11:25 AM - edited 11-08-2022 11:31 AM
@Worle wrote:
For me I use something like:
ffmpeg -f gdigrab -framerate 30 -i desktop output.mkv -f mjpeg tcp://127.0.0.1:7000
I then control it through a library that I found on LAVAG called Net_Proc which allows you to read stdout whilst the process is still running
https://lavag.org/topic/21111-interactive-command-line-using-net/
That will also allow you to kill the ffmpeg process (Although it can be a bit of a pain sometimes).
I am not an ffmpeg expert but I don't think you can pause a recording, but if ffmpeg does monitor stdin for commands you may be able to send those. If not you would have to modify ffMPEG and compile it yourself.
Thanks for your answer. When I record directly via cmd with the command you shared above, I get 16 FPS video recording with 2 screens.If the recording speed is sufficient, then stopping and status querying can be mentioned. But now recording in mp4, mkv format with ffmpeg does not output at the desired speed. Here is the problem. Is this normal ? This Fps rate is not enough. With the example shared by Andrey_Dmitriev , 30 FPS video was recorded for 2 screens.A video recording that can output 30 FPS with 3 screens is required. Even if it records without preview, it is still sufficient.
Of course I have to say this. I've been testing with different screen recorders. It is best done with OBS studio. But here is a detail.
-When I record with Obs studio, the video output covers 3 screens. But the output is frame width:4000 height:560.
-ffmpeg gdigrab video output frame width:5206 height:1246. I think this has an effect on the low FPS we get. I think it is necessary to scale the video output when recording with ffmpeg gdigrab. This way it can gain better performance.
11-08-2022 11:49 PM
@constructionworker wrote:
But now recording in mp4, mkv format with ffmpeg does not output at the desired speed. Here is the problem. Is this normal ? This Fps rate is not enough. With the example shared by Andrey_Dmitriev , 30 FPS video was recorded for 2 screens.A video recording that can output 30 FPS with 3 screens is required.
OBS Studio is open source, so theoretically we can tke a look inside and check how recording is performed.
Just curios which codec was used in OBS Studio? Can you please check the video (which meet you requirement) with Media Info?
https://mediaarea.net/en/MediaInfo
Switch to text and share info:
And your monitors configuration - are they the same in dimentions and scaling, and connected to the same graphic adapter?
I was able to get DirectX based capture in LabVIEW as well (https://github.com/WindowsNT/ScreenCapture), but I don't think it is suitable for you, because can capture the only one monitor and not the entire desktop. I will clean up my fork a little bit if time permit, then share.
The 30 FPS written to the Frame rate property is just info for player and to compute duration, but not reflect real recorded rate. Its same in LabVIEW - you can set up any FPS you like. If 30 FPS written, but captured with 15 FPS, then the video will be played twice faster, nothing more.
And are you really sure that you have in OBS Studio 30 FPS for entire desktop? How did you check this? I mean you should have test app, which will display some reference info (like frame number) on the screen at 60 FPS, then capture it and check captured video frame by frame to be sure that every second frame is captured.
11-09-2022 12:28 AM - edited 11-09-2022 12:38 AM
@Andrey_Dmitriev wrote:Just curios which codec was used in OBS Studio? Can you please check the video (which meet you requirement) with Media Info?
https://mediaarea.net/en/MediaInfo
Switch to text and share info:
I've recorded an example below.
And your monitors configuration - are they the same in dimentions and scaling, and connected to the same graphic adapter?
All monitor settings in both recording types are the same.It is connected to the same graphic adapter.only obs studio is set as follows when recording.
The canvas was adjusted to fit all screens, but the video recording output size was made smaller as below. Obs studio already required different settings to adjust the larger screen recording output.
I was able to get DirectX based capture in LabVIEW as well (https://github.com/WindowsNT/ScreenCapture), but I don't think it is suitable for you, because can capture the only one monitor and not the entire desktop. I will clean up my fork a little bit if time permit, then share.
Yes I need precision multiscreen recording.
The 30 FPS written to the Frame rate property is just info for player and to compute duration, but not reflect real recorded rate. Its same in LabVIEW - you can set up any FPS you like. If 30 FPS written, but captured with 15 FPS, then the video will be played twice faster, nothing more.
Yes,absolutely.
And are you really sure that you have in OBS Studio 30 FPS for entire desktop? How did you check this? I mean you should have test app, which will display some reference info (like frame number) on the screen at 60 FPS, then capture it and check captured video frame by frame to be sure that every second frame is captured.
I opened the stopwatch application and recorded a video and then I moved the video frame by frame with the media player. When I have a different photo for each frame and 1000(ms)/30(fps)=3.3ms for each frame in the stopwatch, the recording is 30 FPS.This is a analyze app 🙂