Skip to content

Instantly share code, notes, and snippets.

@identiq
identiq / Gif.js
Created November 25, 2018 17:37
Video preview generation (like giphy) with FFMPEG (ffmpeg-fluent) on node Serverless Lambda
const config = require('../config.json');
const fs = require('fs');
const _ = require('lodash');
const path = require('path');
const ffmpegPath = require('@ffmpeg-installer/ffmpeg').path;
const ffmpeg = require('fluent-ffmpeg');
ffmpeg.setFfmpegPath(ffmpegPath);
const AWS = require('aws-sdk');
const s3 = new AWS.S3({
@igracia
igracia / mixing_recordings.md
Last active September 21, 2023 19:43 — forked from ktoraskartwilio/mixing_recordings.md
Mixing Recordings

Working with Twilio Room Recordings

The following guide will show you how to mix several audio and video tracks together, forming a grid. For this example, we will use two video and two audio tracks. The video tracks will be placed side by side in a 1024x768 output file.


UPDATE - Video Recording Compositions API is out!

Yes! No ned to go through this process alone anymore. We've recently released the Twilio Recording Composition API. This API will allow you to compose and transcode you Room Recordings. You can find the reference docs here

@fritzy
fritzy / 1_triggers.sql
Last active April 7, 2024 20:07
Get table change notifications from Postgres as JSON
CREATE OR REPLACE FUNCTION table_update_notify() RETURNS trigger AS $$
DECLARE
id bigint;
BEGIN
IF TG_OP = 'INSERT' OR TG_OP = 'UPDATE' THEN
id = NEW.id;
ELSE
id = OLD.id;
END IF;
PERFORM pg_notify('table_update', json_build_object('table', TG_TABLE_NAME, 'id', id, 'type', TG_OP)::text);