How do I read an MP4 file? VideoReader gives the following error "Failed to initialize internal resources."

Error using VideoReader/init (line 619) Failed to initialize internal resources.
Using Windows 10, MATLAB R2016A, recorded the .mp4 stream out of a Cornet encoder (H.264) using VLC, which is a format MATLAB help says it can read. Any advice is helpful. thanks

1 comentario

I have Matlab R2018b on Debian Stretch Linux and get the same error when trying to read files of avi format. (avi is supported) - gstreamer installed and in the latest version. How do I add support to read .MOV and .mp4 files?

Iniciar sesión para comentar.

Respuestas (2)

Problem solved:
sudo add-apt-repository ppa:mc3man/gstffmpeg-keep
sudo apt-get update
sudo apt-get install gstreamer0.10-ffmpeg
sudo apt-get install gstreamer0.10-tools
sudo apt-get install gstreamer0.10-plugins-good

5 comentarios

This worked for me Thanks! (my system: Ubuntu 14.04LTS and Matlab 2016b).
this worked for me on Ubuntu 16.04 thanks
Those are commands that would be executed at a Linux console terminal; they are not MATLAB commands.
Is there a windows equivalent of this?

Iniciar sesión para comentar.

I understand that the error "Failed to Initialize internal resources" pops up when trying to use the 'VideoReader' function in Windows 10, MATLAB R2016A.
There could be various reasons behind this error which are listed as follows:
  1. The required codec is missing for the particular video file. Determine whether the codec is installed on the computer.
  2. The video file contains an audio stream (eg. AC-3) not supported by the API (QTKit, in AC-3 case) used by VideoReader. The only workaround is to re-encode the audio stream in the file into a different format such as MPEG-4/AAC and then try to read the file.
  3. Sometimes, VideoReader cannot open a video file for reading on Windows platforms. This might occur if you have installed a third-party codec that overrides your system settings. Uninstall the codec and try opening the video file in MATLAB again.
The supported container formats and codecs link explains supported codecs in detail. Go through the troubleshooting section to determine if that could be a possibility in this particular case.
Hope this helps!

3 comentarios

I downloaded a new codec package, and now I do not get the error and can open the file, thank you.
However now there's another problem. I'm recording the video with VLC, H.264 compression, video only, transport stream, D1 resolution, 30 FPS, 3100 encode rate, constant bit rate mode, 30 I/P ratio, frame field coding type, interlace scanning mode.
I open the file, and videoreader only sees one frame of all zeros. The video object read is v =
VideoReader with properties:
General Properties:
Name: '20161114_141100.m4v'
Path: 'C:\Users\tdepaolo\Documents\MATLAB\THV3000'
Duration: 275.0755
CurrentTime: 0
Tag: ''
UserData: []
Video Properties:
Width: 720
Height: 480
FrameRate: 30.0000
BitsPerPixel: 24
VideoFormat: 'RGB24'
mmfileinfo gives me this:
Filename: '20161114_141100.m4v'
Path: 'C:\Users\tdepaolo\Documents\MATLAB\THV3000'
Duration: 275.0755
Audio: [1x1 struct]
Video: [1x1 struct]
with info.Video as
Format: 'MPEG2'
Height: 4
Width: 0
so MATLAB seems to think it's MPEG2, when I'm recording MPEG4.
once again, thanks for any advice.
how does one find the missing codec for the particular video file?

Iniciar sesión para comentar.

Preguntada:

el 2 de Nov. de 2016

Comentada:

el 19 de Nov. de 2024

Community Treasure Hunt

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

Start Hunting!

Translated by