Why Does VideoReader return an Empty Object With No Error?
Show older comments
Hello all.
I'm experiencing issues processing video files using VideoReader in matlab R2015a. The code works on my Ubuntu 16.04 machine, and my Windows 10 machine, so I believe the issue has something to do with the decoders installed in CentOS 6.8.
When I attempt to initialize a VideoReader object using a video file (.mp4, .avi, or .mov), I get this result:
>> v=VideoReader('1.avi')
v =
VideoReader with properties:
General Properties:
Name: '1.avi'
Path: '/opt/home/fp/fp06/fp0634/videos'
Duration: 0
CurrentTime: 0
Tag: ''
UserData: []
Video Properties:
Width: 0
Height: 0
FrameRate: 0
BitsPerPixel: 0
VideoFormat: ''
However, if I attempt to analyze the .avi videos using aviinfo, I'm able to extract the metadata:
>> i=aviinfo('1.avi') Warning: AVIINFO will be removed in a future release. Use VIDEOREADER instead. > In aviinfo (line 66)
i =
Filename: '/opt/home/fp/fp06/fp0634/videos/1.avi'
FileSize: 36294688
FileModDate: '02-Aug-2016 18:12:45'
NumFrames: 7095
FramesPerSecond: 30
Width: 1280
Height: 720
ImageType: 'truecolor'
VideoCompression: 'FMP4'
Quality: 4.2950e+07
NumColormapEntries: 0
AudioFormat: 'Format # 0x55'
AudioRate: 44100
NumAudioChannels: 2
The video files I am trying to work with are encoded using MPEG-4, and are of multiple types (specifically .mp4, .avi, and .mov). Matlab seems to recognize that they are video files, since I can use aviinfo on the .avi files, but VideoReader can not extract frames or metadata from them.
In order to solve this issue, I have consulted these articles on how to set up multimedia on CentOS: https://wiki.centos.org/TipsAndTricks/MultimediaOnCentOS7 https://wiki.centos.org/TipsAndTricks/MultimediaOnCentOS
I also looked at many webpages pertaining to similar issues, and they recommended checking that gstreamer0.10 and necessary plugins are installed. I double checked that gstreamer0.10 was installed on my system, and installed the gstreamer-ffmpeg plugin, but I still encounter the same issue.
Running 'yum search gstreamer' gives me these results:
PackageKit-gstreamer-plugin.x86_64 : Install GStreamer codecs using PackageKit
bluez-gstreamer.i686 : GStreamer support for SBC audio format
bluez-gstreamer.x86_64 : GStreamer support for SBC audio format
gstreamer.i686 : GStreamer streaming media framework runtime
gstreamer.x86_64 : GStreamer streaming media framework runtime
gstreamer-devel.i686 : Libraries/include files for GStreamer streaming media framework
gstreamer-devel.x86_64 : Libraries/include files for GStreamer streaming media framework
gstreamer-devel-docs.noarch : Developer documentation for GStreamer streaming media framework
gstreamer-ffmpeg.i686 : GStreamer FFmpeg-based plug-ins
gstreamer-ffmpeg.x86_64 : GStreamer FFmpeg-based plug-ins
gstreamer-ffmpeg-debuginfo.x86_64 : Debug information for package gstreamer-ffmpeg
gstreamer-java.x86_64 : Java interface to the gstreamer framework
gstreamer-java-javadoc.x86_64 : Javadocs for gstreamer-java
gstreamer-java-swt.x86_64 : SWT support for gstreamer-java
gstreamer-plugins-bad.i686 : GStreamer streaming media framework "bad" plug-ins
gstreamer-plugins-bad.x86_64 : GStreamer streaming media framework "bad" plug-ins
gstreamer-plugins-bad-debuginfo.x86_64 : Debug information for package gstreamer-plugins-bad
gstreamer-plugins-bad-free.i686 : GStreamer streaming media framework "bad" plug-ins
gstreamer-plugins-bad-free.x86_64 : GStreamer streaming media framework "bad" plug-ins
gstreamer-plugins-bad-free-devel.i686 : Development files for the GStreamer media framework "bad" plug-ins
gstreamer-plugins-bad-free-devel.x86_64 : Development files for the GStreamer media framework "bad" plug-ins
gstreamer-plugins-bad-free-devel-docs.x86_64 : Development documentation for the GStreamer "bad" plug-ins
gstreamer-plugins-bad-free-extras.i686 : Extra GStreamer "bad" plugins (less often used "bad" plugins)
gstreamer-plugins-bad-free-extras.x86_64 : Extra GStreamer "bad" plugins (less often used "bad" plugins)
gstreamer-plugins-bad-freeworld-devel.i686 : Development files for the GStreamer "bad" plug-ins
gstreamer-plugins-bad-freeworld-devel.x86_64 : Development files for the GStreamer "bad" plug-ins
gstreamer-plugins-bad-nonfree.x86_64 : Non Free GStreamer streaming media framework "bad" plug-ins
gstreamer-plugins-bad-nonfree-debuginfo.x86_64 : Debug information for package gstreamer-plugins-bad-nonfree
gstreamer-plugins-base.i686 : GStreamer streaming media framework base plug-ins
gstreamer-plugins-base.x86_64 : GStreamer streaming media framework base plug-ins
gstreamer-plugins-base-devel.i686 : GStreamer Base Plugins Development files
gstreamer-plugins-base-devel.x86_64 : GStreamer Base Plugins Development files
gstreamer-plugins-base-devel-docs.noarch : Developer documentation for GStreamer Base plugins library
gstreamer-plugins-good.i686 : GStreamer plug-ins with good code and licensing
gstreamer-plugins-good.x86_64 : GStreamer plug-ins with good code and licensing
gstreamer-plugins-good-devel.i686 : Dummy package to make gstreamer-plugins-good multilib
gstreamer-plugins-good-devel.x86_64 : Dummy package to make gstreamer-plugins-good multilib
gstreamer-plugins-ugly.i686 : GStreamer streaming media framework "ugly" plug-ins
gstreamer-plugins-ugly.x86_64 : GStreamer streaming media framework "ugly" plug-ins
gstreamer-plugins-ugly-debuginfo.x86_64 : Debug information for package gstreamer-plugins-ugly
gstreamer-plugins-ugly-devel-docs.noarch : Development documentation for the GStreamer "ugly" plug-ins
gstreamer-python.x86_64 : Python bindings for GStreamer
gstreamer-python-devel.x86_64 : Headers for developing programs that will use gstreamer-python
gstreamer-tools.x86_64 : common tools and files for GStreamer streaming media framework
gstreamer1-libav.x86_64 : GStreamer 1.0 libav-based plug-ins
gstreamer1-libav-debuginfo.x86_64 : Debug information for package gstreamer1-libav
gstreamer1-plugins-bad-freeworld.x86_64 : GStreamer 1.0 streaming media framework "bad" plug-ins
gstreamer1-plugins-bad-freeworld-debuginfo.x86_64 : Debug information for package gstreamer1-plugins-bad-freeworld
gstreamer1-plugins-ugly.x86_64 : GStreamer 1.0 streaming media framework "ugly" plug-ins
gstreamer1-plugins-ugly-debuginfo.x86_64 : Debug information for package gstreamer1-plugins-ugly
gstreamer1-plugins-ugly-devel-docs.noarch : Development documentation for the GStreamer "ugly" plug-ins
gstreamer1-vaapi.x86_64 : GStreamer plugins to use VA API video acceleration
gstreamer1-vaapi-debuginfo.x86_64 : Debug information for package gstreamer1-vaapi
gstreamer1-vaapi-devel.x86_64 : Development files for gstreamer1-vaapi
phonon-backend-gstreamer.i686 : Gstreamer phonon backend
phonon-backend-gstreamer.x86_64 : Gstreamer phonon backend
qt-gstreamer.x86_64 : C++ bindings for GStreamer with a Qt-style API
qt-gstreamer-debuginfo.x86_64 : Debug information for package qt-gstreamer
qt-gstreamer-devel.x86_64 : Header files and development documentation for qt-gstreamer
I am unsure whether the issue is with matlab or CentOS (or both). Any advice regarding this issue is highly appreciated. Thank you for your time.
2 Comments
Walter Roberson
on 11 Aug 2016
Does the metadata show up after you read one frame? Except for the duration, which might not be known until you have read all of the frames.
Kalie H
on 12 Aug 2016
Answers (0)
Categories
Find more on Video Formats and Interfaces in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!