From a4eab1944ab4ad57285e541e26794bcdfbb06104 Mon Sep 17 00:00:00 2001 From: Alexey Khit Date: Mon, 14 Nov 2022 01:29:45 +0300 Subject: [PATCH] Add ffmpeg async option for HomeKit audio --- cmd/ffmpeg/README.md | 1 + cmd/ffmpeg/ffmpeg.go | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/cmd/ffmpeg/README.md b/cmd/ffmpeg/README.md index 6d19340d..88a91d45 100644 --- a/cmd/ffmpeg/README.md +++ b/cmd/ffmpeg/README.md @@ -58,3 +58,4 @@ - https://github.com/leandromoreira/ffmpeg-libav-tutorial - https://www.reddit.com/user/VeritablePornocopium/comments/okw130/ffmpeg_with_libfdk_aac_for_windows_x64/ - https://slhck.info/video/2017/02/24/vbr-settings.html +- [HomeKit audio samples problem](https://superuser.com/questions/1290996/non-monotonous-dts-with-igndts-flag) diff --git a/cmd/ffmpeg/ffmpeg.go b/cmd/ffmpeg/ffmpeg.go index 7ba5d00d..8dd5cf8b 100644 --- a/cmd/ffmpeg/ffmpeg.go +++ b/cmd/ffmpeg/ffmpeg.go @@ -115,6 +115,10 @@ func Init() { input = strings.Replace(tpl["file"], "{input}", s, 1) } + if _, ok := query["async"]; ok { + input = "-use_wallclock_as_timestamps 1 -async 1 " + input + } + s = cmd + input if query != nil {