facebook / idb

idb is a flexible command line interface for automating iOS simulators and devices
https://fbidb.io
MIT License
4.51k stars 432 forks source link

The --fps option for video-stream doesn't work. #846

Open kyoung-mo-yang opened 1 year ago

kyoung-mo-yang commented 1 year ago

Description

If --fps option for video-stream is greater than 1, the option doesn't work.

Reproduction

The two scripts below have the same FPS applied.

idb video-stream --fps 30 --format mjpeg --compression-quality 1.0 --udid {UDID}
idb video-stream --fps 10 --format mjpeg --compression-quality 1.0 --udid {UDID}

Solution

https://github.com/facebook/idb/blob/262f5c6e8853ff580b0a4b332c191478e0b7c088/FBDeviceControl/Video/FBDeviceVideoStream.m#L102

The above code should be modified as follows:

Float64 frameTime = 1.0 / configuration.framesPerSecond.unsignedIntegerValue;

Additional Information