From: Tom on
Hello,

I have a question concerning the valid arguments for the 'VideoCompressor' property of the 'video.MultimediaFileWriter' constructor.
I am not able to find a documentation about this property save for the very vague description in the help file:
<quote>
Choose None (uncompressed) to save uncompressed video data to the multimedia file. The other options reflect the available video compression algorithms installed on your system.
</quote>

I have 2 problems with this 'explanation':
1.) If I supply 'None' as an argument I get the following error message
<quote>
??? Error using ==> pvParse at 22
None is not a valid setting for the VideoCompressor property.
</quote>
What can I do against that?

2.) More important - what do I insert if I want to use a codec? I already tried the full name (e.g. 'Cinepak Codec by Radius') and the fourCC code (e.g. 'cvid') for several codecs which are installed on my machine. Both do not function and produce the same error message as above.

Sadly all the relevant Matlab code is hidden in .p-files and thus I am not able to get the answers from there.

I hope someone can help me with this problem.

Thanks and best regards
Tom

PS: I am using Win7 64 and Matlab 7.10.0 (R2010a).
From: Tom on
After fiddling around some more I found the solution to my first questions (but NOT the more important second).

Answer to 1.) One has to use the argument 'None (uncompressed)' and not 'None' as I have written above.

Question 2.) remains open.

Greetings,
Tom
From: witek on
Tom,

You bring up a very good point about documentation. We'll need to make it clear as to how
you set these properties most easily. On Windows, the list of compressors depends on
the availability of codecs on your system and is created dynamically. On Linux, only
the uncompressed AVIs can be recorded.

Either way, by far, the easiest way to set the properties is to use Tab Completion. Here is
how you do it:

>> hmfw = video.MultimediaFileWriter('tomsexample.avi', ...
'AudioInputPort', false, ...
'VideoInputPort', true, ...
'FrameRate', 30);
>> hmfw.VideoCompressor = '<PRESS THE TAB KEY right after you write down the apostrophy>

This will produce a list of properties to choose from. All properties can be set using
tab completion. Some are very long, so typing would be extremely tedious. Once you
realize that use can use tab completion, working with the objects becomes a lot more
enjoyable and productive. BTW, typing hmfw by itself will give you a list of all properties
available in a given configuration of the object.

Let me know if that worked for you and if there is anything else that you need resolved.

Witek

witek @ mathworks.com



Tom <auzinger(a)cg.tuwien.ac.at> wrote:
> Hello,
>
> I have a question concerning the valid arguments for the 'VideoCompressor' property of the 'video.MultimediaFileWriter' constructor.
> I am not able to find a documentation about this property save for the very vague description in the help file:
> <quote>
> Choose None (uncompressed) to save uncompressed video data to the multimedia file. The other options reflect the available video compression algorithms installed on your system.
> </quote>
>
> I have 2 problems with this 'explanation':
> 1.) If I supply 'None' as an argument I get the following error message
> <quote>
> ??? Error using ==> pvParse at 22
> None is not a valid setting for the VideoCompressor property.
> </quote>
> What can I do against that?
>
> 2.) More important - what do I insert if I want to use a codec? I already tried the full name (e.g. 'Cinepak Codec by Radius') and the fourCC code (e.g. 'cvid') for several codecs which are installed on my machine. Both do not function and produce the same error message as above.
>
> Sadly all the relevant Matlab code is hidden in .p-files and thus I am not able to get the answers from there.
>
> I hope someone can help me with this problem.
>
> Thanks and best regards
> Tom
>
> PS: I am using Win7 64 and Matlab 7.10.0 (R2010a).
From: witek on

Tom,

I noticed in your PS that you are using win7 with 64 bit os. There is a caviat that you
should be aware of:
- win7 (64 bit) ships with 32 bit windows media player and uses 32 bit codecs; that's how
Microsoft is able to play most of the content; if you installed 64 bit Windows Media Player
you'd experience difficulties playing some of the media
- many codecs are not available in 64 bit version; there a only a few that come with win7
- if you install 64 bit matlab, it will only be able to use 64 bit codecs, therefore your
selection of codecs will be narrower

What can you do?
- be happy with codecs that ARE available in 64 bit version
- install 32 bit ML which will again give you access to all the 32 bit codecs on your system

Witek

Tom <auzinger(a)cg.tuwien.ac.at> wrote:
> Hello,
>
> I have a question concerning the valid arguments for the 'VideoCompressor' property of the 'video.MultimediaFileWriter' constructor.
> I am not able to find a documentation about this property save for the very vague description in the help file:
> <quote>
> Choose None (uncompressed) to save uncompressed video data to the multimedia file. The other options reflect the available video compression algorithms installed on your system.
> </quote>
>
> I have 2 problems with this 'explanation':
> 1.) If I supply 'None' as an argument I get the following error message
> <quote>
> ??? Error using ==> pvParse at 22
> None is not a valid setting for the VideoCompressor property.
> </quote>
> What can I do against that?
>
> 2.) More important - what do I insert if I want to use a codec? I already tried the full name (e.g. 'Cinepak Codec by Radius') and the fourCC code (e.g. 'cvid') for several codecs which are installed on my machine. Both do not function and produce the same error message as above.
>
> Sadly all the relevant Matlab code is hidden in .p-files and thus I am not able to get the answers from there.
>
> I hope someone can help me with this problem.
>
> Thanks and best regards
> Tom
>
> PS: I am using Win7 64 and Matlab 7.10.0 (R2010a).
From: Tom on
Hello Witek,

thanks for your great answers. Indeed, I was not aware of the Tab-Completion feature. If I use it according to your descriptions I am offered several 'VideoCompressor' values. If selected one of these the video is encoded accordingly.

The 32/64 bit codec problems escaped me, too. I will try to use the 32bit Matlab version if I need specific codecs.

Your answers are very illuminating and helped me greatly. Thank you very much.

A short comment on Tab-Completion:
Perhaps the help documentation should underline the differences between Tab-Completion in the Command Window and the Editor. I was initially surprised that the Tab-Completion works only on objects that are already in the Workspace.
I am accustomed to the Tab-Completion in Visual Studio where you do not have to compile and run your code to have this functionality.
But this is just a small remark and not really important.

So thanks a lot for your excellent help
Best regards,
Tom