0

I would like to do the following two things:

  1. Capture a video of my desktop using VLC media player via the command line. So that I can,
  2. Create a shortcut that I can use over and over without having to modify output file names using a timestamp (with milliseconds) output_yyyyddMMhhmmssSS.mp4

I can capture the video of my desktop OK using the VLC user interface... Media > Convert / Save... > Capture Device tab > Capture mode : Desktop > Convert / Save button > Destination : output.mp4. I'm just having trouble formatting the command line to work. I seem to only be able to create an endless loop.

I also don't know how to format the timestamp.

What I'm using:

  1. Command line which is broken (I produce a screen within a screen within a screen...):

     vlc screen:// sout=#transcode{vcodec=h264,acodec=mpga,ab=128,channels=2,samplerate=44100}:std{access=file{no-overwrite},mux=mp4,dst='C:\Temp\output.mp4'}
    
  2. I haven't even gotten to the timestamp part but I saw this when hunting around and the main answer appears to only be the date part. I'm not sure how to add time into the mix:

    Creating a file name as a timestamp in a batch job

Please help.

1 Answers1

0

I solved this using the following batch command. It combines:

start "" "vlc.exe" "screen://" ":screen-fps=60.000000" ":live-caching=3000" ":sout=#transcode{vcodec=h264,acodec=mpga,ab=128,channels=2,samplerate=44100} :file{dst=C:\\output_%DATE:~-4%%DATE:~4,2%%DATE:~7,2%%TIME:~0,2%%TIME:~3,2%%TIME:~6,2%%TIME:~9,2%.mp4,no-overwrite}" ":sout-keep"
  • A VLC Media Player screen:// capture at 60fps with 3 seconds buffer
    "screen://" ":screen-fps=60.000000" ":live-caching=3000"
  • Conversion to MP4 (h264) with an audio transcode. Audio didn't work for me at time of writing but I don't need it, and
    ":sout=#transcode{vcodec=h264,acodec=mpga,ab=128,channels=2,samplerate=44100}
  • An output file which transposes the parts of the command line date and time functions into YYYYDDMMHHmmssSS format so I can run the script repeatedly with no file conflicts.
    :file{dst=C:\\output_%DATE:~-4%%DATE:~4,2%%DATE:~7,2%%TIME:~0,2%%TIME:~3,2%%TIME:~6,2%%TIME:~9,2%.mp4,no-overwrite}" ":sout-keep"