
- removed --context - added Opus support (now default) - added VP9 support (now default) - added WebM support
38 lines
701 B
Python
38 lines
701 B
Python
#! /usr/bin/env python3
|
|
# encoding: utf-8
|
|
|
|
import os
|
|
import pathlib
|
|
import over
|
|
|
|
# --------------------------------------------------
|
|
|
|
def parse_fps(raw):
|
|
if "/" in raw:
|
|
num, den = (int(x) for x in raw.split("/"))
|
|
|
|
return float(num) / float(den)
|
|
|
|
return float(raw)
|
|
|
|
# --------------------------------------------------
|
|
|
|
def to_Path(raw_path):
|
|
"""
|
|
Returns pathlib.Path pointing to raw_path, handling "~/" correctly.
|
|
|
|
To be removed after python:3.5 move.
|
|
"""
|
|
|
|
if raw_path.startswith("~"):
|
|
raw_path = os.path.expanduser(raw_path)
|
|
|
|
return pathlib.Path(raw_path)
|
|
|
|
# --------------------------------------------------
|
|
|
|
def float_or_string(a):
|
|
try:
|
|
return float(a)
|
|
except:
|
|
return a
|