Shrediquette / PIVlab

Particle Image Velocimetry for Matlab, official repository
https://shrediquette.github.io/PIVlab/
MIT License
140 stars 34 forks source link

I keep having error when I export avi videos. Whatever the field exported. #100

Closed mxardre closed 12 months ago

mxardre commented 1 year ago

Error using VideoWriter/writeVideo Frame must be 1868 by 1869

Error in PIVlab_GUI>saveavi_Callback (line 9105) writeVideo(aviobj,F);

Error while evaluating UIControl Callback.

Error using VideoWriter/writeVideo Frame must be 1868 by 1869

Error in PIVlab_GUI>saveavi_Callback (line 9105) writeVideo(aviobj,F);

Error while evaluating UIControl Callback.

Error using VideoWriter/writeVideo Frame must be 1868 by 1869

Error in PIVlab_GUI>saveavi_Callback (line 9105) writeVideo(aviobj,F);

Error while evaluating UIControl Callback.

Shrediquette commented 1 year ago

Although I have not idea what versions of PIVlab and Matlab you are using, you could be a candidate to beta test the new PIVlab 3.0 (not released yet) which has a completely reworked image / video export: https://drive.google.com/file/d/12VyVKYUL3M-f26bRlJJiTVpngYA7cYSB/view?usp=drive_link

mxardre commented 1 year ago

I am absolutly in to try the 3.0! My current version is Matlab 2023 update2, PIVlab 2.63.0.0

Shrediquette commented 1 year ago

Great, then please tell me if this works for you. If not, then please try to give a copy of the error message, together with a description of what you did. Thanks!

mxardre commented 1 year ago

Forgot to mention I am running all of this on macOs 12.6.2.

Exporting image sequence in PNG or JPG crash matlab (freezing and become not responsive in the monitoring app window) Exporting to mpeg crash and yield the following error:

Warning: The video's width and height has been padded to be a multiple of two as required by the H.264 codec. Error using VideoWriter/writeVideo Frame must be 646 by 524

Error in PIVlab_GUI>do_export_pixel_data_Callback (line 9272) writeVideo(v,export_image);

Error while evaluating UIControl Callback.

mxardre commented 1 year ago

I also have a question (and I know it is not the place to put it) but I have 100 of image sequences to run through PIVlab. Using the GUI is perfect to find the PIV parameters, subsequent filtering, field calculation and exporting. But is there a way to run PIVlab with those parameters without PIVlab? Like in a script peaking up each of my image sequences. I read the PIVlab_commandline.m but it does something way cruder than the GUI.

Shrediquette commented 1 year ago

I also have a question (and I know it is not the place to put it) but I have 100 of image sequences to run through PIVlab. Using the GUI is perfect to find the PIV parameters, subsequent filtering, field calculation and exporting. But is there a way to run PIVlab with those parameters without PIVlab? Like in a script peaking up each of my image sequences. I read the PIVlab_commandline.m but it does something way cruder than the GUI.

Maybe you are looking for this? https://pivlab.blogspot.com/2022/07/new-in-v257-pivlab-batch-sessions.html

Shrediquette commented 1 year ago

Forgot to mention I am running all of this on macOs 12.6.2.

Exporting image sequence in PNG or JPG crash matlab (freezing and become not responsive in the monitoring app window) Exporting to mpeg crash and yield the following error:

Warning: The video's width and height has been padded to be a multiple of two as required by the H.264 codec. Error using VideoWriter/writeVideo Frame must be 646 by 524

Error in PIVlab_GUI>do_export_pixel_data_Callback (line 9272) writeVideo(v,export_image);

Error while evaluating UIControl Callback.

Can you please send me your raw data? I guess some vectors are clipping, but I can't reproduce this without suitable data...

mxardre commented 1 year ago

sur here it is with the settings: https://dl.espci.fr/ticket/071078aa8fd44d40bbbd73a715afcb8b

Shrediquette commented 1 year ago

Can you try this please, for me it fixes the problem: https://drive.google.com/file/d/12VyVKYUL3M-f26bRlJJiTVpngYA7cYSB/view?usp=drive_link

mxardre commented 1 year ago

Great thanks! Exporting png sequence works for the vector field now. But exporting the magnitude is still crashing matlab.

Capture d’écran 2023-12-01 à 19 46 40

I have the window (see capture attached) that open and then freezing.

Besides the magnitude field superimpose on the analysed image that makes it less clear to see. Is that a feature? Capture d’écran 2023-12-01 à 19 39 47

Shrediquette commented 1 year ago

Exporting png sequence works for the vector field now.

But I thought the problem is avi files and mp4?

But exporting the magnitude is still crashing matlab.

Crashing Matlab? Or just throwing an error message in the matlab command window? Which error message?

Besides the magnitude field superimpose on the analysed image that makes it less clear to see. Is that a feature?

Yes, for regular PIV images, this looks quite good. You can change the transparency value plot-> modify plot appearance.

And by the way, I think your data might process much better if you would skip these pre-processing steps in imagej. Have you tried this?

mxardre commented 1 year ago

Thanks!

Exporting png sequence works for the vector field now.

But I thought the problem is avi files and mp4?

But exporting the magnitude is still crashing matlab.

Crashing Matlab? Or just throwing an error message in the matlab command window? Which error message?

Crashing-freezing for image sequence. The second capture (showed above) appear and then the monitor of activity indicates that matlab is not responsive. I have to kill it

And it throw this error for AVI.

  Error using VideoWriter/writeVideo
  Frame must be 1480 by 1421

  Error in PIVlab_GUI>do_export_pixel_data_Callback (line 9338)
                  writeVideo(v,export_image);

  Error while evaluating UIControl Callback.

Besides the magnitude field superimpose on the analysed image that makes it less clear to see. Is that a feature?

Yes, for regular PIV images, this looks quite good. You can change the transparency value plot-> modify plot appearance.

Cool! And by the way, I think your data might process much better if you would skip these pre-processing steps in imagej. Have you tried this?

Actually what I do on fiji is substracting the mean intensity. Because I cannot load this step in PIVlab from the lab session. So that avoid me this extrat step.

Shrediquette commented 12 months ago

Further discussion here please:

103

Shrediquette commented 12 months ago

The error when exporting video should be fixed. I also tried to find a fix for the issue of cmatlab crashing when exporting magnitude on macOS. Please try again. Your preprocessing in fiji looks a bit strange to me (although I dont know how the original data looks like). But the images you are using in PIVlab are binary, and this cant be a good solution IMHO.