Explore / Programming O que isso aqui faz? #!/bin/bash #clear #echo -e… Save Share Download ▾ ReportIn OpenAssistant data, “assistant” turns were written by human volunteers as demonstrations. They are not model outputs.
User2023-02-07 14:13 UTC Copy prompt O que isso aqui faz?
#!/bin/bash
#clear
#echo -e '\033[01;32mABCDEFGHIJKLMNOPQRS\033[00;0m'
echo -e '\033[01;32m—— KWAICUTTER v3 ——\033[00;0m'
echo -e "\033[01;32m———————————————————\033[00;0m"
folder=( p w d ) t l = " t e m p l o g . t x t " v i d e o = (pwd)
tl="temp_log.txt"
video= ( pw d ) tl = " t e m p l o g . t x t " v i (ls -t " (ls -t " tl
echo -e "\033[01;32mVídeo:\033[00;0m tl
echo -e "\033[01;32mFundo:\033[00;0m tl
now= now >> now.mp4"
if [[ " start" >> end" >> (ffmpeg -i " (echo (echo (echo (echo answer" == "s" ]; then
break
elif [ " start" -to " video" -i " line1': fontfile='SourceSansPro-Black.otf': fontsize=60: fontcolor=white: x=(w-text_w)/2: y=185,
drawtext=text=' line3': fontfile='SourceSansPro-Black.otf': fontsize=60: fontcolor=white: x=(w-text_w)/2: y=965,
drawtext=text=' folder/cortes/$outputfile" -y
Show full message · 57 lines Assistant2023-02-22 20:27 UTC Copy response Este é um script em bash que corta um vídeo, adiciona uma imagem de fundo e adiciona quatro linhas de texto em uma fonte chamada "SourceSansPro-Black.otf". Aqui está o que ele faz em detalhes:
Limpa a tela (se essa linha estiver ativada)
Imprime o cabeçalho do script: "—— KWAICUTTER v3 ——"
Obtém o diretório atual e define o nome do arquivo temporário para armazenar o log.
Obtém o último vídeo e a última imagem PNG no diretório atual e imprime seus nomes.
Adiciona a data e a hora atuais ao arquivo de log.
Pergunta ao usuário se ele deseja definir um ponto de início e término personalizados para o corte de vídeo ou usar os valores padrão.
Pergunta ao usuário pelo título e subtítulo para o vídeo.
Pergunta ao usuário se ele deseja renderizar o vídeo ou não.
Cria um diretório chamado "cortes" se ele não existir.
Usa o software FFmpeg para cortar o vídeo de acordo com os pontos de início e término (ou o valor padrão, se nenhum ponto de início e término personalizados for especificado).
Adiciona a imagem de fundo e as quatro linhas de texto no vídeo.
Copy first prompt Copy first response
Other models, same or similar prompt Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Details
Provider OpenAssistant (human-written)
Model provenance As recorded by source dataset
Turns 1 (2 messages)
Language pt
Conversation date Feb 7, 2023
Added to archive Nov 16, 2026
ID 01m7h3y4yp0x6gaxbgwd6qrch1Source & license Imported from OpenAssistant Conversations (oasst2) (source ). Imported records earn no Research Points.
Upstream record: 0c34dd8f-836e-4f15-8fd5-ed83025bdb89:663a8699-19e1-4cb3-bdc7-73de74346795
Köpf et al., OpenAssistant Conversations — Democratizing Large Language Model Alignment (2023).
License: Apache-2.0
Dataset releases Not yet included in a published release.
d
eo
=
f o l d e r " ∣ g r e p ′ . m p 4 ′ ∣ h e a d − 1 ) i m a g e = folder" | grep '.mp4' | head -1)
image= f o l d er "∣ g r e p ′ . m p 4 ′ ∣ h e a d − 1 ) ima g e = folder" | grep '.png' | head -1)
#echo -e "\033[01;32mRECURSOS DETECTADOS\033[00;0m
echo "" >
v i d e o " ∣ t e e − a video" | tee -a v i d eo "∣ t ee − a i m a g e " ∣ t e e − a image" | tee -a ima g e "∣ t ee − a ( d a t e + " (date +"%d-%m-%Y_%H-%M-%S") ; echo ( d a t e + " tl
outputfile="corte_
@ " = = ∗ " − c " ∗ ] ] ; t h e n e c h o − e " \0 33 [ 01 ; 32 m ——————————————————— \0 33 [ 00 ; 0 m " e c h o − e − n " \0 33 [ 01 ; 32 m I n ı ˊ c i o [ E x 00 : 00 : 10 ] : \0 33 [ 00 ; 0 m " ; r e a d s t a r t ; e c h o " c o m e c \c o : @" == *"-c"* ]]; then
echo -e "\033[01;32m———————————————————\033[00;0m"
echo -e -n "\033[01;32mInício [Ex 00:00:10]: \033[00;0m"; read start ; echo "começo: @" == ∗ " − c " ∗ ]] ; t h e n ec h o − e " \0 33 [ 01 ; 32 m ——————————————————— \0 33 [ 00 ; 0 m " ec h o − e − t l e c h o − e − n " \0 33 [ 01 ; 32 m F i n a l [ E x 00 : 01 : 30 ] : \0 33 [ 00 ; 0 m " ; r e a d e n d ; e c h o " t h e e n d : tl
echo -e -n "\033[01;32mFinal [Ex 00:01:30]: \033[00;0m" ; read end ; echo "the end: tl ec h o − e − n " \0 33 [ 01 ; 32 m F ina l [ E x 00 : 01 : 30 ] : \0 33 [ 00 ; 0 m " ; r e a d e n d ; ec h o " t h ee n d : t l e l s e s t a r t = " 00 : 00 : 00 " e n d = tl
else
start="00:00:00"
end= tl e l ses t a r t = "00 : 00 : 00" e n d = undefined
line1 | sed "s/'/\'\\\\\\\\\\\\''/g")
line2=
line2 | sed "s/'/\'\\\\\\\\\\\\''/g")
line3=
line3 | sed "s/'/\'\\\\\\\\\\\\''/g")
line4=
line4 | sed "s/'/\'\\\\\\\\\\\\''/g")
while true; do
echo -e "\033[01;32m———————————————————\033[00;0m"
echo -e -n "\033[01;33mRenderizar? (s/n) \033[00;0m" ; read answer
if [ "
a n s w e r " = = " n " ] ; t h e n e x i t e l s e e c h o − e " \0 33 [ 01 ; 31 m A p e n a s ′ s ′ o u ′ n ′ \0 33 [ 00 ; 0 m " f i d o n e i f t e s t ! − d c o r t e s ; t h e n m k d i r c o r t e s f i f f m p e g − s s " answer" == "n" ]; then
exit
else
echo -e "\033[01;31mApenas 's' ou 'n'\033[00;0m"
fi
done
if test ! -d cortes; then
mkdir cortes
fi
ffmpeg -ss " an s w er " == " n " ] ; t h e n e x i t e l seec h o − e " \0 33 [ 01 ; 31 m A p e na s ′ s e n d " − a v o i d n e g a t i v e t s m a k e z e r o − i " end" -avoid_negative_ts make_zero -i " e n d " − a v o i d n e g a t i v e t s mak e z er o − i " i m a g e " − f i l t e r c o m p l e x " [ 0 ] s c a l e = − 1 : 540.5 [ v i d ] ; [ 1 ] s c a l e = − 1 : − 1 [ i m g ] ; [ i m g ] [ v i d ] o v e r l a y = ( W − w ) / 2 : ( H − h ) / 2 , d r a w t e x t = t e x t = ′ image" \
-filter_complex "[0]scale=-1:540.5[vid]; [1]scale=-1:-1[img]; [img][vid] overlay=(W-w)/2:(H-h)/2, \
drawtext=text=' ima g e " − f i l t e r c o m pl e x " [ 0 ] sc a l e = − 1 : 540.5 [ v i d ] ; [ 1 ] sc a l e = − 1 : − 1 [ im g ] ; [ im g ] [ v i d ] o v er l a y = ( W − w ) /2 : ( H − h ) /2 , d r a w t e x t = t e x t = ′
l i n e 2 ′ : f o n t f i l e = ′ S o u r c e S a n s P r o − B l a c k . o t f ′ : f o n t s i z e = 60 : f o n t c o l o r = w h i t e : x = ( w − t e x t w ) / 2 : y = 255 , d r a w t e x t = t e x t = ′ line2': fontfile='SourceSansPro-Black.otf': fontsize=60: fontcolor=white: x=(w-text_w)/2: y=255, \
drawtext=text=' l in e 2 ′ : f o n t f i l e = ′ S o u r ce S an s P r o − B l a c k . o t f ′ : f o n t s i z e = 60 : f o n t co l or = w hi t e : x = ( w − t e x t w ) /2 : y = 255 , d r a w t e x t = t e x t = ′
l i n e 4 ′ : f o n t f i l e = ′ S o u r c e S a n s P r o − B l a c k . o t f ′ : f o n t s i z e = 60 : f o n t c o l o r = w h i t e : x = ( w − t e x t w ) / 2 : y = 1035 " − p r e s e t u l t r a f a s t − c : a a a c − v q u i e t − s t a t s " line4': fontfile='SourceSansPro-Black.otf': fontsize=60: fontcolor=white: x=(w-text_w)/2: y=1035" \
-preset ultrafast -c:a aac -v quiet -stats " l in e 4 ′ : f o n t f i l e = ′ S o u r ce S an s P r o − B
Salva o vídeo renderizado no diretório "cortes" com um nome baseado na data e hora atual. n " \0 33 [ 01 ; 32 m I n ı ˊ c i o [ E x 00 :
00 :
10 ] :
\0 33 [ 00 ; 0 m " ; r e a d s t a r t ; ec h o " co m e c \c o :
′
o
u ′
n ′
\0
33
[
00
;
0
m
"
f
i
d
o
n
e
i
f
t
es
t
!
−
d cor t es ; t h e nmk d i r cor t es f i f f m p e g −
ss "
l
a
c
k
.
o
t
f ′
:
f o n t s i z e =
60 :
f o n t co l or =
w hi t e :
x =
( w −
t e x t w ) /2 :
y =
1035" −
p r ese t u l t r a f a s t −
c :
aaa c −
v q u i e t −
s t a t s "