jq -r '[.[] ] | .[0]' input.json
jq --arg len $len -r '[.[] ] | .[$len | tonumber]."aud-cmd"' input.json
| #! /bin/bash | |
| # | |
| # Diffusion youtube avec ffmpeg | |
| # Configurer youtube avec une résolution 720p. La vidéo n'est pas scalée. | |
| VBR="2500k" # Bitrate de la vidéo en sortie | |
| FPS="30" # FPS de la vidéo en sortie | |
| QUAL="medium" # Preset de qualité FFMPEG | |
| YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2" # URL de base RTMP youtube |
| curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - | |
| sudo apt install nodejs | |
| sudo npm install --unsafe-perm -g expo-cli |
| /** | |
| * marked - a markdown parser | |
| * Copyright (c) 2011-2013, Christopher Jeffrey. (MIT Licensed) | |
| * https://github.com/chjj/marked | |
| */ | |
| ;(function(){var block={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:noop,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:noop,lheading:/^([^\n]+)\n *(=|-){3,} *\n*/,blockquote:/^( *>[^\n]+(\n[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment|closed|closing) *(?:\n{2,}|\s*$)/,def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:noop,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};block.bullet=/(?:[*+-]|\d+\.)/;block.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/;block.item=replace(block.item,'gm') | |
| (/bull/g,block.bullet) | |
| ();block.list=replace(block.list) | |
| (/bull/g,block.bullet) | |
| ('hr',/\n+(?=(?: *[-*_]){3,} *(?:\n+|$))/) |
| # Concat folder Videos with ffmpeg | |
| ffmpeg -f concat -safe 0 -i <(for f in ./*.MP4; do echo "file '$PWD/$f'"; done) -c copy output.MP4 | |
| # Concat files in the list.txt | |
| ffmpeg -f concat -safe 0 -i list.txt -c copy output.mp4 | |
| # Concat with re-encode (if faced some errors like "Non-monotonous DTS in output stream") | |
| ffmpeg -f concat -safe 1 -i list.txt -c:v libx265 -preset ultrafast -crf 18 -c:a libmp3lame output3.mp4 | |
| # list.txt | |
| # file 1.mp4 | |
| # file 2.mp4 |
| ffmpeg -i intro.mp4 -i overlay.png \ | |
| -filter_complex "[1:v]scale=520:-1,format=rgba,colorchannelmixer=aa=0.5[fg];[0][fg]overlay=1380:920:enable='between(t,0,20)'" \ | |
| -pix_fmt yuv420p -c:v libx264 -preset fast -crf 22 -c:a libmp3lame \ | |
| output.mp4 | |
| ffmpeg -i intro.mp4 -i overlay.png \ | |
| -filter_complex "[1:v]format=rgba,colorchannelmixer=aa=0.7[fg];[0][fg]overlay" \ | |
| -pix_fmt yuv420p -c:a copy \ | |
| output.mp4 |
| # install doctl | |
| sudo apt update | |
| sudo apt -y install snapd | |
| sudo snap install doctl | |
| ln -s /snap/bin/doctl /usr/local/bin | |
| # initiate doctl | |
| # Generate access token herer https://cloud.digitalocean.com/account/api/tokens | |
| doctl auth init | |
| # list current droplets in json format | |
| doctl compute droplet list -o json |
| server { | |
| listen 80 default_server; | |
| root /var/www/html; | |
| index index.php index.html index.htm index.nginx-debian.html; | |
| server_name _; | |
| location / { | |
| try_files $uri $uri/ =404; | |
| } |
| bootscript=/root/run.sh | |
| servicename=customboot | |
| cat > $bootscript <<EOF | |
| #!/usr/bin/env bash | |
| echo "$bootscript ran at $(date)!" > /tmp/it-works | |
| EOF | |
| chmod +x $bootscript |