How to store a string in video description or somewhere so that i can retrieve it?
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
ASHWIN JOSHY
el 4 de Mayo de 2022
Comentada: Walter Roberson
el 25 de Nov. de 2024 a las 9:35
I am trying to store a string while writing images to video using below code
data='This necessary string i need after converting to video'
outputVideo = VideoWriter('TestVideo.avi','Uncompressed AVI');%image format and compression
outputVideo.FrameRate = app.videoFrameRate;%Setting the frame rate
open(outputVideo)
TestImageFolder='FinalImages';
TestImagePath=dir([TestImageFolder '/*.tiff']);
numberOfTestImages=size(TestImagePath,1);
%Looping through all images and adding to video
for i = 1:numberOfTestImages
img = imread(['FinalImages\finalImage' num2str(i) '.tiff']);
writeVideo(outputVideo,uint8(img))
end
close(outputVideo)
I really want to store the data in the video or in the description or somewhere so that i can read it again, does anyone know a method for this?
1 comentario
Walter Roberson
el 25 de Nov. de 2024 a las 9:35
https://superuser.com/questions/1519310/how-do-you-edit-the-metadata-of-an-avi-file mentions three different tools that allow changing metadata
Respuestas (1)
Udit06
el 25 de Nov. de 2024 a las 9:10
Hi Ashwin,
You can create a MATLAB object to store your video and description. You can achieve this by defining a simple class as shown below:
classdef VideoWithDescription
properties
video
description
end
methods
function obj = VideoWithDescription(video, description)
obj.video = video;
obj.description = description;
end
end
end
The solution is specific to MATLAB and won't be directly applicable if you need to process or share this data outside of MATLAB.
If you want to share the data outside of MATLAB, you can store your string in a separate text file with the same base name as your video file. For example, TestVideo.avi can store the video and TestVideo.txt can store the video description. This is a simple option if you don't managing separate files.
I hope this helps.
0 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!