[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Changing timestamps in video files



Sorry for coming back so late, I was very busy the last few weeks.

Anders Andersson <pipatron@gmail.com> writes:

> On Wed, Apr 29, 2020 at 4:17 PM David Wright <deblis@lionunicorn.co.uk> wrote:
> >
> > On Wed 29 Apr 2020 at 13:16:17 (+0200), Anders Andersson wrote:
> > > On Wed, Apr 29, 2020 at 12:54 PM elvis <elvis@dogonfire.com> wrote:
> > > > On 29/4/20 8:29 pm, Anders Andersson wrote:
> > > > >
> > > > > [ touch file system timestamps ]
> > > >
> > > > Don't try that on faked_evidence.pdf
> > > >
> > > > Pdfs have an internal timestamp you need to change as well.
> > > >
> > > >
> > > > I think this is what he wants for movie files, but I am not sure they
> > > > have the time encoded into them...
> > >
> > > Sure. We can only guess what goes on in OPs mind. Could be basically
> > > anything, so I imagine this list of replies will grow until OP tells
> > > us what they want.
> >
> > Well, the OP wrote "in video files", which rules out touch.
> > It's pretty obvious that the OP is more interested in modifying
> > timestamps more like the one seen here, reading 210.718067.
> >
> > $ ffprobe 2037DFB67323C9DBA31FA6AE9C27A2670855D94A
> > Input #0, mpegts, from '2037DFB67323C9DBA31FA6AE9C27A2670855D94A':
> >   Duration: 00:00:07.57, start: 210.718067, bitrate: 4413 kb/s
> >   Program 1
> >     Metadata:
> >       service_name    : Service01
> >       service_provider: FFmpeg
> >     Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(progressive), 1920x1080, Closed Captions, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
> >     Stream #0:1[0x101]: Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, stereo, fltp, 102 kb/s
> > $
>
> Or maybe he wants to change actual timestamps in video files, like
> this? https://i.stack.imgur.com/UcoNw.jpg
>
> It's far from obvious that he wants fragment timestamps since they
> would not apply to image files as he mentioned in the first post.

I want to change the timestamps internal to video files like .avi and
.mov, e.g. when I have taken a video with my Canon Ixus or Canon
Powershot camera while the clock was set to a wrong time after DST
change.  For pictures I can change the EXIF data in .jpg files with
the command-line tool jhead.

For video files there are obviously similar timestamps in the files:
A file from my Canon Ixus:
$ strings -a  ixus-<nnnnn>.avi | grep 2015
MON AUG 17 15:50:11 2015

A file from my Canon Powershot:
$ strings -a  powershot-<nnnnn>.mov | grep 2019
2019:07:25 18:58:49
2019:07:25 18:58:49
2019:07:25 18:58:49

I couldn't find any good info about these file formats and the
timestamps in them and the meaning of the three timestamps in .mov
files.  Some of my .mov files have even more than 3 timestamps in
them.

I could change the strings in the files using an editor that supports
binary files or write a small program to do it.  But I don't know if
that would corrupt the files, e.g. because of CRC for some header, or
if there are further non-ASCII timestamps that strings(1) wouldn't
find.  Therefore my question if there's a tool to do it.

Steve


Reply to: