VideoWriter Profiles Missing ("The specified profile is not valid.")

Hello, I'm trying to run some code on a new computer, and my video writer software is not working. I would like to create a VideoWriter object with the 'Grayscale AVI' profile, but "The specified profile is not valid." When I run VideoWriter.getProfiles(), I only have 'Motion Jpeg AVI' and 'Uncompressed AVI'. Where do I get the other standard profiles?

Answers (2)

This is an old question but I just came across the same problem. most of this info is taken from the videowriter() help file.
'Profile' in this case means video encoding format e.g. '.avi' etc. check to see if you have it in two places. if your file name has the extension in it then you may not need the extra extension -> this is valid and works (2017a)
v = VideoWriter('newfile.avi');
Taking the available help file profile info you can choose from the following:
'Archival' Motion JPEG 2000 file with lossless compression
'Motion JPEG AVI' AVI file using Motion JPEG encoding
'Motion JPEG 2000' Motion JPEG 2000 file
'MPEG-4' MPEG-4 file with H.264 encoding (systems with Windows 7 or later, or Mac OS X 10.7 and later)
'Uncompressed AVI' Uncompressed AVI file with RGB24 video
'Indexed AVI' Uncompressed AVI file with indexed video
'Grayscale AVI' Uncompressed AVI file with grayscale video profile sets default values for video properties such as VideoCompressionMethod.
Have the same problems. I need 'MPEG-4', while my profiles only have:
Archival Video file compression with JPEG 2000 codec with lossless mode enabled.
Grayscale AVI An AVI file with Grayscale Video Data
Indexed AVI An AVI file with Indexed Video Data
Motion JPEG 2000 Video file compression with JPEG 2000 codec.
Motion JPEG AVI An AVI file with Motion JPEG compression
Uncompressed AVI An AVI file with uncompressed RGB24 video data

3 Comments

Hello,
Did you ever find a solution to this? I am having a similar issue trying to run VideoWriter() on a linux cluster. I need 'MPEG-4' as well but am getting the same error.
MPEG-4 MPEG-4 file with H.264 encoding (systems with Windows 7 or later, or macOS 10.7 and later)
Notice that does not mention Linux.
Ahh, major oversight indeed. Thank you, Walter!

Sign in to comment.

Asked:

on 19 Feb 2015

Commented:

on 8 Feb 2021

Community Treasure Hunt

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

Start Hunting!