Skip to content

Instantly share code, notes, and snippets.

View dranger003's full-sized avatar

DAN™ dranger003

  • Canada
  • 07:45 (UTC -04:00)
View GitHub Profile
@dranger003
dranger003 / Enable_vt100_csharp.cs
Created January 27, 2018 21:13 — forked from tomzorz/Enable_vt100_csharp.cs
Enable VT100 for the current console window from .NET Core
using System;
using System.Runtime.InteropServices;
namespace Vt100Test
{
public class Program
{
// ReSharper disable InconsistentNaming
@dranger003
dranger003 / ffmpeg-hevc-encode-nvenc.md
Created January 21, 2018 19:23
This gist shows you how to encode specifically to HEVC with ffmpeg's NVENC on supported hardware, with a two-pass profile and optional CUVID-based hardware-accelerated decoding.

Encoding high-quality HEVC content with FFmpeg - based NVENC encoder on supported hardware:

If you've built ffmpeg as instructed here on Linux and the ffmpeg binary is in your path, you can do fast HEVC encodes as shown below, using NVIDIA's NPP's libraries to vastly speed up the process.

Now, to do a simple NVENC encode in 1080p, (that will even work for Maxwell Gen 2 (GM200x) series), start with:

ffmpeg  -i <inputfile>  \
-filter:v hwupload_cuda,scale_npp=w=1920:h=1080:format=nv12:interp_algo=lanczos,hwdownload \

-c:v hevc_nvenc -profile main -preset slow -rc vbr_hq \

#define TRIAC_PIN 5
#define ZERO_CROSS_PIN 4
#define DEBOUNCE_TIME 9000 //9ms - 10ms is the pulse period
static uint32_t lastPulse = 0;
static uint16_t period = 5000; //5ms - 50% for each half wave
void ICACHE_RAM_ATTR onTimerISR(){
if(GPIP(TRIAC_PIN)){//OUTPUT is HIGH
GPOC = (1 << TRIAC_PIN);//low