【问题标题】:Mplayer: Thumbnails every secondMplayer:每秒缩略图
【发布时间】:2013-08-10 16:01:36
【问题描述】:

我想每秒从视频中创建缩略图,但由于某种原因mplayer 会跳过帧。 例如,在2mn 49s duration 的视频中,我只有 59 个缩略图而不是 169 个

我尝试过的: mplayer -nosound -vo jpg:outdir=. -sstep 1 file.flv


媒体信息文件.flv

General
Complete name                            : file.flv
Format                                   : Flash Video
File size                                : 12.6 MiB
Duration                                 : 2mn 49s
Overall bit rate                         : 626 Kbps
Tagging application                      : Yet Another Metadata Injector for FLV - Version 1.8

Video
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L3.0
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 4 frames
Codec ID                                 : 7
Duration                                 : 2mn 48s
Bit rate                                 : 555 Kbps
Width                                    : 704 pixels
Height                                   : 396 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 30.000 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.066
Stream size                              : 11.2 MiB (89%)
Writing library                          : x264 core 125
Encoding settings                        : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=48 / lookahead_threads=6 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=abr / mbtree=1 / bitrate=555 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00

【问题讨论】:

  • 在 Windows 上查看这个问题我也遇到了一个问题,sstep 的行为很奇怪......但可能与此相反。我的示例视频是 3:07(187 秒),但第 71 个以上的缩略图是结束帧。在我的情况下,我想要 X(嗯,10)个视频,所以我将总时间除以 X,四舍五入并将其设置为 sstep。然后我将最大帧数设置为 X。mplayer -nosound -vo jpeg:outdir=thumbnails -sstep 18 -frames 10 video.mp4 我不再得到空帧

标签: linux video ffmpeg thumbnails mplayer


【解决方案1】:

你可以使用 ffmpeg。

PNG

ffmpeg -i input -r 1 output_%03d.png

JPG

ffmpeg -i input -r 1 -qscale:v 2 output_%03d.jpg

  • -r 1 将每秒输出 1 帧。 -r 1/5 将每 5 秒输出 1 帧。

  • 这将产生以output_001.jpg开头的数字顺序文件。

  • 对于 JPG,您可以使用 -qscale:v 改变输出质量。范围是 2(最佳质量)到 31(最差质量)。

  • 如果你想限制输出文件的数量,你可以添加-frames:v,例如-frames:v 10 10个输出图像。

【讨论】:

  • ffmpeg 比 mplayer 慢很多,但我想我别无选择。
  • @rabotalius select 视频过滤器的使用可能更快,但我没有测试。
猜你喜欢
  • 1970-01-01
  • 2014-08-26
  • 1970-01-01
  • 2017-01-21
  • 1970-01-01
  • 1970-01-01
  • 2017-05-15
  • 2019-12-04
  • 1970-01-01
相关资源
最近更新 更多