FFMPEG命令(用于捕获关键帧)执行,但不创建输出文件

时间:2017-04-10 07:46:31

标签: vb.net ffmpeg

我正在尝试使用最新的FFMPEG exe的FFMPEG命令。该命令执行正常。但是没有创建输出文件。

这是我在DOS提示符下尝试的命令。根据一位同事的评论,这是(该命令)之前没有任何麻烦。

D:\Utilities\FFMPegVideoManager\FFMPEG_updated\ffmpeg.exe -i
"M:\content\video.mp4" -y -ss 1 -frames 1
"E:\frame\testtest.jpg"

执行后的输出是

C:\Users\ABCD>D:\Utilities\FFMPegVideoManager\FFMPEG_updated\ffmpeg.exe -i "M:\FTP Home Directory\LocalUser\WAP_UAT\Processing Folder\wspa1\Delivery\San4\content\0101_eatingredpanda.mp4" -y -ss 1 -frames 1 "E:\sandeep\testtest.jpg"
ffmpeg version N-85266-g1229007 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 6.3.0 (GCC)
  configuration: --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-zlib
  libavutil      55. 59.100 / 55. 59.100
  libavcodec     57. 90.100 / 57. 90.100
  libavformat    57. 72.100 / 57. 72.100
  libavdevice    57.  7.100 / 57.  7.100
  libavfilter     6. 83.100 /  6. 83.100
  libswscale      4.  7.100 /  4.  7.100
  libswresample   2.  8.100 /  2.  8.100
  libpostproc    54.  6.100 / 54.  6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'M:\content\0101_eatingredpanda.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    creation_time   : 1970-01-01T00:00:00.000000Z
    encoder         : Lavf52.31.0
  Duration: 00:00:19.52, start: 0.000000, bitrate: 12506 kb/s
    Stream #0:0(eng): Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p, 960x540 [SAR 1:1 DAR 16:9], 12373 kb/s, 25 fps, 25 tbr, 25 tbn, 25 tbc (default)
    Metadata:
      creation_time   : 1970-01-01T00:00:00.000000Z
      handler_name    : VideoHandler
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      creation_time   : 1970-01-01T00:00:00.000000Z
      handler_name    : SoundHandler
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg4 (native) -> mjpeg (native))
Press [q] to stop, [?] for help
[swscaler @ 0000000006238340] deprecated pixel format used, make sure you did set range correctly
Output #0, image2, to 'E:\sandeep\testtest.jpg':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    encoder         : Lavf57.72.100
    Stream #0:0(eng): Video: mjpeg, yuvj420p(pc), 960x540 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc (default)
    Metadata:
      creation_time   : 1970-01-01T00:00:00.000000Z
      handler_name    : VideoHandler
      encoder         : Lavc57.90.100 mjpeg
    Side data:
      cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
frame=    1 fps=0.0 q=6.6 Lsize=N/A time=00:00:00.04 bitrate=N/A speed=0.447x
video:48kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown 

所以从输出detials看起来似乎没问题。那为什么不创建输出文件呢?感谢

1 个答案:

答案 0 :(得分:0)

您可以尝试使用此命令从视频文件中提取第一帧:

  

ffmpeg.exe -i M:\ content \ video.mp4 -vf“select = gte(n \,1)” - vframes 1   out_1.png

例如,如果您想要获得第100帧,则以下变体将是合适的:

  

ffmpeg.exe -i M:\ content \ video.mp4 -vf“select = gte(n \,100)” - vframes 1   out_100.png

要识别视频文件中的kayframe,您可以尝试下一个命令:

  

ffprobe.exe M:\ content \ video.mp4 -show_entries frame = key_frame -select_streams v -of compact = p = 0