Output file corrupted when recording the screen for a given duration.

About encoding, codec settings, muxers and filter usage
cy_rus
New Cone
New Cone
Posts: 2
Joined: 04 Oct 2018 04:45

Output file corrupted when recording the screen for a given duration.

Postby cy_rus » 04 Oct 2018 15:13

Hello,
I am trying to start VLC using command line arguments in order to record the screen activity. The recording duration will be variable : between 2 h and 3 h. One image per second is enough. It should start as soon as a user opens a windows session and should stop as soon as soon as he logs out.

The following code produces a valid mp4 file :

Code: Select all

"C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" screen:// --no-one-instance --screen-follow-mouse --screen-fps=1 --no-audio --sout "#transcode{vcodec=h264,vb=400,fps=1,scale=1,width=auto,height=auto,acodec=none}:duplicate{dst=std{access=file,mux=mp4,dst='Test.mp4'}}"
However, when I try to start VLC hidden for a recording session of 30 s (just testing) the mp4 file output is corrupted. Here is the code :
"C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" screen:// -I dummy --dummy-quiet --no-one-instance --screen-follow-mouse --screen-fps=1 --no-audio --start-time=0 --run-time=30 --stop-time=30 --sout "#transcode{vcodec=h264,vb=400,fps=1,scale=1,width=auto,height=auto,acodec=none}:duplicate{dst=std{access=file,mux=mp4,dst='Test.mp4'}}" vlc://quit
I am stuck there. :( I feel that VLC does not close itself right when I use vlc://quit and --start-time=0 --run-time=30 --stop-time=30. Could it be that some kind of recording buffer is lost when VLC quits ?

Do you have any suggestions ? Am I doing something wrong ? Thanks in advance.

User avatar
InTheWings
Developer
Developer
Posts: 1275
Joined: 07 Aug 2013 13:15
VLC version: crashing
Operating System: Linux
Contact:

Re: Output file corrupted when recording the screen for a given duration.

Postby InTheWings » 04 Oct 2018 15:31

time variables have only effect on playback of timed media.
screen capture has undefined timing.
:!: If you want your problem to be solved :
* First read troubleshooting guide VSG:Main
* Always provide verbose LOGS ! (command line or from gui)
* Always check your issue against a developer build from Nightly Build of VLC
* Tell us when your problem is solved !

cy_rus
New Cone
New Cone
Posts: 2
Joined: 04 Oct 2018 04:45

Re: Output file corrupted when recording the screen for a given duration.

Postby cy_rus » 04 Oct 2018 21:08

Hello InTheWings,

Thanks for your answer. I understand. So, according to you, it explains the fact that VLC quits without saving what it has recorded, right ? (VLC still quits after 30 s so I thought it was really working).

If I don't use vlc://quit, --start-time, --run-time and --stop-time, I still need to find a way to start VLC so that it records the screen activity until the user logs out of windows.

For instance, the following code could be executed each time the user logs on Windows:

Code: Select all

"C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" screen:// -I dummy --dummy-quiet --no-one-instance --screen-follow-mouse --screen-fps=1 --no-audio -- --sout "#transcode{vcodec=h264,vb=400,fps=1,scale=1,width=auto,height=auto,acodec=none}:duplicate{dst=std{access=file,mux=mp4,dst='Test.mp4'}}"
However, I have no way to close VLC properly so that the output file is saved correctly. Neither can I ask the user to close it by himself because it has to stay in the background and to be automatic (still, the user knows that everything he does is recorded for security purposes ; it is clear from the beginning).

What can I do ? Is there a file format that would still be functionnal/repairable if it is not closed properly ? Other toughts ?


Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: drey_mod and 35 guests