fluent 的后处理动画制作实在让人痛苦,还是自己摸索一下,用实际命令比较合适。找了一堆的视频转换工具,没个合适的,还不如 MSW
带的 MovieMaker 好使。
先看看 mpeg_encode 如何使用:
Usage:
mpeg_encode [options] param_file
Options:
-stat stat_file: append stats to stat_file
-quiet n: don't report remaining time for at least n seconds
-realquiet: output nothing at all if successful
-no_frame_summary: suppress frame summary lines
-float_dct: use more accurate floating point DCT
-gop gop_num: encode only the numbered GOP
-combine_gops: combine GOP files instead of encode
-frames first_frame last_frame: encode only the specified frames
-combine_frames: combine frame files instead of encode
-nice: run slave processes nicely
-max_machines num_machines: use at most num_machines machines
-snr: print signal-to-noise ratio
-bit_rate_info rate_file: put bit rate in specified file
-mv_histogram: show histograms of motion vectors
下面给出目前用的 param_file,主要处理 ppm 文件。
INPUT_DIR tmp
OUTPUT seq1.mpg
BASE_FILE_FORMAT PPM
INPUT
sequence-1_*.ppm [0000-0139]
END_INPUT
PATTERN IBBPBBPBBP
INPUT_CONVERT *
GOP_SIZE 16
SLICES_PER_FRAME 1
PIXEL HALF
RANGE 10
PSEARCH_ALG LOGARITHMIC
BSEARCH_ALG CROSS2
IQSCALE 1
PQSCALE 1
BQSCALE 1
REFERENCE_FRAME ORIGINAL
FRAME_RATE 30
FORCE_ENCODE_LAST_FRAME
试试 ImageMagick 制作动画,倒是挺不错。比 mpeg_encode 来得好使,功能也更强大。
首先,为了得到体积较小的动画文件,把文件转成 jpg。批量转换的话,直接用脚本调用就可以了。
convert -quality 50% seqence-1_0000.ppm sequence-1_0000.jpg
然后,转换合成 gif 动画。
convert -delay 20 -loop 0 *.jpg seq1.gif

本文介绍了在Fluent后处理中制作动画的困难,并推荐了使用mpeg_encode和ImageMagick作为解决方案。通过mpeg_encode的参数设置和ImageMagick的转换脚本,可以将PPM文件转换为高质量的MPG或GIF动画。

4050

被折叠的 条评论
为什么被折叠?



