2 个不稳定版本
0.4.0 | 2021 年 10 月 2 日 |
---|---|
0.3.1 | 2020 年 9 月 2 日 |
#502 在 图像
600KB
2K SLoC
Rust 中的视频联系人表(in)
用 Rust 编写的视频联系人表生成器。
存在的理由
此应用程序是 vcsi 的直接移植。算法和设计的全部功劳归原作者。
我在学习 Rust,在处理另一个项目时,我需要一个联系人表生成器。现有的生成器在安装时需要一些其他工具,而我想要一个可以直接使用的东西。这个过程使我能够专注于语言的易用性,而不是算法。
安装
我希望安装过程尽可能简单。从 发行版 下载您平台上的存档(也许将来会在 Windows 上)。解压缩二进制文件并将其放置在您的 $PATH
上。
需求
ffmpeg
和 ffprobe
需要安装。
用法
示例
最简单的用法是运行它,除了输入文件外不使用任何额外参数。请参阅以下完整的参数列表以获取默认值。
$ vcsr bbb_sunflower_2160p_60fps_normal.mp4
参数
$ vcsr -h
vcsr 0.1.0
USAGE:
vcsr [FLAGS] [OPTIONS] <filenames>...
FLAGS:
-a, --accurate Make accurate captures. This capture mode is way slower than the default one but it
helps when capturing frames from HEVC videos.
-S, --actual-size Make thumbnails of actual size. In other words, thumbnails will have the actual 1:1
size of the video resolution.
--fast Fast mode. Just make a contact sheet as fast as possible, regardless of output image
quality. May mess up the terminal.
-h, --help Prints help information
--ignore-errors Ignore any error encountered while processing files recursively and continue to the
next file.
--no-overwrite Do not overwrite output file if it already exists, simply ignore this file and
continue processing other unprocessed files.
--no-shadow show dropshadow on frames
-r, --recursive Process every file in the specified directory recursively
-t, --show-timestamp display timestamp for each frame
--timestamp-border-mode Draw timestamp text with a border instead of the default rectangle.
-V, --version Prints version information
-v, --verbose display verbose messages
OPTIONS:
-A, --accurate-delay-seconds <accurate-delay-seconds>
Fast skip to N seconds before capture time, then do accurate capture (decodes N seconds of video before each
capture). This is used with accurate capture mode only.
--background-colour <background-colour>
Color of the timestamp background rectangle in hexadecimal, for example AABBCC [default: ffffff00]
--capture-alpha <capture-alpha>
Alpha channel value for the captures (transparency in range [0, 255]). Defaults to 255 (opaque) [default:
255]
--delay-percent <delay-percent>
do not capture frames in the first and last n percent of total time
--end-delay-percent <end-delay-percent>
do not capture frames in the last n percent of total time [default: 7]
--exclude-extensions <exclude-extensions>...
Do not process files that end with the given extensions.
--frame-type <frame-type>
Frame type passed to ffmpeg 'select=eq(pict_type,FRAME_TYPE)' filter. Should be one of ('I', 'B', 'P') or
the special type 'key' which will use the 'select=key' filter instead.
-g, --grid <grid>
display frames on a mxn grid (for example 4x5). The special value zero (as in 2x0 or 0x5 or 0x0) is only
allowed when combined with --interval or with --manual. Zero means that the component should be
automatically deduced based on other arguments passed. [default: 4x4]
--grid-horizontal-spacing <grid-horizontal-spacing>
number of pixels spacing captures horizontally [default: 15]
--grid-spacing <grid-spacing>
number of pixels spacing captures both vertically and horizontally
--grid-vertical-spacing <grid-vertical-spacing>
number of pixels spacing captures vertically [default: 15]
-f, --format <image-format>
Output image format. Can be any format supported by image-rs. For example 'png' or 'jpg'. [default:
jpg]
--interval <interval>
Capture frames at specified interval. Interval format is any string supported by `humantime`. For example
'5m', '3 minutes 5 seconds', '1 hour 15 min and 20 sec' etc.
-m, --manual <manual-timestamps>...
Space-separated list of frame timestamps to use, for example 1:11:11.111 2:22:22.222
--metadata-background-colour <metadata-background-colour>
Color of the metadata background in hexadecimal, for example AABBCC [default: b0cd7b0a]
--metadata-font <metadata-font> Path to TTF font used for metadata
--metadata-font-colour <metadata-font-colour>
Color of the metadata font in hexadecimal, for example AABBCC [default: ffffff00]
--metadata-font-size <metadata-font-size>
size of the font used for metadata [default: 32]
--metadata-horizontal-margin <metadata-horizontal-margin>
Horizontal margin (in pixels) in the metadata header. [default: 15]
--metadata-margin <metadata-margin>
Margin (in pixels) in the metadata header. [default: 15]
--metadata-position <metadata-position>
Position of the metadata header. [default: top] [possible values: Top, Bottom,
Hidden]
--metadata-vertical-margin <metadata-vertical-margin>
Vertical margin (in pixels) in the metadata header. [default: 10]
-s, --num-samples <num-samples> number of samples
-o, --output <output-path> save to output file
--start-delay-percent <start-delay-percent>
do not capture frames in the first n percent of total time [default: 7]
-O, --thumbnail-output-path <thumbnail-output-path>
Save thumbnail files to the specified output directory. If set, the thumbnail files will not be deleted
after successful creation of the contact sheet.
--timestamp-background-colour <timestamp-background-colour>
Color of the timestamp background rectangle in hexadecimal, for example AABBCC [default: 000000aa]
--timestamp-border-colour <timestamp-border-colour>
Color of the timestamp border in hexadecimal, for example AABBCC [default: 000000]
--timestamp-border-radius <timestamp-border-radius>
Draw timestamp text with a border instead of the default rectangle. [default: 1.0]
--timestamp-border-size <timestamp-border-size>
Size of the timestamp border in pixels (used only with --timestamp-border-mode). [default: 1]
--timestamp-font <timestamp-font> Path to TTF font used for timestamps
--timestamp-font-colour <timestamp-font-colour>
Color of the timestamp font in hexadecimal, for example AABBCC [default: ffffff]
--timestamp-font-size <timestamp-font-size>
size of the font used for timestamps [default: 12]
--timestamp-horizontal-margin <timestamp-horizontal-margin> [default: 5]
--timestamp-horizontal-padding <timestamp-horizontal-padding>
Horizontal padding (in pixels) for timestamps. [default: 3]
-T, --timestamp-position <timestamp-position>
Timestamp position. [default: se] [possible values: North, South, East,
West, NE, NW, SE, SW, Center]
--timestamp-vertical-margin <timestamp-vertical-margin>
Vertical margin (in pixels) for timestamps. [default: 5]
--timestamp-vertical-padding <timestamp-vertical-padding>
V ertical padding (in pixels) for timestamps. [default: 1]
-w, --width <vcs-width>
width of the generated contact sheet [default: 1500]
ARGS:
<filenames>...
依赖关系
~28–38MB
~430K SLoC