Reducing the size of video files using ffmpeg

27 views
Skip to first unread message

Erick José Ramo Da Silva

unread,
Oct 30, 2024, 3:03:12 PM10/30/24
to OpenCASA Mailing List
Dear colleagues,

Erick Silva from São Paulo State University (Brazil) here.
A while ago, someone posted a way to reduce the *.avi file size using ffmpeg while keeping compatibility with OpenCASA.
I managed to reduce the file size to about 2/3 (~58 MB to 38 MB) using:

ffmpeg -i input.avi -vcodec rawvideo -pix_fmt gray output.avi


However, I have old files here that are only 2 MB. I am afraid I cannot find the command line to do that.
Does anyone have it?

Thanks a lot!
Kind regards,
Erick

Erick J. R. Silva, Ph.D.
Assistant Professor
Department of Biophysics and Pharmacology
Institute of Biosciences of Botucatu
Universidade Estadual Paulista "Júlio de Mesquita Filho" (UNESP)
Rua Prof. Dr. Antonio Celso W. Zanin, S/N
Botucatu-SP, Brasil, 18618-689 
Researcher ID: D-2976-2009
Scopus ID: 36176142500

Felipe Martínez-Pastor

unread,
Oct 30, 2024, 5:25:51 PM10/30/24
to OpenCASA Mailing List
Hi Erick,
I understand that you had color videos and you could make them smaller by removing the color information. Maybe you can make them smaller by using png compression or MJPEG compression (e.g., (e.g.  ffmpeg -i input.avi -codec: mjpeg output.avi; careful, it is lossy and I don't recommend it if you need to replicate your analyses in the future).
Could you develop your question about the 2 MB videos? Maybe they are already in greyscale. Unfortunately, the AVI reader for ImageJ only reads uncompressed video or MJPEG compressed. Fiji has an FFMPEG extension (add the ffmpeg source in the Update section), enabling to manage more formats, but it is not integrated in OpenCASA.
I take the opportunity to remind that OpenCASA is FOSS and anyone can contribute!
Regards,
Felipe
Reply all
Reply to author
Forward
0 new messages