Skip to content

Instantly share code, notes, and snippets.

Syntax: x264 [options] -o outfile infile [widthxheight]
Infile can be raw YUV 4:2:0 (in which case resolution is required),
or YUV4MPEG 4:2:0 (*.y4m),
or Avisynth if compiled with support (no).
or libav* formats if compiled with lavf support (no) or ffms support (no).
Outfile type is selected by filename:
.264 -> Raw bytestream
.mkv -> Matroska
.flv -> Flash Video
@tqk2811
tqk2811 / CopyProperties.cs
Last active February 26, 2025 11:05
CopyProperties between same object type
public static void CopyTo<T, TProperties>(this T source, T target, Expression<Func<T, TProperties>> expression)
{
MemberExpression? memberExpression = expression.Body as MemberExpression;
if (memberExpression is null)
return;
List<MemberExpression> listMemberExpression = new([memberExpression]);//child to parent
while (true)
{
MemberExpression? child_memberExpression = memberExpression?.Expression as MemberExpression;
@tqk2811
tqk2811 / MonoScriptTry.cpp
Created February 16, 2025 19:34 — forked from zwcloud/MonoScriptTry.cpp
Trying mono in C++
#include <mono/jit/jit.h>
#include <mono/metadata/assembly.h>
#pragma comment(lib, "mono-2.0.lib")
int main(int argc, char* argv[])
{
mono_set_dirs("C:\\Program Files (x86)\\Mono\\lib",
"C:\\Program Files (x86)\\Mono\\etc");
MonoDomain *domain;
import sys
import os
import numpy as np
import argparse
from modules.utils.paths import (WHISPER_MODELS_DIR, DIARIZATION_MODELS_DIR, OUTPUT_DIR, DEFAULT_PARAMETERS_CONFIG_PATH,
UVR_MODELS_DIR)
from modules.uvr.music_separator import MusicSeparator
parser = argparse.ArgumentParser()
ChromeDriverService? _service = null;
public int? ChromeProcessId
{
get
{
ProcessHelper processHelper = new ProcessHelper((uint)_service!.ProcessId);
foreach (var child in processHelper.ChildrensProcess)
{
ProcessHelper.Win32_Process? win32_Process = child.Query_Win32_Process();
if (win32_Process?.Name?.Contains("chrome", StringComparison.OrdinalIgnoreCase) == true)
try
{
VideoTextVM.RenderWorkStatus = RenderWorkStatus.Working;
if (string.IsNullOrWhiteSpace(VideoOutputConfigure.SaveDir))
throw new InvalidOperationException("Chưa chọn thư mục đầu ra");
Directory.CreateDirectory(VideoTextVM.TmpDir);
FFmpegArg ffmpegArg = new FFmpegArg().OverWriteOutput().VSync(VSyncMethod.cfr);
class WrapperStream : Stream
{
readonly HttpResponseMessage _httpResponseMessage;
readonly Stream _stream;
public WrapperStream(HttpResponseMessage httpResponseMessage, Stream stream)
{
this._httpResponseMessage = httpResponseMessage;
this._stream = stream;
}
public override bool CanRead => _stream.CanRead;
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Runtime.InteropServices;
namespace Spazzarama.ScreenCapture
{
public static class Direct3DCapture
{
@tqk2811
tqk2811 / DeepCopyExtension.cs
Last active April 5, 2024 15:53
DeepCopy and keep your pointer of class not change. Note: for IEnumerable<T> only support Array, IList, IDictionary and can't keep pointer of items.
public static class DeepCopyExtension
{
public static T CloneByJson<T>(this T obj, JsonSerializerSettings? jsonSerializerSettings = null)
{
return JsonConvert.DeserializeObject<T>(JsonConvert.SerializeObject(obj, jsonSerializerSettings), jsonSerializerSettings)!;
}
public static object? CloneByJson(this object obj, Type type, JsonSerializerSettings? jsonSerializerSettings = null)
{
return JsonConvert.DeserializeObject(JsonConvert.SerializeObject(obj, jsonSerializerSettings), type, jsonSerializerSettings)!;
@tqk2811
tqk2811 / YuvColorSpaceWindow.xaml
Last active March 13, 2024 03:22
wpf Yuv Color Space
<Window x:Class="Yuv.YuvColorSpaceWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Title="YuvColorSpace" Height="470" Width="450">
<Grid>
<Rectangle >
<Rectangle.Fill>