Change Recording Timestamp

MontysEvilTwin

Well-Known Member
I want to change the time and date stamps of a recording. I can do this by recreating the sidecars with AV2HDR-T2 but as I already have the hmt file I presume I can do this with a Hex editor. I have looked at Raydon's file analysis and there are several places with time information so I am not sure which ones need changing. The time format (Epoch) also has me stumped.

Edit. Should have put this in the customised thread, sorry. More haste, less speed.
Now moved, thanks admins.
 
Last edited:
An update to the hmt utility would be cool, but in the interim here's a quick shell script that should set the time for you. I recommend backing up your "hmt" file before running this, just to be on the safe side!

Save the following script as "setRecStart.sh" (or similar)
Code:
#!/bin/sh
set -e

if [ $# != 3 ]; then
  echo "Usage: $0 <date> <time> <hmt>"
  echo "  eg. $0  2014-11-21  19:30  programme.hmt"  
  exit 1
fi

d=$1
t=$2
hmt=$3

start=`hmt "$hmt" |grep "Recording start"|awk -F'[: ]' '{print $3;}'`
end=`hmt "$hmt" |grep "Recording end"|awk -F'[: ]' '{print $3;}'`

let len=$end-$start

newStart=`date +%s -d"$d $t:00"`
let newEnd=$newStart+$len

hmt +patch32=640:$newStart "$hmt"
hmt +patch32=644:$newEnd "$hmt"

touch -t @$newStart "$hmt"
 
Last edited:
Thanks very much Oatcake. Does the script need to be saved in a particular location, and how would I specify the hmt file/ file location and run it?
I have figured out how to do it manually with a hex editor, but it is a bit convoluted. You have to take the time-stamp you want, convert this into Unix Epoch time, convert that to hexadecimal and then insert the hex digits (4 x 2 characters) into the hmt at the specified location, in reverse order!
 
Thanks very much Oatcake. Does the script need to be saved in a particular location, and how would I specify the hmt file/ file location and run it?
Stick it in /mod/usr/bin
You specify the file on the command line as a parameter, just like you do with everything else!
 
Does the script file then need to be given execute privilege, or is all that taken care of?
Yes it does and no it isn't, respectively.
One would need "chmod +x /mod/usr/bin/setrecstart" assuming you called it "setrecstart", rather than the (IMHO) annoying mixed-case-with-unnecessary-extension example given above.
 
Back
Top