Modificações Flavio

This commit is contained in:
EmersonJSC 2024-07-10 14:19:15 -03:00
parent fefb18d133
commit ffbc33c0b9
15 changed files with 28 additions and 38 deletions

View File

@ -1,10 +0,0 @@
---
author: Emerson Junio Silva Costa
description: Como criar uma aula no site
date: 19/03/2024
software: [Alice_Cast]
level: Basico
layout: aulas
---
Exportando dados do Hydrogen

View File

@ -1,27 +1,32 @@
#!/bin/sh #!/bin/sh
SRC=_aulas/ SRC=_aulas
SCRIPT=script/
TMP=tmp/
PARAM="scale=1920:1080: force_original_aspect_ratio=decrease: eval=frame,pad=1920:1080: -1:-1:color=black"
mkdir -p ./${TMP}
# #################################### # ####################################
# Creating the credits clip # Creating the credits clip
# #################################### # ####################################
if test tmp-credits.mkv -ot credits.svg ; then if test ${SCRIPT}/tmp-credits.mkv -ot ${SCRIPT}/credits.svg ; then
ffmpeg -y -loop 1 -i credits.svg -i credits.wav -shortest tmp-credits.mkv ffmpeg -y -loop 1 -i ${SCRIPT}/credits.svg -i ${SCRIPT}/credits.wav -shortest ${TMP}/tmp-credits.mkv
fi fi
# #################################### # ####################################
# Creating dest dir # Creating dest dir
# #################################### # ####################################
mkdir -p thumbs mkdir -p ./thumbs
mkdir -p videos mkdir -p ./videos
for aula in ./${SRC}*.md; do for aula in ./${SRC}/*.md; do
# #################################### # ####################################
# Getting parameters from aulas # Getting parameters from aulas
# #################################### # ####################################
NAME="$(basename "${aula}" .md)" NAME="$(basename "${aula}" .md)"
AUTHOR=$(grep "^author: " "${aula}" | sed -e 's/author: //g') AUTHOR=$(grep "^author: " "${aula}" | sed -e 's/author: //g')
INPUT="${SRC}${NAME}.mkv" INPUT="${SRC}/${NAME}.mkv"
SCRIPT=$(dirname $0)"/"
echo "########################################" echo "########################################"
echo "# Aula: ${aula}" echo "# Aula: ${aula}"
@ -35,22 +40,22 @@ for aula in ./${SRC}*.md; do
# #################################### # ####################################
# Creating the thumbnail if does not exist # Creating the thumbnail if does not exist
# #################################### # ####################################
if test ! -f "thumbs/${NAME}.jpg" ; then if test ! -f "./thumbs/${NAME}.jpg" ; then
ffmpeg -y -i "${INPUT}" -vframes 1 -an -s 400x222 -ss 30 "thumbs/${NAME}.jpg" ffmpeg -y -i "${INPUT}" -vframes 1 -an -s 400x222 -ss 30 "./thumbs/${NAME}.jpg"
fi fi
# #################################### # ####################################
# if output exist, continue # if output exist, continue
# #################################### # ####################################
if test -f "videos/${NAME}.mp4" ; then if test -f "./videos/${NAME}.mp4" ; then
continue continue
fi fi
# #################################### # ####################################
# Creating the intro clip # Creating the intro clip
# #################################### # ####################################
sed "s/nomenome/$AUTHOR/g" ${SCRIPT}intro.svg | sed "s/curso/${NAME}/g" > ${SCRIPT}tmp-intro.svg sed "s/nomenome/$AUTHOR/g" ${SCRIPT}/intro.svg | sed "s/curso/${NAME}/g" > ${TMP}/tmp-intro.svg
ffmpeg -y -loop 1 -i ${SCRIPT}tmp-intro.svg -i ${SCRIPT}intro.wav -shortest ${SCRIPT}tmp-intro.mkv ffmpeg -y -loop 1 -i ${TMP}/tmp-intro.svg -i ${SCRIPT}/intro.wav -shortest ${TMP}/tmp-intro.mkv
# ################################################### # ###################################################
# Audio adjustment # Audio adjustment
@ -60,24 +65,24 @@ for aula in ./${SRC}*.md; do
# -af dynaudnorm=p=1 # -af dynaudnorm=p=1
# -af speechnorm=e=12.5:r=0.0001:l=1 # -af speechnorm=e=12.5:r=0.0001:l=1
# -af acompressor=threshold=0.089:ratio=9:attack=200:release=1000:makeup=2 # -af acompressor=threshold=0.089:ratio=9:attack=200:release=1000:makeup=2
ffmpeg -y -i "${INPUT}" -af dynaudnorm=p=1 ${SCRIPT}tmp-normalized.mkv ffmpeg -y -i "${INPUT}" -af dynaudnorm=p=1 ${TMP}/tmp-normalized.mkv
# #################################################### # ####################################################
# Wartermarking the video file # Wartermarking the video file
# #################################################### # ####################################################
sed "s/nomenome/$AUTHOR/g" ${SCRIPT}watermark.svg | sed "s/curso/${NAME}/g" > ${SCRIPT}tmp-watermark.svg sed "s/nomenome/$AUTHOR/g" ${SCRIPT}/watermark.svg | sed "s/curso/${NAME}/g" > ${TMP}/tmp-watermark.svg
# add watermark to video # add watermark to video
ffmpeg -y -i ${SCRIPT}tmp-normalized.mkv -i ${SCRIPT}tmp-watermark.svg -i ${SCRIPT}logo.png -filter_complex "[0][1]overlay=5:H-h-5:format=auto[bg];[bg][2]overlay=W-w-5:5:format=auto" -c:a copy ${SCRIPT}tmp-video.mkv ffmpeg -y -i ${TMP}/tmp-normalized.mkv -i ${TMP}/tmp-watermark.svg -i ${SCRIPT}/logo.png \
-filter_complex "[0][1]overlay=5:H-h-5:format=auto[bg];[bg][2]overlay=W-w-5:5:format=auto" -c:a copy ${TMP}/tmp-video.mkv
# #################################################### # ####################################################
# Concatenating videos # Concatenating videos
# #################################################### # ####################################################
PARAM="scale=1920:1080: force_original_aspect_ratio=decrease: eval=frame,pad=1920:1080: -1:-1:color=black"
ffmpeg -y \ ffmpeg -y \
-i ${SCRIPT}tmp-intro.mkv \ -i ${TMP}/tmp-intro.mkv \
-i ${SCRIPT}tmp-video.mkv \ -i ${TMP}/tmp-video.mkv \
-i ${SCRIPT}tmp-credits.mkv \ -i ${TMP}/tmp-credits.mkv \
-filter_complex \ -filter_complex \
"[0:v]$PARAM[v0]; [1:v]$PARAM[v1]; [2:v]$PARAM[v2]; [v0][0:a][v1][1:a][v2][2:a] concat=n=3:v=1:a=1 [v] [a]" \ "[0:v]$PARAM[v0]; [1:v]$PARAM[v1]; [2:v]$PARAM[v2]; [v0][0:a][v1][1:a][v2][2:a] concat=n=3:v=1:a=1 [v] [a]" \
-map [v] -map [a] \ -map [v] -map [a] \
@ -85,12 +90,7 @@ for aula in ./${SRC}*.md; do
-vcodec libx264 \ -vcodec libx264 \
-pix_fmt yuv420p \ -pix_fmt yuv420p \
-vsync 2 \ -vsync 2 \
"videos/${NAME}.mp4" "./videos/${NAME}.mp4"
done done
rm -f ${SCRIPT}tmp-intro.svg rm -f ${tmp}
rm -f ${SCRIPT}tmp-intro.mkv
rm -f ${SCRIPT}tmp-normalized.mkv
rm -f ${SCRIPT}tmp-watermark.svg
rm -f ${SCRIPT}tmp-video.mkv

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB