`
lobin
  • 浏览: 390773 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

FFmpeg: 图像处理

 
阅读更多

像素

查看像素格式

 

可以通过ffmpeg工具指定-pix_fmts查看FFmpeg支持哪些像素格式:

./ffmpeg.exe -pix_fmts

 

像素格式参考AVPixelFormat定义。

 

和像素格式有关的一个重要概念: 颜色空间,如YUV,RGB等。

 

图像

 

图像处理

查看图像信息

./ffprobe.exe /cygdrive/h/huacao.jpg

ffprobe version 2.7.2 Copyright (c) 2007-2015 the FFmpeg developers

  built with gcc 4.5.3 (GCC)

  configuration: --enable-shared --prefix=/usr/local/ffmpeg

  libavutil      54. 27.100 / 54. 27.100

  libavcodec     56. 41.100 / 56. 41.100

  libavformat    56. 36.100 / 56. 36.100

  libavdevice    56.  4.100 / 56.  4.100

  libavfilter     5. 16.101 /  5. 16.101

  libswscale      3.  1.101 /  3.  1.101

  libswresample   1.  2.100 /  1.  2.100

Input #0, image2, from '/cygdrive/h/huacao.jpg':

  Duration: 00:00:00.04, start: 0.000000, bitrate: 28728 kb/s

    Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 800x450 [SAR 96:96 DAR 16:9], 25 tbr, 25 tbn, 25 tbc

 

图像格式转换

 

图像转换为yuv格式:

./ffmpeg -i /cygdrive/h/huacao.jpg -s 1024x680 -pix_fmt yuvj420p /cygdrive/h/huacao-pix_fmt_yuvj420p-1024x680.yuv

 

./ffprobe.exe /cygdrive/h/huacao-pix_fmt_yuvj420p-1024x680.yuv

ffprobe version 2.7.2 Copyright (c) 2007-2015 the FFmpeg developers

  built with gcc 4.5.3 (GCC)

  configuration: --enable-shared --prefix=/usr/local/ffmpeg

  libavutil      54. 27.100 / 54. 27.100

  libavcodec     56. 41.100 / 56. 41.100

  libavformat    56. 36.100 / 56. 36.100

  libavdevice    56.  4.100 / 56.  4.100

  libavfilter     5. 16.101 /  5. 16.101

  libswscale      3.  1.101 /  3.  1.101

  libswresample   1.  2.100 /  1.  2.100

[IMGUTILS @ 0x22a614] Picture size 0x0 is invalid

[IMGUTILS @ 0x22a194] Picture size 0x0 is invalid

[rawvideo @ 0x2001a200] Could not find codec parameters for stream 0 (Video: rawvideo (I420 / 0x30323449), yuv420p, -4 kb/s): unspecified size

Consider increasing the value for the 'analyzeduration' and 'probesize' options

/cygdrive/h/huacao-pix_fmt_yuvj420p-1024x680.yuv: Operation not permitted

 

1
0
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics