VideoReader doesn't seem to read videofiles (Ubuntu)

1 次查看(过去 30 天)
I am having some trouble with VideoReader, using Ubuntu 14.04 and MATLAB 2015A. The amount of code I've written at this point is pretty straight forward:
vidObj = VideoReader('9/video.avi');
vidObj produces the following output:
vidObj =
VideoReader with properties:
General Properties:
Name: 'video.avi'
Path: '/home/xx/Dropbox/xx/9'
Duration: 8.1920
CurrentTime: 0
Tag: ''
UserData: []
Video Properties:
Width: 0
Height: 0
FrameRate: 0
BitsPerPixel: 0
VideoFormat: ''
I might add that the actual duration of the video is more like 2 seconds. Now, I've been looking into GStreamer and installed version 1.0 through a PPA and codecs packages (the latter through software center). It also seems to me that many people get an explicit error, when there are problems regarding this (looking at previously asked questions), which I am not getting. I have read, write and execute properties of the file in question.
  2 个评论
Dinesh Iyer
Dinesh Iyer 2015-7-20
Tobias,
First of VideoReader only supports Gstreamer version 0.10 and not version 1.0. My initial guess would be that the file has a video stream encoded in a format for which there are no codecs available on your system to read. Couple of things to try are?
1. Are you able to play this file using Totem Player which also uses Gstreamer?
2. Try to execute the following on the Linux console against Gstreamer 0.10
gst-launch-0.10 playbin2 uri=file:///home/xx/Dropbox/xx/9/video.avi video-sink=appsink audio-sink=fakesink text-sink=fakesink
and verify that it does not generate any errors.
Tobias
Tobias 2015-7-21
Thank you for getting back to me. To make a long story short, you're option number 2 pinpointed the problem for me, which was a missing mpeg4 codecs, specifically caused by me having GS1.0 and not 0.10.
I just got the following output from the same operations:
vidObj =
VideoReader with properties:
General Properties:
Name: 'video.avi'
Path: '/home/xx/Dropbox/xx/9'
Duration: 8.1920
CurrentTime: 0
Tag: ''
UserData: []
Video Properties:
Width: 1280
Height: 720
FrameRate: 240
BitsPerPixel: 24
VideoFormat: 'RGB24'
The duration is still off, but I'm going to "ignore" it for now and continue with my processing of the data, as the span of my original question would seem fully answered.

请先登录,再进行评论。

采纳的回答

Dinesh Iyer
Dinesh Iyer 2015-7-21
Tobias, I am glad that installing the missing MPEG4 codecs resolved this issue.
Dinesh
  1 个评论
Tobias
Tobias 2015-7-21
Refer to Dinesh's comment on my original question for the solution, if anybody happens to stumble upon this. Thanks again, Dinesh.

请先登录,再进行评论。

更多回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by