Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem loading video on OS X #14

Closed
dahtah opened this issue Sep 22, 2015 · 2 comments
Closed

Problem loading video on OS X #14

dahtah opened this issue Sep 22, 2015 · 2 comments

Comments

@dahtah
Copy link
Contributor

dahtah commented Sep 22, 2015

This error was reported by a user of the imager package, but it's not to do with the R side of things and it has me stumped.
The original issue is here: dahtah/imager#3.
On an OS X system, a call to load() fails on a MPEG-1 video even though the user has installed ffmpeg, imagemagick and graphicsmagick. The video loads fine on all systems I've tried so far (it's here: https://github.com/dahtah/imager/blob/master/inst/extdata/tennis_sif.mpeg)

Here's the CImg error:
convert: delegate failed "ffmpeg" -nostdin -v -1 -i "%i" -vframes %S -vcodec pam -an -f rawvideo -y "%u.pam" 2> "%Z"' @ error/delegate.c/InvokeDelegate/1332. convert: unable to open image/var/tmp/magick-25902iqF0P0m51egQ.pam': No such file or directory @ error/blob.c/OpenBlob/2695.
convert: no images defined `pnm:-' @ error/convert.c/ConvertImageCommand/3230.
sh: mpeg2decode: command not found
gm convert: Unable to open file (/var/folders/70/d3g1lc394k163j9bw8h68f8c0000gn/T/gmtK8MYB*.ppm) [No such file or directory].
gm convert: Unable to open file (/var/folders/70/d3g1lc394k163j9bw8h68f8c0000gn/T/gmh4FOq5).
Error: [instance(0,0,0,0,0x0,non-shared)] CImg::load(): Failed to recognize format of file '/Users/kruny1001/Library/R/3.2/library/imager/extdata/tennis_sif.mpeg'.

@dtschump
Copy link
Collaborator

Works for me with the provided video file on Ubuntu Linux, using ffmpeg.
I cannot tell much about the issue. Maybe The OP should try to read his video with ffmpeg alone, to see if this works. And if it works, that could mean ffmpeg is not found by CImg (is it in the $PATH ?).
Does the bug happen with an older version of CImg maybe ?
There are many possibilities. The fact that it doesn't work with convert at the very end does not surprise me too much, but if ffmpeg is installed, I see no reasons why it couldn't handle the file.

Another solution would be to enable the OpenCV library when compiling CImg, as it can be used to read/write video files as well, in a more "native" way (without an external system call to ffmpeg). I've tried this solution too, to read the provided video, and it works well too.

@dahtah
Copy link
Contributor Author

dahtah commented Sep 23, 2015

Thanks David, I'm forwarding your comments to the OP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants