Skip to content

Instantly share code, notes, and snippets.

@matiaskorhonen
Last active March 12, 2024 08:57
Show Gist options
  • Save matiaskorhonen/a84da223c0c7896eebbbfaefda81b271 to your computer and use it in GitHub Desktop.
Save matiaskorhonen/a84da223c0c7896eebbbfaefda81b271 to your computer and use it in GitHub Desktop.
Add a device frame to an iOS screen recording (specifically an iPhone 12 Pro)
# Record screen from simulator:
xcrun simctl io booted recordVideo appVideo.mov
# Full size screen recording
ffmpeg -i screen-recording.mp4 -i iPhone12ProOverlay.png \
-filter_complex "scale=-1:2532,pad=width=3656:height=2057:x=(ow-iw)/2:y=(oh-ih)/2,overlay=x=0:y=0" \
output.mp4
# Screen recording resized to 1920px height
ffmpeg -i screen-recording.mp4 -i iPhone12ProOverlay-3656.png \
-filter_complex "scale=-1:1920,pad=width=3656:height=2057:x=(ow-iw)/2:y=(oh-ih)/2,overlay=x=0:y=0" \
output.mp4
This file has been truncated, but you can view the full file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment