0

Getting the delay of an audio stream is usually easy with ffprobe and a command like:

ffprobe -show_entries stream -i "(file_path)"

Obtaining an output that includes the desired info (see "start_time"):

...
index=1
codec_name=ac3
...
...
start_time=0.880000
...

This has worked fine with all my video files, allowing to develop automated procedures.

But now I got one that shows start_time=0.000000 for all streams, when analyzed with ffprobe. However Media Player Classic confirms there is a 2.5 seconds audio delay, see Media Player Classic screenshot

Offending video is an AVI file. Its ffprobe output is:

index=0
codec_name=mpeg4
codec_long_name=MPEG-4 part 2
profile=Advanced Simple Profile
codec_type=video
codec_time_base=1001/24000
codec_tag_string=XVID
codec_tag=0x44495658
width=720
height=384
coded_width=720
coded_height=384
has_b_frames=1
sample_aspect_ratio=1:1
display_aspect_ratio=15:8
pix_fmt=yuv420p
level=5
color_range=N/A
color_space=unknown
color_transfer=unknown
color_primaries=unknown
chroma_location=left
field_order=unknown
timecode=N/A
refs=1
quarter_sample=false
divx_packed=false
id=N/A
r_frame_rate=24000/1001
avg_frame_rate=24000/1001
time_base=1001/24000
start_pts=0
start_time=0.000000
duration_ts=179064
duration=7468.461000
bit_rate=1804834
max_bit_rate=N/A
bits_per_raw_sample=N/A
nb_frames=179064
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=0
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
index=1
codec_name=ac3
codec_long_name=ATSC A/52A (AC-3)
profile=unknown
codec_type=audio
codec_time_base=1/48000
codec_tag_string=[0] [0][0]
codec_tag=0x2000
sample_fmt=fltp
sample_rate=48000
channels=6
channel_layout=5.1(side)
bits_per_sample=0
dmix_mode=-1
ltrt_cmixlev=-1.000000
ltrt_surmixlev=-1.000000
loro_cmixlev=-1.000000
loro_surmixlev=-1.000000
id=N/A
r_frame_rate=0/0
avg_frame_rate=0/0
time_base=1/56000
start_pts=0
start_time=0.000000
duration_ts=N/A
duration=N/A
bit_rate=448000
max_bit_rate=N/A
bits_per_raw_sample=N/A
nb_frames=418233816
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=0
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0

Where in this output can I find a way to locate those 2.5 seconds?

Perhaps running ffprobe with other arguments will show it more clearly?

  • For AVIs, ffmpeg ignores the delay. May consider that a bug, and file a report at trac.ffmpeg.org – Gyan Feb 6 at 6:18
  • Curiously ffplay plays correctly the video, with the right audio delay, so internally seems to track it (unless it delegates playing to system codecs) – oscar Feb 7 at 11:55
  • Nope, all playback occurs through native codecs or via in-tree wrappers for external decoders. Timestamps are handled by the demuxer, in any case, which is native here. – Gyan Feb 7 at 12:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.