x264enc latency issue with state changes
Steve McFarlin via gstreamer-devel <[email protected]>
| Newsgroups | gmane.comp.video.gstreamer.devel |
|---|---|
| Message-ID | <CAO+_Wz5gi6nLCLg30wvXKb5xnoLvYJv+hyzowU-CPGshrrssiw@mail.gmail.com> |
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