Effacer les filtres
Effacer les filtres

appending frames to an existing .avi file

4 vues (au cours des 30 derniers jours)
Giovanni de amici
Giovanni de amici le 9 Fév 2018
Commenté : Carl Witthoft le 14 Juin 2018
am trying to figure out a way to append frames to .avi files.
In a simplistic way I want to:
open and set up multiple movie files, close it and then reopen and add more video frames to it.
for i=1:n1
open the moviefile(i) using:
myVideo(i) = VideoWriter (name, option)
open(myVideo(i))
write a title screen to moviefile(i) using:
writeVideo (myVideo(i), plotID)
close moviefile(i) using:
close (myVideo(i))
end
then:
for j = 1:n2
read n1 datastreams from file(j)
process data from file(j) into n1 different plots
for i=1:n1
open myVideo(i)
append plot(i) to myVideo(i)
close myVideo(i)
end
end
It sounds simple, but the second loop on "i" does not work. I can open myVideo(i), but when I write to it, the previous contents are overwritten. I cannot see an option "append" to writeVideo, so I presume there must be some other workaround and/or a different way (other than VideoWriter) to start the whole process. Any help/suggestion will be appreciated.
disclaimer: I have seen the existing answers to a similar question, and neither fit my case because: option 1): I cannot keep all the .avi files continuously open (run out of memory) option 2): only applies to windows machines (I am working on a OSX platform)
  1 commentaire
Carl Witthoft
Carl Witthoft le 14 Juin 2018
According to other threads, WriteVideo will not append. There's a thing on FEX called "mmwrite," Windows only, requires DirectX9, that might work. MathWorks is being overly cautious again (since appending mismatched image frame types would be really bad).

Connectez-vous pour commenter.

Réponses (0)

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by