Diference between pkt_duration and pkt_duration_time in ffprobe
Asked Answered
M

1

6

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?

Moreland answered 13/2, 2015 at 11:37 Comment(0)
G
7

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.

Grainfield answered 15/2, 2015 at 6:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.