如何确保FFmpeg生成正确的持续时间?

时间:2019-06-26 09:13:58

标签: ffmpeg

例如,以下命令创建一个三秒钟的视频。

ffmpeg -f lavfi -i color=c=red:r=30:d=3:size=800x600 red.nut

但是ffprobe显示持续时间为N / A:

[STREAM]
index=0
codec_name=mpeg4
codec_long_name=MPEG-4 part 2
profile=Simple Profile
codec_type=video
codec_time_base=0/1
codec_tag_string=FMP4
codec_tag=0x34504d46
width=800
height=600
coded_width=800
coded_height=600
has_b_frames=0
sample_aspect_ratio=1:1
display_aspect_ratio=4:3
pix_fmt=yuv420p
level=1
color_range=unknown
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=30/1
avg_frame_rate=0/0
time_base=1/61440
start_pts=0
start_time=0.000000
duration_ts=N/A
duration=N/A
bit_rate=N/A
max_bit_rate=N/A
bits_per_raw_sample=N/A
nb_frames=N/A
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
TAG:encoder=Lavc57.107.100 mpeg4
[/STREAM]

是否可以设置标志以允许FFmpeg生成正确的duration_ts和持续时间?

0 个答案:

没有答案