Shift in lines when creating videos using VideoWriter
16 views (last 30 days)
Show older comments
I'm using VideoReader to read a mp4 video, insert a few shapes and annotations, then use VideoWriter to write a new video file. The script was working fine with matlab 2023a on an intel macbook pro. After I switch to matlab 2023b on a macbook with m3 chip, the script stop working. The video geneerated shows weird shift in lines below:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1641846/image.png)
I did notice if I change the file type for VideoWriter from 'MPEG-4' to 'Uncompressed AVI", it can work. But the file size is gigantic.
Can someone help please? Thank you so much!
0 Comments
Answers (2)
Walter Roberson
on 13 Mar 2024
This is a known problem in R2023b for the Apple Silicon
Possibly it only happens when you only write a single frame to the movie; I am not sure about that.
2 Comments
Joseph Slivka
on 10 May 2024
I was also experiencing the same problem in r2023b running on macbook pro apple silicon. I fixed it randomly by adding text to the figure, even if it is just a blank string.
text(0.99*ax.XLim(2),0.99*ax.YLim(1),'','HorizontalAlignment','right','VerticalAlignment','bottom','FontSize',40,'FontName','Arial')
I believe all the options are unnecessary but just citing exactly what I did. Maybe this will help provide a temporary solution.
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!