有报道称,格式错误的h264视频文件导致iOS设备挂起或崩溃(我以纯文本形式添加了该链接,以避免意外的点击进入,风险自负:http://www.apps4iphone.net/videocrash.html)。我正在尝试对该文件进行反向工程,以了解它为何以及如何损害iOS设备。

用Mediainfo Mac查看该文件似乎没有任何异常:

* * * MediaInfo Mac 0.7.36.0 file analysis report.
* * * MediaInfo Mac is ©2010 by Diego Massanti - http://mediainfo.massanti.com
* * * MediaInfoLib by Jerome Martinez - http://mediainfo.sourceforge.net
Created on: Nov 22, 2016, 1:55:04 PM EST
Report for file: IMG_0942.mp4

General / Container Stream #1
    Total Video Streams for this File.................1
    Total Audio Streams for this File.................1
    Video Codecs Used.................................AVC
    Audio Codecs Used.................................AAC LC
    File Format.......................................MPEG-4
    Play Time.........................................5s 6ms
    Total File Size...................................527 KiB
    Total Stream BitRate..............................863 Kbps
Video Stream #1
    Codec (Human Name)................................AVC
    Codec (FourCC)....................................avc1
    Codec Profile.....................................Baseline@L3.0
    Frame Width.......................................480 pixels
    Frame Height......................................480 pixels
    Frame Rate........................................25.000 fps
    Total Frames......................................126
    Display Aspect Ratio..............................1.000
    Scan Type.........................................Progressive
    Color Space.......................................YUV
    Codec Settings (Summary)..........................1 Ref Frames
    QF (like Gordian Knot)............................0.137
    Codec Settings (CABAC)............................No
    Codec Settings (Reference Frames).................1
    Video Stream Length...............................5s 6ms
    Video Stream BitRate..............................789 Kbps
    Video Stream BitRate Mode.........................VBR
    Bit Depth.........................................8 bits
    Video Stream Size.................................486 KiB (92%)
    Video Stream Title................................Core Media Video
    Date of Original Encoding.........................UTC 2016-11-17 20:14:29
Audio Stream #1
    Codec.............................................AAC
    Codec (FourCC)....................................40
    Audio Stream Length...............................4s 504ms
    Audio Stream BitRate..............................72.0 Kbps
    Audio Stream BitRate Mode.........................CBR
    Number of Audio Channels..........................1
    Audio Channel's Positions.........................Front: C
    Sampling Rate.....................................44.1 KHz
    Audio Stream Size.................................39.2 KiB (7%)
    Audio Stream Title................................Core Media Audio
    Date of Original Encoding.........................UTC 2016-11-17 20:14:29

ffprobe输出:

➜  Downloads ffprobe IMG_0942.mp4
ffprobe version 3.2 Copyright (c) 2007-2016 the FFmpeg developers
  built with Apple LLVM version 8.0.0 (clang-800.0.42.1)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/3.2 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-opencl --disable-lzma --enable-vda
  libavutil      55. 34.100 / 55. 34.100
  libavcodec     57. 64.100 / 57. 64.100
  libavformat    57. 56.100 / 57. 56.100
  libavdevice    57.  1.100 / 57.  1.100
  libavfilter     6. 65.100 /  6. 65.100
  libavresample   3.  1.  0 /  3.  1.  0
  libswscale      4.  2.100 /  4.  2.100
  libswresample   2.  3.100 /  2.  3.100
  libpostproc    54.  1.100 / 54.  1.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'IMG_0942.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 1
    compatible_brands: mp41mp42isom
    creation_time   : 2016-11-17T20:14:29.000000Z
  Duration: 00:00:05.01, start: 0.000000, bitrate: 862 kb/s
    Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 71 kb/s (default)
    Metadata:
      creation_time   : 2016-11-17T20:14:29.000000Z
      handler_name    : Core Media Audio
    Stream #0:1(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 480x480, 794 kb/s, 25.17 fps, 25 tbr, 12800 tbn, 25600 tbc (default)
    Metadata:
      creation_time   : 2016-11-17T20:14:29.000000Z
      handler_name    : Core Media Video


我不确定读取视频文件头内容的最佳方法Mac。但是,什么会导致该视频挂起iOS设备?它的标题格式错误吗?元数据或视频流损坏?另请注意,这不会使Mac上的Quicktime崩溃或iOS模拟器上的Safari / AVFoundation崩溃。

#1 楼

我一直在研究相同的问题,尽管我没有确切找到导致问题的原因。我尝试使用ffmpeg查找一些信息。运行时:

ffmpeg -v error -i IMG_0942.mp4 -f null - 2> IMG_0942.mp4.log


它产生以下内容:

[h264 @ 0x8f4720] top block unavailable for requested intra4x4 mode -1 at 0 0 
[h264 @ 0x8f4720] error while decoding MB 0 0


不确定是否知道如何阅读或它的含义(我没有),但这确实有助于演示找到问题所在的方法。

让我知道您是否在此问题上取得了更大的进步。

评论


PS。刚刚检查过,IOS 10.2修复了该问题。

– MikeSchem
16 Dec 14'在17:48