Skip to content

Instantly share code, notes, and snippets.

View damienlaine's full-sized avatar
🎯
Focusing

Damien Laine damienlaine

🎯
Focusing
View GitHub Profile
# For all snippets, check documentation for details and settings.
# encode video from a V4L2 device, using specified settings.
# x265 worked somewhat better here and produced less skips (although uses 10x CPU compared to x264)
ffmpeg -f video4linux2 -framerate 30 -input_format mjpeg -video_size 1920x1080 -i /dev/video6 -c:v libx265 -preset ultrafast -c:a none -crf 20 out.mp4
# Convert a raw YUYV422 frame from my USB "microscope" to PNG:
# other valid pixel formats are e.g. rgb24 or yuv420p
ffmpeg -f rawvideo -video_size 2592x1944 -pixel_format yuyv422 -i input_yuyv422_2592x1944.dat -f image2 output.png

Stt-Ws

Streaming speech to text standalone worker. Processes audio streams on an WS endpoint

Client to WS

Establish connection

Initiate the server connection by sending a json message. {"config": {"sample_rate":16000, "metadata":1 }}

Option :