Skip to content

Instantly share code, notes, and snippets.

@bsidhom
Created February 21, 2023 07:01
Show Gist options
  • Save bsidhom/d417f02dfb5eb00b4c9f75ef9bc8f249 to your computer and use it in GitHub Desktop.
Save bsidhom/d417f02dfb5eb00b4c9f75ef9bc8f249 to your computer and use it in GitHub Desktop.
Set the creation timestamp of an MP4 file using `ffmpeg`
#!/usr/bin/env bash
set -euo pipefail
function main() {
local input="$1"
local output="$2"
local timestamp="$3"
if [[ "$input" == "$output" ]] ; then
echo "input and output files must be different"
exit 2
fi
echo ffmpeg -i "$input" -c copy -map_metadata 0 -metadata creation_time="$timestamp" "$output"
}
main "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment