Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6821313
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:31:49+00:00 2026-05-26T21:31:49+00:00

I am working on an application where I am capturing a full HD Video

  • 0

I am working on an application where I am capturing a full HD Video from a framegrabber card and saving it to a file on disk. I am using Diretshow interfaces to capture the video stream, encode it and then using AVI Mux filter I am saving it to the disk.

Now I also want to add the timestamp(time when video was captured) to the video file, so that timestamp is visible on the top of video when user plays the video file later. And user should be able to play it any popular players(VLC, Windows media player etc.). Can anyone help me with possible methods for achieving this task.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T21:31:50+00:00Added an answer on May 26, 2026 at 9:31 pm

    You can write your own filter for this that inherits from CTransInPlaceFilter. Override the Transform method and in it you can write the time stamp on top of the Bitmap using GDI+.

    You would have to connect this filter in the appropriate position in the graph i.e. somewhere where the media type is RGB.

    EDIT:
    Here’s some sample code ripped from a filter of mine for writing text on an RGB frame.
    Hopefully that should get you started:

    #include <Gdiplus.h>
    ...
    using namespace Gdiplus;
    
    HRESULT UtilityFilter::Transform(IMediaSample *pSample)
    {
      ...
      std::string sText = ...
      return drawTextOntoFrame(sText, pSample); 
    }
    
    HRESULT UtilityFilter::drawTextOntoFrame(const std::string& sText, IMediaSample *pSample)
    {
      // get image properties
      AM_MEDIA_TYPE mt;
      HRESULT hr = InputPin()->ConnectionMediaType(&mt);
      if (FAILED(hr))
      {
        return hr;
      }
      ASSERT(mt.formattype == FORMAT_VideoInfo);
      BITMAPINFOHEADER *pbmi = HEADER(mt.pbFormat);
    
      // Get image buffer
      BYTE *pBuffer(NULL);
      hr = pSample->GetPointer(&pBuffer);
      if (FAILED(hr))
      {
        return hr;
      }
    
      wchar_t* wsText = StringUtil::stlToWide(sText);
    
      BITMAPINFO bitmapInfo;
      bitmapInfo.bmiHeader = *pbmi;
    
      Bitmap bm(&bitmapInfo, (void*)pBuffer);
      Graphics* pGraphics = Graphics::FromImage(&bm);
    
      // Initialize font
      Font myFont(L"Arial", 16);
      //RectF layoutRect(0.0f, 0.0f, 200.0f, 50.0f);
      RectF layoutRect(m_uiX, m_uiY, 350.0f, 50.0f);
      StringFormat format;
      format.SetAlignment(StringAlignmentNear);
      SolidBrush blackBrush(Color(255, 0, 0, 0));
      SolidBrush greenBrush(Color(255, 0, 255, 0));
    
      // Draw string
      pGraphics->DrawString(
        wsText,
        sText.length(),
        &myFont,
        layoutRect,
        &format,
        &greenBrush);
    
      delete[] wsText;
      delete pGraphics;
      return S_OK;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working On Audio/Video capturing from a Web Camera and this is targeted
I have working on an application which captures screen shots and create video from
I am working on MS Word application capturing tool in which we capture selected
I am working on a small C application and I am capturing a value
I have a working application which gets the GPS Long/Lat of from a BlackBerry
im working on application using delphi 7 , and i just came across this
I have a working application using Three20. It basically is a bunch of nested
I have a working application using Json.NET (newtonsoft) as a custom serializer. Currently I'm
I'm working on application sending changed files to other computers. Currently a changed file
I'm working on application which has workflow like this: 1.parsing home page (using HttpURLConnection,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.