How to interpret the timestamp in filename in downloaded files

Hi

I had to, one at a time :-(, to download 543 videos, not I need to be able to label to file names correctly.

i.e. the downloaded file from Ring:

1272036_6870141820246961153_stamp.mp4

How do I translate the filename to a proper yyyyMMddhhmmss name?

Thanks

Hey there, @MichaelGaarde. Although it sounds like you’ve already downloaded the files you need, this can be done automatically, on certain operating systems, with the Ring app. When downloading from an IOS mobile device or via web browser, these file names are not formatted. If you have an Android mobile device or a Mac OSX computer, downloading videos from the Ring app on these devices will automatically name the file with date/ time.

As we value our neighbours’ feedback, we’ve created a Feature Request board. If you see this as being useful on all platforms, feel free to request it there. This will allow other neighbors to comment and add interest, all in one place, so we can share it with our teams here. :slight_smile:

Hi,

I’d like to reiterate this question:

Your response explains options for downloading them. But I have *already* downloaded hundreds of videos, only to realize there’s no metadata at all, and the filenames seem to be random.

So, the original question is, how can we interpret the filenames? Are they some funky format taht we can interpret into the video’s original time and date?

I mean, Ring certainly knows how useless this is for archival/record-keeping to have hundreds of surveillance cam videos with no way to navigate them by time/date. Right?

1 Like

Hi Michael,
the translation is simple, just convert the 6870141820246961153 number to hexa, use eight MSB bytes, convert to decimal, multiply by 1000 and convert th result from system time to date time. Your downloaded file was recorder on Tue Sep 08 2020 15:39:02
Regards, Michael

2 Likes

For anyone still looking for this, I created a PowerShell Script to rename the files.

function Convert-RingNameToDate
{
  [CmdletBinding()]
  param
  (
    [Parameter(Mandatory=$true, Position=0, HelpMessage='Please add a help message here')]
    [System.Int64]
    $number
  )
  
  $bits = [Convert]::ToString($number,2)
  $MSB = [string]$bits[0..30] -replace(' ','')
  $Dec = [convert]::ToInt64($MSB,2)
  $Epoch = Get-Date -Date "01/01/1970"
  $DateTime = $Epoch.AddSeconds($Dec)
  
  return (Get-date ($DateTime) -Format YYYY-mm-dd-HH-mm-ss)
}


$Folder = "D:\Temp\Ring"
$Items = Get-ChildItem $Folder -Filter *.mp4 -Recurse

Foreach ($item in $Items){
  $newname = "$(Convert-RingNameToDate($item.BaseName)).mp4"
  if  (-not (Test-Path "$($item.DirectoryName)\$($newname)") ){
    $item | Rename-Item -NewName $newname
  }
}

To use:

Where I download the videos in a ZIP file, and they are named:
6946548309236321348.mp4

Change $Folder to the location of your Ring Video files.

You can modify the format of the filename from “yyyy-MM-dd-HH-mm-ss” to anything you like.
PowerShell date formatting

One more thing: I found the conversion to date/time was in UTC. If you wish to add or remove hours edit the line:

$DateTime = $Epoch.AddSeconds($Dec)
to
$DateTime = $Epoch.AddSeconds($Dec).AddHours(-5) # CST

1 Like

Thanks for writing the Powershell script!
Only the format method was not correct.

return (Get-date ($DateTime) -Format “yyyy/MM/dd HH:mm K”)

And for who is interrested, I’ve converted the Powershell script to a Python3 version:

import datetime

def ConvertDingIdToDateTime(dingId):    
  bits = format(dingId, '0>42b')
  MSB = bits[0:31]
  dingDateTime = datetime.datetime.fromtimestamp(int(MSB,2))

  return dingDateTime

WOW, but still sounds GREEK to me.

Why can’t Ring just make it easy on its users and rename all the files for us? Hate it when a company is NOT customer-centric/friendly