mirror of https://github.com/ErsatzTV/ErsatzTV.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
693 B
23 lines
693 B
using System.Globalization; |
|
|
|
namespace ErsatzTV.FFmpeg.OutputOption; |
|
|
|
public class OutputTsOffsetOption : OutputOption |
|
{ |
|
private readonly long _ptsOffset; |
|
private readonly int _videoTrackTimeScale; |
|
|
|
public OutputTsOffsetOption(long ptsOffset, int videoTrackTimeScale) |
|
{ |
|
_ptsOffset = ptsOffset; |
|
_videoTrackTimeScale = videoTrackTimeScale; |
|
} |
|
|
|
public override string[] OutputOptions => new[] |
|
{ |
|
"-output_ts_offset", |
|
$"{(_ptsOffset / (double)_videoTrackTimeScale).ToString(NumberFormatInfo.InvariantInfo)}" |
|
}; |
|
|
|
// public override FrameState NextState(FrameState currentState) => currentState with { PtsOffset = _ptsOffset }; |
|
}
|
|
|