为了重新编码视频,我正在探测mp4(h264 / aac)文件。我想知道为什么视频[STREAM]报告的持续时间duration=6.500000
之间存在差异(而音频的持续时间为6.54,视频的持续时间应为目标)和-show_data和-show_format选项duration=6.466667
提供的持续时间可能会发生,如下面的输出所示。
~/workspace/ (master):ffprobe -show_format -show_streams -show_data -of json original.mp4
ffprobe version 2.2.3 Copyright (c) 2007-2014 the FFmpeg developers
built on Jun 3 2014 06:51:16 with Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
configuration: --prefix=/usr/local/Cellar/ffmpeg/2.2.3 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --enable-vda --cc=clang --host-cflags= --host-ldflags= --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid
libavutil 52. 66.100 / 52. 66.100
libavcodec 55. 52.102 / 55. 52.102
libavformat 55. 33.100 / 55. 33.100
libavdevice 55. 10.100 / 55. 10.100
libavfilter 4. 2.100 / 4. 2.100
libavresample 1. 2. 0 / 1. 2. 0
libswscale 2. 5.102 / 2. 5.102
libswresample 0. 18.100 / 0. 18.100
libpostproc 52. 3.100 / 52. 3.100
{
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'original.mp4':
Metadata:
major_brand : mp42
minor_version : 1
compatible_brands: mp41mp42isom
creation_time : 2014-06-22 19:43:39
Duration: 00:00:06.47, start: 0.000000, bitrate: 1164 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, smpte170m), 480x480, 1087 kb/s, 27.23 fps, 30 tbr, 600 tbn, 1200 tbc (default)
Metadata:
creation_time : 2014-06-22 19:43:39
handler_name : Core Media Video
Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 64 kb/s (default)
Metadata:
creation_time : 2014-06-22 19:43:39
handler_name : Core Media Audio
"streams": [
{
"index": 0,
"codec_name": "h264",
"codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
"profile": "Main",
"codec_type": "video",
"codec_time_base": "1/1200",
"codec_tag_string": "avc1",
"codec_tag": "0x31637661",
"width": 480,
"height": 480,
"has_b_frames": 0,
"sample_aspect_ratio": "0:1",
"display_aspect_ratio": "0:1",
"pix_fmt": "yuv420p",
"level": 30,
"r_frame_rate": "30/1",
"avg_frame_rate": "354/13",
"time_base": "1/600",
"start_pts": 0,
"start_time": "0.000000",
"duration_ts": 3900,
"duration": "6.500000",
"bit_rate": "1087856",
"nb_frames": "177",
"extradata": "\n00000000: 014d 001e ffe1 000e 674d 001e ab60 f07b .M......gM...`.{\n00000010: 4d40 4041 8080 0100 0428 ee17 0c M@@A.....(...\n",
"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
},
"tags": {
"creation_time": "2014-06-22 19:43:39",
"language": "und",
"handler_name": "Core Media Video"
}
},
{
"index": 1,
"codec_name": "aac",
"codec_long_name": "AAC (Advanced Audio Coding)",
"codec_type": "audio",
"codec_time_base": "1/44100",
"codec_tag_string": "mp4a",
"codec_tag": "0x6134706d",
"sample_fmt": "fltp",
"sample_rate": "44100",
"channels": 1,
"channel_layout": "mono",
"bits_per_sample": 0,
"r_frame_rate": "0/0",
"avg_frame_rate": "0/0",
"time_base": "1/44100",
"start_pts": 0,
"start_time": "0.000000",
"duration_ts": 288768,
"duration": "6.548027",
"bit_rate": "64599",
"nb_frames": "282",
"extradata": "\n00000000: 1208 ..\n",
"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
},
"tags": {
"creation_time": "2014-06-22 19:43:39",
"language": "und",
"handler_name": "Core Media Audio"
}
}
],
"format": {
"filename": "original.mp4",
"nb_streams": 2,
"nb_programs": 0,
"format_name": "mov,mp4,m4a,3gp,3g2,mj2",
"format_long_name": "QuickTime / MOV",
"start_time": "0.000000",
"duration": "6.466667",
"size": "941468",
"bit_rate": "1164702",
"probe_score": 100,
"tags": {
"major_brand": "mp42",
"minor_version": "1",
"compatible_brands": "mp41mp42isom",
"creation_time": "2014-06-22 19:43:39"
}
}
}