Skip to content

Instantly share code, notes, and snippets.

@benf2004
Last active March 4, 2024 20:44
Show Gist options
  • Save benf2004/af609cc7bf4b6aa64138efb2073c48f1 to your computer and use it in GitHub Desktop.
Save benf2004/af609cc7bf4b6aa64138efb2073c48f1 to your computer and use it in GitHub Desktop.
BeReal REAL Recap for 2023 and beyond

How to create a 2022 style BeReal recap video with your 2023 photos

Since BeReal took away the traditional recap video, I decided to put together one myself. With the help of GPT-4, I worked out a fairly simple solution.

Step 1: Downloading Your Photos from BeReal

  1. Open your web browser on a computer and go to toofake.lol.
  2. Use your phone number to log in.
  3. Once logged in, look for the button named "memories" and click on it.
  4. Look for a checkbox that says "Export merged primary + secondary into one image". Select this.
  5. There should be a button that says "download all as ZIP". Click this to download all your photos in a ZIP file.

Step 2: Making the Video with Python

  1. Create a New Folder: On your computer, make a new folder where you want to keep your video project.
  2. Set Up Python:
    • If you don’t have Python installed, download it from python.org and follow the instructions to install it.
    • Open your command prompt (Windows) or terminal (Mac/Linux). Type python3 -m venv myenv to create a new Python environment called 'myenv'.
    • Activate the environment:
      • On Windows, type myenv\Scripts\activate.
      • On Mac/Linux, type source myenv/bin/activate.
  3. Install moviepy: In the same command prompt or terminal, type pip install moviepy. This installs a tool to help make the video.
  4. Get ImageMagick:
    • Download ImageMagick from imagemagick.org for your operating system and install it. This tool helps with image processing. On MacOS, all you have to do is type brew install imagemagick into terminal.
  5. Prepare Your Photos:
    • Find the ZIP file you downloaded from BeReal and unzip it.
    • Rename the unzipped folder to 'photos'.
    • Move this 'photos' folder to the new folder you created in step 1.
  6. Create and Run the Python Script:
    • Open a text editor (like IDLE, Notepad, TextEdit) and copy-paste the provided Python script below recap.py into it.
    • Save this file as recap.py in your project folder.
    • Go back to your command prompt or terminal. Make sure you're in your project folder (use the cd command to navigate).
    • Run the script by typing python recap.py.
  7. Enjoy Your Video!
    • After the script finishes running, look for a file named final_recap.mp4 in your project folder.
    • Open it to watch your recap video.

That's it! Enjoy watching your BeReal memories come together in a video.

This content is avaliable under the MIT License.

from moviepy.editor import VideoFileClip, concatenate_videoclips, TextClip, CompositeVideoClip, ColorClip, ImageSequenceClip, ImageClip
import os
from datetime import date, timedelta
import numpy as np
# Function to generate the intro video
def generate_intro(start_date, end_date, folder_path, output_path):
# Calculate total days for each half of the year
total_days = (end_date - start_date).days + 1
# Collect all image paths
image_paths = []
for single_date in (start_date + timedelta(n) for n in range(total_days)):
# Construct the folder and file name based on the date
folder_name = single_date.strftime('%Y-%m, %B %Y')
file_name = single_date.strftime('%B %d, %Y.png')
file_path = os.path.join(folder_path, folder_name, file_name)
# Check if the file exists
if os.path.exists(file_path):
image_paths.append(file_path)
# Create the video
clip = ImageSequenceClip(image_paths, fps=72)
clip.write_videofile(output_path, codec='libx264')
# Function to generate the main video
def generate_video(start_date, end_date, initial_duration, final_duration, folder_path, output_path):
# Calculate total days
total_days = (end_date - start_date).days + 1
# Calculate the exponential factor for the transition periods (Jan-Feb and Nov-Dec)
transition_days = ((date(2023, 3, 1) - start_date).days,
(end_date - date(2023, 11, 1)).days)
exp_factor = np.log(final_duration / initial_duration) / min(transition_days)
# Initialize an array to hold all the clips
clips = []
for i, single_date in enumerate((start_date + timedelta(n) for n in range(total_days))):
# Construct the folder and file name based on the date
folder_name = single_date.strftime('%Y-%m, %B %Y')
file_name = single_date.strftime('%B %d, %Y.png')
file_path = os.path.join(folder_path, folder_name, file_name)
# Check if the file exists
if os.path.exists(file_path):
# Calculate the duration based on the date
if single_date < date(2023, 3, 1):
# Jan-Feb: exponential decay
duration = initial_duration * np.exp(exp_factor * i)
elif single_date >= date(2023, 3, 1) and single_date < date(2023, 11, 1):
# Mar-Oct: constant minimum duration
duration = final_duration
else:
# Nov-Dec: reverse exponential growth
post_october_days = (single_date - date(2023, 11, 1)).days
duration = final_duration / np.exp(exp_factor * post_october_days)
# Create a clip for each image
clip = ImageClip(file_path).set_duration(duration)
clips.append(clip)
# Concatenate all clips to form the final video
final_clip = concatenate_videoclips(clips, method="compose")
final_clip.write_videofile(output_path, fps=24, codec='libx264')
# Function to compile the final video
def compile_videos(intro_path, recap_path, final_output_path):
# Load the intro and recap videos
intro_clip = VideoFileClip(intro_path)
recap_clip = VideoFileClip(recap_path)
# Create a TextClip for "2023 RECAP"
text_clip = TextClip("2023 RECAP", fontsize=280, font='Impact', color='white', align='center', method='caption').set_duration(intro_clip.duration)
text_clip = text_clip.set_position(('center', 'center'))
intro_text_clip = CompositeVideoClip([intro_clip, text_clip])
# Create a black screen with text for 2 seconds
black_screen = ColorClip(size=intro_clip.size, color=[0, 0, 0], duration=2)
black_screen_text = TextClip("2023 RECAP", fontsize=280, font='Impact', color='white', align='center', method='caption').set_duration(2)
black_screen_text = black_screen_text.set_position(('center', 'center'))
black_screen_clip = CompositeVideoClip([black_screen, black_screen_text])
# Concatenate the clips
final_clip = concatenate_videoclips([intro_text_clip, black_screen_clip, recap_clip])
final_clip.write_videofile(final_output_path, codec="libx264")
# Generate the intro video
start_date = date(2023, 1, 1)
end_date = date(2023, 12, 31)
folder_path_intro = 'photos' # Folder for intro photos
output_path_intro = 'intro.mp4'
generate_intro(start_date, end_date, folder_path_intro, output_path_intro)
# Generate the main video
initial_duration = 0.7
final_duration = 0.1
folder_path_main = 'photos' # Folder for main video photos
output_path_main = 'main.mp4'
generate_video(start_date, end_date, initial_duration, final_duration, folder_path_main, output_path_main)
# Compile the final video
compile_videos(output_path_intro, output_path_main, "final_recap.mp4")
# The above code is avaliable under the MIT License
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment