Roboflow video input of IDE Frame Buffer saved video fails?

Roboflow “Upload Data” rejects the .mp4 video file saved directly from the OpenMV IDE Frame Buffer? The video is captured from the AE3 (running a bare “new file” program). Interestingly, if I input the frame buffer saved .mp4 file to HandBrake and generate a new .mp4 file, then the HandBrake output video uploads fine to Roboflow and is fully intact. The AE3 and IDE are at Firmware 5.0.0. I did not see this topic listed in the forum…

Hmmm, we use ffmpeg to generate those mp4 files. I don’t know what to debug in this case.

Here is the error message. The Roboflow video upload issue may be related to Browser uploading. I’ve tried both Edge and Chrome.

Error message:
We couldn’t read this video in your browser.

This usually happens when a video uses a format your browser can’t open — common with footage from DJI drones and many newer phones, which often record in HEVC (H.265).

The easiest fix is to save or export the video as an MP4 (H.264) and upload it again — most phones, video apps, and free converters can do this. You can also check which video formats your browser supports.

For more information, see the supported video formats section in our documentation.

Can you post the video file? I can send it to them for support. This isn’t an issue on our end, though.

Example AE3 video (saved from OpenMV IDE Frame Buffer). Note, the video plays fine in Windows Media Player. (Google Docs/Vid upload results in error message of invalid format too.) Gemini suggests the following:

![Stairs_up-

Thanks for the report Jim — this is a real bug on our end, and Roboflow’s
error message is pointing at the wrong culprit.

It isn’t HEVC. Your file is MPEG-4 Part 2 (the old DivX/Xvid codec):

Stream #0:0: Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p, 640x480
  encoder : Lavc60.3.100 mpeg4

No browser has ever shipped an MPEG-4 Part 2 decoder for <video>, and
Roboflow reads video in the browser — hence the rejection. Its guess of HEVC
is wrong, but its advice (“convert to MP4 H.264”) is right.

Why the IDE produced it. The FFmpeg we bundle is an LGPL build, configured
--disable-libx264. When we asked it for an .mp4 without naming a codec, it
fell back to the mp4 muxer’s default encoder — which, with libx264 absent, is
MPEG-4 Part 2. So every frame buffer recording saved as .mp4 has this
problem, not just yours.

Workaround right now, using the FFmpeg already installed with the IDE — no
download needed:

"C:\Program Files\OpenMV IDE\share\qtcreator\ffmpeg\windows\bin\ffmpeg.exe" ^
  -i input.mp4 -c:v h264 -pix_fmt yuv420p -movflags +faststart output.mp4

(The same binary ships on macOS and Linux under
share/qtcreator/ffmpeg/<platform>/. Using -c:v h264 rather than a specific
encoder name matters — our builds are not uniform across platforms, and this
lets FFmpeg pick whichever H.264 encoder that platform’s build actually has.)

On your clip that turns 1.5 MB of unplayable MPEG-4 Part 2 into a 409 KB H.264
file that uploads fine.

Fixed for the next release. Three changes:

  1. Video output now asks for H.264 by name on .mp4/.mov/.m4v/.mkv,
    picking the right encoder for whichever platform build is running, plus
    +faststart so playback can start before the whole file downloads. MJPEG,
    GIF and image-sequence exports are unchanged.

  2. Recorded frame rates now snap to a whole number when they’re already within
    2% of one. Recordings were declaring the measured average capture rate —
    yours was 30.29 fps on a 1/12116 timebase — which is honest but awkward for
    annotation tools that index frames off the declared rate. This only re-tags
    the header: no frame is added, dropped or reordered, so frame indices still
    map 1:1 onto captured frames. Only the playback clock shifts (your 4.59 s
    clip becomes 4.63 s). Deliberate slow time-lapses are left exactly as
    measured.

  3. Fixed a related crash-on-convert: the rescale option computed an odd output
    height for many aspect ratios, and H.264 can’t encode odd dimensions, so a
    rescaled convert would have failed outright once we switched to H.264.

@kwagyeman I can confirm the Roboflow “upload data” window accepts the OpenMV IDE saved Frame Buffer video after processing with the ffmpeg.exe program included with OpenMV. However, Roboflow frame extraction fails after capturing just a few frames, even though the video plays fine in the Roboflow “upload data” window. Roboflow error message:

“Frame extraction failed: Timeout while seeking video frame”

FYI as you proceed with the next release, ffmpeg.exe did produce the following warnings:

Command entered:

C:\Program Files\OpenMV IDE\share\qtcreator\ffmpeg\windows\bin>ffmpeg.exe -i C:\Users\jmeck\OneDrive\Documents\OpenMV\Stairs_Video_Capture\Stairs_not_up-01.mp4 -c:v h264 -pix_fmt yuv420p -movflags +faststart C:\Users\jmeck\OneDrive\Documents\OpenMV\Stairs_Video_Capture\Stairs_not_up-01_ffmpeg.mp4
ffmpeg version n6.0-18-g27205c0b47-20230503 Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 12.2.0 (crosstool-NG 1.25.0.152_89671bf)

…

libswresample 4. 10.100 / 4. 10.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from ‘C:\Users\jmeck\OneDrive\Documents\OpenMV\Stairs_Video_Capture\Stairs_not_up-01.mp4’:
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2mp41
encoder : Lavf60.3.100
Duration: 00:01:33.01, start: 0.000000, bitrate: 1133 kb/s
Stream #0:00x1: Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p, 640x400 [SAR 1:1 DAR 8:5], 1132 kb/s, 30.27 fps, 30.27 tbr, 30267 tbn (default)
Metadata:
handler_name : VideoHandler
vendor_id : [0][0][0][0]
encoder : Lavc60.3.100 mpeg4
Stream mapping:
Stream #0:0 → #0:0 (mpeg4 (native) → h264 (libopenh264))
Press [q] to stop, [?] for help

[libopenh264 @ 000001b26e2d9980] [OpenH264] this = 0x000001b26e394e00, Warning:layerId(0) doesn’t support profile(578), change to UNSPECIFIC profile
[libopenh264 @ 000001b26e2d9980] [OpenH264] this = 0x000001b26e394e00, Warning:bEnableFrameSkip = 0,bitrate can’t be controlled for RC_QUALITY_MODE,RC_BITRATE_MODE and RC_TIMESTAMP_MODE without enabling skip frame.

Output #0, mp4, to ‘C:\Users\jmeck\OneDrive\Documents\OpenMV\Stairs_Video_Capture\Stairs_not_up-01_ffmpeg.mp4’:
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2mp41
encoder : Lavf60.3.100
Stream #0:0(und): Video: h264 (avc1 / 0x31637661), yuv420p(progressive), 640x400 [SAR 1:1 DAR 8:5], q=2-31, 30.27 fps, 30267 tbn (default)
Metadata:
handler_name : VideoHandler
vendor_id : [0][0][0][0]
encoder : Lavc60.3.100 libopenh264
Side data:
cpb: bitrate max/min/avg: 0/0/2000000 buffer size: 0 vbv_delay: N/A
[mp4 @ 000001b26c92e840] Starting second pass: moving the moov atom to the beginning of the file
frame= 2815 fps=2165 q=-0.0 Lsize= 5890kB time=00:01:32.97 bitrate= 519.0kbits/s speed=71.5x
video:5878kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.202377%

C:\Program Files\OpenMV IDE\share\qtcreator\ffmpeg\windows\bin>

Great catch, and thanks for pasting the full log — the answer was in it.

This is a second, separate bug, and it’s one my workaround command caused.
Sorry about that.

What’s happening. Both H.264 encoders ignore FFmpeg’s generic key frame
interval and substitute their own — and libopenh264 effectively emits no
periodic key frame at all. Your 2815-frame file came out with exactly one
key frame
, so all 93 seconds is a single GOP.

That plays fine, because playback just decodes straight through. But seeking
to frame N means decoding every frame before it. Roboflow’s extractor seeks to
each frame it wants, so each one costs more than the last — hence it dies
partway through with “Timeout while seeking video frame” rather than failing
immediately.

The irony is that the original MPEG-4 Part 2 files were seekable — that
encoder took FFmpeg’s default of a key frame every 12 frames. My fix made the
files playable and unseekable at the same time.

Updated workaround — add -g 30 and -profile:v high:

ffmpeg.exe -i input.mp4 -c:v h264 -profile:v high -g 30 ^
  -pix_fmt yuv420p -movflags +faststart output.mp4

On a file the size of yours that goes from 1 key frame to 93 (one per second).
It costs about 25% more disk. -profile:v high also silences that first
warning you saw: left alone the wrapper requests constrained baseline, which
OpenH264 refuses and warns about before falling back — naming high avoids the
round trip and codes ~6% smaller.

The second warning (bEnableFrameSkip = 0, bitrate can't be controlled...) is
harmless and you can ignore it. It’s telling you the encoder will not drop
frames to hit a bitrate target, which is what we want — every captured frame
survives.

Both fixes are now in for the next release, so the IDE will emit seekable
H.264 directly and none of this will be needed.

If frame extraction still stalls after re-converting with -g 30, let me know
the file length and I’ll dig further.

Thanks for letting me know about the bugs!

@kwagyeman Your “take 2” workaround fully works. The OpenMV IDE frame buffer saved video processes without error via your provided ffmpeg.exe command. The Roboflow “upload data” receives it fine and successfully parsed out individual frames.
Your prompt support & workaround resolution are much appreciated!
Best, Jim