Como fazer screenshots múltiplas no Debian?

AnarcoPunkRJ

Power Member
Boas,

estou precisando fazer screenshots múltiplas no meu Debian, instalei uns 6 players diferentes e nenhum deles tem essa opção.

Preciso fazer screens de vídeos, mas apenas consigo screens únicas, gostaria de fazer aquela screen que gostam várias capturas, assim como o Windows Media Player Classic faz.

Alguém pode ajudar-me?


Obrigado
 
Abres um terminal na pasta onde tens o filme e:
Código:
$ mplayer -vf nome_do_filme.mpg
Opções:
s -> tira um shot
S -> começa a tirar shots (clica em S para parar) atenção: ficas com uma carrada de ficheiros


EDIT:
Outra ideia.
Cria uma pasta e copia para aí o vídeo. Abres um terminal dentro dessa pasta e:
Código:
$ ffmpeg -i NOME_DO_FILME -ss 5 -s sqcif -r .05 -y shot%03d.png; montage *.png -geometry +4+4 -tile 2x screenshots.png
Se o filme for muito longo vais ficar com muitas imagens... podes interromper com a tecla 'q'.
O 'montage' cria um ficheiro PNG com todos os screenshots (imagens png existentes nessa pasta)
 
Última edição:
Vou tentar e já digo.
A primeira não tentei pois preciso de várias screens em um único arquivo.


Não consegui.
Durante as capturas o seguinte erro fica aparecendo na consola:
"maker does not match f_code" dezenas de linhas.
Mas as screens são feitas e salvas, porém no final acontece o seguinte erro:
montage: command not found.

Tentei instalar o "ImageMagick" para poder utilizar o comando montage, sem sucesso.
Os seguintes avisos são apresentados:
' || echo './'`wand/magick-wand.c
mv -f wand/.deps/wand_libMagickWand_la-magick-wand.Tpo wand/.deps/wand_libMagickWand_la-magick-wand.Plo
/bin/sh ./libtool --silent --tag=CC --mode=compile gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I./config -fopenmp -g -O2 -Wall -W -pthread -MT wand/wand_libMagickWand_la-mogrify.lo -MD -MP -MF wand/.deps/wand_libMagickWand_la-mogrify.Tpo -c -o wand/wand_libMagickWand_la-mogrify.lo `test -f 'wand/mogrify.c' || echo './'`wand/mogrify.c




Alguém tem uma idéia de como ajudar-me?
Ficaria agradecido.
 
Última edição:
Outra possibilidade (requisitos: Perl, ffmpeg e Image Magick):

Código:
#!/usr/bin/perl -T
#===============================================================================
#
#         FILE:  video2shots.pl
#
#        USAGE:  ./video2shots.pl  [options]
#
#  DESCRIPTION:  captures frames from video and creates an image
#
# REQUIREMENTS:  ffmpeg imagemagick
#         BUGS:  probably lots!
#       AUTHOR:  slack_guy
#      VERSION:  1.1
#      CREATED:  22-05-2009
#     REVISION:  1.1 23-05-2009
#===============================================================================
#
#==========================================================================
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.
#==========================================================================
#

use strict;
use warnings;
$ENV{'PATH'} = '/bin:/usr/bin';
use Getopt::Long;
use File::Temp qw/tempfile tempdir/;

my $OPTIONS = {
    in_file  => undef,
    out_file => q|shots.png|,
    temp_dir => tempdir( CLEANUP => 1 ),
    start    => 1,
    frames   => 30,
    ratio    => q|.05|,
    cols     => 3,
    rows     => q||,
    border   => 2,
    size     => q|sqcif|,
    shadow   => q||,
};

my $options = GetOptions(
    'i|in|infile=s'   => \$OPTIONS->{in_file},
    'o|out|outfile=s' => \$OPTIONS->{out_file},
    'start=i'         => \$OPTIONS->{start},
    'frames=i'        => \$OPTIONS->{frames},
    'ratio=s'         => \$OPTIONS->{ratio},
    'cols=i'          => \$OPTIONS->{cols},
    'rows=i'          => \$OPTIONS->{rows},
    'border=i'        => \$OPTIONS->{border},
    'size=s'          => \$OPTIONS->{size},
    'shadow=s'        => \$OPTIONS->{shadow},
);

#####
# Required applications
chomp( my $ffmpeg  = qx|which ffmpeg 2>/dev/null| );
chomp( my $montage = qx|which montage 2>/dev/null| );

#####
# Exit with usage message if:
# 1. there's no input file argument
# 2. file doesn't exist
# 3. ffmpeg is not in path
# 4. montage is not in path
# 5. temporary directory doesn't exist
if (   !$OPTIONS->{in_file}
    || !-f $OPTIONS->{in_file}
    || !-e $OPTIONS->{temp_dir}
    || $ffmpeg !~ /^\//x
    || $montage !~ /^\//x )
{
    print _usage();
    exit 0;
}

my $video_title = video_encode( { options => $OPTIONS } );

image_montage(
    {
        options => $OPTIONS,
        title   => $video_title,
    }
);

exit 0;

sub image_montage {

    my $params = shift;
    my $_options = $params->{options}, my $title = $params->{title};

    ######
    # Reads png files from temporary directory and produces an image
    my $cmd_create_image = qq|$montage "$_options->{temp_dir}/*.png" |;
    $cmd_create_image .= qq| -frame $_options->{border} |;
    if ( $_options->{shadow} eq 'yes' ) { $cmd_create_image .= q| -shadow |; }
    $cmd_create_image .= qq| -pointsize 7 -title "$title"|;
    $cmd_create_image .= qq| -geometry +10+10 |;
    $cmd_create_image .= qq| -tile $_options->{cols}x$_options->{rows} |;
    $cmd_create_image .= qq| "$_options->{out_file}"|;
    $cmd_create_image = untaint($cmd_create_image);

    my $create_image = qx|$cmd_create_image 2>&1|;

    return;
}

sub video_encode {

    my $params   = shift;
    my $_options = $params->{options};

    ######
    # Encodes video and returns a string as Title
    my $cmd_encode = qq|$ffmpeg -i "$_options->{in_file}" |;
    $cmd_encode .= qq| -ss $_options->{start}|;
    $cmd_encode .= qq| -s $_options->{size} -vframes $_options->{frames} |;
    $cmd_encode .= qq| -r $_options->{ratio} -y |;
    $cmd_encode .= qq| "$_options->{temp_dir}/shot\%03d.png"|;
    $cmd_encode = untaint($cmd_encode);
    my $encode = qx|$cmd_encode 2>&1|;

    my ( $hrs_range, $min_range, $sec_range );
    if ( $encode =~ /Duration: (\d{2}):(\d{2}):(\d{2})/x ) {
        ( $hrs_range, $min_range, $sec_range ) = ( $1, $2, $3 );
    }

    return qq|$_options->{in_file}\n($hrs_range:$min_range:$sec_range)|;

}

sub _usage {

    return <<"TEXT";
Usage:

\t $0 [options]

Options:
\t -[infile|in|i] video_filename
\t -[outfile|out|o] image_filename
\t -start nn (default: 1 second)
\t -frames nn (default: 30)
\t -ratio .nn (default: .05)
\t -cols n (default: 2)
\t -rows n (default: )
\t -border n (default: 2)
\t -size string (default: sqcif - more options from ffmpeg)
\t -shadow [yes|no] (default: no)

Requirements:
\t ffmpeg
\t montage (image magick)

Example:
\t $0 -start 10 -frames 20 -cols 3 -border 0 -size qcif -i video.mpg -o out.png

TEXT

}

sub untaint {

    my $data = shift;
    if ( !$data ) { return }

    if ( $data =~ /^([-\@\w.\s"\/\%\*\(\)\:\+]+)$/mx ) {
        $data = $1;
    }
    else {
        die qq|Bad data in '$data'\n|;
    }

    return $data;
}

Exemplo:
Código:
$ chmod +x video2shots.pl
$ ./video2shots.pl -start 450 -i Pink\ Floyd\ -\ Live\ At\ Pompeii\ -\ Echoes\ _part\ 1_.mpg
$ xv shots.png
shots.png


Patches e sugestões são muito bem-vindos! :)
 
Última edição:
Back
Topo