share screenshots and recrordings from RetroPie to twitter:
This was setup to run on a Raspberry Pi 3 Model B running RetroPie. I'm sure it would work on other Retroarch's as well. I wouldn't try this on an older Pi 1, or single core system. The screenshot stuff should work (maybe this should be configurable?) but the recording/gif converting would likely be too slow on a single core system (it can already bog down the Pi 3 at times).
(I am sure versions can flex a bit)
If you are setting these things up on RetroPie you can follow these guides:
- Recording Live Gameplay in RetroPie’s RetroArch Emulators Natively on the Raspberry Pi
- Recording gameplay videos on RetroPie (with some handy shell scripts!)
- I also ran into this snag
clone this repo somewhere:
git clone email@example.com:rickycodes/retrorecord.git
The application requires the following environment variables to be
exported on your system eg:
export TWITTER_CONSUMER_KEY= \ TWITTER_CONSUMER_SECRET= \ TWITTER_ACCESS_TOKEN= \ TWITTER_ACCESS_TOKEN_SECRET= \ SCREENSHOTS_DIR=/home/pi/.config/retroarch/screenshots/ \ RECORDINGS_DIR=/home/pi/recordings/ \ GIFS_DIR=/home/pi/gifs/
The directories should match what you have set in Retropie's own config.
If you don't have the above env vars set the application will quit on startup:
application started... prompts are OFF Couldn't read SCREENSHOTS_DIR (environment variable not found)
Building the container
docker build -t retrorecord .
docker run --publish 8000:8000 --detach --name rr retrorecord
Building on the container
docker exec -it rr cargo build --verbose --target=armv7-unknown-linux-gnueabihf --release
This will create a release bin that you can then move to to your pi or host os eg:
Don't forget to make it executable!
sudo chmod +x retrorecord
If you try running on an arch that doesn't match the target you'll get:
bash: ./retrorecord: cannot execute binary file: Exec format error
build with cargo:
cargo build --release
run unit tests:
cargo test --verbose
run the binary:
(this will prompt you before posting)
run the binary:
and you should see:
application started... prompts are OFF
|Get to a screen in game that you'd like to capture and enter the main menu of RetroArch:|
|Go into the "Quick Menu" and select "Take Screenshot":|
retrorecord will print something like this to stdout:
file written: "/home/pi/.config/retroarch/screenshots/Super Mario Bros 3 (U) (PRG 1)-180425-190211.png" posted tweet!
Once you exit the game the recording will stop and you should seem some ffmpeg output from retrorecord followed by:
gif complete! gif_path is "/home/pi/gifs/output.gif" posted tweet!
If you want to record specific sections of a game consider using save states: play the game with the normal emulator to a point where you'd like to start recording, save state then relaunch with the recording enabled and load state to record from that point onward.
All this app really does is watch folders for screenshots & recordings, so presumably you could get this to work on most systems? While this was used to create whatmeplaying you could use a similar setup to post screenshots/videos/gifs from games to anywhere (so long as there's an API of some sort).
Most of the magic (literally ImageMagick) is in the mkvToGif.sh file
Copyright © 2017 Ricky Miller
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.