I am relatively a beginner in ffmpeg and video production and was trying to extract duration of a video using ffprobe, using the following command:
ffprobe -loglevel error -select_streams v -show_entries stream -of json filename.mp4
Output:
{
"programs": [
],
"streams": [
{
"index": 0,
"codec_name": "h264",
"codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
"profile": "Baseline",
"codec_type": "video",
"codec_time_base": "250/15007",
"codec_tag_string": "avc1",
"codec_tag": "0x31637661",
"width": 640,
"height": 352,
"coded_width": 640,
"coded_height": 352,
"has_b_frames": 0,
"pix_fmt": "yuv420p",
"level": 30,
"chroma_location": "left",
"refs": 1,
"is_avc": "true",
"nal_length_size": "4",
"r_frame_rate": "15007/500",
"avg_frame_rate": "15007/500",
"time_base": "1/30014",
"start_pts": 0,
"start_time": "0.000000",
"duration_ts": 479000,
"duration": "15.959219",
"bit_rate": "1826913",
"bits_per_raw_sample": "8",
"nb_frames": "479",
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0
},
"tags": {
"rotate": "90",
"language": "und"
},
"side_data_list": [
{
"side_data_type": "Display Matrix",
"displaymatrix": "\n00000000: 0 65536 0\n00000001: -65536 0 0\n00000002: 0 0 1073741824\n",
"rotation": -90
}
]
}
]
}
I have been trying to understand what is the difference between
duration_ts and duration
Can someone just point me in the right direction to understand what each of them means?
I understand that the duration stands for run time of video but don't know what duration_ts
here refers to.
duration_ts
is in timebase units. See stackoverflow.com/questions/43333542/…