VideoWriter generating unexpected results
32 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I believe the VideoWriter in R2023b has a bug. It can be reproduced with this piece of code:
v = VideoWriter('test.mp4', 'MPEG-4'); % use h264 encoding
v.FrameRate = 30;
v.Quality = 100;
open(v)
vidFrame = ones([1920, 1080, 3]);
writeVideo(v, vidFrame);
close(v)
There are black lines appearing in the output video:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1565394/image.png)
I am on MacOS Sonoma 14.1.2 (M2 Ultra).
9 commentaires
Raphaël Nussbaumer
le 7 Nov 2024
hFig = figure('position',[0 0 800 800])
Alexander
le 6 Déc 2024
Modifié(e) : Alexander
le 6 Déc 2024
I'm also getting this bug on Apple Silicon version. I've seen people talk about setting the figure size as a multiple of 8 to fix the problem, but both my width and heights are multiples of 8. In fact, the original poster here used 1920x1080, which are also multiples of 8. Can you expand on what you mean by multiple of 8?
By trial and error:
Height dimension doesn't seem to matter
Width is crucial. Get distortion is use some numbers e.g. 456, 458, 460, 462, however 464 works. Also 2x456 = 920 works fine.
Réponses (0)
Voir également
Catégories
En savoir plus sur Audio and Video Data dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!