[FFmpeg-devel] [PATCH] avformat/libsrt: Change latency option to milliseconds

Jack Waller ffmpeg at gmail.com
Wed Apr 8 10:45:48 EEST 2020


On Wed, Apr 8, 2020 at 3:34 PM pkv <pkv at obsproject.com> wrote:

>
> Le 08/04/2020 à 3:45 am, Limin Wang a écrit :
> > On Wed, Apr 08, 2020 at 02:16:23AM +0200, pkv wrote:
> >> Hi
> >>
> >> Le 08/04/2020 à 12:33 am, Limin Wang a écrit :
> >>> On Tue, Apr 07, 2020 at 08:25:44PM +0200, pkv wrote:
> >>>> Hi
> >>>>
> >>>> new patch for latency option following the comments from N. George.
> >>> I recall I had submit a patchset for related option incliding latency.
> >>>
> https://patchwork.ffmpeg.org/project/ffmpeg/patch/20200331140808.8839-2-lance.lmwang@gmail.com/
> >> hadn't spotted it; why was it not merged ?
> >>
> >>
> >>> Why I haven't change to use AV_OPT_TYPE_DURATION, for the latency can
> >>> be used in format srt://xxxx:port?latency=?, it's in unit of ms,
> >>> in addition, AV_OPT_TYPE_DURATION is in unit of second default, it'll
> >>> break the old user.
> >> i tested with ffmpeg.exe; the change to
> >>
> >> AV_OPT_TYPE_DURATION
> >>
> >> didn't seem to break anything.
> >>
> >> The default is still set to whatever the libsrt API has set (120 ms
> >> for transtype=live).
> >>
> >> Can you produce code broken by that change ?
> > What's your command line?
> > I recall If use AV_OPT_TYPE_DURATION for option, the default is in unit
> of second if your
> > don't add suffix of ms, us. However the old is us, so it'll cause old
> user
> > setting broken.
> >
> Ok I get your point.
>
> here are the commands I tested with:
>
> ffmpeg.exe -re -i source.mp4 -c copy -f mpegts srt:://dest:port
>
> and
>
> ffmpeg.exe -re -i source.mp4 -c copy -f mpegts
> srt:://dest:port?latency=400000
>
> These two don't break anything.
>
> But indeed
>
> ffmpeg.exe -re -i source.mp4 -c copy -latency=400000 -f mpegts
> srt:://dest:port
>
> is breaking stuff.
>
> I'll revert the change suggested by N. George in that case.
>

DO NOT CHANGE,

Microsecond is better than millisecond. it's compatible with other ffmpeg
options

The fault is srt's implementation, not ffmpeg's


More information about the ffmpeg-devel mailing list