3
$\begingroup$

I am having trouble importing the 8MB mp4 file available at this link. It was recorded on my Digital Camera and is 1920x1080 30fps.

I've tried vid = Import["C:\\Users\\Patrick\\MyRocketVideo.mp4", "AVI"], but all it returns is $Failed!

I'm using "11.0.1 for Microsoft Windows (64-bit) (September 20, 2016)"

Can anyone confirm this? Or find a way around this.

$\endgroup$
  • $\begingroup$ Its working fine on 11.0 $\endgroup$ – zhk Mar 9 '17 at 4:39
  • $\begingroup$ It works on OS X too, with M 11.0.1. But I am surprised that it works. AVI and MP4 are two different container formats. This is not an AVI file. Why should it work when you try to import it as such? One guess is that Mathematica simply asks the operating system to interpret the file, and Mathematica itself doesn't really care about either the container format or the codec used. This would explain why I can import it as "AVI", even though it isn't one. It could be that your computer doesn't have the necessary codecs to deal with MP4 (at least not within the framework that Mathematica... $\endgroup$ – Szabolcs Mar 9 '17 at 9:38
  • $\begingroup$ ... tries to use to interpret the file). This would explain why it works for @MapleSE but not for you (assuming he also uses Windows). I don't use Windows anymore so I don't know what is the current best way to install codecs. You may want to try a codec pack like cccp-project.net but be aware that some of these can also break stuff (not only fix stuff). I used to use this one years ago. $\endgroup$ – Szabolcs Mar 9 '17 at 9:39
  • $\begingroup$ Otherwise, you can use ffmpeg or ImageMagick to convert the video to a sequence of images, then import the images one by one. You will need to install these tools and read up on how to use them from the command line. I can never remember the correct syntax, so I cannot tell you right now. But it shouldn't take long to look it up. $\endgroup$ – Szabolcs Mar 9 '17 at 9:41
  • $\begingroup$ I am using 11.0 on Windows 10. $\endgroup$ – zhk Mar 9 '17 at 13:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.