master-of-zen / Av1an

Cross-platform command-line AV1 / VP9 / HEVC / H264 encoding framework with per scene quality encoding
GNU General Public License v3.0
1.51k stars 155 forks source link

Video quality suffers when input is a Vapoursynth script and not mkv file #810

Open KosakaIsMe opened 9 months ago

KosakaIsMe commented 9 months ago

While testing with Vapoursynth I noticed that if I were to use a vapoursynth script as the input in Av1an the bitrate would be lower and visually worse than if I were to use an mkv file as the input. I don't know why this is an issue as the vapoursynth script is the bare minimum of

import vapoursynth as vs
from vapoursynth import core
core.max_cache_size=1024

file = "input.mkv"

video = core.bs.VideoSource(file)

video.set_output()

The mkv also contains no audio or fonts of any kind. I would be glad if someone could help as I'm lost as to why this is happening.

master-of-zen commented 9 months ago

What are your encoding setting?

KosakaIsMe commented 9 months ago

What are your encoding setting?

For testing I used

av1an \
-e svt-av1 \
--concat mkvmerge \
--resume \
-x 240 \
--verbose \
--split-method av-scenechange \
--sc-method standard \
--sc-downscale-height 540 \
--chunk-method bestsource \
--pix-format yuv420p10le \
--sc-pix-format yuv420p \
--workers 5 \
-v " --input-depth 10 --lp 2 --preset 10 --crf 29 --keyint 0 --aq-mode 2 --irefresh-type 1 --enable-overlays 1 --scd 0 --tune 2 --chroma-u-dc-qindex-offset -1 --chroma-u-ac-qindex-offset -1 --chroma-v-dc-qindex-offset -1 --chroma-v-ac-qindex-offset -1 --enable-tf 0 --enable-qm 1 --qm-min 5 --qm-max 9 " \
-a " -an " \
-i "input.mkv" \
-o "regular-mkv-input.mkv"
master-of-zen commented 9 months ago

Try lowering your preset and crf, my guess that quality is bad because of them

KosakaIsMe commented 9 months ago

Try lowering your preset and crf, my guess that quality is bad because of them

My issue isn't the encode settings (I chose preset 10 so my testing would be quick) But rather that when I use a vapoursynth script as the input the result isn't the same as if I were to use an mkv file. Looking at the scenes.json file there's a large difference between the two vs-scenes.json and mkv-scenes.json. The regular mkv one seems to have more scenes in it compared to the vapoursynth one. also the resulting video file(s) are visually different from each other as shown here