[FFmpeg-user] Getting precise start time from wall-clock for capture

Nicolas George george at nsup.org
Mon May 18 18:38:18 CEST 2015


Le nonidi 29 floréal, an CCXXIII, Arthur Wait a écrit :
> Apologies for hijacking the thread (though I'm not clear as to what in
> particular I did in that regard--I started the thread).

No real harm done, ans sorry for the harsh tone. Your initial message has
this:

>>> In-Reply-To: <CAE6_U_rTuD6z-kD1fiDfAz6_ZO6FhLFvRV_nW7vQB2A0pUM+Og at mail.gmail.com>

That means you wrote it by replying to this message.

> The capture I'm doing is v4l2 to nvenc to matroska.

Then frames have timestamps provided by the kernel:

ffprobe -i /dev/video0 -of compact -show_packets
[...]
packet|codec_type=video|stream_index=0|pts=1392045174616|pts_time=1392045.174616|...

As you can see, this is the monotonic clock (and my uptime here is 16 days),
but lavd can convert for you:

http://ffmpeg.org/ffmpeg-devices.html#video4linux2_002c-v4l2

With that, you just need to do whatever you want with the timestamps. By
default, ffmpeg will normalize the timestamps before any filtering or
encoding, but you can disable that with the "-copyts" option.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-user/attachments/20150518/22837e01/attachment.asc>


More information about the ffmpeg-user mailing list