Create a Screen Recorder in C#

Поділитися
Вставка
  • Опубліковано 31 жов 2024

КОМЕНТАРІ • 94

  • @zopa9999999999999
    @zopa9999999999999 5 років тому +6

    Dude thank you so much. It works just perfectly. Good luck with other stuff, can't wait to see your new content!

  • @mebtuabebe8428
    @mebtuabebe8428 11 місяців тому

    Thanks a lot. It is a great effort after all. Jesus bless you.

  • @moe3661
    @moe3661 5 років тому +10

    Hey Ben, at the end it doesn't save the mp4 video any idea why?

    • @jonasferraz
      @jonasferraz 5 років тому +5

      I had the same problem.
      I've just deleted the call for the function DeleteFilesExcept in the function Stop and it worked.

  • @somanjitsahoo5008
    @somanjitsahoo5008 3 роки тому +2

    TermSpar: Umm, so we need to write Videofilewriter.
    Me: Wait that illegal! , you said just one word and wrote 1000 words at a single second.

  • @Nilkanthalover
    @Nilkanthalover 4 роки тому +2

    Thanks....good coding

  • @chidebenosiri4662
    @chidebenosiri4662 3 роки тому

    Thank you for the video! God bless! This video helped me know how to take a screenshot as well.

  • @chrisrodriguezm13
    @chrisrodriguezm13 Рік тому

    My recorder isn't working... I'm having a stack overflow exception... How do I fix this?

  • @navjotangra3679
    @navjotangra3679 Рік тому

    is there any way to record cursor movement ?

  • @maciejdev
    @maciejdev 3 роки тому +1

    Do you know how to modify bitrate so that the captured video is more clear?

  • @leejinwon
    @leejinwon Рік тому

    Thank you very much 🤩

    • @knarf0506
      @knarf0506 Рік тому

      how can it work?
      can you tell me?

  • @BlueZackMuthey
    @BlueZackMuthey Рік тому

    How do you add ffmpeg to the project? You skipped that.

  • @Mazel_Tov_888
    @Mazel_Tov_888 4 роки тому +1

    amazing, how much time did it take you to create this, including research?

    • @termspar4231
      @termspar4231  4 роки тому

      I don't remember exactly, but I developed this idea over the course of several weeks.

    • @mebtuabebe8428
      @mebtuabebe8428 11 місяців тому

      @@termspar4231 Thanks really! You brought it here finally to help your bros. Jesus bless you!

  • @6in6sen6qwert9
    @6in6sen6qwert9 4 роки тому

    Hi! Thank you for tutorial. I have question. Why final video accelerated?

    • @mDoThis
      @mDoThis 4 роки тому

      You need to experiment with framerate and ticker. For me worked 15fps and ticker every 1 milisecond - almost perfect.

  • @joenatanpramudji7338
    @joenatanpramudji7338 3 роки тому

    Somehow the program is not recording the audio, so ffmpeg cannot combine it into the FinalVideo(I've tried by manually inserting the .wav file to the folder and it works). I've tried Debug.WriteLine inside the RecordAudio and SaveAudio functions and both are showing outputs so I assume that the functions are called but I am not sure why is it not creating any audio file.

  • @semnal.m2581
    @semnal.m2581 3 роки тому

    Your pastebin code is different from code of this video. Who is pbRec? And who is txtSetName?

  • @unitywith_misavondo
    @unitywith_misavondo 3 роки тому

    why after i press the stop button the video will be automaticly deleted?

  • @arma3tools509
    @arma3tools509 2 роки тому

    What is "pbRec" and "txtSetName"??

  • @JohanKorthout
    @JohanKorthout 5 років тому

    Very nice tutorial; I have a question: does the client have to have ffmpeg installed also? Or is everything in the software via references? Are the references enough? If it has to be installed, I guess one could add the files of a ffmpeg installation to the setup of the screen-recorder software or main software anyway. But it would be preferable if that would not be necessary. Thanks already for clarification.

    • @termspar4231
      @termspar4231  4 роки тому

      Johan Korthout
      Unfortunately yes, the client would need to have FFMPEG installed. The only workaround I could think of to this is using a container, but I’m not too sure on how those work or if they’d even solve the problem, but it’s something to look into!

    • @mDoThis
      @mDoThis 4 роки тому

      You can always provide installation files in your project and set up some checker if FFMPEG has already been installed - if not, run separate consoleApp project and install it automatically (after client's approval for it).
      EDIT:
      Actually, I've created solution for your problem. Put your ffmpeg.exe file in folder, where recorder.exe is placed (and always keep it there), then implement adding ffmpeg.exe to env variables with:
      public void SetEnvPathForFfmpeg()
      {
      string startupPath = Environment.CurrentDirectory;
      var name = "PATH";
      var scope = EnvironmentVariableTarget.Machine;
      var oldValue = Environment.GetEnvironmentVariable(name, scope);
      if (!oldValue.Contains(startupPath))
      {
      var newValue = oldValue + $@";{startupPath}";
      Environment.SetEnvironmentVariable(name, newValue, scope);
      }
      }

  • @marcelosaturno1025
    @marcelosaturno1025 2 роки тому

    Does anyone know if the VideoFileWriter module is still working? since in my code it doesn't work

  • @pixlox
    @pixlox 5 років тому

    Good Work Ben! Thanks!

    • @termspar4231
      @termspar4231  5 років тому

      PixloxFortnite I’m glad you enjoyed

  • @hohohappyday77
    @hohohappyday77 3 роки тому

    video can't save because occur exception..
    So how to solve problem?

  • @kuca5985
    @kuca5985 5 років тому +2

    i dont know why but when i try to stop i dont record the microphone pls help and the final video dont save

    • @moe3661
      @moe3661 5 років тому +1

      Im getting both files created but theres no video file at the end when i click stop, did u end up figuring out your issue?

    • @termspar4231
      @termspar4231  4 роки тому

      Moe
      Did you setup FFMPEG properly?

  • @csarena6539
    @csarena6539 4 роки тому

    Good video.. I learnt a lot

  • @ersinersoy1913
    @ersinersoy1913 4 роки тому

    nice work, thank you very much. but audio and video do not progress simultaneously, I used timer elapsed 15 and framerate 10. Do you have any advice

    • @termspar4231
      @termspar4231  4 роки тому

      Unfortunately this is just something you have to play around with till it works, and it's very imperfect. The purpose of this video was moreso just to get across some interesting C# concepts under the veil of an inadequate screen recorder lol

    • @mDoThis
      @mDoThis 4 роки тому

      @@termspar4231 Using WPFs ticker 15fps and 1 milisecond tick is almost perfect

  • @zubairmehmood196
    @zubairmehmood196 3 роки тому

    can we use this library in dotnet web applications, desktop app working fine but they give me this error on web dotnet mvc application "Could not load file or assembly 'Accord.Video.FFMPEG.x64.DLL' or one of its dependencies. The specified module could not be found." Thanks

    • @TheMigham
      @TheMigham 3 роки тому

      r you using netcore? 'cause it does'nt work yet =(

  • @ivanpaxd7006
    @ivanpaxd7006 2 роки тому

    This can work for Android ?

  • @lidas0516
    @lidas0516 5 років тому +2

    did you just create a blank solution

  • @nurselikaya9479
    @nurselikaya9479 2 роки тому

    Hello honey. I took a error
    Exception => - $exception {"Cannot open the video file. Error code: -22. Message: Invalid argument when trying to access: C:\\TestFolder//7.01.2022 22:08:09.mp4"} Can you tell me why i took this error

  • @maciejdev
    @maciejdev 3 роки тому

    why is the "Rectangle" in green?
    Edit: can someone please explain what this implies? I assume it is some reserved function for this word in C#
    Edit 2: Never mind, I just found it: Initializes a new instance of the Rectangle class with the specified location and size.

  • @subhanullahadelyar
    @subhanullahadelyar 8 місяців тому

    I Recorded a video but sound was not working 😢😢

  • @riozer0
    @riozer0 5 років тому +1

    very good tutorial sir! im workin on some project right now, can you make another tutorial about cam recorder? record video from other device? like webcam? thanks before sir!

  • @Vexxlol
    @Vexxlol 5 років тому +1

    Audio isn't working when the video is rendered.

    • @termspar4231
      @termspar4231  4 роки тому

      Avēx
      Hmm strange. Is the audio working before the final video is created?

  • @imalaia8033
    @imalaia8033 4 роки тому

    Nice vid!

  • @manojsinghghazaibadsushant8704
    @manojsinghghazaibadsushant8704 4 роки тому

    is there anyway, we can show mouse cursor in screen recording? thanks for this video.

    • @termspar4231
      @termspar4231  4 роки тому

      I'm not sure. If the screen capture isn't picking it up, then probably not, but you can maybe look into alternative ways to take screenshots w/ C# that include the cursor

  • @pmaly1980
    @pmaly1980 2 роки тому

    Hi, nice tutorial. Could you please create new video and use some h.264 and h.265 NuGet Packages? Thx P.

  • @uhdamis
    @uhdamis 2 роки тому

    Hi I need the source code for ScreenRecTutorial project can you please send it to me .

  • @itekconyit
    @itekconyit 4 роки тому

    to pause and resume?

  • @virtue90s
    @virtue90s 5 років тому

    Thank you for good tutorial. Do you have any idea about why combining video & audio is not working? I removed to deleteExcept statement on Stop function and I saw that video & audio files are created and combined version is not created.

    • @termspar4231
      @termspar4231  4 роки тому

      Erdem
      Is your FFMPEG properly setup?

    • @virtue90s
      @virtue90s 4 роки тому

      @@termspar4231 i configured same like in tutorial, but i have been discovered one thing video duration and audio duration are different. I dont know why. I tought it might be the reason.

    • @termspar4231
      @termspar4231  4 роки тому

      Erdem
      Are the video and audio files being saved to the same folder?

    • @virtue90s
      @virtue90s 4 роки тому

      @@termspar4231 Yes they are

    • @termspar4231
      @termspar4231  4 роки тому

      Erdem
      Hmm I’d have to take a closer look at your exact implementation of this. You have discord?

  • @HalloGaming
    @HalloGaming 3 роки тому +2

    Screen Recorder Tutorial: Mic

  • @mDoThis
    @mDoThis 4 роки тому

    Yeah, I know this video is 2 years old any many things could've changed in this time, but looking at this nowadays I have some suggestions:
    Why won't you use "System.IO.Path.GetTempPath()" to get temp path? Only for naming ands possible disc choosing purposes? Shouldn't this name be in some config file then?
    I also believe that you don't need to use "bitmap.Dispose()" in "using" statement - "using" is read by compiler as something like
    try { //code }
    finally { [usings_name].Dispose(); }
    And public methods mixed with (or under) private methods is not the most readable technique.
    Aaaaan be careful with slashes! Code was searching for (...)\\Folder\\file.mp4 and found (...)\\Folder//file.mp4, so it didn't count and deleted everything.
    But, a t the end of the day, whole idea is brilliant and very helpful, thank you!

  • @moonstonestudios8719
    @moonstonestudios8719 4 роки тому

    will this work on a macOS if not, can you point me in the right direction?

    • @termspar4231
      @termspar4231  4 роки тому

      Moonstone Studios sadly i don’t think so because I’m pretty sure C# is specifically designed for Microsoft, and I’m really sorry but I don’t know anything about macOS development and so your googling would be as good as mine!

  • @omerdursun5537
    @omerdursun5537 4 роки тому

    good tutorial

  • @andykwan-d5m
    @andykwan-d5m 5 років тому +1

    Love it, just want to make FPS better though

    • @termspar4231
      @termspar4231  4 роки тому

      Andly Kwan
      Ya that would be nice. As I stated at the beginning of this video, following this method you’re not gonna be able to make the next FRAPS or OBS. Rather the intent of this video was more just to explore the code behind some screen recorders. But if you can improve it, by all means!

  • @nihatbeyi
    @nihatbeyi 4 роки тому

    How can we do it when we click on each start, the time will be reset..?

    • @termspar4231
      @termspar4231  4 роки тому +1

      Nihat Beyi to be honest I never developed this project that far so I’m not entirely sure, I was mostly just relying on restarting the app to reset things because C# does that a lot better than I could!

    • @mDoThis
      @mDoThis 4 роки тому +1

      Maybe just make some of the timer variables public and pin to the Start button logic setting up those variables to the starting point? Creating new Stopwatch etc

  • @markmeza1427
    @markmeza1427 4 роки тому

    Me, just wanting to have a screen recorder with no lag:
    HACKERMAN

  • @SanLLL
    @SanLLL 4 роки тому

    how do i open up c# in visual studio

    • @programmerjudson5918
      @programmerjudson5918 4 роки тому

      ua-cam.com/video/mQu2bCZ0T1o/v-deo.html this can be help you bro

  • @memerboi1707
    @memerboi1707 4 роки тому

    Welp, I've learned to not to tell it to do it on Desktop, all my files are now deleted.

    • @heroyusuf5511
      @heroyusuf5511 4 роки тому

      wow

    • @termspar4231
      @termspar4231  4 роки тому +1

      Yikes ya you definitely wanna be careful when writing functions that delete files

    • @memerboi1707
      @memerboi1707 4 роки тому +1

      @@termspar4231 Okey thanks, I was able to recover them after 4 hours half a million files lmao

    • @termspar4231
      @termspar4231  4 роки тому +2

      Memer Boi thanks be to God ☦️

    • @Dave-nv5rv
      @Dave-nv5rv 4 роки тому +1

      @@memerboi1707
      Glad it worked out.
      Gotta be careful with deleting and even creating files.
      I know someone that filled their drive with a video recording they thought was not running. Ui crashed but recording continued. After that it the OS wouldn't run due to no space to write logs etc.
      Had to slave the drive then delete the giant video after actually figuring out what happened

  • @MysAtheLight
    @MysAtheLight 5 років тому

    Got these errors
    1. The name 'pbRec' does not exist in the current context
    2. The name txtSetName does not exist in the current context
    Doesn't work. when I suppress errors, record button doesn't work. None of the buttons work

    • @termspar4231
      @termspar4231  4 роки тому

      Smiley Jamally
      I mean it’s giving your the errors right there. You probably didn’t create those objects

    • @MysAtheLight
      @MysAtheLight 4 роки тому +1

      @@termspar4231 I have long fixed it. Worked perfectly.
      Already on my next projects

  • @markmeza1427
    @markmeza1427 4 роки тому

    15:37

  • @karis7539
    @karis7539 3 роки тому

    Found you here: www.pexels.com/ru-ru/photo/4709286/

  • @hoangtruong7166
    @hoangtruong7166 3 роки тому

    30:25 37:23