I do not want to get bogged down in my code when the purpose of this is to encourage the use of ffmpeg in easily controlled threads. ImgFiles is used to return any thumbnails that were created. VideoID (I use a database) tells the threaded process which video to use taken from the database.įname is used in other parts of my functions that use FilesToProcess, but not used here.ĭurationSeconds - is filled in by the threads that just collect video duration. In this case thw class Thrdffmpeg contains, public class ThrdFfmpegįFmpegStuff contains the various ffmpeg functionality, thrd is obviously the thread.Ī property in FfmpegStuff is the class FilesToProcess, which is used to pass information to the called process, and receive information once the thread has stopped.
Which is the list of threads that you are running, I make use of a timer to Pole these threads, you can also set up an event if Pole'ing is not suitable for your application. In the thread controller you have something like List threads = new List() I stack up threads, write a simple thread controller class, then you can easily make use of what ever functionality of ffmpeg you want to use.Īs an example, this contains sections use ffmpeg to create a thumbnail from a time that I specify. The reason I'm thinking #1 might be the better option is that most FFmpeg tutorials are in C++ and I'd also have more control over memory management than if I was to do it in c#.Īlso would you happen to have any useful links (perhaps a tutorial) for using FFmpeg?Ī solution that is viable for both Linux and Windows is to just get used to using console ffmpeg in your code.
#FFMPEG WINDOWS TUTORIAL MOVIE#
This should display the Mandelbrot file’s technical metadata.So I know its a fairly big challenge but I want to write a basic movie player/converter in c# using the FFmpeg library.
Test ffprobe by pasting into the Terminal or the Command Prompt the line:įfprobe -show_format -show_streams -print_format json Desktop\mandelbrot.mkv Test ffplay by pasting into the Terminal or the Command Prompt the line: This should produce on your Desktop a file of the Mandelbrot pattern. Test ffmpeg by pasting into the Terminal or the Command Prompt the line:įfmpeg -f lavfi -i mandelbrot -t 10 -pix_fmt yuv420p Desktop\mandelbrot.mkv
#FFMPEG WINDOWS TUTORIAL INSTALL#
Installing the software from a buildĭownload and install the binary of the latest release provided by Gyan Doshi: You can now close the administrative Command Prompt and open a regular one (cmd.exe). You should now have the commands ffmpeg, ffplay and ffprobe installed. Once Chocolatey is installed, you can build FFmpeg with the command: command-click onto cmd.exe) and pasting the following command at the -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString(''))" & SET PATH=%PATH% %ALLUSERSPROFILE%\chocolatey\bin FFmpeg You can install Chocolatey by opening an administrative Command Prompt (e.g. It can be installed on Windows by running in the Terminal:īrew install gcc Installing the software with Chocolatey ChocolateyĬhocolatey is a package manager for Windows. In order for Homebrew to install other applications, the compliler gcc is needed. This works fine on both the Windows Terminal (recommended) and Windows Subsystem for Linux, as well as the various Linux distribution apps. While waiting for Homebrew working directly on Windows, please follow the instructions given at Installation for the Linux users in this Cookbook. Installation for Window users Installing the software with Homebrew