Neither one nor Many
Software engineering blog about my projects, geometry, visualization and music.
In case you are looking for a free alternative to Camtasia Studio or many other alternatives... One of my favorite tools of all time, ffmpeg can do it for free!
The simplest thing that will work is ffmpeg -f gdigrab -framerate 10 -i desktop output.mkv
(source)
This gives pretty good results already (if you use an MKV container, FLV will give worse results for example).
gdigrab
adds a mouse pointer to the video but does not scale it according to HiDPI settings, so it will be extremely small.
You can configure the mouse pointer to extra large to fix that. That mouse pointer won't scale either, but at least you end up with a regular size pointer in the video
More options you can find here, I've settled with single pass encoding using -c:v libx264 -preset ultrafast -crf 22
.
ffmpeg -f gdigrab -framerate 30 -i desktop ^
-c:v libx264 -preset ultrafast -crf 22 output.mkv
First execute ffmpeg -list_devices true -f dshow -i dummy
this will give you directshow devices. (source)
On my laptop this command outputs:
[dshow @ 00000000023224a0] DirectShow video devices (some may be both video and audio devices)
[dshow @ 00000000023224a0] "USB2.0 HD UVC WebCam"
[dshow @ 00000000023224a0] Alternative name "@device_pnp_\\?\usb#vid_04f2&pid_b3fd&mi_00#6&11eacec2&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global"
[dshow @ 00000000023224a0] "UScreenCapture"
[dshow @ 00000000023224a0] Alternative name "@device_sw_{860BB310-5D01-11D0-BD3B-00A0C911CE86}\UScreenCapture"
[dshow @ 00000000023224a0] DirectShow audio devices
[dshow @ 00000000023224a0] "Microphone (Realtek High Definition Audio)"
[dshow @ 00000000023224a0] Alternative name "@device_cm_{33D9A762-90C8-11D0-BD43-00A0C911CE86}\wave_{1DDF1986-9476-451F-A6A4-7EBB5FB1D2AB}"
Now I know the device name I can use for audio is "Microphone (Realtek High Definition Audio)"
. Use it for the following parameters in ffmpeg -f dshow -i audio="Microphone (Realtek High Definition Audio)"
.
I ended up with capture-video.bat
like this:
ffmpeg -f dshow -i audio="Microphone (Realtek High Definition Audio)" ^
-f gdigrab -framerate 30 -i desktop ^
-c:v libx264 -preset ultrafast -crf 22 output.mkv
This is a resulting video where I used this command, resolution of the video is 3840x2160 and the HiDPI scale is set to 2.5.
For this I use the following command, to insert a keyframe every 25 frames (the closer to one, the larger the output file will be):
ffmpeg.exe -i %1 -qscale 0 -g 25 %2
The option -qscale 0
is for preserving the quality of the video.
(Changing the container to .mov
was probably not necessary, I tried this hoping that Adobe Premiere would support it, but it didn't!)
Found the following tool for editing: Filmora and (on my laptop) it was able to smoothly edit the footage. They support GPU acceleration, but the additional keyrames really help with a smooth experience.
Once you get the hang of it (shortcut keys are your friend) it's pretty easy to cut & paste your videos.
As I discovered Adobe Premiere earlier, doesn't like MKV, but it also doesn't like 4:4:4 (yuv444p), the pixel format used by default (it seems).
You can view such information using ffprobe <VIDEO FILE>
. Anyway, it seems to like yuv420p, so add -pix_fmt yuv420p
to make it work for Premiere:
ffmpeg.exe -i input.mkv -qscale 0 -g 25 -pix_fmt yuv420p output.mov
Ray Burgemeestre
2016-05-19 16:47:35