Skip to content

Latest commit

 

History

History
 
 

gen2-play-encoded-stream

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Play Encoded Stream

These demos show how you can play H264/H265 OAK-encoded streams on the host computer.

1. main.py using FFMPEG

It plays encoded stream by piping the output stream of the device to the input of the ffplay process.

Encoding demo

python3 main.py

2. pyav.py using PyAv library

This demo decodes encoded stream to OpenCV frames using the PyAv library. Note that this might freeze on Linux computers, which is due to PyAv library; see workaround here. For us, it worked as expected on Windows.

python3 pyav.py

3. mjpeg.py with OpenCV decoding

This demo decodes encoded MJPEG stream using OpenCV's cv2.imdecode() function. Note that MJPEG compression isn't as great compared to H.264/H.265, more information here.

python3 mjpeg.py

Pre-requisites

Install requirements:

sudo apt install ffmpeg
python3 -m pip install -r requirements.txt