From 78b45b3cb62f96587336c86e94e5e3926585395b Mon Sep 17 00:00:00 2001 From: hashirama Date: Fri, 12 Jul 2024 03:28:12 +0000 Subject: [PATCH] force audio alignment in mpv MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit explanation: - vf=setpts=PTS/1 ensures that each frame is shown at its correct time according to the video’s original timing. It does not affect the overall playback speed dictated by the frame rate setting. ( i use 20 fps to avoid getting drowsy ) - vf=setpts=PTS/1 is set to prevent issues like audio-video desynchronization or to ensure smooth playback, especially with variable frame rate (VFR) videos. --- home-configuration/home-configuration.scm | 1 + 1 file changed, 1 insertion(+) diff --git a/home-configuration/home-configuration.scm b/home-configuration/home-configuration.scm index ce97734..3e7fac5 100644 --- a/home-configuration/home-configuration.scm +++ b/home-configuration/home-configuration.scm @@ -234,6 +234,7 @@ ("ls" . "ls -p --color=auto") ("run_code" . "g++ -o main main.cc -Ofast -std=c++23 -s -flto -march=native -I ~/dev/ajatt/hakurei/include/ && ./main") ("rgf" . "rg --files | rg") + ("mpv" . "mpv --audio-pitch-correction=yes --vf=setpts=PTS/1") ("record" . "ffmpeg -f x11grab -r 23 -s 1366x768 -i $DISPLAY -f pulse -i nui_mic_remap -filter_complex '[1:a]volume=2.0[a]' -map 0:v -map '[a]' -c:v libx264 -pix_fmt yuv420p -preset ultrafast -crf 23 -y /tmp/output.mp4") ("isolate" . "guix shell --container --network --preserve='^DISPLAY$' \ --preserve='^XAUTHORITY$' --expose=$XAUTHORITY --expose=/etc/ssl/certs --no-cwd ")))