how to add text to an mp4 using videoReader?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I'll start by saying I don't have insertText so have been using text(). The code I have so far is:
v = VideoReader('1.mp4');
vidWidth = v.Width;
vidHeight = v.Height;
mov = struct('cdata',zeros(vidHeight,vidWidth,3,'uint8'),'colormap',[]);
k = 1;
while hasFrame(v)
mov(k).cdata = readFrame(v);
k = k+1;
end
hf = figure;
set(hf,'position',[150 150 vidWidth vidHeight]);
text(0.5,0.5,'LLLLLLL');
hold on
movie(hf,mov,1,v.FrameRate);
hold off
it seems the text is getting written behind the video and not being added directly to the video. have tried bringing the text to the front in case that was the problem to no avail. does anyone have any ideas?
0 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Convert Image Type finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!