Video recording through .NET

Forum Forums Visual Components 4.1 .NET Addon Programming Video recording through .NET

Tagged: 

This topic contains 3 replies, has 2 voices, and was last updated by ccamilo ccamilo 4 months, 3 weeks ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #14268
    Avatar
    jaisantosh.d
    Participant

    Hello,

    I want to record Simulation video in Visual Components through .NET. Can anyone suggest any solution with an Example??

    #14281
    ccamilo
    ccamilo
    Participant

    You can do something like this:

    Hope it helps

    #14299
    Avatar
    jaisantosh.d
    Participant

    Hi ccamilo,

    Thanks for the reply.

    I have used the same code, but it is not working at all.

    My code is like this:

    [Export(typeof(IPlugin))]
    public class Class1 : IPlugin
    {
    public void Exit()
    {

    }

    public void Initialize()
    {

    }
    public IVideoRecorder videoRecorder = null;
    public void StartRecording()
    {
    //Reset simulation to stop recording
    var app = IoC.Get<IApplication>();
    app.Simulation.SimulationReset += OnSimulationReset;

    //Set and Start Video recording
    videoRecorder = IoC.Get<IVideoRecordExporter>();
    videoRecorder.Start();

    //start simulation
    var runtime = IoC.Get<ISimulationSettingViewModel>().SimulationRunTime;
    IoC.Get<ISimulationService>().SwitchRunState(runtime, 0);

    }

    public void OnSimulationReset(Object sender, EventArgs e)
    {
    //Stop video Recording
    string pathtosave = @”F:\WORK\video.avi”;
    videoRecorder.Stop(IoC.Get<IUrlHelper>().LocalPathToUrl(pathtosave, false));
    }

    }

     

    Please check and let me know where I am wrong.

    #14510
    ccamilo
    ccamilo
    Participant

    I don’t see you are calling StartRecording() in your code. You should use this method whenever you want to start recording. Also, simulation should stop at some point in order to finish the recording process. At which point would you like to app to start recording the simulation?

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.