3 ms·
On Windows I use a small program that grabs a frame every second through the desktop API as a DirectX texture, and compresses that straight on the GPU to h265 u
by kaetemi 3y ago
On Windows I use a small program that grabs a frame every second through the desktop API as a DirectX texture, and compresses that straight on the GPU to h265 using AMF. I'll upload the source in case it's interesting for anyone else.
- deleted 3y ago[deleted]
- WirelessGigabit 3y agoI would love this!
- kaetemi 3y agoAlright, here you go. https://github.com/kaetemi/second_capture/blob/master/second_capture.cpp https://github.com/kaetemi/second_capture/blob/master/second...
- Jayakumark 3y agoThanks for open sourcing it so fast
- jdthedisciple 3y agowhy does CPP code always look so messy and unintelligible? like if I see C# or Python it makes sense to me at least in some way whereas CPP code always looks like it's powering some rocket engine? Also thanks for sharing!
- jdrek1 3y agoWell first of all, C++ is the language you'd be using to power a rocket engine. And second, that code is a terrible example because most of it isn't C++. Large parts of that are very C like or directly C because it's using the Windows API.
- kaetemi 3y agoLargely because it's a melting pot of ancient and modern coding standards. Got the C Win32 API along COM style and then whatever AMF is doing. Makes things very verbose and explicit. I've seen worse Python. Personally, I think it's charming. :)
- diggan 3y ago> like if I see C# or Python it makes sense to me at least in some way Could it be that you're just more used to looking at C#/Python than other things, then other things are more foreign and therefor look messy? As another anecdote, I cannot stand browsing/looking through C# code as it tends to be filled with various classes just to basically write very basic programs. The amount of over-engineering I've seen in C# surpasses everything else I've looked at. Not to mention how people seem to arbitrary chose between private/public with no real consensus on when to use what, everything seems to be encapsulated in the wrong way. And don't get me started on the infrastructure around it, csproj vs sln and dealing with dependencies/assemblies. But then I mostly write Clojure code day-to-day, and I realize that my troubles for dealing with C# is mostly because of what I'm used to, not because the language itself is inherently shit. I only have myself to blame for this. I'm sure people who write C# day-to-day have the same feelings about Clojure as I have about C#.
- theropost 3y agoThanks, I am giving it a try - any dependency required for Windows 10? Compiles fine, but get an error about AVIFileInit - maybe to do with <vfw.h>?
- vitovito 3y agoAMF is AMD's equivalent to NVENC. I think if you aren't running an AMD card, you won't have the necessary libraries?
- theropost 3y agoAh yes, that would be it. Thanks! I threwa quick C++ program together to do something similar using FFMPEG.
- kaetemi 3y agoYea, I haven't really needed an NVENC version yet. Will probably add it... eventually... for my laptop. Shouldn't be too any more difficult than just swapping out the right parts, though.
- Sakos 3y agoThanks for sharing. It's a very cool idea. I briefly tried using it but I don't have an AMD card (just Intel and NVIDIA). How difficult do you think it might be for me to implement support for something like NVENC instead? I only skimmed the code and I'm not sure yet exactly what the AMF code is doing.
- Jayakumark 3y ago+1
- kaetemi 3y agoSee sibling comment response. :)