MP4 from BlueIris won't play on an Apple Silicon M1-based Mini

TheWaterbug

Getting comfortable
Joined
Oct 20, 2017
Messages
767
Reaction score
1,664
Location
Palos Verdes
I'm exporting security camera MP4s from Blue Iris, such as this this 3 MB sample, and I'm having trouble playing them back (and therefore editing them in DaVinci Resolve) on my M1 Mini/12.0.1.

They all work fine on my ancient mid-2014 Intel MBP/10.14.6. I can open them in Quicklook, QuickTime Player, VLC 3.0.16, or DaVinci Resolve 17.2, and they look just as I expect them to.

If I do any of the same on the Mini:
  1. Quicklook shows just a gray screen and a spinner that never turns into anything.
  2. Quicktime Player shows a black screen
  3. VLC shows a gray screen with some evidence of something, for about a second, and then renders the remainder of the file correctly.
  4. DaVinci Resolve shows the media as being Offline

I'm guessing these are all symptoms of the same problem, because they're presumably using the same macOS libraries. VLC's behavior gives me some hope, because it eventually finds its way.

Is this a malformed MP4?
 

IReallyLikePizza2

Known around here
Joined
May 14, 2019
Messages
1,852
Reaction score
4,443
Location
Houston
Exact same issue here, there is something wrong with how Blue Iris is exporting/transcoding the files. I've played with the encode settings to no end, and there is no fix

its not limited to MacOS, the videos also don't play in the Telegram IM app.

The "fix" for me is to just transcode them with Handbrake before I do anything with them
 

TheWaterbug

Getting comfortable
Joined
Oct 20, 2017
Messages
767
Reaction score
1,664
Location
Palos Verdes
its not limited to MacOS, the videos also don't play in the Telegram IM app.
Is that app on iOS or Android? These files also fail to play in Safari on my iPhone (iOS 15.1.1) so it might be an AppleOS/Apple-Silicon problem, since many/most apps on iOS/macOS are using hardware accelerated decoding.

A user on a Mac forum told me that VLC on Monterey/AS will play it correctly if HW acceleration is turned off in VLC.

Anyone have an Intel Mac running Monterey?
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,676
Reaction score
14,024
Location
USA
I've had playback issues with Blue Iris exports before. It can work to use ffmpeg to input the Blue Iris export, copy all streams, and output a fresh new MP4. Since this is just remuxing without transcoding the media, it is very fast and lossless.

The command would be something like this:

Code:
ffmpeg -i input.mp4 -c:v copy -c:a copy output.mp4
ffmpeg for Windows can be gotten from here Releases · BtbN/FFmpeg-Builds

The smallest full-featured stable build today would be ffmpeg-n4.4.1-2-gcc33e73618-win64-gpl-shared-4.4.zip I believe.
 

IReallyLikePizza2

Known around here
Joined
May 14, 2019
Messages
1,852
Reaction score
4,443
Location
Houston
I've had playback issues with Blue Iris exports before. It can work to use ffmpeg to input the Blue Iris export, copy all streams, and output a fresh new MP4. Since this is just remuxing without transcoding the media, it is very fast and lossless.

The command would be something like this:

Code:
ffmpeg -i input.mp4 -c:v copy -c:a copy output.mp4
ffmpeg for Windows can be gotten from here Releases · BtbN/FFmpeg-Builds

The smallest full-featured stable build today would be ffmpeg-n4.4.1-2-gcc33e73618-win64-gpl-shared-4.4.zip I believe.
This is great information! I'll have to try it out.
 

TheWaterbug

Getting comfortable
Joined
Oct 20, 2017
Messages
767
Reaction score
1,664
Location
Palos Verdes
Code:
ffmpeg -i input.mp4 -c:v copy -c:a copy output.mp4
I just tried this on this collection of files, and it doesn't fix it.

I tried ffmpeg -i input.mp4 -c:v libx264 -c:a copy output.mp4

and that produces a ton of "error while decoding MB 161 121, bytestream -5" errors, but then finally outputs a file that will play back. Its 3x the original size, but it will play back.

So this is possibly pointing towards a malformed mp4 file from BI.
 

TheWaterbug

Getting comfortable
Joined
Oct 20, 2017
Messages
767
Reaction score
1,664
Location
Palos Verdes
I think I can exonerate the camera. I downloaded a clip from the camera via the Amcrest desktop app:

https://www.kan.org/download/FromCamera ... topApp.mp4

and then approximately the same clip from BlueIris:


The BI clip fails to play back on 12.1/M1, but the Amcrest version works fine.

If I export from BI with the "re-encode video to h.264" box checked, then it bloats the file by nearly 10x, but the resulting file works fine:


Any here have an Intel Mac running 12.0.1 or 12.1?
 
Last edited:

TheWaterbug

Getting comfortable
Joined
Oct 20, 2017
Messages
767
Reaction score
1,664
Location
Palos Verdes
Have you installed the codec pack suggested by Blue Iris help file?
I haven't, but the problem is with playback on a Mac (or iPhone), not in Windows. Macs and iPhones have no problem with the vast majority of MP4 files, including MP4s downloaded directly from the camera (e.g. not through BI), nor with an MP4 re-encoded by BI. The problem appears to be limited only to MP4s that are exported directly from BI without re-encoding, and then only in a newer version of macOS.

On another, Mac-specific forum, another user reports that these files also fail on an Intel-based Mac running macOS 12.x with hardware decoding, so it appears to be a pure software bug, and not related to anything specific in Apple Silicon as I had originally surmised.
 

hisokajp

n3wb
Joined
Oct 28, 2019
Messages
4
Reaction score
0
Location
Seattle
i have the same problem with my exports now... used to work fine and now MP4 do not open. I removed and reinstalled codec pack, try ffmpeg, and even .avi (file isn't even saved) but nothing works so far...

anyone has a different solution? i am on the last stable software, should i try the latest non-stable instead?
 

MachAF

Young grasshopper
Joined
Dec 12, 2018
Messages
49
Reaction score
23
Location
Washington
Anyone find a solution to this? When using UI3 on my intel iMac i can download the videos fine. When I use my new M2 MacBook the video wont play only the audio when using quicktime. VLC player will play them however.
 

TheWaterbug

Getting comfortable
Joined
Oct 20, 2017
Messages
767
Reaction score
1,664
Location
Palos Verdes
No solution yet. I'm going to do a more controlled and better-documented sampling of video, both for this forum and for BI tech support, when I get a chance. I'll also try looking at the files using this MP4 header inspector, although I don't know enough about MP4 to be able to understand what I'm seeing!
 

TheWaterbug

Getting comfortable
Joined
Oct 20, 2017
Messages
767
Reaction score
1,664
Location
Palos Verdes
More data:

Here’s the direct export from the Blue Iris console on the BI PC, without re-encoding:


Here’s with re-encoding from the Blue Iris console on the BI PC:


Here’s the direct export from UI3 without re-encoding:


and here’s from UI3 with the BI Re-encode video to H.264 checked:


These are directly from the Clips view, with no edits to the start/stop points, so they should all be the exact same period of time. Filenames are unchanged, too.

Whether downloaded from the BI console and then copied to my Mac or whether downloaded via Chrome/UI3 on my Mac, the behavior is the same. If the MP4 has NOT been re-encoded, it won’t play properly. If it has been re-encoded, then it will play back properly.

Symptoms and workarounds are the same as they were last year:

  1. Finder: Cmd-I will display a thumbnail for the “bad” MP4s, and even play them back, but:
  2. QuickTime Player will not!
  3. VLC with Hardware Deocoding checked wil play them, but the first few frames display incorrectly as a gray “snow” field before eventually rendering correctly.
  4. VLC with Hardware Deocoding un-checked wil play them correctly from Frame 1.
  5. DaVinci Resolve cannot read them.
  6. ffprobe reports errors in the un-transcoded files, but not in the re-encoded files. The errors are here, and the details are spoilered below:
    1. [h264 @ 0x7fd082805200] error while decoding MB 161 121, bytestream -5
    2. [h264 @ 0x7fd082805200] concealing 50 DC, 50 AC, 50 MV errors in I frame
    3. [h264 @ 0x7fd082805200] error while decoding MB 161 121, bytestream -6
    4. [h264 @ 0x7fd082805200] concealing 50 DC, 50 AC, 50 MV errors in P frame
    5. [h264 @ 0x7fd082805200] error while decoding MB 161 121, bytestream -5
    6. [h264 @ 0x7fd082805200] concealing 50 DC, 50 AC, 50 MV errors in P frame
    7. [h264 @ 0x7fd082805200] error while decoding MB 161 121, bytestream -5
    8. [h264 @ 0x7fd082805200] concealing 50 DC, 50 AC, 50 MV errors in P frame
Bad file:

/Applications/ffmpeg/ffprobe /Users/steven/Downloads/TrailDown.20230203_042912-042924.495.mp4
ffprobe version N-109745-g7d49fef8b4-tessus static FFmpeg binaries for macOS 64-bit Copyright (c) 2007-2023 the FFmpeg developers
built with Apple clang version 11.0.0 (clang-1100.0.33.17)
configuration: --cc=/usr/bin/clang --prefix=/opt/ffmpeg --extra-version=tessus --enable-avisynth --enable-fontconfig --enable-gpl --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libmysofa --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvmaf --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-version3 --pkg-config-flags=--static --disable-ffplay
libavutil 57. 44.100 / 57. 44.100
libavcodec 59. 61.100 / 59. 61.100
libavformat 59. 37.100 / 59. 37.100
libavdevice 59. 8.101 / 59. 8.101
libavfilter 8. 56.100 / 8. 56.100
libswscale 6. 8.112 / 6. 8.112
libswresample 4. 9.100 / 4. 9.100
libpostproc 56. 7.100 / 56. 7.100
[h264 @ 0x7fd082805200] error while decoding MB 161 121, bytestream -5
[h264 @ 0x7fd082805200] concealing 50 DC, 50 AC, 50 MV errors in I frame
[h264 @ 0x7fd082805200] error while decoding MB 161 121, bytestream -6
[h264 @ 0x7fd082805200] concealing 50 DC, 50 AC, 50 MV errors in P frame
[h264 @ 0x7fd082805200] error while decoding MB 161 121, bytestream -5
[h264 @ 0x7fd082805200] concealing 50 DC, 50 AC, 50 MV errors in P frame
[h264 @ 0x7fd082805200] error while decoding MB 161 121, bytestream -5
[h264 @ 0x7fd082805200] concealing 50 DC, 50 AC, 50 MV errors in P frame
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/steven/Downloads/TrailDown.20230203_042912-042924.495.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Duration: 00:00:11.30, start: 0.000000, bitrate: 6417 kb/s
Stream #0:0[0x1](und): Video: h264 (Main) (avc1 / 0x31637661), yuvj420p(pc, bt709, progressive), 2592x1944, 6388 kb/s, 19.91 fps, 20.67 tbr, 90k tbn (default)
Metadata:
handler_name : VideoHandler
vendor_id : [0][0][0][0]
Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 8000 Hz, mono, fltp, 26 kb/s (default)
Metadata:
handler_name : SoundHandler
vendor_id : [0][0][0][0]

Good file:

/Applications/ffmpeg/ffprobe /Users/steven/Downloads/TrailDown.20230203_042912-042924.494.mp4
ffprobe version N-109745-g7d49fef8b4-tessus static FFmpeg binaries for macOS 64-bit Copyright (c) 2007-2023 the FFmpeg developers
built with Apple clang version 11.0.0 (clang-1100.0.33.17)
configuration: --cc=/usr/bin/clang --prefix=/opt/ffmpeg --extra-version=tessus --enable-avisynth --enable-fontconfig --enable-gpl --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libmysofa --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvmaf --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-version3 --pkg-config-flags=--static --disable-ffplay
libavutil 57. 44.100 / 57. 44.100
libavcodec 59. 61.100 / 59. 61.100
libavformat 59. 37.100 / 59. 37.100
libavdevice 59. 8.101 / 59. 8.101
libavfilter 8. 56.100 / 8. 56.100
libswscale 6. 8.112 / 6. 8.112
libswresample 4. 9.100 / 4. 9.100
libpostproc 56. 7.100 / 56. 7.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/steven/Downloads/TrailDown.20230203_042912-042924.494.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Duration: 00:00:12.09, start: 0.000000, bitrate: 37956 kb/s
Stream #0:0[0x1](und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p(progressive), 2592x1952, 37926 kb/s, 19.94 fps, 20.42 tbr, 90k tbn (default)
Metadata:
handler_name : VideoHandler
vendor_id : [0][0][0][0]
Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 8000 Hz, mono, fltp, 27 kb/s (default)
Metadata:
handler_name : SoundHandler
vendor_id : [0][0][0][0]
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,676
Reaction score
14,024
Location
USA
It sounds like Blue Iris might not be starting at a proper keyframe when you export without reencoding. Unfortunately I am not nearly enough of a video format expert to be able to analyze the file format or the frames within.

Do you have any Smart Codec or H.264+ or H.265+ options enabled in the camera's web interface? Those mess with iframes and could cause such an issue. But it also wouldn't surprise me at all if this is caused by something else.
 

TheWaterbug

Getting comfortable
Joined
Oct 20, 2017
Messages
767
Reaction score
1,664
Location
Palos Verdes
It sounds like Blue Iris might not be starting at a proper keyframe when you export without reencoding. Unfortunately I am not nearly enough of a video format expert to be able to analyze the file format or the frames within.

Do you have any Smart Codec or H.264+ or H.265+ options enabled in the camera's web interface? Those mess with iframes and could cause such an issue. But it also wouldn't surprise me at all if this is caused by something else.
Camera is set for vanilla H.264:

1675813465226.png

and Direct To Disc is enabled in BI.
 

TheWaterbug

Getting comfortable
Joined
Oct 20, 2017
Messages
767
Reaction score
1,664
Location
Palos Verdes
Also, please note that the playback error is specific to Apple-Silicon-based Macs. Either file plays properly in Windows.

But the ffprobe output is the same whether I run ffprobe in Windows or on my Mac, so there appears to be an issue with the file itself that Windows can handle, that my Intel Mac could handle, but that my AS Mac can not handle.
 
Top