Encoding 如何减少H.264电影中moov atom的大小,以改善智能手机的流媒体启动?

Encoding 如何减少H.264电影中moov atom的大小,以改善智能手机的流媒体启动?,encoding,ffmpeg,h.264,mp4,aac,Encoding,Ffmpeg,H.264,Mp4,Aac,我们在智能手机(iOS和Android)上运行视频流服务。 我们使用H.264+AAC编码并使用mp4容器。 我们有一个问题,长电影(60分钟以上)需要很长时间才能完成 开始玩吧,并追踪到大尺寸的moov 这些电影的原子。 对于110分钟的电影来说,原子大到4.2Mb,这显然需要很长的时间 是时候通过3G下载到智能手机上了 有没有办法使moov原子变小?我们可以减少一点 降低音频采样率,但明显低于22kHz 这是不可接受的 我们使用ffmpeg作为编码器,使用MP4Box移动元数据 放在文件的前

我们在智能手机(iOS和Android)上运行视频流服务。 我们使用H.264+AAC编码并使用mp4容器。 我们有一个问题,长电影(60分钟以上)需要很长时间才能完成 开始玩吧,并追踪到大尺寸的moov 这些电影的原子。 对于110分钟的电影来说,原子大到4.2Mb,这显然需要很长的时间 是时候通过3G下载到智能手机上了

有没有办法使moov原子变小?我们可以减少一点 降低音频采样率,但明显低于22kHz 这是不可接受的

我们使用ffmpeg作为编码器,使用MP4Box移动元数据 放在文件的前面。有什么办法让它成功吗 小一点的moov?有没有其他的编码器能制造出更小的moov

例如

大尺寸(280 Mb,1小时49分钟)可流化mp4(h.264,AAC)文件的头文件大小较大(4.2 Mb)。文件由两次传递ffmpeg和MP4Box编码,用于将元数据替换到文件的开头:

/usr/bin/ffmpeg -i /var/lib/encoder/incoming/2388 -aspect 320:210 -threads 8 -vcodec libx264 -profile baseline -level 13 -flags +loop+mv4 -cmp 256 -partitions +parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 -me_method hex -subq 7 -trellis 1 -refs 5 -bf 0 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -qmin 10 -qmax 51 -qdiff 4 -b:v 270k -maxrate 270k -bufsize 270k -g 30 -passlogfile /tmp/mediaservice/3100/video-IPH.ffmpeg -an -f rawvideo -pass 1 -y /dev/null

/usr/bin/ffmpeg -i /var/lib/encoder/incoming/2388 -aspect 320:210 -threads 8 -vcodec libx264 -profile baseline -level 13 -flags +loop+mv4 -cmp 256 -partitions +parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 -me_method hex -subq 7 -trellis 1 -refs 5 -bf 0 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -qmin 10 -qmax 51 -qdiff 4 -b:v 270k -maxrate 270k -bufsize 270k -g 30 -passlogfile /tmp/mediaservice/3100/video-IPH.ffmpeg -acodec libfaac -ac 2 -b:a 32k -ar 44100 -f mp4 -pass 2 -y /var/lib/encoder/encoded/3100/video-IPH.mp4

/usr/bin/MP4Box -quiet -tmp /tmp/mediaservice/3100/ -inter 500 /var/lib/encoder/encoded/3100/video-IPH.mp4
媒体信息(音频采样率=44100):

General
Count                                    : 278
Count of stream of this kind             : 1
Kind of stream                           : General
Kind of stream                           : General
Stream identifier                        : 0
Count of video streams                   : 1
Count of audio streams                   : 1
Video_Format_List                        : AVC
Video_Format_WithHint_List               : AVC
Codecs Video                             : AVC
Audio_Format_List                        : AAC
Audio_Format_WithHint_List               : AAC
Audio codecs                             : AAC LC
Complete name                            : 1348645218_970458_2465.iph.mp4
File name                                : 1348645218_970458_2465.iph.mp4
File extension                           : mp4
Format                                   : MPEG-4
Format                                   : MPEG-4
Format/Extensions usually used           : mp4 m4v m4a m4b m4p 3gpp 3gp 3gpp2 3g2 k3g jpm jpx mqv ismv isma f4v
Commercial name                          : MPEG-4
Format profile                           : Base Media
Internet media type                      : video/mp4
Codec ID                                 : isom
Codec ID/Url                             : http://www.apple.com/quicktime/download/standalone.html
Codec                                    : MPEG-4
Codec                                    : MPEG-4
Codec/Extensions usually used            : mp4 m4v m4a m4b m4p 3gpp 3gp 3gpp2 3g2 k3g jpm jpx mqv ismv isma f4v
File size                                : 272703970
File size                                : 260 MiB
File size                                : 260 MiB
File size                                : 260 MiB
File size                                : 260 MiB
File size                                : 260.1 MiB
Duration                                 : 6556027
Duration                                 : 1h 49mn
Duration                                 : 1h 49mn 16s 27ms
Duration                                 : 1h 49mn
Duration                                 : 01:49:16.027
Overall bit rate                         : 332767
Overall bit rate                         : 333 Kbps
Stream size                              : 4230761
Stream size                              : 4.03 MiB (2%)
Stream size                              : 4 MiB
Stream size                              : 4.0 MiB
Stream size                              : 4.03 MiB
Stream size                              : 4.035 MiB
Stream size                              : 4.03 MiB (2%)
Proportion of this stream                : 0.01551
HeaderSize                               : 4230683
DataSize                                 : 268473217
FooterSize                               : 70
IsStreamable                             : Yes
File last modification date              : UTC 2012-09-26 12:38:19
File last modification date (local)      : 2012-09-26 21:38:19
Writing application                      : Lavf54.6.100

Video
Count                                    : 201
Count of stream of this kind             : 1
Kind of stream                           : Video
Kind of stream                           : Video
Stream identifier                        : 0
ID                                       : 1
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format/Url                               : http://developers.videolan.org/x264.html
Commercial name                          : AVC
Format profile                           : Baseline@L1.3
Format settings                          : 5 Ref Frames
Format settings, CABAC                   : No
Format settings, CABAC                   : No
Format settings, ReFrames                : 5
Format settings, ReFrames                : 5 frames
Format settings, GOP                     : M=1, N=30
Internet media type                      : video/H264
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Codec ID/Url                             : http://www.apple.com/quicktime/download/standalone.html
Codec                                    : AVC
Codec                                    : AVC
Codec/Family                             : AVC
Codec/Info                               : Advanced Video Codec
Codec/Url                                : http://developers.videolan.org/x264.html
Codec/CC                                 : avc1
Codec profile                            : Baseline@L1.3
Codec settings                           : 5 Ref Frames
Codec settings, CABAC                    : No
Codec_Settings_RefFrames                 : 5
Duration                                 : 6556017
Duration                                 : 01:49:16.017
Bit rate                                 : 270000
Bit rate                                 : 270 Kbps
Width                                    : 480
Width                                    : 480 pixels
Height                                   : 270
Height                                   : 270 pixels
Pixel aspect ratio                       : 1.000
Display aspect ratio                     : 1.778
Display aspect ratio                     : 16:9
Rotation                                 : 0.000
Frame rate mode                          : CFR
Frame rate mode                          : Constant
FrameRate_Mode_Original                  : VFR
Frame rate                               : 29.970
Frame rate                               : 29.970 fps
Frame count                              : 196484
Resolution                               : 8
Resolution                               : 8 bits
Colorimetry                              : 4:2:0
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8
Bit depth                                : 8 bits
Scan type                                : Progressive
Scan type                                : Progressive
Interlacement                            : PPF
Interlacement                            : Progressive
Bits/(Pixel*Frame)                       : 0.070
Stream size                              : 220159060
Stream size                              : 210 MiB (81%)
Stream size                              : 210 MiB
Stream size                              : 210 MiB
Stream size                              : 210 MiB
Stream size                              : 210.0 MiB
Stream size                              : 210 MiB (81%)
Proportion of this stream                : 0.80732
Writing library                          : x264 - core 125
Writing library                          : x264 core 125
Writing library/Name                     : x264
Writing library/Version                  : core 125
Encoding settings                        : cabac=0 / ref=5 / deblock=1:0:0 / analyse=0x1:0x131 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=8 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=0 / weightp=0 / keyint=30 / keyint_min=16 / scenecut=40 / intra_refresh=0 / rc_lookahead=30 / rc=2pass / mbtree=1 / bitrate=270 / ratetol=1.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / vbv_maxrate=270 / vbv_bufsize=270 / nal_hrd=none / ip_ratio=1.40 / aq=1:1.00
Tagged date                              : UTC 2012-09-25 07:21:37

Audio
Count                                    : 169
Count of stream of this kind             : 1
Kind of stream                           : Audio
Kind of stream                           : Audio
Stream identifier                        : 0
ID                                       : 2
ID                                       : 2
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Commercial name                          : AAC
Format profile                           : LC
Codec ID                                 : 40
Codec                                    : AAC LC
Codec                                    : AAC LC
Codec/Family                             : AAC
Codec/CC                                 : 40
Duration                                 : 6556027
Duration                                 : 1h 49mn
Duration                                 : 1h 49mn 16s 27ms
Duration                                 : 1h 49mn
Duration                                 : 01:49:16.027
Bit rate mode                            : VBR
Bit rate mode                            : Variable
Bit rate                                 : 58955
Bit rate                                 : 59.0 Kbps
Maximum bit rate                         : 270000
Maximum bit rate                         : 270 Kbps
Channel(s)                               : 2
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Channel positions                        : 2/0/0
Sampling rate                            : 44100
Sampling rate                            : 44.1 KHz
Samples count                            : 289120791
Compression mode                         : Lossy
Compression mode                         : Lossy
Stream size                              : 48314149
Stream size                              : 46.1 MiB (18%)
Stream size                              : 46 MiB
Stream size                              : 46 MiB
Stream size                              : 46.1 MiB
Stream size                              : 46.08 MiB
Stream size                              : 46.1 MiB (18%)
Proportion of this stream                : 0.17717
Tagged date                              : UTC 2012-09-25 07:21:37
Atom ftyp @ 0 of size: 32, ends @ 32
Atom moov @ 32 of size: 1276327, ends @ 1276359
     Atom mvhd @ 40 of size: 108, ends @ 148
     Atom trak @ 148 of size: 821662, ends @ 821810
         Atom tkhd @ 156 of size: 92, ends @ 248
         Atom edts @ 248 of size: 36, ends @ 284
             Atom elst @ 256 of size: 28, ends @ 284
         Atom mdia @ 284 of size: 821526, ends @ 821810
             Atom mdhd @ 292 of size: 32, ends @ 324
             Atom hdlr @ 324 of size: 45, ends @ 369
             Atom minf @ 369 of size: 821441, ends @ 821810
                 Atom vmhd @ 377 of size: 20, ends @ 397
                 Atom dinf @ 397 of size: 36, ends @ 433
                     Atom dref @ 405 of size: 28, ends @ 433
                 Atom stbl @ 433 of size: 821377, ends @ 821810
                     Atom stsd @ 441 of size: 149, ends @ 590
                         Atom avc1 @ 457 of size: 133, ends @ 590
                             Atom avcC @ 543 of size: 47, ends @ 590
                     Atom stts @ 590 of size: 24, ends @ 614
                     Atom stss @ 614 of size: 26340, ends @ 26954
                     Atom stsc @ 26954 of size: 52, ends @ 27006
                     Atom stsz @ 27006 of size: 785956, ends @ 812962
                     Atom stco @ 812962 of size: 8848, ends @ 821810
     Atom trak @ 821810 of size: 454452, ends @ 1276262
         Atom tkhd @ 821818 of size: 92, ends @ 821910
         Atom edts @ 821910 of size: 36, ends @ 821946
             Atom elst @ 821918 of size: 28, ends @ 821946
         Atom mdia @ 821946 of size: 454316, ends @ 1276262
             Atom mdhd @ 821954 of size: 32, ends @ 821986
             Atom hdlr @ 821986 of size: 45, ends @ 822031
             Atom minf @ 822031 of size: 454231, ends @ 1276262
                 Atom smhd @ 822039 of size: 16, ends @ 822055
                 Atom dinf @ 822055 of size: 36, ends @ 822091
                     Atom dref @ 822063 of size: 28, ends @ 822091
                 Atom stbl @ 822091 of size: 454171, ends @ 1276262
                     Atom stsd @ 822099 of size: 91, ends @ 822190
                         Atom mp4a @ 822115 of size: 75, ends @ 822190
                             Atom esds @ 822151 of size: 39, ends @ 822190
                     Atom stts @ 822190 of size: 161368, ends @ 983558
                     Atom stsc @ 983558 of size: 1480, ends @ 985038
                     Atom stsz @ 985038 of size: 282372, ends @ 1267410
                     Atom stco @ 1267410 of size: 8852, ends @ 1276262
     Atom udta @ 1276262 of size: 97, ends @ 1276359
         Atom meta @ 1276270 of size: 89, ends @ 1276359
             Atom hdlr @ 1276282 of size: 33, ends @ 1276315
             Atom ilst @ 1276315 of size: 44, ends @ 1276359
                 Atom ©too @ 1276323 of size: 36, ends @ 1276359
                     Atom data @ 1276331 of size: 28, ends @ 1276359
Atom mdat @ 1276359 of size: 251293325, ends @ 252569684
Atom free @ 252569684 of size: 8, ends @ 252569692
Atom free @ 252569692 of size: 62, ends @ 252569754
------------------------------------------------------
Total size: 252569754 bytes; 50 atoms total. AtomicParsley version: 0.9.0 (utf8)
Media data: 251293325 bytes; 1276429 bytes all other atoms (0.505% atom overhead).
Total free atom space: 70 bytes; 0.000% waste. Padding available: 0 bytes.
------------------------------------------------------
Moov-atom-info(/Moov/trak[0]-视频,/Moov/trak[1]-音频)采样率44100: (查看trak中的stsz和stts节点)

以音频采样率11025重新编码此电影后,标题大小要小得多:

媒体信息(音频采样率=11025):(裁剪复制信息)

Moov-atom-info(/Moov/trak[0]-视频,/Moov/trak[1]-音频)采样率11025:

General
Count                                    : 278
Count of stream of this kind             : 1
Kind of stream                           : General
Kind of stream                           : General
Stream identifier                        : 0
Count of video streams                   : 1
Count of audio streams                   : 1
Video_Format_List                        : AVC
Video_Format_WithHint_List               : AVC
Codecs Video                             : AVC
Audio_Format_List                        : AAC
Audio_Format_WithHint_List               : AAC
Audio codecs                             : AAC LC
Complete name                            : 1348645218_970458_2465.iph.mp4
File name                                : 1348645218_970458_2465.iph.mp4
File extension                           : mp4
Format                                   : MPEG-4
Format                                   : MPEG-4
Format/Extensions usually used           : mp4 m4v m4a m4b m4p 3gpp 3gp 3gpp2 3g2 k3g jpm jpx mqv ismv isma f4v
Commercial name                          : MPEG-4
Format profile                           : Base Media
Internet media type                      : video/mp4
Codec ID                                 : isom
Codec ID/Url                             : http://www.apple.com/quicktime/download/standalone.html
Codec                                    : MPEG-4
Codec                                    : MPEG-4
Codec/Extensions usually used            : mp4 m4v m4a m4b m4p 3gpp 3gp 3gpp2 3g2 k3g jpm jpx mqv ismv isma f4v
File size                                : 272703970
File size                                : 260 MiB
File size                                : 260 MiB
File size                                : 260 MiB
File size                                : 260 MiB
File size                                : 260.1 MiB
Duration                                 : 6556027
Duration                                 : 1h 49mn
Duration                                 : 1h 49mn 16s 27ms
Duration                                 : 1h 49mn
Duration                                 : 01:49:16.027
Overall bit rate                         : 332767
Overall bit rate                         : 333 Kbps
Stream size                              : 4230761
Stream size                              : 4.03 MiB (2%)
Stream size                              : 4 MiB
Stream size                              : 4.0 MiB
Stream size                              : 4.03 MiB
Stream size                              : 4.035 MiB
Stream size                              : 4.03 MiB (2%)
Proportion of this stream                : 0.01551
HeaderSize                               : 4230683
DataSize                                 : 268473217
FooterSize                               : 70
IsStreamable                             : Yes
File last modification date              : UTC 2012-09-26 12:38:19
File last modification date (local)      : 2012-09-26 21:38:19
Writing application                      : Lavf54.6.100

Video
Count                                    : 201
Count of stream of this kind             : 1
Kind of stream                           : Video
Kind of stream                           : Video
Stream identifier                        : 0
ID                                       : 1
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format/Url                               : http://developers.videolan.org/x264.html
Commercial name                          : AVC
Format profile                           : Baseline@L1.3
Format settings                          : 5 Ref Frames
Format settings, CABAC                   : No
Format settings, CABAC                   : No
Format settings, ReFrames                : 5
Format settings, ReFrames                : 5 frames
Format settings, GOP                     : M=1, N=30
Internet media type                      : video/H264
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Codec ID/Url                             : http://www.apple.com/quicktime/download/standalone.html
Codec                                    : AVC
Codec                                    : AVC
Codec/Family                             : AVC
Codec/Info                               : Advanced Video Codec
Codec/Url                                : http://developers.videolan.org/x264.html
Codec/CC                                 : avc1
Codec profile                            : Baseline@L1.3
Codec settings                           : 5 Ref Frames
Codec settings, CABAC                    : No
Codec_Settings_RefFrames                 : 5
Duration                                 : 6556017
Duration                                 : 01:49:16.017
Bit rate                                 : 270000
Bit rate                                 : 270 Kbps
Width                                    : 480
Width                                    : 480 pixels
Height                                   : 270
Height                                   : 270 pixels
Pixel aspect ratio                       : 1.000
Display aspect ratio                     : 1.778
Display aspect ratio                     : 16:9
Rotation                                 : 0.000
Frame rate mode                          : CFR
Frame rate mode                          : Constant
FrameRate_Mode_Original                  : VFR
Frame rate                               : 29.970
Frame rate                               : 29.970 fps
Frame count                              : 196484
Resolution                               : 8
Resolution                               : 8 bits
Colorimetry                              : 4:2:0
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8
Bit depth                                : 8 bits
Scan type                                : Progressive
Scan type                                : Progressive
Interlacement                            : PPF
Interlacement                            : Progressive
Bits/(Pixel*Frame)                       : 0.070
Stream size                              : 220159060
Stream size                              : 210 MiB (81%)
Stream size                              : 210 MiB
Stream size                              : 210 MiB
Stream size                              : 210 MiB
Stream size                              : 210.0 MiB
Stream size                              : 210 MiB (81%)
Proportion of this stream                : 0.80732
Writing library                          : x264 - core 125
Writing library                          : x264 core 125
Writing library/Name                     : x264
Writing library/Version                  : core 125
Encoding settings                        : cabac=0 / ref=5 / deblock=1:0:0 / analyse=0x1:0x131 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=8 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=0 / weightp=0 / keyint=30 / keyint_min=16 / scenecut=40 / intra_refresh=0 / rc_lookahead=30 / rc=2pass / mbtree=1 / bitrate=270 / ratetol=1.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / vbv_maxrate=270 / vbv_bufsize=270 / nal_hrd=none / ip_ratio=1.40 / aq=1:1.00
Tagged date                              : UTC 2012-09-25 07:21:37

Audio
Count                                    : 169
Count of stream of this kind             : 1
Kind of stream                           : Audio
Kind of stream                           : Audio
Stream identifier                        : 0
ID                                       : 2
ID                                       : 2
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Commercial name                          : AAC
Format profile                           : LC
Codec ID                                 : 40
Codec                                    : AAC LC
Codec                                    : AAC LC
Codec/Family                             : AAC
Codec/CC                                 : 40
Duration                                 : 6556027
Duration                                 : 1h 49mn
Duration                                 : 1h 49mn 16s 27ms
Duration                                 : 1h 49mn
Duration                                 : 01:49:16.027
Bit rate mode                            : VBR
Bit rate mode                            : Variable
Bit rate                                 : 58955
Bit rate                                 : 59.0 Kbps
Maximum bit rate                         : 270000
Maximum bit rate                         : 270 Kbps
Channel(s)                               : 2
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Channel positions                        : 2/0/0
Sampling rate                            : 44100
Sampling rate                            : 44.1 KHz
Samples count                            : 289120791
Compression mode                         : Lossy
Compression mode                         : Lossy
Stream size                              : 48314149
Stream size                              : 46.1 MiB (18%)
Stream size                              : 46 MiB
Stream size                              : 46 MiB
Stream size                              : 46.1 MiB
Stream size                              : 46.08 MiB
Stream size                              : 46.1 MiB (18%)
Proportion of this stream                : 0.17717
Tagged date                              : UTC 2012-09-25 07:21:37
Atom ftyp @ 0 of size: 32, ends @ 32
Atom moov @ 32 of size: 1276327, ends @ 1276359
     Atom mvhd @ 40 of size: 108, ends @ 148
     Atom trak @ 148 of size: 821662, ends @ 821810
         Atom tkhd @ 156 of size: 92, ends @ 248
         Atom edts @ 248 of size: 36, ends @ 284
             Atom elst @ 256 of size: 28, ends @ 284
         Atom mdia @ 284 of size: 821526, ends @ 821810
             Atom mdhd @ 292 of size: 32, ends @ 324
             Atom hdlr @ 324 of size: 45, ends @ 369
             Atom minf @ 369 of size: 821441, ends @ 821810
                 Atom vmhd @ 377 of size: 20, ends @ 397
                 Atom dinf @ 397 of size: 36, ends @ 433
                     Atom dref @ 405 of size: 28, ends @ 433
                 Atom stbl @ 433 of size: 821377, ends @ 821810
                     Atom stsd @ 441 of size: 149, ends @ 590
                         Atom avc1 @ 457 of size: 133, ends @ 590
                             Atom avcC @ 543 of size: 47, ends @ 590
                     Atom stts @ 590 of size: 24, ends @ 614
                     Atom stss @ 614 of size: 26340, ends @ 26954
                     Atom stsc @ 26954 of size: 52, ends @ 27006
                     Atom stsz @ 27006 of size: 785956, ends @ 812962
                     Atom stco @ 812962 of size: 8848, ends @ 821810
     Atom trak @ 821810 of size: 454452, ends @ 1276262
         Atom tkhd @ 821818 of size: 92, ends @ 821910
         Atom edts @ 821910 of size: 36, ends @ 821946
             Atom elst @ 821918 of size: 28, ends @ 821946
         Atom mdia @ 821946 of size: 454316, ends @ 1276262
             Atom mdhd @ 821954 of size: 32, ends @ 821986
             Atom hdlr @ 821986 of size: 45, ends @ 822031
             Atom minf @ 822031 of size: 454231, ends @ 1276262
                 Atom smhd @ 822039 of size: 16, ends @ 822055
                 Atom dinf @ 822055 of size: 36, ends @ 822091
                     Atom dref @ 822063 of size: 28, ends @ 822091
                 Atom stbl @ 822091 of size: 454171, ends @ 1276262
                     Atom stsd @ 822099 of size: 91, ends @ 822190
                         Atom mp4a @ 822115 of size: 75, ends @ 822190
                             Atom esds @ 822151 of size: 39, ends @ 822190
                     Atom stts @ 822190 of size: 161368, ends @ 983558
                     Atom stsc @ 983558 of size: 1480, ends @ 985038
                     Atom stsz @ 985038 of size: 282372, ends @ 1267410
                     Atom stco @ 1267410 of size: 8852, ends @ 1276262
     Atom udta @ 1276262 of size: 97, ends @ 1276359
         Atom meta @ 1276270 of size: 89, ends @ 1276359
             Atom hdlr @ 1276282 of size: 33, ends @ 1276315
             Atom ilst @ 1276315 of size: 44, ends @ 1276359
                 Atom ©too @ 1276323 of size: 36, ends @ 1276359
                     Atom data @ 1276331 of size: 28, ends @ 1276359
Atom mdat @ 1276359 of size: 251293325, ends @ 252569684
Atom free @ 252569684 of size: 8, ends @ 252569692
Atom free @ 252569692 of size: 62, ends @ 252569754
------------------------------------------------------
Total size: 252569754 bytes; 50 atoms total. AtomicParsley version: 0.9.0 (utf8)
Media data: 251293325 bytes; 1276429 bytes all other atoms (0.505% atom overhead).
Total free atom space: 70 bytes; 0.000% waste. Padding available: 0 bytes.
------------------------------------------------------
在慢速连接中,此电影将在30-40秒后开始播放,直到标头信息(4.2 Mb)下载。我需要那部电影尽快开始播放。我还有下一个问题:

  • 如何减少电影标题的大小

  • 如何缩小 /moov[0]/trak[1]/mdia[0]/minf[0]/stbl[0]以及为什么它在 抽样率44100


  • 看起来AAC编码器或ffmpeg对AAC流的编码做得不好。采样率不是这里的问题。您是否尝试过使用其他AAC编码器

    -acodec aac -strict experimental
    
    ffmpeg通常使用非常小的块大小,这将导致更大的头。视频也是如此

    下面的例子非常极端

    原子stts@869498,尺寸:2135816,末端为3005314

    原子stsz@3045026,尺寸:1129400,末端为4174426

    如果另一个AAC编码器最终看起来相同,我会尝试另一个编码器。
    我建议您不要先使用ffmpeg,然后再使用mp4box,而是看看ffmpeg的一个分支,名为。这可以在转码时将头放在起始位置,而不是作为后期处理。但考虑到它是ffmpeg分支,我不确定它是否会对您的头大小问题有所帮助。值得一试。

    我重新编码了电影
    ffmpeg-I 1348645218_970458_2465.iph.mp4-acodec aac-strict experimental-vcodec copy 1348645218_970458_2465.iph.aac_exp.mp4
    ,头大小从4.2MB减少到3.8Mb。不管怎样,它都是大尺寸的。也许你知道如何增加块大小?恐怕使用ffmpeg是不可能的。这完全取决于编码器。也试试ffmbc,看看效果是否更好。这不是一个答案,但您可以使用ffmpeg通过
    -faststart
    选项移动moov atom(您需要为该选项编译ffmpeg,因为它是昨天引入的)。FFmpeg还附带了单独的
    qt faststart
    工具,该工具还可以重新定位atom。您的问题解决了吗?我现在也有同样的问题,正在努力寻找解决办法。不,我没有。我切换到DASH&HLS协议。好的,不是我想听的,但谢谢!