x264enc latency issue with state changes
Steve McFarlin
steve.mcfarlin at hopin.to
Wed Jul 19 17:31:58 UTC 2023
Hello All -
I have noticed that there is a 2 second delay between going from the
preroll/paused state to the playing state. In a test pipeline using
videotestsrc/x264enc I set the state to PAUSED. After that complets I
set the state to PLAYING. The state transition will take ~2 seconds.
If I set the state to PLAYING from the NULL state the transition is
very fast. What I have noticed is with the x264enc defaults the
latency in the encoder will be set to:
x264enc gstx264enc.c:2208:gst_x264_enc_set_latency:<x264enc0> Updating
latency to 0:00:02.066666667 (62 frames)
With tune set to realtime it will be:
x264enc gstx264enc.c:2208:gst_x264_enc_set_latency:<x264enc0> Updating
latency to 0:00:01.333333334 (40 frames)
These times directly correspond to the time between setting the state
to PLAYING and receiving the completion of the state transition from
the bus.
Is there anything I can do to prevent this from happening? nvh264enc
has no such issue. I can work around this issue in my application.
This app uses cefsrc. We use PAUSE to preroll which causes cefsrc to
load a web page. Once this page is loaded JS code will call into the
app which sets the state to PLAYING. This is a blocking call, and the
2 seconds of wait time is unacceptable. For now we can simply not
await the return of this call.
Thanks for any guidance.
--
Steve McFarlin
More information about the gstreamer-devel
mailing list