Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Diference between pkt_duration and pkt_duration_time in ffprobe

When I execute next ffprobe command in an HLS stream with parameter to show frames in specific stream video in flat format and grep with 'pkt' pattern, it returns this info:

$ ffprobe -i http://xxxxxxxxxxxxxxxx/PCMDY_SUB.m3u8 -show_frames -select_streams v:0 -print_format flat | grep pkt
...
frames.frame.229.pkt_pts=2438664735,
frames.frame.229.pkt_pts_time=27096.274833,
frames.frame.229.pkt_dts=2438664735,
frames.frame.229.pkt_dts_time=27096.274833,
frames.frame.229.pkt_duration=3600,
frames.frame.229.pkt_duration_time="0.040000",
frames.frame.229.pkt_pos=13348,
frames.frame.229.pkt_size=2510,

frames.frame.230.pkt_pts=2438668335,
frames.frame.230.pkt_pts_time=27096.314833,
frames.frame.230.pkt_dts=2438668335,
frames.frame.230.pkt_dts_time=27096.314833,  
frames.frame.230.pkt_duration=3600,
frames.frame.230.pkt_duration_time="0.040000",
frames.frame.230.pkt_pos=15980,
frames.frame.230.pkt_size=2389,
...

What is the difference between info with _time pattern and without it?.

I supposed that pkt_duration are in microseconds, and pkt_duration_time is in seconds. It's true?

like image 758
albertoiNET Avatar asked Feb 13 '15 11:02

albertoiNET


1 Answers

The difference is that pkt_duration is not in microseconds but in time base slices, often like:

1/framerate/1000

pkt_duration_time is in seconds. You can see the units by passing to ffprobe the '-unit' option:

 ffprobe -i i.mp4 -show_frames -unit
 ....
pkt_pts=14014
pkt_pts_time=0.233567 s
pkt_dts=14014
pkt_dts_time=0.233567 s
pkt_duration=2002
pkt_duration_time=0.033367 s

More info about timebases.

like image 99
Vladimir Kunschikov Avatar answered Sep 21 '22 17:09

Vladimir Kunschikov