Skip to content

Commit 2d27f6d

Browse files
a3fBastian-Krause
authored andcommitted
remote: client: add video --fps option
The video modes reported by a video device aren't necessarily possible in practice, e.g. because it is connected via USB 2.0 instead of USB 3.0. To allow for an easy evaluation of video devices and how they're connected, expose the newly added fps feature in USBVideoDriver as --fps command line option. Signed-off-by: Ahmad Fatoum <[email protected]>
1 parent f23fe56 commit 2d27f6d

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

CHANGES.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ New Features in 25.1
1313

1414
- The `USBVideoDriver`'s ``stream`` method can now be called with ``fps=True``
1515
to embed an overlay with FPS statistics into the video stream.
16+
This is exposed in ``labgrid-client video`` via the new ``--fps`` option.
1617

1718
Breaking changes in 25.1
1819
~~~~~~~~~~~~~~~~~~~~~~~~

contrib/completion/labgrid-client.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ _labgrid_client_video()
661661
662662
case "$cur" in
663663
-*)
664-
COMPREPLY=( $(compgen -W "--quality --controls --name $_labgrid_shared_options" -- "$cur") )
664+
COMPREPLY=( $(compgen -W "--quality --controls --fps --name $_labgrid_shared_options" -- "$cur") )
665665
;;
666666
esac
667667
}

labgrid/remote/client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1313,6 +1313,7 @@ def telnet(self):
13131313
def video(self):
13141314
place = self.get_acquired_place()
13151315
quality = self.args.quality
1316+
fps = self.args.fps
13161317
controls = self.args.controls
13171318
target = self._get_target(place)
13181319
name = self.args.name
@@ -1342,7 +1343,7 @@ def video(self):
13421343
mark = "*" if default == name else " "
13431344
print(f"{mark} {name:<10s} {caps:s}")
13441345
else:
1345-
res = drv.stream(quality, controls=controls)
1346+
res = drv.stream(quality, controls=controls, fps=fps)
13461347
if res:
13471348
exc = InteractiveCommandError("gst-launch-1.0 error")
13481349
exc.exitcode = res
@@ -1972,6 +1973,7 @@ def main():
19721973

19731974
subparser = subparsers.add_parser("video", help="start a video stream")
19741975
subparser.add_argument("-q", "--quality", type=str, help="select a video quality (use 'list' to show options)")
1976+
subparser.add_argument("-f", "--fps", action='store_true', help="Overlay FPS statistics")
19751977
subparser.add_argument(
19761978
"-c", "--controls", type=str, help="configure v4l controls (such as 'focus_auto=0,focus_absolute=40')"
19771979
)

0 commit comments

Comments
 (0)