SDVDMux
Publicado por Carlos Alberto 24/10/2006
[ Hits: 4.540 ]
O SDVDMux serve para adicionar legendas em arquivos MPEG, além de testar se seu sistema tem o necessário para fazer isso. Basta ter em uma mesma pasta o vídeo e todas as legendas.
Os nomes dos arquivos não devem ter espaços, vírgulas ou acentos, todas as legendas serão acrescentadas uma a uma, gerando um arquivo mpeg final.
Sua execução ficaria assim:
./sdvdmux -f fps -v video.mpg -l '*.srt'
#!/bin/sh
#
# sdvdmux - attempt to multiplex an unknown type of text suttitle in to a dvd video file.
#
# Copyright (C) 1991 by Carlos Alberto (carlosxlinux@Gmail.com).
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted, provided
# that the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation. This software is provided "as is" without express or
# implied warranty.
SPUMUX=`ls /usr/bin/spumux 2> /dev/null`
MPGINFO=`ls /usr/bin/mpginfo 2> /dev/null`
NUM="0"
if [ -z $SPUMUX ];
then
echo "Não encontrado o pacote dvdauthor, instale-o e tente novamente."
exit 2;
fi
while getopts l:L:v:V:f:F OPT
do
case ${OPT} in
t | T) TIPO_TRACK="${OPTARG}";;
l | L) SUBT_TRACK="${OPTARG}";;
v | V) VIDE_TRACK="${OPTARG}";;
f | F) VID_FPS_SRC="${OPTARG}";;
h | H) echo "Desconhecido ou incompleto.";
echo "Use: sdvdmux [-f fps] [ -t dvd, cvd, or svcd ] -l arquivo_legenda -v arquivo_mpeg";
exit 2;;
esac
done
if [ -z "$SUBT_TRACK" -o -z "$VIDE_TRACK" ];
then
echo "Desconhecido ou incompleto.";
echo "Use: sdvdmux [-f fps] [ -m dvd, cvd, or svcd ] -l arquivo_legenda -v arquivo_mpeg";
exit 2;
fi
ARQUIVOTIPO=`file "$VIDE_TRACK" | cut -d: -f2 | cut -d, -f1 | cut -d" " -f2-`
if [ "$ARQUIVOTIPO" != "MPEG sequence" ];
then
echo "$VIDE_TRACK: não é um arquivo do tipo MPEG ou arquivo não informado."
exit 2;
fi
TTFTEST=`ls $HOME/.spumux/*.ttf 2> /dev/null`
if [ -z "$TTFTEST" ];
then
ln -fs /usr/share/fonts/truetype/msttcorefonts/ $HOME/.spumux
fi
TTFTEST=`ls $HOME/.spumux/arial.ttf 2> /dev/null`
if [ -z "$TTFTEST" ];
then
echo "Fonte ARIAL não encontrada, instale o pacote msttcorefonts, e tente novamente.";
exit 2;
fi
if [ -z $TIPO_TRACK ];
then
TIPO_TRACK="dvd";
fi
if [ -z $VID_FPS_SRC ];
then
if [ -z $MPGINFO ];
then
echo "Não encontrado o programa mpginfo no seu patch, é necessário para a detecção dos frames do video.";
echo "Assumindo 25 fps.";
VID_FPS_SRC="25";
else
VID_FPS_SRC=`$MPGINFO -N "$VIDE_TRACK" 2> /dev/null | grep "fps" | awk '{print $5}'`;
VID_WIDTH=`mpginfo -N "$VIDE_TRACK" 2> /dev/null | grep "Size" | cut -d"[" -f 2 | awk '{print $1}'`;
VID_HEIGHT=`mpginfo -N "$VIDE_TRACK" 2> /dev/null | grep "Size" | cut -d"]" -f 1 | awk '{print $4}'`;
echo "Video com $VID_FPS_SRC fps e $VID_WIDTH x $VID_HEIGHT detectados.";
if test "${VID_FPS_SRC}" == ""; then
echo "Não foi possível detectar a taxa de frames.";
echo "Assumindo 25 fps.";
VID_FPS_SRC="25";
fi
fi
fi
for LISTA in `ls $SUBT_TRACK`;
do
SPUXML="<subpictures><stream><textsub filename='$LISTA' characterset='ISO8859-1' fontsize='28.0' font='arial.ttf' horizontal-alignment='center' vertical-alignment='bottom' bottom-margin='30' subtitle-fps='$VID_FPS_SRC' movie-width='720' movie-height='480' /></stream></subpictures>"
echo "$SPUXML" > spuxml.xml;
fim=`spumux -s "$NUM" -P -m "$TIPO_TRACK" "spuxml.xml" < "$VIDE_TRACK" > videofinal-$NUM.mpg`;
echo $fim;
echo "Acrescentada a legenda $NUM"
VIDE_TRACK="videofinal-$NUM.mpg"
if [ "$NUM" -gt "0" ];
then
rm -f videofinal-$NUM1.mpg;
fi
NUM1=$NUM;
NUM=`expr $NUM + 1`;
done
rm -f spuxml.xml
User manager - o gerenciador de usuários para Slackware Linux
Organizar seus arquivos por pastas
Solicitar senha para abrir programa
Script bem simples para eniar e-mail com arquivo em anexo.
Nenhum comentário foi encontrado.
Modo Simples de Baixar e Usar o bash-completion
Monitorando o Preço do Bitcoin ou sua Cripto Favorita em Tempo Real com um Widget Flutuante
Instalando partes faltantes do Plasma 6
Adicionar botão "mostrar área de trabalho" no Zorin OS
Como montar um servidor de backup no linux
Estou tentando ser legalista, mas tá complicado! (9)
espelhar monitores nao funciona (2)
SQLITE não quer funcionar no LINUX LMDE6 64 com Lazaruz 4.2 64bit (n... (1)









