-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvwaves
executable file
·127 lines (116 loc) · 2.89 KB
/
vwaves
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#! /bin/bash
# 01 Se discretiza ${filter_complex}
# 02 Se elimina el logotipo y se substituye por el texto @tocamgar
# Se fija el tamaño en 360p
# Se modifica el texto para que no expanda los caracteres especiales (: \)
#################################################################################################
#set -x
#echo -n "Introduce el audio de entrada: "
read -ep "Introduce el audio de entrada (/mnt/d/Sonido/PRENSA/): " -i "/mnt/d/Sonido/PRENSA/" a_entrada # RUTA COMPLETA DEL AUDIO DE ENTRADA
# a_entrada="/mnt/d/Sonido/PRENSA/EL DIARIO.ES/El exnúmero dos de Interior depositó ante.m4a" # RUTA COMPLETA DEL AUDIO DE ENTRADA
ruta="${a_entrada%/*}/" # SOLO LA RUTA DEL FICHERO DE AUDIO
nom_f="${a_entrada##*/}" # NOMBRE DEL FICHERO CON EXTENSIÓN
ext_f=".${nom_f##*.}" # EXTENSIÓN DEL FICHERO CON . DELANTE
nom_f="${nom_f%.*}" # NOMBRE DEL FICHERO SIN EXTENSIÓN
#echo -n "Introduce la ruta del vídeo de salida: "
read -ep "Introduce la ruta del vídeo de salida (/mnt/d/Vídeos/PRENSA/): " -i "/mnt/d/Vídeos/PRENSA/" ruta_salida # RUTA DEL VIDEO DE SALIDA
fontfile="/mnt/c/Windows/Fonts/impact.ttf" # UBICACIÓN DE LA FUENTE DE TEXTO A EMPLEAR
read -ep "Introduce el titular 1: " txt_l1 # LINEA 1 DE TEXTO A INCRUSTAR
read -ep "Introduce el titular 2: " txt_l2 # LINEA 2 DE TEXTO A INCRUSTAR
#read -p "Introduce la url: " url # LINEA 2 DE TEXTO A INCRUSTAR
fondo="/mnt/d/Pictures/${nom_f}.png"
#logo="/mnt/d/Pictures/logo-cam_53x26.png" # RUTA COMPLETA DE LA MARCA DE AGUA A INCRUSTAR
f_resolucion='
[0:v]
scale=
width=640:
height=640:
flags=bicubic
[fondo]
'
f_txt_l1='
,
drawtext=
fontfile='${fontfile}':
text='${txt_l1}':
fontcolor=white:
borderw=1:
fontsize=20:
alpha=1:
x=(w-tw)/2:
y=(th/4):
expansion=none
'
f_txt_l2='
,
drawtext=
fontfile='${fontfile}':
text='${txt_l2}':
fontcolor=white:
borderw=1:
fontsize=20:
alpha=1:
x=(w-tw)/2:
y=(2*th/4)+text_h:
expansion=none
'
f_txt_logo='
,
drawtext=
fontfile='/mnt/c/Windows/Fonts/arial.ttf':
text='@tocamgar':
fontcolor=white:
borderw=1:
fontsize=18:
alpha=1:
x=w-tw-10:
y=h-th-10:
expansion=none
[fondo]
'
f_showwaves="
;
[1:a]
showwaves=
s=380x260:
mode=cline:
scale=cbrt:
colors=white,
colorkey=
color=0x000000:
similarity=0.25:
blend=0.75,
format=argb,
colorchannelmixer=
aa=0.8
[waves]
;
[fondo][waves]
overlay=
x=240:
y=251
[v]
"
#[fondo][waves]
# overlay=
# x=(main_w-overlay_w)/2:
# y=(main_h-overlay_h-15)
#[v]
#filter_complex="${f_resolucion}${f_txt_l1}${f_txt_l2}${f_txt_logo}${f_showwaves}"
filter_complex="${f_resolucion}${f_showwaves}"
v_salida="${ruta_salida}${nom_f}_waves.mp4" # RUTA COMPLETA DEL VIDEO DE SALIDA
##########
# FFMPEG #
##########
ffmpeg -y \
-i "${fondo}"\
-i "${a_entrada}"\
-filter_complex "${filter_complex}" \
-map '[v]' \
-map '1:a' \
-c:v h264 \
-crf 32 \
-c:a aac \
-q:a 0.4 \
-ac 1 \
"${v_salida}"