# Homework 2 - x264 encoding 

===

### install x264 lib
```
  $ sudo apt-get install libx264-dev
```
### convert mp4 file to YUV 
```
  $ ffmpeg -i sample.mp4 -f rawvideo -vcodec rawvideo -pix_fmt yuv420p sample.yuv
```

### make a mp4 container for h264 file
```
  $ ffmpeg -i source.h264 -c:v copy -f mp4 myOutputFile.mp4
```

### calculate PSNR
```
  $ ffmpeg -i input_video.mp4 -i reference_video.mp4 -filter_complex "psnr" "output_video.mp4"
```
