linux - Mplayer:每秒缩略图

标签 linux video ffmpeg thumbnails mplayer

我想每秒从视频创建缩略图,但由于某种原因 mplayer 跳帧。 例如,在 200 万 49 秒时长 的视频中,我只有 59 个缩略图,而不是 169 个

我尝试过的: mplayer -nosound -vo jpg:outdir=. -sstep 1 文件.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

最佳答案

你可以使用 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 个输出图像。

关于linux - Mplayer:每秒缩略图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18134527/

相关文章:

python - Linux (Ubuntu) 中的 systemd 服务出错

linux - 如何将 read() 设置为非阻塞模式

android - 无法在 Android 上从 Azure Blob 存储播放 mp4

iphone - 使用 FFMPEG 可靠地将视频转换为 iphone/ipod 和 flash 播放器的 mp4

linux - 默认情况下,如何将帮助结果通过管道传递给 less?

即使在 main 中的最后一条语句之后,Java 程序仍继续运行(在后台)

video - FFMPEG 棕褐色滤镜

ios - IOS上的YouTube视频不起作用

Cmd - 查找一些文件并在该文件上执行命令

nginx - 在端口 1935 上提供 rtmp