```python import cv2 import numpy as np from matplotlib import pyplot as plt from IPython.display import display from PIL import Image ``` ```python cap = cv2.VideoCapture("filesrc location=street.h264 ! h264parse ! vaapih264dec ! videoconvert ! video/x-raw,format=NV12 ! appsink") ret, vaapi = cap.read() cap.release() rgb_vaapi = cv2.cvtColor(vaapi, cv2.COLOR_YUV2RGB_NV12) display(Image.fromarray(rgb_vaapi)) ``` ![](https://i.imgur.com/2KpHjWH.jpg) ```python cap = cv2.VideoCapture("filesrc location=street.h264 ! h264parse ! mfxh264dec ! videoconvert ! video/x-raw,format=NV12 ! appsink") ret, mfx = cap.read() cap.release() rgb_mfx = cv2.cvtColor(mfx, cv2.COLOR_YUV2RGB_NV12) display(Image.fromarray(rgb_mfx)) ``` ![](https://i.imgur.com/yvu1wr4.jpg) ```python cap = cv2.VideoCapture("filesrc location=street.h264 ! h264parse ! avdec_h264 ! videoconvert ! video/x-raw,format=NV12 ! appsink") ret, av = cap.read() cap.release() rgb_av = cv2.cvtColor(av, cv2.COLOR_YUV2RGB_NV12) display(Image.fromarray(rgb_av)) ``` ![](https://i.imgur.com/4R1wf4b.jpg)