Skip to content

Instantly share code, notes, and snippets.

@nickkraakman
nickkraakman / ffmpeg-cheatsheet.md
Last active April 23, 2024 20:53
FFmpeg cheat sheet for 360 video

FFmpeg Cheat Sheet for 360º video

Brought to you by Headjack

 
FFmpeg is one of the most powerful tools for video transcoding and manipulation, but it's fairly complex and confusing to use. That's why I decided to create this cheat sheet which shows some of the most often used commands.

 
Let's start with some basics:

  • ffmpeg calls the FFmpeg application in the command line window, could also be the full path to the FFmpeg binary or .exe file
@dbr
dbr / ociorv.mu
Created April 26, 2011 13:48
WIP OCIO integration for RV
use rvtypes;
use app_utils;
use commands;
use extra_commands;
use rvui;
require math;
require io;
require qt;
require system;
@dbr
dbr / nuke_save_with_root_settings.py
Last active September 21, 2023 07:27
Saving selected Nuke nodes to file, preserving the root settings
def root_settings_to_string(root):
"""Serialise the project settings. Used when writing the selected
nodes (otherwise things like the frame range would be lost)
"""
# Write non-default settings, in .nk script format. Also write
# user-knob definitons to avoid errors like NUKE-256
rootstring = root.writeKnobs(nuke.TO_SCRIPT | nuke.WRITE_USER_KNOB_DEFS)
# TODO: Why doesn't writeKnobs write [first/last]_frame? Also
from PySide import QtGui, QtCore
def findDagWidget():
stack = QtGui.QApplication.topLevelWidgets()
while stack:
widget = stack.pop()
if widget.windowTitle() == 'Node Graph':
# You should probably be a little safer with this return, but the actual DAG widget
# seems to be here consistently... if not, it should be the only child of 'widget'
@dbr
dbr / nuke_viewer_shortcut_intercept.py
Created June 4, 2013 04:12
Test of finding Nuke's viewer widget, and intercepting the hardwired "c" shortcut and rewiring it to view the RGB channel
"""Test of finding Nuke's viewer widget, and intercepting the hardwired "c" shortcut and rewiring it to view the RGB channel
"""
from PySide import QtGui, QtCore
def findviewer():
stack = QtGui.QApplication.topLevelWidgets()
viewers = []
while stack:
@stenstorp
stenstorp / maya2016.sh
Last active December 8, 2022 06:37 — forked from MichaelLawton/gist:ee27bf4a0f591bed19ac
Installing Maya 2016 SP6 on Ubuntu 16.04 with Student License
#!/bin/bash
#Download Maya from here: http://download.autodesk.com/us/support/files/maya_2016_service_pack_6/Autodesk_Maya_2016_SP6_EN_Linux_64bit.tgz
#Get a student License from: http://www.autodesk.com/education/free-software/maya
#Log in and select maya 2016, your language and an OS. Either should work.
# !!!!!! IMPORTANT !!!!!!
# BEFORE RUNNING, REPLACE "USER" AND "HOME" AT THE BOTTOM OF THIS SCRIPT WITH YOUR USERNAME AND HOME FOLDER
# !!!!!! IMPORTANT !!!!!!
@fredrikaverpil
fredrikaverpil / custom_ui_docked.py
Last active December 1, 2022 16:29
Create custom PySide GUI and dock it into Nuke UI
import PySide.QtCore as QtCore
import PySide.QtGui as QtGui
from nukescripts import panels
class PanelTest(QtGui.QWidget):
def __init__(self, parent=None):
QtGui.QWidget.__init__(self, parent)
self.setLayout(QtGui.QVBoxLayout())
self.myTable = QtGui.QTableWidget()
self.myTable.header = ['Date', 'Files', 'Size', 'Path' ]
#![no_std]
#![no_main]
use cortex_m::peripheral;
use cortex_m_rt::entry;
use panic_halt as _;
use stm32f3xx_hal::{pac, delay, prelude::*};
#[entry]
fn main() -> ! {
@devjj
devjj / ffmpeg-hevc-encode-nvenc.md
Last active April 28, 2022 18:36
This gist shows you how to encode specifically to HEVC with ffmpeg's NVENC on supported hardware, with an optional CUVID-based hardware-accelerated decoder.

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

tl;dr

ffmpeg -hide_banner -i input -c:v hevc_nvenc -preset hq -rc constqp -global_quality 21 -c:a libfdk_aac -ar:a 48000 -channel_layout:a 5.1 -ab:a 640k output

ffmpeg -hide_banner -i input -c:v hevc_nvenc -preset hq -rc vbr_hq -b:v 30000k -qmin 17 -qmax 21 -c:a libfdk_aac -ar:a 48000 -channel_layout:a 5.1 -ab:a 640k output

"""
RGB to XYZ gamut-remapping matrix calculation.
Main function is rgb_to_xyz_matrix.
"""
class MatrixError(Exception):
pass
class NonInvertableMatrix(MatrixError):