SDVDMux
Publicado por Carlos Alberto 24/10/2006
[ Hits: 4.167 ]
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
Shell para extrair informações de impressoras Brother
Instalador de programas no Ubuntu
Script para atualização de sistemas Debian, Ubuntu e variáveis.
Listar o número de arquivos de um diretório
Ver TV e rádio online por shell script
Nenhum comentário foi encontrado.
Atualizar o macOS no Mac - Opencore Legacy Patcher
Crie alias para as tarefas que possuam longas linhas de comando - bash e zsh
Criando um gateway de internet com o Debian
Configuração básica do Conky para mostrar informações sobre a sua máquina no Desktop
Aprenda a criar músicas com Inteligência Artificial usando Suno AI
Instalando Zoom Client no Ubuntu 24.04 LTS
Instalando Zoom Client no Fedora 40
Instalando Navegador Firefox no Debian 12
Bloqueando propagandas no Youtube e outros sites com o uBlocker Origin
Configurando static ipv6 em placa de rede eth0[DUVIDA] (1)
Sistema da Coréia do Norte - Red Star OS (59)
Comando interno CD não funciona (16)
Dificuldade em ler binário (12)
Em que pasta/arquivo ficam as configurações das janelas em derivados d... (2)