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?

albertoiNET
  • 1,280
  • 25
  • 34

1 Answers1

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.

Community
  • 1
  • 1
Vladimir Kunschikov
  • 1,735
  • 1
  • 16
  • 16