필터 지우기
필터 지우기

how to add text to an mp4 using videoReader?

조회 수: 1 (최근 30일)
james Brown
james Brown 2018년 8월 8일
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개)

카테고리

Help CenterFile Exchange에서 Language Support에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by