Clear Filters
Clear Filters

VideoReader Motion JPEG 2000 format does not work

25 views (last 30 days)
Evan
Evan on 17 Jul 2024 at 14:49
Edited: Walter Roberson on 19 Jul 2024 at 6:21
R2024a VideoReader does not import .mj2 files correctly. When inspecting the frames they are blank. R2023b has no issues importing .mj2 files. Here's the coded tested between both matlab verisons. Any suggestions for getting VideoReader working in 2024a?
% Get selected file
savelocation = "frames.mj2";
% Load frames
v = VideoReader(savelocation);
frames = read(v);
imagesc(frames(:,:,:,400))
  1 Comment
Umar
Umar on 18 Jul 2024 at 3:14
Edited: Walter Roberson on 19 Jul 2024 at 6:21
Hi Evan,
One possible solution to this problem could be to try using a different approach to reading .mj2 files in MATLAB R2024a. You can consider using the mmfileinfo function to gather information about the multimedia file, followed by using the mmread function to read the frames from the .mj2 file. Here is an example of how you can modify your code to potentially resolve this issue:
% Get selected file
savelocation = "frames.mj2";
% Get information about the multimedia file
info = mmfileinfo(savelocation);
% Read frames from the multimedia file
frames = mmread(savelocation);
imagesc(frames.frames(400).cdata);
By utilizing these functions, you may be able to successfully read and display frames from .mj2 files in MATLAB R2024a. For more information on these functions, please refer to
Good luck!

Sign in to comment.

Answers (1)

Deep
Deep on 19 Jul 2024 at 5:19
Hi Evan,
I understand that when you are importing an MJ2 file using ‘VideoReader’, it works fine in MATLAB R2023b but gives blank frames in MATLAB R2024a.
This is a known bug in MATLAB R2024a, here is the link to the bug report:
Unfortunately, there are no workarounds as per the bug report.
I hope my answer was helpful!

Products


Release

R2024a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!