Skip to content

Conversation

@jeanmichelbouchard
Copy link
Contributor

I have added customizable and randomized winner strings that are displayed when a team wins. Also, in the documentation I added a schema for the Raspberry Pi only version.

@swehner
Copy link
Owner

swehner commented Apr 2, 2019

Thanks for this! I've already cherry-picked and merged your schematic for the Pi here 8950d3b
I'll take a look a the winner string changes and merge them as soon as I have a bit more time.

Copies replays to a timestamped version to save the video files for futur viewing.
Added the possibility to specify a path to  save the replays, to a USB stick for example.
# If we want to keep replays, make a copy of the files with a timestamp.
if config.save_replays == True:
copyfile(os.path.join(config.replay_path, "replay_short.h264"),
os.path.join(config.replay_path, "{}_replay_short.h264".format(int(time.time()))))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The replay_path is set up to be an in-memory directory (it's in /dev/shm). We should copy these to the SD card so it doesn't fill up RAM and is available even after a reboot, so a different directory should be configured here.
I'd also get the date to preprend to the files before generating them so that they are assured to be the same:

if config.save_replays:
  time_prefix = time.strftime("%Y%m%d_%H%M%S", time.localtime())
  for file in ['replay_short.h264', 'replay_long.h264']:
    copyfile(
      os.path.join(config.replay_path, filename),
      os.path.join(config.save_replay_path, '{}_{}'.format(time_prefix, filename))

If this is copied to the SD, we'd need to check how long this actually takes, because if you do this in python it'll block the actual replay until the copying is finished.
Maybe it would be better to do it in the backgorund - either in generate_replay.sh (passing some extra parameters and do it in background), or launch a different .sh file that does the copying in the background...

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also take into account that this'll eventually fill up the SD card, so there should be a limit on the amount of files stored..


# -- Enable camera, replays and video motiondetector
#plugins.update(set(['replay', 'camera', 'motiondetector']))
#camera_preview = "-p 0,0,128,72"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't add your config to the repo (same goes for the .vscode files)

@jeanmichelbouchard
Copy link
Contributor Author

jeanmichelbouchard commented Apr 16, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants