Use ffmpeg in Matlab
이전 댓글 표시
Hi, all I'm trying to use the software 'ffmpeg' in Matlab. I'm using Mac system with Matlab 2012a. I had installed the ffmpeg software and could run it in the Mac terminal. However, when I tried to use it in Matlab with the command "system('ffmpeg xxxxxx')" and "unix('ffmpeg xxxx')", Matlab gave the error message that "/bin/bash: ffmpeg: command not found". My ffmpeg is in directory "/opt/local/bin", which is not included in Matlab's $PATH variable when I typed "system('echo $PATH')" in Matlab. I tried to use "system('export PATH=$PATH:/opt/local/bin')" in Matlab, but "system('echo $PATH')" still showed that the directory "/opt/local/bin" was not included. http://www.mathworks.com/matlabcentral/newsreader/view_thread/255609 This link mentioned about modifying the "$MATLAB/bin/matlab" file to add $PATH. However, even though I used "sudo chmod +wrx " to clear the readonly attribute of this file, I could not modify it because it still said the file was readonly. Does anyone have any idea about how to use ffmpeg in Matlab? Thanks a lot in advance.
Regards Yongqian
답변 (1개)
Yongqian Yang
2014년 9월 24일
2 개 추천
댓글 수: 3
Erdem Yilmaz
2016년 4월 16일
편집: Erdem Yilmaz
2016년 4월 16일
I had the same issue on OS-X El Capitan Version 10.11.4 Here's how I solved it:
1 ) Go to terminal, type
printenv PATH
2 ) Copy the output of the command
3 ) Go to Matlab. Type setenv('PATH', [getenv('PATH') '??????']); instead of ?????? paste what you got from terminal
This solved my problem
Peter Krumholz
2023년 12월 12일
Solved mine too!
Eric
2024년 5월 8일
Erdem's solution fixed mine too! Matlab r2024a, Apple Silicon M2 chip, ffmpeg version 7.0
카테고리
도움말 센터 및 File Exchange에서 Audio and Video Data에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!