{"id":18124584,"url":"https://github.com/tonytonyjan/timestamp_maker","last_synced_at":"2025-07-17T13:39:50.743Z","repository":{"id":62559014,"uuid":"387186601","full_name":"tonytonyjan/timestamp_maker","owner":"tonytonyjan","description":"timestamp_maker is a command-line tool that adds timestamp on images/videos based on their creation time.","archived":false,"fork":false,"pushed_at":"2021-07-25T10:50:25.000Z","size":34235,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-28T21:50:27.557Z","etag":null,"topics":["ffmpeg","image-processing","imagemagick","ruby","timestamp","video-processing"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tonytonyjan.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-18T13:48:41.000Z","updated_at":"2024-12-07T11:40:45.000Z","dependencies_parsed_at":"2022-11-03T11:15:42.764Z","dependency_job_id":null,"html_url":"https://github.com/tonytonyjan/timestamp_maker","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/tonytonyjan/timestamp_maker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tonytonyjan%2Ftimestamp_maker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tonytonyjan%2Ftimestamp_maker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tonytonyjan%2Ftimestamp_maker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tonytonyjan%2Ftimestamp_maker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tonytonyjan","download_url":"https://codeload.github.com/tonytonyjan/timestamp_maker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tonytonyjan%2Ftimestamp_maker/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265611774,"owners_count":23797957,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ffmpeg","image-processing","imagemagick","ruby","timestamp","video-processing"],"created_at":"2024-11-01T08:06:32.708Z","updated_at":"2025-07-17T13:39:45.728Z","avatar_url":"https://github.com/tonytonyjan.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"= timestamp_maker\n\n`timestamp_maker` is a command-line tool that adds timestamp on assets/videos based on their creation time.\n\nIt looks up the following metadata (ex. EXIF) of the file:\n\n. Creation time\n. GPS coordinate\n. Time offset\n\n[link=\"https://github.com/tonytonyjan/timestamp_maker/actions/workflows/test.yml\"]\nimage::https://github.com/tonytonyjan/timestamp_maker/actions/workflows/test.yml/badge.svg[]\n\n== Prerequisite\n\n. https://ffmpeg.org/[FFmpeg] with both https://www.freedesktop.org/wiki/Software/fontconfig/[Fontconfig] and https://www.freetype.org/[FreeType] enabled\n. https://imagemagick.org/index.php[ImageMagick]\n. https://www.iana.org/time-zones[tzdata]\n\nBy default, ImageMagick uses https://en.wikipedia.org/wiki/Helvetica[Helvetica] font.\nYou should either install it or use `--font-familiy` to speicy another font in your system.\n\n== Installation\n\n[source,sh]\n----\ngem install timestamp_maker\n----\n\n== Usage\n\n=== Quick Start\n\n[source,sh]\n----\ntimestamp assets/in.jpg assets/out-1.jpg\n----\n\nimage::assets/out-1.jpg[]\n\n[source,sh]\n----\ntimestamp assets/in.mp4 assets/out-1.gif\n----\n\nimage::assets/out-1.gif[]\n\n=== Customize Appearance\n\n[source,sh]\n----\ntimestamp \\\n  --format '臺北時間：%Y/%m/%d %H:%M:%S' \\\n  --font-padding 2 \\\n  --font-family 'Noto Sans Mono CJK TC' \\\n  --font-size 16 \\\n  --font-color black \\\n  --background-color '#FFFFFFB7' \\\n  --coordinate-origin bottom-right \\\n  -x 6 -y 6 \\\n  assets/in.jpg assets/out-2.jpg\n----\n\nimage::assets/out-2.jpg[]\n\n=== Customize Time\n\n[source,sh]\n----\ntimestamp \\\n  --time-zone America/New_York \\\n  --time '2017-03-12T01:59:56-05:00' \\\n  assets/in.mp4 assets/out-2.gif\n----\n\nimage::assets/out-2.gif[]\n\nIt handles daylight saving time for you. :)\n\nRun `timestamp --help` for more information.\n\n=== Configure `TimestampMaker` instance\n\n[source,sh]\n----\ntimestamp -r ./config.rb in.mp4 out.mp4\n----\n\n.`config.rb`\n[source,ruby]\n----\nTimestampMaker.instance =\n  TimestampMaker.new(mime_recognizer: @my_recognizer)\n----\n\n== API\n\n[source,ruby]\n----\nrequire 'timestamp_maker'\n\nTimestampMaker.new.add_timestamp(input_path, output_path)\n----\n\nThe snippet above is equivalent to:\n\n[source,ruby]\n----\nrequire 'timestamp_maker'\n\nTimestampMaker.new.add_timestamp(\n  input_path, output_path,\n  format: '%Y-%m-%d %H:%M:%S',\n  time: nil,\n  font_size: 32,\n  font_family: 'Sans',\n  font_color: 'white',\n  background_color: '#000000B3',\n  time_zone: nil,\n  coordinate_origin: 'top-left',\n  x: 32,\n  y: 32,\n  font_padding: 8\n)\n----\n\n=== Customize MIME Type Recognizer\n\n[source,ruby]\n----\nclass FileMime\n  def recognize(path)\n    command = %W[file --brief --mime-type #{path}]\n    stdout_string, status = Open3.capture2(*command)\n    stdout_string\n  end\nend\nTimestampMaker.new(mime_recognizer: FileMime.new)\n----\n\n=== Customize Timezone Lookuper\n\nBy default, `timestamp_maker` uses https://github.com/zverok/wheretz[`wheretz`] to find IANA timezone by given latitude/longitude offline.\n\nUnfortunately, `wheretz` is not under active maintenance and its' database would outdate some day.\nWe can replae `wheretz` to other more reliable tools like GeoName, for example:\n\n[source,ruby]\n----\nrequire 'timestamp_maker/time_zone_lookupers/geo_name'\nTM = TimestampMaker\nlookup = TM::TimeZoneLookupers::GeoName.new(username: 'YOUR_USERNAME')\nTM.new(\n  handlers: [\n    TM::Handlers::ImageMagick.new(time_zone_lookuper: lookup),\n    TM::Handlers::Ffmpeg.new(time_zone_lookuper: lookup)\n  ]\n)\n----\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftonytonyjan%2Ftimestamp_maker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftonytonyjan%2Ftimestamp_maker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftonytonyjan%2Ftimestamp_maker/lists"}