Completely removed VVC support (for now)
This commit is contained in:
parent
6e9d7cd009
commit
3a56b1a2d4
|
@ -1,6 +1,7 @@
|
|||
### 7
|
||||
- Starting including rust code
|
||||
- FFMPEG info, hash path, adapt probing rate to rust
|
||||
- Removed VVC support for now
|
||||
|
||||
### 6
|
||||
- ~1.7x faster probes for svt-av1
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
</h4>
|
||||
<h2 align="center">Easy, Fast, Efficient and Feature Rich</h2>
|
||||
|
||||
An easy way to start using VVC / AV1 / HEVC / H264 / VP9 / VP8 encoding. AOM, RAV1E, SVT-AV1, SVT-VP9, VPX, x265, x264, VTM(Experimental) are supported.
|
||||
An easy way to start using AV1 / HEVC / H264 / VP9 / VP8 encoding. AOM, RAV1E, SVT-AV1, SVT-VP9, VPX, x265, x264, VTM(Experimental) are supported.
|
||||
|
||||
Example with default parameters:
|
||||
|
||||
|
@ -41,7 +41,7 @@ With your own parameters:
|
|||
Output file ending is always `.mkv`
|
||||
|
||||
-enc --encoder Encoder to use
|
||||
(`aom`,`rav1e`,`svt_av1`,`svt_vp9`,`vpx`,`x265`, `x264`,`vvc`)
|
||||
(`aom`,`rav1e`,`svt_av1`,`svt_vp9`,`vpx`,`x265`, `x264`)
|
||||
Default: aom
|
||||
Example: -enc rav1e
|
||||
|
||||
|
@ -50,7 +50,7 @@ With your own parameters:
|
|||
|
||||
-p --passes Set number of passes for encoding
|
||||
(Default: AOMENC: 2, rav1e: 1, SVT-AV1: 1, SVT-VP9: 1,
|
||||
VPX: 2, x265: 1, x264: 1, VVC:1)
|
||||
VPX: 2, x265: 1, x264: 1)
|
||||
|
||||
-w --workers Override number of workers.
|
||||
|
||||
|
@ -139,7 +139,7 @@ With your own parameters:
|
|||
|
||||
--target_quality Quality value to target.
|
||||
VMAF used as substructure for algorithms.
|
||||
Supported in all encoders supported by Av1an except for VVC.
|
||||
Supported in all encoders supported by Av1an.
|
||||
Best works in range 85-97.
|
||||
When using this mode, you must specify full encoding options.
|
||||
These encoding options must include a quantizer based mode,
|
||||
|
@ -219,7 +219,6 @@ With your own parameters:
|
|||
- [Install SVT-AV1](https://gitlab.com/AOMediaCodec/SVT-AV1)
|
||||
- [Install SVT-VP9](https://github.com/OpenVisualCloud/SVT-VP9)
|
||||
- [Install vpx](https://chromium.googlesource.com/webm/libvpx/) VP9, VP8 encoding
|
||||
- [Install VTM](https://vcgit.hhi.fraunhofer.de/jvet/VVCSoftware_VTM) VVC encoding test model
|
||||
|
||||
- Optional :
|
||||
|
||||
|
|
|
@ -213,7 +213,6 @@ class Args:
|
|||
"vpx",
|
||||
"x265",
|
||||
"x264",
|
||||
# "vvc",
|
||||
],
|
||||
)
|
||||
encode_group.add_argument(
|
||||
|
|
|
@ -12,22 +12,6 @@ if platform.system() == "Linux":
|
|||
import resource
|
||||
|
||||
|
||||
def vvc_concat(temp: Path, output: Path):
|
||||
"""
|
||||
Concatenates vvc files
|
||||
|
||||
:param temp: the temp directory
|
||||
:param output: the output video
|
||||
:return: None
|
||||
"""
|
||||
encode_files = sorted((temp / "encode").iterdir())
|
||||
bitstreams = [x.as_posix() for x in encode_files]
|
||||
bitstreams = " ".join(bitstreams)
|
||||
cmd = f"vvc_concat {bitstreams} {output.as_posix()}"
|
||||
|
||||
subprocess.run(cmd, shell=True, check=True)
|
||||
|
||||
|
||||
def concatenate_mkvmerge(temp: Path, output):
|
||||
"""
|
||||
Uses mkvmerge to concatenate encoded segments into the final file
|
||||
|
|
|
@ -3,17 +3,15 @@ from .rav1e import Rav1e
|
|||
from .svtav1 import SvtAv1
|
||||
from .svtvp9 import SvtVp9
|
||||
from .vpx import Vpx
|
||||
from .vvc import Vvc
|
||||
from .x264 import X264
|
||||
from .x265 import X265
|
||||
|
||||
ENCODERS = {
|
||||
'aom': Aom(),
|
||||
'rav1e': Rav1e(),
|
||||
'svt_av1': SvtAv1(),
|
||||
'svt_vp9': SvtVp9(),
|
||||
'vpx': Vpx(),
|
||||
'vvc': Vvc(),
|
||||
'x264': X264(),
|
||||
'x265': X265(),
|
||||
"aom": Aom(),
|
||||
"rav1e": Rav1e(),
|
||||
"svt_av1": SvtAv1(),
|
||||
"svt_vp9": SvtVp9(),
|
||||
"vpx": Vpx(),
|
||||
"x264": X264(),
|
||||
"x265": X265(),
|
||||
}
|
||||
|
|
|
@ -1,131 +0,0 @@
|
|||
import os
|
||||
import subprocess
|
||||
from distutils.spawn import find_executable
|
||||
from pathlib import Path
|
||||
from subprocess import PIPE, STDOUT
|
||||
from typing import Tuple, Optional
|
||||
import re
|
||||
|
||||
from av1an.project import Project
|
||||
from av1an.chunk import Chunk
|
||||
from av1an.commandtypes import MPCommands, CommandPair, Command
|
||||
from .encoder import Encoder
|
||||
from av1an.logger import log
|
||||
from av1an.utils import list_index_of_regex
|
||||
|
||||
|
||||
class Vvc(Encoder):
|
||||
"""
|
||||
Redo after VVenC default and expert app have concatenation
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
super(Vvc, self).__init__(
|
||||
encoder_bin="vvc_encoder",
|
||||
encoder_help="vvc_encoder --help",
|
||||
default_args=None,
|
||||
default_passes=1,
|
||||
default_q_range=(15, 50),
|
||||
output_extension="h266",
|
||||
)
|
||||
|
||||
def compose_1_pass(self, a: Project, c: Chunk, output: str) -> MPCommands:
|
||||
return [
|
||||
CommandPair(
|
||||
[Encoder.compose_ffmpeg_pipe(a)],
|
||||
[
|
||||
"vvc_encoder",
|
||||
"-c",
|
||||
a.vvc_conf,
|
||||
"-i",
|
||||
"-",
|
||||
*a.video_params,
|
||||
"-f",
|
||||
str(c.frames),
|
||||
"--InputBitDepth=10",
|
||||
"--OutputBitDepth=10",
|
||||
"-b",
|
||||
output,
|
||||
],
|
||||
)
|
||||
]
|
||||
|
||||
def compose_2_pass(self, a: Project, c: Chunk, output: str) -> MPCommands:
|
||||
raise ValueError("VVC does not support 2 pass encoding")
|
||||
|
||||
def man_q(self, command: Command, q: int) -> Command:
|
||||
"""Return command with new cq value
|
||||
|
||||
:param command: old command
|
||||
:param q: new cq value
|
||||
:return: command with new cq value"""
|
||||
|
||||
adjusted_command = command.copy()
|
||||
|
||||
i = list_index_of_regex(adjusted_command, r"-q")
|
||||
adjusted_command[i + 1] = f"{q}"
|
||||
|
||||
return adjusted_command
|
||||
|
||||
def match_line(self, line: str):
|
||||
"""Extract number of encoded frames from line.
|
||||
|
||||
:param line: one line of text output from the encoder
|
||||
:return: match object from re.search matching the number of encoded frames"""
|
||||
|
||||
return re.search(r"POC.*? ([^ ]+?)", line)
|
||||
|
||||
def make_pipes(
|
||||
self,
|
||||
a: Project,
|
||||
c: Chunk,
|
||||
passes: int,
|
||||
current_pass: int,
|
||||
output: str,
|
||||
man_q: int = None,
|
||||
):
|
||||
"""
|
||||
Creates a pipe for the given chunk with the given project
|
||||
|
||||
:param a: the Project
|
||||
:param c: the Chunk
|
||||
:param passes: the total number of passes (1 or 2)
|
||||
:param current_pass: the current_pass
|
||||
:param man_q: use a diffrent quality
|
||||
:return: a Pipe attached to the encoders stdout
|
||||
"""
|
||||
# Filter cmd not used?
|
||||
_, enc_cmd = (
|
||||
self.compose_1_pass(a, c, output)[0]
|
||||
if passes == 1
|
||||
else self.compose_2_pass(a, c, output)[current_pass - 1]
|
||||
)
|
||||
|
||||
if man_q:
|
||||
enc_cmd = self.man_q(enc_cmd, man_q)
|
||||
elif c.vmaf_target_cq:
|
||||
enc_cmd = self.man_q(enc_cmd, c.vmaf_target_cq)
|
||||
|
||||
pipe = subprocess.Popen(
|
||||
enc_cmd, stdout=PIPE, stderr=STDOUT, universal_newlines=True
|
||||
)
|
||||
return pipe, tuple()
|
||||
|
||||
def is_valid(self, project: Project) -> Tuple[bool, Optional[str]]:
|
||||
# vvc requires a special concat executable
|
||||
if not find_executable("vvc_concat"):
|
||||
return False, 'vvc concatenation executable "vvc_concat" not found'
|
||||
|
||||
# vvc requires video information that av1an can't provide
|
||||
if project.video_params is None:
|
||||
return (
|
||||
False,
|
||||
"VVC requires:\n"
|
||||
" -wdt X - video width\n"
|
||||
" -hgt X - video height\n"
|
||||
" -fr X - framerate\n"
|
||||
" -q X - quantizer\n"
|
||||
"Example: -wdt 640 -hgt 360 -fr 23.98 -q 30",
|
||||
)
|
||||
|
||||
return super().is_valid(project)
|
|
@ -80,7 +80,7 @@ def tqdm_bar(
|
|||
enc = ENCODERS[encoder]
|
||||
pipe, utility = enc.make_pipes(a, c, passes, current_pass, c.output)
|
||||
|
||||
if encoder in ("aom", "vpx", "rav1e", "x265", "x264", "vvc", "svt_av1"):
|
||||
if encoder in ("aom", "vpx", "rav1e", "x265", "x264", "svt_av1"):
|
||||
process_encoding_pipe(pipe, encoder, counter, c, utility)
|
||||
|
||||
if encoder in ("svt_vp9"):
|
||||
|
|
|
@ -6,7 +6,7 @@ from distutils.spawn import find_executable
|
|||
from pathlib import Path
|
||||
from av1an.commandtypes import Command
|
||||
from av1an.utils import frame_probe_fast
|
||||
from av1an.concat import vvc_concat, concatenate_mkvmerge
|
||||
from av1an.concat import concatenate_mkvmerge
|
||||
from av1an.logger import log
|
||||
from av1an_pyo3 import (
|
||||
get_ffmpeg_info,
|
||||
|
@ -84,11 +84,6 @@ class Project(object):
|
|||
self.n_threads: int = None
|
||||
self.vmaf_filter: str = None
|
||||
|
||||
# VVC
|
||||
self.vvc_conf: Path = None
|
||||
self.video_dimensions = (None, None)
|
||||
self.video_framerate = None
|
||||
|
||||
# Set all initial values
|
||||
self.load_project(initial_data)
|
||||
|
||||
|
@ -244,9 +239,7 @@ class Project(object):
|
|||
"""
|
||||
try:
|
||||
log("Concatenating")
|
||||
if self.encoder == "vvc":
|
||||
vvc_concat(self.temp, self.output_file.with_suffix(".h266"))
|
||||
elif self.output_ivf:
|
||||
if self.output_ivf:
|
||||
concatenate_ivf(
|
||||
str((self.temp / "encode").resolve()),
|
||||
str(self.output_file.with_suffix(".ivf").resolve()),
|
||||
|
|
|
@ -119,10 +119,6 @@ def startup_check(project: Project):
|
|||
|
||||
setup_encoder(project)
|
||||
|
||||
# No check because vvc
|
||||
if project.encoder == "vvc":
|
||||
project.no_check = True
|
||||
|
||||
if project.encoder == "svt_vp9" and project.passes == 2:
|
||||
print(
|
||||
"Implicitly changing 2 pass svt-vp9 to 1 pass\n2 pass svt-vp9 isn't supported"
|
||||
|
|
|
@ -17,7 +17,7 @@ setuptools.setup(
|
|||
version=version,
|
||||
author="Master_Of_Zen",
|
||||
author_email="master_of_zen@protonmail.com",
|
||||
description="Cross-platform command-line AV1 / VP9 / HEVC / H264 / VVC encoding framework with per scene quality encoding",
|
||||
description="Cross-platform command-line AV1 / VP9 / HEVC / H264 encoding framework with per scene quality encoding",
|
||||
long_description=long_description,
|
||||
long_description_content_type="text/markdown",
|
||||
url="https://github.com/master-of-zen/Av1an",
|
||||
|
|
2
setup.py
2
setup.py
|
@ -40,7 +40,7 @@ setuptools.setup(
|
|||
version=version,
|
||||
author="Master_Of_Zen",
|
||||
author_email="master_of_zen@protonmail.com",
|
||||
description="Cross-platform command-line AV1 / VP9 / HEVC / H264 / VVC encoding framework with per scene quality encoding",
|
||||
description="Cross-platform command-line AV1 / VP9 / HEVC / H264 encoding framework with per scene quality encoding",
|
||||
long_description=long_description,
|
||||
long_description_content_type="text/markdown",
|
||||
url="https://github.com/master-of-zen/Av1an",
|
||||
|
|
Loading…
Reference in a new issue