how to add text to an mp4 using videoReader?
2 views (last 30 days)
Show older comments
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 Comments
Answers (0)
See Also
Categories
Find more on Convert Image Type in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!