You can use my Python VidGear library to process the WriteGear API video , which allows us to use almost all available parameters supported by FFmpeg (frame rate, bit rate, codecs, format and size, multiplexing, DEMUX, etc.) in compression mode , easily and flexibly, and at the same time reliably processes errors and warnings all the time very quietly.
Parameters:
For example, to use H.264 to produce high-quality video using the x264 encoder, we can configure its parameters as follows to obtain lossless video output:
output_params = {"-vcodec":"libx264", "-crf": 0, "-preset": "fast", "tune": "zerolatency"}
and then pass this dictionary to WriteGear as an example below
Basic usage example
# import libraries from vidgear.gears import WriteGear import cv2 output_params = {"-vcodec":"libx264", "-crf": 0, "-preset": "fast"}
Read more about usage here and full documents here
source share