Skip to content

Instantly share code, notes, and snippets.

@dericed
dericed / tc2vtt
Created April 10, 2019 18:32
broken attempt to convert timecode data into a vtt file
#!/bin/bash
# these two functions cross-convert between frame number and timecode value
# borrowed from https://github.com/yamaq/timecode/blob/master/timecode
function convToFN() {
# Convert to frame number(1800) from timecode(00:01:00:00)
# $1 --> tc
# $2 --> fpsHz
# $3 --> fpsCalc
local tc frames frameBase
#!/bin/bash
# label the first script argument as a variable called PBCORE_IN
PBCORE_IN="${1}"
# set a variable to say that the output will be written next to the input pbcore.xml but with a .ffmetadata extension
FFMETADATA_OUT="${PBCORE_IN}.ffmetadata"
# check that a file is provided as an input
if [[ ! -f "${PBCORE_IN}" ]] ; then
echo "Error: Please supply a pbcore xml to use such as"
<!DOCTYPE html>
<html lang="en" class="Internet-Draft">
<head>
<meta charset="utf-8">
<title>FFV1 Video Coding Format Version 0, 1, and 3</title>
<meta content="Michael Niedermayer" name="author">
<meta content="Dave Rice" name="author">
<meta content="Jerome Martinez" name="author">
<meta content="This document defines FFV1, a lossless intra-frame video encoding format. FFV1 is designed to efficiently compress video data in a variety of pixel formats. Compared to uncompressed video, FFV1 offers storage compression, frame fixity, and self-description, which makes FFV1 useful as a preservation or intermediate video format." name="description">
<meta content="xml2rfc 2.12.3" name="generator">
cellar S. Lhomme
Internet-Draft
Intended status: Standards Track M. Bunkus
Expires: January 26, 2019
D. Rice
July 25, 2018
Subject: [PATCH] Limited timecode support for lavd/decklink
---
libavdevice/decklink_common.cpp | 30 -----------------------
libavdevice/decklink_common.h | 42 +++++++++++++++++++++++++++++++++
libavdevice/decklink_common_c.h | 1 +
libavdevice/decklink_dec.cpp | 19 +++++++++++++++
libavdevice/decklink_dec_c.c | 9 +++++++
5 files changed, 71 insertions(+), 30 deletions(-)
ffmpeg started on 2018-04-19 at 09:43:22
Report written to "/Users/cnicols/Desktop/TEST/1_ffmpeg_20180419-094322.log"
Command line:
/usr/local/opt/ffmpegdecklink/bin/ffmpeg-dl -v info -nostdin -hide_banner -nostats -f decklink -draw_bars 0 -audio_input analog -video_input composite -format_code ntsc -channels 8 -raw_format yuv422p10 -i "Intensity Shuttle Thunderbolt" -metadata:s:v:0 "encoder=Uncompressed 10-bit 4:2:2" -color_primaries smpte170m -color_trc bt709 -colorspace smpte170m -color_range mpeg -metadata "creation_time=now" -movflags write_colr -c:v v210 -c:a pcm_s24le -filter_complex "[0:v:0]setfield=bff,setsar=40/27,setdar=4/3; [0:a:0]pan=stereo| c0=c0 | c1=c1[stereo1];[0:a:0]pan=stereo| c0=c2 | c1=c3[stereo2]" -map "[stereo1]" -map "[stereo2]" -f mov /Users/cnicols/Desktop/TEST/1.mov -map 0 -c copy -f nut -
Splitting the commandline.
Reading option '-v' ... matched as option 'v' (set logging level) with argument 'info'.
Reading option '-nostdin' ... matched as option 'stdin' (enable or disable intera
#!/usr/bin/env bash
# vrecord
# Open-source software for capturing a video signal and turning it into a digital file.
SCRIPTDIR=$(dirname "${0}")
CONFIG_FILE="${HOME}/.$(basename "${0}").conf"
unset VERSION
if [[ $(dirname "$(command -v "${0}")") = "/usr/local/bin" ]] ; then
VERSION=$(TMP=$(brew info vrecord | grep ".*\*$" | grep -Eo "/vrecord/.* \(") ; echo "${TMP:9:(${#TMP}-11)}")
_________________________________________
/ WARNING: There were pts \
| discontinuities for these frame ranges: |
| 2980-2981 2983-2983 2985-2986 2988-2988 |
| 2990-2991 2993-2993 2995-2995 2997-2997 |
| 2999-2999 3002-3002 3004-3004 3006-3006 |
| 3008-3009 3011-3011 3013-3013 3015-3016 |
| 3018-3018 3020-3021 3023-3023 3025-3026 |
| 3028-3028 3030-3030 3032-3032 3034-3034 |
| 3036-3037 3039-3039 3041-3041 3043-3044 |
ffmpeg -f lavfi -i "smptebars=s=720x480:r=25:d=5" -f lavfi -i "aevalsrc=0.1*sin(1000*2*PI*t):d=5:s=48000:c=stereo" -f lavfi -i "color=color=black:s=720x480:r=25:d=5" -f lavfi -i "aevalsrc=0:d=5:s=48000:c=stereo" -f lavfi -i "color=s=2x2:r=1:d=6,format=gray,geq=lum=4-N,datascope=s=24x12,crop=6:12:10:0,scale=iw*30:ih*30:flags=neighbor,pad=720:480:(720-iw)/2:(480-ih)/2,fps=25" -f lavfi -i "sine=r=48000:frequency=1:beep_factor=400:duration=5" -f lavfi -i "nullsrc=s=720x480:r=25:d=5,geq=random(1)/hypot(X-cos(N*0.07)*W/2-W/2\,Y-sin(N*0.09)*H/2-H/2)^2*1000000*sin(N*0.02):128:128,geq=r='X/W*r(X,Y)':g='(1-X/W)*g(X,Y)':b='(H-Y)/H*b(X,Y)'" -f lavfi -i "anoisesrc=colour=pink:d=5:r=48000,tremolo=f=0.1:d=0.9" -f lavfi -i "color=color=black:s=720x480:r=25:d=5" -f lavfi -i "aevalsrc=0:d=5:s=48000:c=stereo" -filter_complex "[0:v][1:a][2:v][3:a][4:v][5:a][6:v][7:a][8:v][9:a]concat=n=5:v=1:a=1" -c:v libx264 -pix_fmt yuv420p -c:a aac like_stuff_from_tapes.mp4