mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
use new functions in extract review slate and otio burnins
This commit is contained in:
parent
fbf57760ab
commit
50c0580fef
6 changed files with 53 additions and 221 deletions
|
|
@ -88,6 +88,7 @@ from .transcoding import (
|
|||
get_ffprobe_streams,
|
||||
get_ffmpeg_codec_args,
|
||||
get_ffmpeg_format_args,
|
||||
convert_ffprobe_fps_value,
|
||||
)
|
||||
from .avalon_context import (
|
||||
CURRENT_DOC_SCHEMAS,
|
||||
|
|
@ -234,6 +235,7 @@ __all__ = [
|
|||
"get_ffprobe_streams",
|
||||
"get_ffmpeg_codec_args",
|
||||
"get_ffmpeg_format_args",
|
||||
"convert_ffprobe_fps_value",
|
||||
|
||||
"CURRENT_DOC_SCHEMAS",
|
||||
"PROJECT_NAME_ALLOWED_SYMBOLS",
|
||||
|
|
|
|||
|
|
@ -732,3 +732,23 @@ def _ffmpeg_dnxhd_codec_args(stream_data, source_ffmpeg_cmd):
|
|||
|
||||
output.extend(["-g", "1"])
|
||||
return output
|
||||
|
||||
|
||||
def convert_ffprobe_fps_value(str_value):
|
||||
"""Returns (str) value of fps from ffprobe frame format (120/1)"""
|
||||
if str_value == "0/0":
|
||||
print("WARNING: Source has \"r_frame_rate\" value set to \"0/0\".")
|
||||
return "Unknown"
|
||||
|
||||
items = str_value.split("/")
|
||||
if len(items) == 1:
|
||||
fps = float(items[0])
|
||||
|
||||
elif len(items) == 2:
|
||||
fps = float(items[0]) / float(items[1])
|
||||
|
||||
# Check if fps is integer or float number
|
||||
if int(fps) == fps:
|
||||
fps = int(fps)
|
||||
|
||||
return str(fps)
|
||||
|
|
|
|||
|
|
@ -152,23 +152,3 @@ def is_oiio_supported():
|
|||
))
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
def get_fps(str_value):
|
||||
"""Returns (str) value of fps from ffprobe frame format (120/1)"""
|
||||
if str_value == "0/0":
|
||||
print("WARNING: Source has \"r_frame_rate\" value set to \"0/0\".")
|
||||
return "Unknown"
|
||||
|
||||
items = str_value.split("/")
|
||||
if len(items) == 1:
|
||||
fps = float(items[0])
|
||||
|
||||
elif len(items) == 2:
|
||||
fps = float(items[0]) / float(items[1])
|
||||
|
||||
# Check if fps is integer or float number
|
||||
if int(fps) == fps:
|
||||
fps = int(fps)
|
||||
|
||||
return str(fps)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue