mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-12-18 14:04:20 +01:00
Reduce latency by 1 frame
To packetize the H.264 raw stream, av_parser_parse2() (called by av_read_frame()) knows that it has received a full frame only after it has received some data for the next frame. As a consequence, the client always waited until the next frame before sending the current frame to the decoder! On the device side, we know packets boundaries. To reduce latency, make the device always transmit the "frame meta" to packetize the stream manually (it was already implemented to send PTS, but only enabled on recording). On the client side, replace av_read_frame() by manual packetizing and parsing. <https://stackoverflow.com/questions/50682518/replacing-av-read-frame-to-reduce-delay> <https://trac.ffmpeg.org/ticket/3354>
This commit is contained in:
@@ -277,7 +277,6 @@ scrcpy(const struct scrcpy_options *options) {
|
||||
.local_port = options->port,
|
||||
.max_size = options->max_size,
|
||||
.bit_rate = options->bit_rate,
|
||||
.send_frame_meta = record,
|
||||
.control = options->control,
|
||||
};
|
||||
if (!server_start(&server, options->serial, ¶ms)) {
|
||||
|
||||
Reference in New Issue
Block a user