VideoReader doesn't seem to read videofiles (Ubuntu)

1 回表示 (過去 30 日間)
Tobias
Tobias 2015 年 7 月 20 日
コメント済み: Tobias 2015 年 7 月 21 日
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 件)

カテゴリ

Help Center および File ExchangeAudio and Video Data についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by