From d0873e9b73a3110389d98f3ba049e592dd9a9ced Mon Sep 17 00:00:00 2001 From: trueChazza Date: Mon, 12 Feb 2024 11:13:17 +1300 Subject: [PATCH] fix: fix keyframes remove trailing underscore for ffmpeg v5 ffmpeg v6 contains double underscore i.e. K__ --- lib/hls_playlist.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/hls_playlist.ex b/lib/hls_playlist.ex index f0bc460..5f56f75 100644 --- a/lib/hls_playlist.ex +++ b/lib/hls_playlist.ex @@ -31,12 +31,12 @@ defmodule HlsPlaylist do |> Enum.map(fn x -> String.trim(x) |> String.split("\n") - |> Enum.filter(fn x -> String.contains?(x, "K__") end) + |> Enum.filter(fn x -> String.contains?(x, "K_") end) end) |> Enum.reject(fn x -> Enum.empty?(x) end) |> Enum.map(fn x -> String.trim_leading(Enum.at(x, 0), "packet,") - |> String.trim_trailing(",K__") + |> String.trim_trailing(",K_") |> String.split(",") |> Kernel.hd() |> String.to_float