diff --git a/src/core/io/ffmpeg_filter_io.ml b/src/core/io/ffmpeg_filter_io.ml index 4de2552ba5..258675e5e5 100644 --- a/src/core/io/ffmpeg_filter_io.ml +++ b/src/core/io/ffmpeg_filter_io.ml @@ -195,7 +195,10 @@ class virtual ['a] input_base ~name ~pass_metadata ~self_sync ~is_ready ~pull (fun result (label, fn) -> match fn frame with | None -> result - | Some v -> ("lavfi.liq." ^ label, get_time v) :: result) + | Some v -> + ("lavfi.liq." ^ label, Int64.to_string v) + :: ("lavfi.liq." ^ label ^ "_time", get_time v) + :: result) [] [ ("pts", Avutil.Frame.pts); diff --git a/src/libs/autocue.liq b/src/libs/autocue.liq index c5738937ee..1f6136cecf 100644 --- a/src/libs/autocue.liq +++ b/src/libs/autocue.liq @@ -228,7 +228,17 @@ def autocue.internal.ebur128(~ratio=50., ~timeout=10., filename) = s = source.on_metadata(s, fun (m) -> frames := [...frames(), m]) source.drop(ratio=ratio, s) - frames() + list.sort( + fun (m, m') -> + begin + pos = + float_of_string(list.assoc(default="0.", "lavfi.liq.pts_time", m)) + pos' = + float_of_string(list.assoc(default="0.", "lavfi.liq.pts_time", m')) + if pos < pos' then -1 elsif pos < pos' then 1 else 0 end + end, + frames() + ) end %else ignore(ratio) @@ -387,7 +397,7 @@ def autocue.internal.implementation( # Get current frame loudness level and timestamp db_level = list.assoc(default="nan", string("lavfi.r128.M"), frame) current_ts := - float_of_string(list.assoc(default="0.", "lavfi.liq.pts", frame)) + float_of_string(list.assoc(default="0.", "lavfi.liq.pts_time", frame)) # Process only valid level values if @@ -708,8 +718,10 @@ def autocue.internal.implementation( # Get very last frame for precise track duration frame = list.last(frames) duration = - float_of_string(list.assoc(default="0.", "lavfi.liq.pts", frame)) + - float_of_string(list.assoc(default="0.", "lavfi.liq.duration", frame)) + float_of_string(list.assoc(default="0.", "lavfi.liq.pts_time", frame)) + + float_of_string( + list.assoc(default="0.", "lavfi.liq.duration_time", frame) + ) # Finalize cue/cross/fade values now... if cue_out() == 0. then cue_out := duration end