Improve company productivity with a Business Account.Sign Up

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 5459
  • Last Modified:

VLC snapshots from video stream with added date and time overlay

I cant figure out how to add date and time overlay when making a snapshot of a video stream in VLC player and command line. In the attached example I can see date and time in the player but its not saved with the snapshot file.
  • 2
1 Solution
This what I see dropping your file onto VLC
Says it's a undf?
No suitable decoder module:
VLC does not support the audio or video format "undf". Unfortunately there is no way for you to fix this.
VLC errorUse .asf format?
I don't know if you can add the date and time to the live streaming maybe later once you stop capturing.
I'm not familiar with using VLC via cmd line either but I dare say adding a date and type would be like a subfilter
See if this helps
From my lengthy experimenting I do not think you can include the time and date in the snapshot because it is only an overlay applied at runtime, and not actually embedded into the video.

I had wondered whether the text was included in the snapshot image as a layer that was not visible, and would be lost in JPG images that don't support transparency and layers but retained in PNG snapshots, but I have looked at PNG snapshots and see no sign of any hidden layers with the text overlay.  They are just single layer images.

I think you are going to have to apply the time stamp to the image immediately after the snapshot is created by VLC Player using another command line utility such as ImageMagick.

The second or two difference in time may or may not be important to you, and it's an additional complication that you probably didn't want, but that's the only way I think you will achieve this.

It is possible that there may be some other advanced display settings that concern "blending" of content layers or similar, whereby snapshot screen capture includes the overlaid content, but I haven't discovered any.

You are using VLC's "marquee filter" to display the time and date in the video when played.  You can use a text string and/or any of the built in variables shown here:
I have been testing with %d.%m.%y  %H:%M-%S which displays as eg. 20.01.2013  09:55-12

The manual equivalent to your scripted method of playing the video and showing the marquee is to configure the user settings then click the snapshot tool.

Tools > Preferences > Show settings > Click "All" for advanced settings.
Scroll down to and expand the sections shown in the screenshots below.

Note that the 4th image is a composite and is only representative of how it looked in VLC Player, not actually what I captured.  I had to do some copying and pasting and insert text using a text tool to simulate the appearance and position of the date/time stamp.
.  .  .Date/Time stamp overlay in VLC Player  Date/Time overlay text not captured in snapshotThe image editing tools I currently have installed on this PC capture the VLC Player window, but the content of the actual video is captured as live content (OLE - Object Linking and Embedding) that is impossible to merge into the image and retain using standard image editing applications.  It's the same with trying to use Alt + PrintScreen to capture something in Windows Media Player.  All you get is black screen area surrounded by the application window.  I think it is to do with the manner in which Windows layers content on the screen display.

As far as ImageMagick is concerned, there is a learning curve but the online documentation is very full.  Basically it comprises a suite of separate EXE files namely: animate, compare, composite, conjure, convert, display, identify, import, mogrify, montage, and stream.

Eack of the programs support a lot of different commands, each with their own parameters, and many of the commands apply to more than one of the programs.  To help narrow down which program, command, and switches best suit your needs, there are examples and references:

Annotating the images is what you would be looking for:
You can label an image above or below it, or right on top of it, and format the area for this label/caption:
Alternatively you can watermark an image with text and format it:

It's easy enough to get the System date and time from the variables %DATE% and %TIME% at the command line, and format them to a more friendly format for ImageMagick to use as the annotation or labelling text.  This question shows an example:
but there are quite a few other ways to achieve the same thing.

The difficult part of running a VLC Player script to generate a snapshot image and then call ImageMagick to annotate or label it would be knowing the file name of the snapshot that VLC Player just created.  Probably the best way would be to create one Windows batch file to call both the programs, and have the batch file maintain a counter so that it can track what the file name should be each time it runs.  If you use incrementing numbers as your file names rather than the date and time it would be a whole lot easier to achieve.

What do you think?
petlar930Author Commented:
BillDL thanks a lot for your answer, I understand the problem and will try imagequick. It looks like the right tool for this.
Thank you petlar930
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now