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

  • Home
  • SEARCH
  • 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 7074891
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:06:44+00:00 2026-05-28T06:06:44+00:00

I am using ffmpeg to decode an rtsp stream which is displayed using DirectShow

  • 0

I am using ffmpeg to decode an rtsp stream which is displayed using DirectShow I need to add text to the each video frame and I also need to record the video with the text added. I can’t therefore use DirectShow to overlay the text as it won’t be on the raw frame to be saved. The (not set in stone yet) requirement for the text is that it can be various fonts or sizes etc.

I presume then that I will need create the raw bitmap of my text and overlay this on top of my raw BGR image. I know how to write over the current image. What I do not know is how to get from Font XX, Size, XX, String XX to some raw data to overlay.

Can someone suggest what I should do or point me in the right direction. My low level code is in C/C++, but this is being driven from a C#.Net application.

Any help is appreciated.

Thanks.

  • 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-28T06:06:45+00:00Added an answer on May 28, 2026 at 6:06 am

    You’ll have to get the device context (HDC) of the raw bitmap that you want to write the text on and do something like this:

    CString out = "My String";
    
    LOGFONT LogFont;
    memset( &LogFont, 0, sizeof( LOGFONT ) );
    LogFont.lfStrikeOut = 0;
    LogFont.lfUnderline = 0;
    LogFont.lfHeight = 12;
    LogFont.lfEscapement = 0;
    LogFont.lfQuality = CLEARTYPE_QUALITY;
    LogFont.lfItalic = FALSE;
    strcpy(LogFont.lfFaceName, "Arial");
    
    HFONT font = CreateFontIndirect(&LogFont);
    
    HDC dc = // Get your DC from the Raw Bitmap
    SelectObject(dc, font);
    SetTextColor(dc, RGB(255, 255, 255) );
    SetBkMode(dc, TRANSPARENT);
    TextOut(dc, 0, 0, out.GetBuffer(), out.GetLength() );
    DeleteObject( font );
    
    // Release the Raw Bitmap DC
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using ffmpeg to decode a video file in C. I am struggling
I convert a file using ffmpeg command in which audio and video bitrate are
I need to extract stills from video files. Currently I am using ffmpeg, but
I need to join several jpg files into video using FFmpeg library. But I
I created an .png image from a video using ffmpeg tool and i want
i found some articles, some projects to create thumbnail of a video, using ffmpeg.exe,
I am using ffmpeg to decode a file and play it back on an
I'm working on an rtsp streaming(AAC format) client for iOS using ffmpeg. Right now
I'm using ffmpeg in Ubuntu for the image creation and video conversion my problem
I'm having a few problems converting video files from the command line using FFMPEG.

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.