Image to Video Conversion Error
3 views (last 30 days)
Show older comments
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 Comments
Answers (1)
Image Analyst
on 12 Apr 2019
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.
2 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!