Skip to content

kunalkhanna/yuv-tools

 
 

Repository files navigation

YCbCr (YUV)

Tools for various operations on raw YCbCr video files. http://en.wikipedia.org/wiki/YCbCr

ycbcr.py - is the main class that supports the following formats:

  • IYUV
  • UYVY
  • YV12
  • NV12
  • YVYU
  • YUY2
  • 422

Supported operations:

  • basic info about a file
  • convert between any of the formats above (including correct sub- re-sampling of chroma-data)
  • split a file into individual frames
  • creates a diff between two files
  • PSNR calculations, one value per color-plane including weighted and average
  • get luma-data per frame
  • SSIM calculation on luma
  • convert between 8bpp and 10bpp
  • flip left/right, upside/down
  • draw frame number in luma-data
  • crop
  • visualization of PSNR/SSIM using matplotlib
  • reduce framerate by throwing away frames

Also includes a simple GUI using wxpython that wraps the psnr/ssim operations above.

Usage

$ ./ycbcr.py info foreman_352x288.yuv 352 288 YV12
$ ./ycbcr.py convert --help
$ ./ycbcr.py diff --help
$ ./ycbcr.py split --help
$ ./ycbcr.py psnr --help
$ ./ycbcr.py ssim --help
$ ./ycbcr.py 8to10 --help
$ ./ycbcr.py 10to8 --help
$ ./ycbcr.py fliplr --help
$ ./ycbcr.py flipud --help
$ ./ycbcr.py fnum --help
$ ./ycbcr.py crop --help
$ ./ycbcr.py fr --help
$ ./plot_diff.py foreman_cif_frame_0.yuv foreman_cif_frame_1.yuv 352 288 YV12
$ ./visual.py psnr_all foreman_cif_frame_0.yuv 352 288 YV12 foreman_cif_frame_1.yuv

Files

  • ycbcr.py - main class
  • plot_diff.py - matplotlib wrapper around PSNR/SSIM-calculation. Generate nice plots using luma-data.
  • verify.py - unittest
  • visual.py - matplotlib wrapper around PSNR/SSIM-calculation. Generate nice plots.

Screenshots

Here's one of the output from visual.py

psnr

psnr

About

Tools for working with YCbCr files. Format conversion, diffs, splitter, re/sub-sampling, etc

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%