Skip to content

Instantly share code, notes, and snippets.

View Cdaprod's full-sized avatar
🫠
Learn something new everyday!

David Cdaprod

🫠
Learn something new everyday!
View GitHub Profile
@Cdaprod
Cdaprod / docker-blender-all-in-one.sh
Created June 30, 2025 22:00
Blender-in-Docker “Factory-Startup” one-liner that procedurally creates a scene (plane textured with a phone-screen video, sun light, animated camera with Bézier easing), then headlessly renders the result to an H.264 MP4—no pre-existing .blend required. Ideal as a reproducible, copy-paste gist for anyone needing quick 3-D perspective moves on v…
docker run --rm -i -v "$PWD":/w linuxserver/blender:4.4.3 \
blender --factory-startup -b --python - <<'PY'
import bpy, math, os
vid = "/w/phone_screen.mp4" # <<< your vertical video
assert os.path.exists(vid), "Video missing"
# ------------------------------------------------------ build objects
bpy.ops.mesh.primitive_plane_add(size=2)
plane = bpy.context.object
@Cdaprod
Cdaprod / two_cam_auto_vfx.py
Created June 30, 2025 18:04
Dual camera (hero+witness) tracking system for VFX with BPY in blender Python scripting.
# /scripts/two_cam_auto_vfx.py
"""
Two-Camera VFX Auto-Rig -- Audio-Sync, Insta360-aware Edition
─────────────────────────────────────────────────────────────────────────────
• Imports hero + witness plates
• Automatically aligns them via audio-waveform cross-correlation
• Auto-detects FPS, resolution & 360⇆rectilinear
• Injects missing XMP → always pano-aware
• Tracks witness plate on a seeded grid, iteratively cleans & re-solves
• Builds RigRoot ▶ WitnessCam ▶ HeroCam hierarchy
@Cdaprod
Cdaprod / Ndi-Moviepy.md
Created June 16, 2025 16:22
NDI+Moviepy Notebook

NDI Stream to MoviePy Professional Video Processing

A comprehensive system for capturing NDI streams, recording them, and processing with MoviePy for professional video production workflows.

📦 Cell 1: Install Dependencies

# Install required packages
!pip install ndi-python opencv-python ipywidgets moviepy numpy pillow
# Note: Ensure NDI SDK/Runtime is installed on your system
@Cdaprod
Cdaprod / run-llama-cuda-server.ps1
Created June 15, 2025 19:38
Running dockerized `ghcr.io/ggml-org/llama.cpp` CUDA Server
docker run --gpus all --restart unless-stopped -d `
-v "B:\Models:/models" `
-p 8000:8000 `
ghcr.io/ggml-org/llama.cpp:server-cuda `
-m /models/llama-2-7b-chat.Q4_K_M.gguf `
--port 8000 --host 0.0.0.0 -n 512 --n-gpu-layers 35

🎬 CDAProd — NodeVideo Expressions Guide

⚙️ Built by David Cannan — DevOps Engineer & AI Solutions Architect
💡 Self-made | #devopsdad | #tripletdad | #hacktheplanet

GitHub - Cdaprod Blog LinkedIn

@Cdaprod
Cdaprod / Cinematic_Text_Expression.md
Last active June 11, 2025 17:36
Mini script - Motion Expression Fx for NodeVideo

Simple Cinematic Example for Text

fadeInDuration = 1.5
delay = (index - 1) * 0.2
t = time - (thisLayer.startTime + delay)

progress = clamp(t / fadeInDuration, 0, 1)
easeT = ease(progress, 0, 1)
@Cdaprod
Cdaprod / my_autometadata.py
Last active June 4, 2025 17:12
Goes with my xqd smb gist and this one is attempting to automate all metadata
import os
import cv2
import xml.etree.ElementTree as ET
def get_video_technical_info(path):
cap = cv2.VideoCapture(path)
fps = cap.get(cv2.CAP_PROP_FPS)
frame_count = int(cap.get(cv2.CAP_PROP_FRAME_COUNT))
width = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH))
height = int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT))
@Cdaprod
Cdaprod / my_xqd_smb_share.md
Last active June 4, 2025 15:15
Automating XQD Via Network Share Using SMB

TL;DR • It’s fine that both XQD cards individually mount as D:. • Differentiate them by VolumeLabel, not by drive letter. • Modify your script so the SMB share name = VolumeLabel (e.g. XQD_Card1, XQD_Card2). • Register your task once via PowerShell—after that, “hot-plug” automatically shares whichever card you inserted under the correct name.

Feel free to reach out if you want help auto-removing the share on eject, adding logging to see exactly when each card fires, or any other fine-tuning!

Explanation of Key Changes

@Cdaprod
Cdaprod / camera_rig_and_ios_polycam.py
Last active May 28, 2025 22:28
Blender BPY — Here’s how to extract a frame and map it onto a traced 3D object:​​​​​​​​​​​​​​​​
"""
Nikon + Polycam iOS - Camera Rig
"""
#!/usr/bin/env python3
"""
Camera Rig + iPhone Polycam Automation System
Monitors for new Polycam scans and camera footage, then processes automatically
"""
import os
@Cdaprod
Cdaprod / bpy_video_and_image_texture_mapping_demonstration.py
Created May 28, 2025 21:26
Blender BPY — Texture Mapping & Raycasting With iPhone Screenshots and Recordings
import bpy
import bmesh
import os
from mathutils import Vector
from bpy_extras.object_utils import world_to_camera_view
# ============ MEDIA LOADING & VALIDATION ============
def validate_media_file(file_path):
"""Validate if file exists and get media type"""