Output parameters and video manipulation

221 views
Skip to first unread message

Angie Eads

unread,
Mar 24, 2020, 3:46:44 PM3/24/20
to OpenCASA Mailing List
Hi all,

Thank you so much to the creators for this great plugin! I am currently using it to assess fish sperm motility with some success.

I would just like to restate a request another poster made for the motility module about presenting the total number of cells (or a count of the non-motile cells) within a sample that is used to calculate the % motile. I have some debris in my videos unfortunately the same size as the sperm cells, and as such, the % motile output is likely much lower than it should be. If I knew the total count used to calculate the % motile, I could manually adjust the value accounting for incorrect non-motile cells. As it stands, I'm not confident I can use the values provided for these (dirty) samples and I can't accurately adjust them.


I just want to share my video converting and trimming code I am using in CMD with ffmpeg, as it took me a while to figure it out and might save others the time!

"C:\Program Files (x86)\WinFF\ffmpeg.exe" -y -i "D:\...1.mp4” -vcodec rawvideo -ss 00:00:05 -t 00:00:02 -pix_fmt gray -vf negate "C:\...1.avi"

The "-ss" and "-t" times translate as "starting at 5 sec into the video, trim to 2 sec in length". I am taking videos in positive phase contrast, so "-vf negate" inverts the color. Obviously, you need to adjust the input and output directories and file names.

I have also found better tracking success adjusting the contrast on my videos in ImageJ, so will also share the following Macro that I wrote to batch enhance .avi files at 120 fps (can adjust this as required):

input = "C:/Users/VIDEO INPUT FOLDER/";
output = "C:/Users/VIDEO OUTPUT FOLDER/";
list = getFileList(input);
setBatchMode(true);
for (i = 0; i < list.length; i++) {
run("AVI...", "open=["+input + list[i]+"] convert");
run("Enhance Contrast...", "saturated=1 normalize process_all");
run("AVI... ", "compression=None frame=119.9 save=[" + output + list[i] + "]");
close();
}


Happy tracking!
Angie
Reply all
Reply to author
Forward
0 new messages