Solved

VLC snapshots from video stream with added date and time overlay

Posted on 2013-01-19
4
4,281 Views
Last Modified: 2013-01-25
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.
example-VLC-batch---DT.txt
0
Comment
Question by:petlar930
  • 2
4 Comments
 
LVL 69

Expert Comment

by:Merete
ID: 38797476
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
Documentation:Modules/time
http://wiki.videolan.org/Documentation:Modules/time
http://www.videolan.org/doc/streaming-howto/en/ch02.html
Sap-Announce.JPG
0
 
LVL 38

Accepted Solution

by:
BillDL earned 500 total points
ID: 38798243
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:
http://wiki.videolan.org/Documentation:Modules/marq
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.
http://www.imagemagick.org/script/command-line-tools.php

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:
http://www.imagemagick.org/Usage/
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/windows/

Annotating the images is what you would be looking for:
http://www.imagemagick.org/Usage/annotating/
You can label an image above or below it, or right on top of it, and format the area for this label/caption:
http://www.imagemagick.org/Usage/annotating/#anno_below
http://www.imagemagick.org/Usage/annotating/#anno_on
Alternatively you can watermark an image with text and format it:
http://www.imagemagick.org/Usage/annotating/#wmark_text

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:
http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=19274
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?
0
 

Author Comment

by:petlar930
ID: 38815859
BillDL thanks a lot for your answer, I understand the problem and will try imagequick. It looks like the right tool for this.
0
 
LVL 38

Expert Comment

by:BillDL
ID: 38817774
Thank you petlar930
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Microsoft Office Picture Manager is not included in Office 2013. This comes as a shock to users upgrading from earlier versions of Office, such as 2007 and 2010, where Picture Manager was included as a standard application. This article explains how…
In a previous article published here at Experts Exchange, Signature Image with Transparent Background (http://www.experts-exchange.com/Web_Development/Document_Imaging/A_12380-Signature-Image-with-Transparent-Background.html), I explained how to cre…
The goal of the tutorial is to teach the user what exposure is and how to use the exposure slider. Analyze the photo that you want to edit, then adjust the exposure slider to your liking.
In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now