Feature Request: Headless CLI stream mode — video frame output + controller input via stdin/stdout for AI agent automation #784
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
stale
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-streetpea/chiaki-ng#784
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Feature Request: Headless CLI stream mode — video frames + controller input via stdin/stdout
Summary
Extend
chiaki-cliwith a newstreamsubcommand that connects to a PS5/PS4, decodes video frames to stdout (raw or PNG), and reads controller inputs from stdin (JSON or line-based protocol). This would enable AI agent automation — letting programs (not just humans) play games via Remote Play.Motivation
Currently,
chiaki-clionly supportsdiscoverandwakeup. The full streaming experience (video + audio + controller I/O) is only available through the Qt GUI (chiaki). This makes it impossible to:The
libchiakiC API already has everything needed:ChiakiVideoSampleCallback→ receives raw H.264/H.265 framesChiakiControllerState→ full controller state struct (buttons, sticks, touch, motion)chiaki_feedback_sender_set_controller_state()→ pushes inputs to the consoleChiakiEventCallback→ session events (connected, quit, rumble, etc.)A headless CLI mode would unlock the entire
libchiakiAPI for non-GUI use cases.Proposed Design
CLI Usage
Video Output (stdout or file pipe)
pngraw-h264yuv420pEach frame could be prefixed with a header:
Controller Input (stdin)
JSON line-based protocol — one JSON object per line:
Where:
buttons: array of button names (CROSS,MOON,BOX,PYRAMID,DPAD_LEFT/RIGHT/UP/DOWN,L1,R1,L3,R3,OPTIONS,SHARE,TOUCHPAD,PS)left_x,left_y,right_x,right_y: int16 stick values (-32767 to 32767)l2,r2: uint8 trigger values (0-255)toucharray,gyro/accel/orientfor motionA special
idleinput resets the controller:Session Events (stderr)
Events written to stderr as JSON lines for the consuming program:
Use Cases
Implementation Notes
libchiakiAPI already exposes all needed callbacks and structs:chiaki_session_set_video_sample_cb()for frame capturechiaki_session_set_event_cb()for session eventschiaki_feedback_sender_set_controller_state()for inputffmpegdecoder.c)ChiakiControllerStateat a fixed rate--headlessflag to avoid pulling in Qt/SDL dependenciesAlternatives Considered
ffmpeg -f x11grab, send inputs viaevdev/uinput. Works but is fragile, slow (30-60ms screenshot latency vs direct frame access), and requires a full Qt/graphics stack running.A native headless mode is cleaner, faster, and more portable.
Related
cli/src/main.c— current CLI with only discover + wakeuplib/include/chiaki/session.h—ChiakiVideoSampleCallback,ChiakiEventCallbacklib/include/chiaki/controller.h—ChiakiControllerStatelib/include/chiaki/feedbacksender.h—chiaki_feedback_sender_set_controller_state()Community Interest
This would open up PlayStation game automation to the broader AI agent community (Hermes Agent, Claude Code, OpenAI Codex, etc.) — any tool that can read images and write JSON could play PS5/PS4 games via Remote Play.