0

When I try to read a video with the VideoReader object it gives the following error

Error using VideoReader/init (line 429)
The file requires the following codec(s) to be installed on your system:
    video/x-h264

Has anyone seen this problem before?

By the way, I installed all the Gstream libraries and codes as well as the x-h264 codec.

horchler
  • 18,384
  • 4
  • 37
  • 73
erogol
  • 13,156
  • 33
  • 101
  • 155
  • This link might help: http://www.mathworks.com/matlabcentral/answers/48586-how-do-i-install-the-h264-codec-for-mp4-files-in-matlab-2012a-student-for-linux – Oleg Aug 11 '13 at 15:39
  • Also, as @wakjah points out, VideoReader uses QuickTime for the codecs on Mac. Have you tried this on Windows? (it uses DirectShow on Windows) Also, you could try updating QuickTime to see if that helps. – Zero Aug 11 '13 at 16:07
  • @OlegKomarov I have tried but not work – erogol Aug 11 '13 at 16:10
  • @JohnGalt I am working on remote machine and do not have any other computer as the remote one is linux machine – erogol Aug 11 '13 at 16:10

3 Answers3

3

Add this ppa:

sudo add-apt-repository ppa:mc3man/trusty-media

and then

sudo apt-get update
sudo apt-get install gstreamer0.10-ffmpeg

Had the same problem, doing this fixed it.

Le Gnav
  • 113
  • 1
  • 5
BrendanBenting
  • 571
  • 6
  • 8
0

If you can play the videos with VLC player, then the following worked for me:

As a workaround you can run MATLAB on the version of libstdc++ installed on your system:

  1. cd to (matlabroot)/sys/os/glnxa64/

  2. Rename libstdc++.so.6 to backuplibstdc++.so.6

  3. Rename libstdc++.so.6.0.10 to backuplibstdc++.so.6.0.10

  4. Restart MATLAB and execute the code again.

The steps are from this link: http://uk.mathworks.com/matlabcentral/answers/94531-why-do-i-receive-an-error-when-creating-a-videoreader-object-on-linux-in-matlab-r2010b-7-11

GrigorisG
  • 888
  • 8
  • 13
0

A simple solution is to install ffmpeg and then use this function:

function v=readVideo(path_file)

system(['rm /tmp/video_tmp.avi']);
system(['ffmpeg -i ' path_file ' -vcodec copy -acodec copy /tmp/video_tmp.avi']);

v = VideoReader('/tmp/video_tmp.avi')

end