Image to Video Conversion Error
6 次查看(过去 30 天)
显示 更早的评论
I am trying to convert one image into a video or motion jpeg using this code.
A = imread('joshheadshot2.jpg');
v = VideoWriter('myFile','Motion JPEG AVI');
open(v)
writeVideo(v,A)
I do not get any errors in the command window; however, when I try to open 'myFile.avi' a dialog box pops up that says "Cannot import from an empty input file." Any suggestions on how I can get this to work?
0 个评论
回答(1 个)
Image Analyst
2019-4-12
I presume you are trying to open an avi file with VideoReader(), extract one frame from it, and write lots of the same frame to another output video that you're creating with VideoWriter(). Provide VideoReader() an input file that is not empty. It thinks your avi file is empty for some reason. How many bytes is it? If it's small, attach it to your post above.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!