This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a new caption file | |
~~~~~~~~ | |
ffmpeg -i captions.srt captions.ass | |
~~~~~~~~ | |
# Add subtitles to main video without changing it | |
~~~~~~~~ | |
ffmpeg -i video.mp4 -vf "subtitles=captions.ass:force_style='OutlineColour=&H80000000,BorderStyle=4,Outline=1,Shadow=0,MarginV=20'" subtitled-video.mp4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*jslint devel: true, browser: true, es5: true */ | |
/*global Promise */ | |
var promiseCount = 0; | |
function testPromise() { | |
'use strict'; | |
promiseCount += 1; | |
var thisPromiseCount = promiseCount; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*jslint devel: true, browser: true, es5: true */ | |
/*global Promise */ | |
// $http function is implemented in order to follow the standard Adapter pattern | |
function $http(url) { | |
'use strict'; | |
var core = { | |
// Method that performs the ajax request | |
ajax : function (method, url, args) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*jslint devel: true, browser: true, es5: true */ | |
/*global Promise */ | |
function imgLoad(url) { | |
'use strict'; | |
// Create new promise with the Promise() constructor; | |
// This has as its argument a function with two parameters, resolve and reject | |
return new Promise(function (resolve, reject) { | |
// Standard XHR to load an image | |
var request = new XMLHttpRequest(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user:joe-oli ffmpeg |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Waits asynchronously for the process to exit. | |
/// </summary> | |
/// <param name="process">The process to wait for cancellation.</param> | |
/// <param name="cancellationToken">A cancellation token. If invoked, the task will return | |
/// immediately as canceled.</param> | |
/// <returns>A Task representing waiting for the process to end.</returns> | |
public static Task WaitForExitAsync(this Process process, | |
CancellationToken cancellationToken = default(CancellationToken)) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class ProcessHelper | |
{ | |
public static ProcessResult ExecuteShellCommand(string command, string arguments, int timeout) | |
{ | |
var result = new ProcessResult(); | |
using (var process = new Process()) | |
{ | |
process.StartInfo.FileName = command; | |
process.StartInfo.Arguments = arguments; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Diagnostics; | |
using System.Text; | |
using System.Threading.Tasks; | |
public static class ProcessAsyncHelper | |
{ | |
public static async Task<ProcessResult> ExecuteShellCommand(string command, string arguments, int timeout) | |
{ | |
var result = new ProcessResult(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
---------------------------------------------------------------------------------------------------------------------------------- | |
Converting a series of jpeg images to a mp4 video: | |
ffmpeg.exe -f image2 -r 3 -i %06d.jpeg -r 15 -vcodec mpeg4 -s 352x240 Camera-0.avi | |
-f image2 => input format | |
-r 3 => input framerate | |
-i %06d.jpeg => input mask (files must be named sequencially, with 6 digits. Ex: "000000.jpeg", "000001.jpeg", "000002.jpeg", etc) | |
-vcodec mpeg4 => video output codec | |
-s 352x240 => resolution |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@REM bin\ffprobe -v quiet -print_format json -show_format -show_streams^ | |
@REM "D:\path\to\myfile.mp4" | |
bin\ffprobe -v quiet -show_streams^ | |
"D:\path\to\myfile.mp4" | |
@REM *** NOTE THE USE OF THE carret^ at the end of the line you wish to continue *** |