This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

h.264 video will not play on iPad2, iPhone4s, etc

Hi,

We are recording h.264 video, muxing it into an mp4 container (using gstreamer), and then trying to save it to an iPad2 and play it back. Not streaming, just saving the video and playing it back.  The result is a video of the correct length, with audio, but black video. The xcode console does not give us any grief, just fails silently.  I believe that I've changed our codec parameters to be compliant with the iPad2:

    h264params.profileIdc  = 77; // main
    h264params.levelIdc    = 31;  // 3.1
    h264params.entropyMode = 0;
    h264params.transform8x8FlagIntraFrame = 0;
    h264params.transform8x8FlagInterFrame = 0;
    h264params.seqScalingFlag = 0;

We initially suspected our muxer, but if we re-containerize the elementary stream with ffmpeg, it still doesn't work. However, if we "transcode" it to h.264 using ffmpeg, it works.

Anyone have playback working? Any ideas?

Thanks!

Paul

This is a dump of our original video using mp4dump:

mp4dump version 1.6
Dumping 2011-11-03-19-07-43.mp4 meta-information...
 type ftyp
  majorBrand = mp42
  minorVersion = 0 (0x00000000)
  <table entries suppressed>
 type free
 type mdat
 type moov
  type mvhd
   version = 0 (0x00)
   flags = 0 (0x000000)
   creationTime = 3403217264 (0xcad8f970)
   modificationTime = 3403217264 (0xcad8f970)
   timeScale = 1000 (0x000003e8)
   duration = 19113 (0x00004aa9)
   rate = 1.000000
   volume = 1.000000
   reserved1 = <70 bytes>
   00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00
   00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00
   00 00 00 00 00 00 00 00 00 00 40 00 00 00 00 00
   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
   00 00 00 00 00 00
   nextTrackId = 3 (0x00000003)
  type trak
   type tkhd
    version = 0 (0x00)
    flags = 7 (0x000007)
    creationTime = 3403217264 (0xcad8f970)
    modificationTime = 3403217264 (0xcad8f970)
    trackId = 1 (0x00000001)
    reserved1 = <4 bytes> 00 00 00 00
    duration = 19100 (0x00004a9c)
    reserved2 = <12 bytes> 00 00 00 00 00 00 00 00 00 00 00 00
    volume = 0.000000
    reserved3 = <2 bytes> 00 00
    matrix = <36 bytes>
    00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    40 00 00 00
    width = 640.000000
    height = 480.000000
   type mdia
    type mdhd
     version = 0 (0x00)
     flags = 0 (0x000000)
     creationTime = 3403217264 (0xcad8f970)
     modificationTime = 3403217264 (0xcad8f970)
    timeScale = 30 (0x0000001e)
     duration = 573 (0x0000023d)
     language = 0 (0x0000)
     reserved = <2 bytes> 00 00
    type hdlr
     version = 0 (0x00)
     flags = 0 (0x000000)
     reserved1 = <4 bytes> 00 00 00 00
     handlerType = vide
     reserved2 = <12 bytes> 00 00 00 00 00 00 00 00 00 00 00 00
     name = VideoHandler
    type minf
     type vmhd
      version = 0 (0x00)
      flags = 1 (0x000001)
      reserved = <8 bytes> 00 00 00 00 00 00 00 00
     type dinf
      type dref
       version = 0 (0x00)
       flags = 0 (0x000000)
       entryCount = 1 (0x00000001)
       type url
        version = 0 (0x00)
        flags = 1 (0x000001)
        location = (null)
     type stbl
      type stsd
       version = 0 (0x00)
       flags = 0 (0x000000)
       entryCount = 1 (0x00000001)
       type avc1
        reserved1 = <6 bytes> 00 00 00 00 00 00
        dataReferenceIndex = 1 (0x0001)
        reserved2 = <16 bytes> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        width = 640 (0x0280)
        height = 480 (0x01e0)
        reserved3 = <14 bytes> 00 48 00 00 00 48 00 00 00 00 00 00 00 01
        compressorName =
        reserved4 = <4 bytes> 00 18 ff ff
        type avcC
         configurationVersion = 1 (0x01)
      AVCProfileIndication = 77 (0x4d)
         profile_compatibility = 0 (0x00)
         AVCLevelIndication = 31 (0x1f)
         reserved = 63 (0x3f) <6 bits>
         lengthSizeMinusOne = 3 (0x3) <2 bits>
         reserved1 = 7 (0x7) <3 bits>
         numOfSequenceParameterSets = 1 (0x01) <5 bits>
         <table entries suppressed>
         numOfPictureParameterSets = 1 (0x01)
         <table entries suppressed>
      type stts
       version = 0 (0x00)
       flags = 0 (0x000000)
       entryCount = 50 (0x00000032)
       <table entries suppressed>
      type stss
       version = 0 (0x00)
       flags = 0 (0x000000)
       entryCount = 19 (0x00000013)
       <table entries suppressed>
      type stsc
       version = 0 (0x00)
       flags = 0 (0x000000)
       entryCount = 1 (0x00000001)
       <table entries suppressed>
      type stsz
       version = 0 (0x00)
       flags = 0 (0x000000)
       sampleSize = 0 (0x00000000)
       sampleCount = 549 (0x00000225)
       <table entries suppressed>
      type stco
       version = 0 (0x00)
       flags = 0 (0x000000)
       entryCount = 549 (0x00000225)
       <table entries suppressed>
  type trak
   type tkhd
    version = 0 (0x00)
    flags = 7 (0x000007)
    creationTime = 3403217264 (0xcad8f970)
    modificationTime = 3403217264 (0xcad8f970)
    trackId = 2 (0x00000002)
    reserved1 = <4 bytes> 00 00 00 00
    duration = 19113 (0x00004aa9)
    reserved2 = <12 bytes> 00 00 00 00 00 00 00 00 00 00 00 00
    volume = 1.000000
    reserved3 = <2 bytes> 00 00
    matrix = <36 bytes>
    00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    40 00 00 00
    width = 0.000000
    height = 0.000000
   type mdia
    type mdhd
     version = 0 (0x00)
     flags = 0 (0x000000)
     creationTime = 3403217264 (0xcad8f970)
     modificationTime = 3403217264 (0xcad8f970)
  timeScale = 15920 (0x00003e30)
     duration = 304286 (0x0004a49e)
     language = 0 (0x0000)
     reserved = <2 bytes> 00 00
    type hdlr
     version = 0 (0x00)
     flags = 0 (0x000000)
     reserved1 = <4 bytes> 00 00 00 00
     handlerType = soun
     reserved2 = <12 bytes> 00 00 00 00 00 00 00 00 00 00 00 00
     name = SoundHandler
    type minf
     type smhd
      version = 0 (0x00)
      flags = 0 (0x000000)
      reserved = <4 bytes> 00 00 00 00
     type dinf
      type dref
       version = 0 (0x00)
       flags = 0 (0x000000)
       entryCount = 1 (0x00000001)
       type url
        version = 0 (0x00)
        flags = 1 (0x000001)
        location = (null)
     type stbl
      type stsd
       version = 0 (0x00)
       flags = 0 (0x000000)
       entryCount = 1 (0x00000001)
       type mp4a
        reserved1 = <6 bytes> 00 00 00 00 00 00
        dataReferenceIndex = 1 (0x0001)
        soundVersion = 0 (0x0000)
        reserved2 = <6 bytes> 00 00 00 00 00 00
        channels = 1 (0x0001)
        sampleSize = 16 (0x0010)
        packetSize = 0 (0x0000)
        timeScale = 15920 (0x00003e30)
        reserved3 = <2 bytes> 00 00
        type esds
         version = 0 (0x00)
         flags = 0 (0x000000)
         ESID = 2 (0x0002)
         streamDependenceFlag = 0 (0x0) <1 bits>
         URLFlag = 0 (0x0) <1 bits>
         OCRstreamFlag = 0 (0x0) <1 bits>
         streamPriority = 0 (0x00) <5 bits>
         decConfigDescr
          objectTypeId = 64 (0x40)
          streamType = 5 (0x05) <6 bits>
          upStream = 0 (0x0) <1 bits>
          reserved = 1 (0x1) <1 bits>
          bufferSizeDB = 0 (0x000000) <24 bits>
          maxBitrate = 0 (0x00000000)
       avgBitrate = 0 (0x00000000)
          decSpecificInfo
           info = <2 bytes> 14 08
          profileLevelIndicationIndexDescr
         slConfigDescr
          predefined = 2 (0x02)
         ipiPtr
         ipIds
         ipmpDescrPtr
         langDescr
         qosDescr
         regDescr
         extDescr
      type stts
       version = 0 (0x00)
       flags = 0 (0x000000)
       entryCount = 295 (0x00000127)
       <table entries suppressed>
      type stsc
       version = 0 (0x00)
       flags = 0 (0x000000)
       entryCount = 1 (0x00000001)
       <table entries suppressed>
      type stsz
       version = 0 (0x00)
       flags = 0 (0x000000)
       sampleSize = 0 (0x00000000)
       sampleCount = 297 (0x00000129)
       <table entries suppressed>
      type stco
       version = 0 (0x00)
       flags = 0 (0x000000)
       entryCount = 297 (0x00000129)
       <table entries suppressed>





  • Is this gstreamer on some TI device ? If yes, suggest you to try - https://gstreamer.ti.com

    Can that stream play on VLC player or mplayer ? If yes, then its better you ask in apple forum on what setting is needed to play a video on IPAD.

    regards

    Yashwant