I have an mov
file that I need to get the ending pts
for both the audio and video streams. I'm able to do this by doing the following (manually):
ffprobe -show_packets file.mov
Which gives me an output like (with many more packets of course):
[PACKET]
codec_type=audio
stream_index=0
pts=221184
pts_time=5.015510
dts=221184
dts_time=5.015510
duration=580
duration_time=0.013152
convergence_duration=N/A
convergence_duration_time=N/A
size=304
pos=4833575
flags=K_
[/PACKET]
[PACKET]
codec_type=video
stream_index=1
pts=29800
pts_time=4.966667
dts=29400
dts_time=4.900000
duration=200
duration_time=0.033333
convergence_duration=N/A
convergence_duration_time=N/A
size=20707
pos=4837376
flags=__
[/PACKET]
In the scenario above, the ending pts is 221764
for audio and 30000
for video (pts + duration
).
I was wondering if there was an easy way to either get the final audio/video packet pts directly via ffprobe flags or by intelligently parsing the output.