Azzera filtri
Azzera filtri

how to add text to an mp4 using videoReader?

1 visualizzazione (ultimi 30 giorni)
james Brown
james Brown il 8 Ago 2018
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?

Risposte (0)

Prodotti

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by