FEAT: Support for ffmpeg presets (#3840)

* Add hwaccel presets

* Use hwaccel presets

* Add input arg presets

* Use input arg presets

* Make util to clean up redundant code

* Add support for output arg presets

* Add tests

* Update camera specific to use presets

* Update hwaccel to use presets

* Format files and fix tests

* Rewrite tests to test record correctly

* Move presets from string to list to avoid manually separating into a list

* Add mjpeg cuvid decoder preset

* Fix tests

* Fix comment
This commit is contained in:
Nicolas Mowen
2022-11-28 21:48:11 -06:00
committed by GitHub
parent 69560c8bde
commit 87144cd572
6 changed files with 480 additions and 75 deletions
+6 -1
View File
@@ -13,7 +13,7 @@ from abc import ABC, abstractmethod
from collections import Counter
from collections.abc import Mapping
from multiprocessing import shared_memory
from typing import AnyStr
from typing import Any, AnyStr
import cv2
import numpy as np
@@ -886,6 +886,11 @@ def vainfo_hwaccel() -> sp.CompletedProcess:
return sp.run(ffprobe_cmd, capture_output=True)
def get_ffmpeg_arg_list(arg: Any) -> list:
"""Use arg if list or convert to list format."""
return arg if isinstance(arg, list) else arg.split(" ")
class FrameManager(ABC):
@abstractmethod
def create(self, name, size) -> AnyStr: