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 8658851
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T15:51:59+00:00 2026-06-12T15:51:59+00:00

I am a beginner. How and where should i put a label messages after

  • 0

I am a beginner. How and where should i put a label messages after a video is created from below code.

I want to display two messages after the process is completed which is label1: video was created successfully and 2nd messages is videopath of the video.

I only want to display it after the process is completed(video was created).

namespace test
{
    public partial class liveRecording : System.Web.UI.Page
    {
    //video codec
    AVIWriter writer = new AVIWriter("MSVC");  

    protected void Page_Load(object sender, EventArgs e)
    {
        string streamingSource = "http://xxx.sample.com:85/snapshot.cgi";
        string login = "login";
        string password = "password";

        JPEGStream JPEGSource = new JPEGStream(streamingSource);
        JPEGSource.Login = login;
        JPEGSource.Password = password;
        JPEGSource.NewFrame += new NewFrameEventHandler(video_NewFrame);
        JPEGSource.Start();
    }

    public bool IsRecording = false;
    int width = 0;
    int height = 0;

    Queue<Bitmap> frames = new Queue<Bitmap>(); //Queue that store frames to be written by the recorder thread

    private void video_NewFrame(object sender, NewFrameEventArgs eventArgs) //event handler for NewFrame
    {
        //get frame from JPEGStream source
        //Bitmap image = eventArgs.Frame;
        Bitmap image = (Bitmap)eventArgs.Frame.Clone(); //get a copy of the Bitmap from the source

        width = image.Width;
        height = image.Height;

        if (IsRecording)
        {
            //enqueue the current frame to be encoded to a video file
            frames.Enqueue((Bitmap)image.Clone());
        }

        if (!IsRecording)
        {
            IsRecording = true;
            Thread th = new Thread(DoRecording);
            th.Start();
        }
    }

    private void DoRecording()
    {
        //writer.FrameRate = 5;
        string SavingPath = (Server.MapPath("~\\video\\")); 
        string VideoName = "ICS_" + String.Format("{0:yyyyMMdd_hhmmss}", DateTime.Now) + ".avi";
        writer.Open(SavingPath + VideoName, width, height);

        DateTime start = DateTime.Now;
        while (DateTime.Now.Subtract(start).Seconds < 30)
        {
            if (frames.Count > 0)
            {
                Bitmap bmp = frames.Dequeue();
                writer.AddFrame(bmp);//add frames to AVI file
            }
        }
        writer.Close();//close
    }
}
}
  • 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-06-12T15:52:00+00:00Added an answer on June 12, 2026 at 3:52 pm

    I only want to display it after the process is completed(video was created).

    Then you should use AJAX, basically. Your “start encoding” (or whatever) request should complete quickly, so the user gets an appropriate page back. That page should contain Javascript to regularly poll the server to see whether the task has completed – you’ll need some coordination (e.g. via a randomly generated “job ID” which is provided to the client). You could use something like SignalR for “long polling” (where the AJAX fires a request which is expected to wait until either the job has completed or it times out) or just make a quick polling request every few seconds.

    I’m afraid none of this is easy if you’re new to web development – but the task you’re trying to perform isn’t easy, in a world based on HTTP requests and responses.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Beginner question: I want to debug some code that compiles. I pressed debug, it
(I'm a cocoa beginner and ) I'm wondering why we should do: NSLog(@this is
This should be a simple one, but I'm a beginner with C#. Given a
I am a beginner in GAE and still evaluating if I should use this
Beginner in Android development. My code crashes. I have made a simple Java method
I am a beginner to the ASP.Net MVC. After reading many tutorials and digesting
I am a beginner in databases. What edition of sql server i should start
I am a beginner Ruby on Rails developer. So far I have created several
Ok so I am a complete beginner and have managed to put together a
I am Perl beginner and I am fighting with websockets at the moments. After

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.