Passing arguments to system()
9 次查看(过去 30 天)
显示 更早的评论
I'm using system() to run ffmpeg, my problem is that I can't get to pass the arguments from outside this function. This is the code:
function videoFunction(videoFile)
vid = VideoReader(videoFile);
system('ffmpeg -i vid -vn audio.mp3');
disp('Audio extraído')
end
If I put the path to the video in -i video.avi instead of -i vid it would work but I need to pass it like I mentioned. Any ideas?
0 个评论
回答(1 个)
Image Analyst
2015-3-7
If your video file name is in variable videoFile, how about
strCommandLine = sprintf('ffmpeg -i %s -vn audio.mp3', videoFile);
system(strCommandLine);
2 个评论
另请参阅
类别
在 Help Center 和 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!