Created
February 21, 2023 07:01
-
-
Save bsidhom/d417f02dfb5eb00b4c9f75ef9bc8f249 to your computer and use it in GitHub Desktop.
Set the creation timestamp of an MP4 file using `ffmpeg`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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