Skip to content

Instantly share code, notes, and snippets.

View Collonville's full-sized avatar
🍻
Happy beer!!!! Wow!!!!!!

Collonville Collonville

🍻
Happy beer!!!! Wow!!!!!!
View GitHub Profile
@Collonville
Collonville / video_bytes_to_numpy_array.py
Created July 13, 2021 07:43
video bytes to numpy array using ffmpeg command
import shlex
import subprocess
import tempfile
import numpy as np
with tempfile.NamedTemporaryFile() as t:
t.write(encoded)
t.flush()
ffmpeg_command = f"ffmpeg -y -i {t.name} -pix_fmt rgb24 -f rawvideo pipe:1"