ffmpeg -i *.mp4 -vf subtitles=*.srt output.mp4
ffmpeg -i audio.aac -i ch2.h264 -acodec copy -vcodec copy -f mpegts out.ts
ffmpeg -rtsp_transport tcp -i rtsp://fuck.com/fuck/fuck -c copy -f flv rtmp://shit.com/shit/shit
| // usage: promisify(function([args..., cb]) { /* do stuff with args then cb */ })() | |
| exports.promisify = function(fn) { | |
| return function(...args) { | |
| return new Promise((resolve, reject) => { | |
| fn(...args, (err, result) => { | |
| if (err) return reject(err); | |
| resolve(result); | |
| }); | |
| }); | |
| }; |
| const isArray = (a) => { | |
| return (!!a) && (a.constructor === Array); | |
| }; | |
| const isObject = (a) => { | |
| return (!!a) && (a.constructor === Object); | |
| }; | |
| const gunToObj = (obj,getKey,putKey) => { | |
| getKey = (typeof(getKey) === 'undefined') ? '_title' : getKey; | |
| putKey = (typeof(putKey) === 'undefined') ? 'title' : putKey; |
| -- Api Effect Manager | |
| effect module Api where { command = MyCmd } exposing (request, Response) | |
| import Task exposing (..) | |
| import Http | |
| import Process | |
| import Json.Decode as Json exposing ((:=)) | |
| import Native.Api |
| var Gpio = require('pigpio').Gpio, | |
| led = new Gpio(17, { mode: Gpio.OUTPUT }), | |
| led2 = new Gpio(18, { mode: Gpio.OUTPUT }); | |
| led.pwmFrequency(50) | |
| led2.pwmFrequency(50) | |
| led.pwmWrite(0); | |
| const PWRUN = 110; | |
| const PWSTOP = 90; | |
| led2.pwmWrite(PWSTOP); |
| echo “<request><mode>1</mode></request>” | curl -X POST -H “__RequestVerificationToken:1099746139” -H “Content-type: text/xml” -d @- http://192.168.8.1/api/device/mode |
| #!/bin/bash | |
| # Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 12.04 or 14.04 | |
| # Inspired from https://gist.github.com/faleev/3435377 | |
| # Remove any existing packages: | |
| sudo apt-get -y remove ffmpeg x264 libav-tools libvpx-dev libx264-dev | |
| # Get the dependencies (Ubuntu Server or headless users): | |
| sudo apt-get update |