sorted encoder input and updated vsync to cft from 1

This commit is contained in:
k4yt3x 2022-03-05 21:30:01 +00:00
parent 083af60c6f
commit 237f6336ec
2 changed files with 11 additions and 13 deletions

View File

@ -76,7 +76,7 @@ class VideoDecoder(threading.Thread):
self.decoder = subprocess.Popen(
ffmpeg.compile(
ffmpeg.input(input_path, r=frame_rate)["v"]
.output("pipe:1", format="rawvideo", pix_fmt="rgb24", vsync="1")
.output("pipe:1", format="rawvideo", pix_fmt="rgb24", vsync="cfr")
.global_args("-hide_banner")
.global_args("-nostats")
.global_args(

View File

@ -19,13 +19,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
Name: Video Encoder
Author: K4YT3X
Date Created: June 17, 2021
Last Modified: February 27, 2022
Last Modified: March 1, 2022
"""
# local imports
from .pipe_printer import PipePrinter
# built-in imports
import multiprocessing
import multiprocessing.managers
import multiprocessing.sharedctypes
@ -36,10 +32,10 @@ import subprocess
import threading
import time
# third-party imports
from loguru import logger
import ffmpeg
from loguru import logger
from .pipe_printer import PipePrinter
# map Loguru log levels to FFmpeg log levels
LOGURU_FFMPEG_LOGLEVELS = {
@ -88,7 +84,7 @@ class VideoEncoder(threading.Thread):
"pipe:0",
format="rawvideo",
pix_fmt="rgb24",
vsync="1",
vsync="cfr",
s=f"{output_width}x{output_height}",
r=frame_rate,
)
@ -110,12 +106,14 @@ class VideoEncoder(threading.Thread):
frames,
*[s for s in additional_streams if s is not None],
str(self.output_path),
pix_fmt="yuv420p",
vcodec="libx264",
# acodec="copy",
r=frame_rate,
vsync="cfr",
pix_fmt="yuv420p",
crf=17,
vsync="1",
preset="veryslow",
# acodec="libfdk_aac",
# cutoff=20000,
r=frame_rate,
map_metadata=1,
metadata="comment=Processed with Video2X",
)