Microsoft Technical Takeoff: Windows and Microsoft Intune
Oct 24 2022 07:00 AM - Oct 27 2022 12:00 PM (PDT)

Problem Playing MP4 Files sourced from iPhone & CCTV Systems

New Contributor

We keep hitting an issue with Windows failing to play MP4 files. We are using Enterprise N but with Media Feature pack.

The files have no thumbnail available in File explorer (a point I'll come back to), and problems we've seen include Windows Photos App being completely unable to play them or Apps like PowerPoint being unable to import them.

 

Source of files is sometimes iPhone, sometimes CCTV systems. A t first I thought, this must be a codec issue - the files are probably H.265/HEVC inside an MP4 container, and Win10 doesn't have the required Codec for playback. That would be logical...but no, it's not that. These are H.264 Video with AAC(LC) Audio in an MP4 container.

 

Windows should be able to handle that without additional software or codec packs, but it fails.

 

In trying to workaround this, I utilised ffmpeg to covert the files. Initially assuming it was a codec problem I re-encoded the streams, but later found this was unnecessary, as simply re-muxing the file back into another MP4 container using the "-codec copy" switch succeeded in producing a file that would now Playback correctly, work if imported into PowerPoint and interestingly now also has a Thumbnail in File explorer that the source file did not.

 

Both Video and Audio streams should be a byte-for-byte identical copy with only the container element & metadata having changed.

 

Partial sample outputs,

 

Source:

.\ffmpeg.exe -i C:\temp\filename_iOS.mp4
Input #0, avi, from 'C:\temp\filename_iOS.mp4':
  Metadata:
    software        : Lavf58.76.100
  Duration: 00:00:06.52, start: 0.000000, bitrate: 8805 kb/s
  Stream #0:0: Video: h264 (High) (H264 / 0x34363248), yuv420p(tv, bt709, progressive), 1920x1080, 8811 kb/s, 29.97 fps, 29.97 tbr, 29.97 tbn, 59.94 tbc
  Stream #0:1: Audio: aac (LC) ([255][0][0][0] / 0x00FF), 44100 Hz, stereo, fltp, 130 kb/s

 

Conversion:

.\ffmpeg.exe -i C:\temp\filename_iOS.mp4 -codec copy C:\temp\filename_iOS_2.mp4
Input #0, avi, from 'C:\temp\filename_iOS.mp4':
  Metadata:
    software        : Lavf58.76.100
  Duration: 00:00:06.52, start: 0.000000, bitrate: 8805 kb/s
  Stream #0:0: Video: h264 (High) (H264 / 0x34363248), yuv420p(tv, bt709, progressive), 1920x1080, 8811 kb/s, 29.97 fps, 29.97 tbr, 29.97 tbn, 59.94 tbc
  Stream #0:1: Audio: aac (LC) ([255][0][0][0] / 0x00FF), 44100 Hz, stereo, fltp, 130 kb/s
Output #0, mp4, to 'C:\temp\filename_iOS_2.mp4':
  Metadata:
    software        : Lavf58.76.100
    encoder         : Lavf58.77.100
  Stream #0:0: Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1920x1080, q=2-31, 8811 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 29.97 tbc
  Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 130 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[mp4 @ 000002bee57de1c0] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
[mp4 @ 000002bee57de1c0] pts has no valueB time=00:00:00.00 bitrate=11636.4kbits/s speed=  33x
    Last message repeated 143 times
[mp4 @ 000002bee57de1c0] pts has no valueB time=00:00:04.80 bitrate=8729.4kbits/s speed=9.59x
    Last message repeated 48 times
frame=  193 fps=0.0 q=-1.0 Lsize=    6998kB time=00:00:06.47 bitrate=8848.5kbits/s speed=9.64x
video:6891kB audio:102kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.068556%

 

Converted File:

.\ffmpeg.exe -i C:\temp\filename_iOS_2.mp4
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\temp\filename_iOS_2.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.77.100
  Duration: 00:00:06.50, start: 0.000000, bitrate: 8816 kb/s
  Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080, 8765 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
  Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 126 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]

So the repackaged file's metadata looks substantially different now

 

 

I can't fathom why Windows and other MS apps are so picky about the container. I can only assume it's the pts timestamps or something making the whole video file appear corrupt in some way. But other device just handle this on the fly and don't complain.

 

 

Has anyone else seen this issue and got a good solution?

0 Replies