CreatePreview > change codec

CreatePreview > change codec

MehdiZangenehBar
Advocate Advocate
1,938 Views
21 Replies
Message 1 of 22

CreatePreview > change codec

MehdiZangenehBar
Advocate
Advocate

Is it possible to change output codec of CreatePreview output?

0 Likes
1,939 Views
21 Replies
Replies (21)
Message 2 of 22

denisT.MaxDoctor
Advisor
Advisor

Can this be done through the user interface? I guess not...

 

So the only way I can see is to try changing the output file extension. I've never tried it, but it might be possible to change the codec that way. You will tell us later...

0 Likes
Message 3 of 22

denisT.MaxDoctor
Advisor
Advisor

In any case, the right thing to do is to simply convert the AVI preview to what you need. There are some built-in .NET and Qt methods and classes for that now.

0 Likes
Message 4 of 22

MehdiZangenehBar
Advocate
Advocate

The codec that my customer wants is H264

0 Likes
Message 5 of 22

MehdiZangenehBar
Advocate
Advocate

The file format will not effect the codec. it is just a container.

0 Likes
Message 6 of 22

MehdiZangenehBar
Advocate
Advocate

Converting will take some time I guess,...
If we couldn't find the solution, maybe converting image sequences to video using ffmpeg.exe would be solution.But syncing and trimming audio would be another challange.

0 Likes
Message 7 of 22

MehdiZangenehBar
Advocate
Advocate
The latest chosed coded setting will be loaded somewhere in user ini file right? maybe we be able to change it before preview?
0 Likes
Message 8 of 22

denisT.MaxDoctor
Advisor
Advisor

is there any way to specify a codec in the INI?

 

0 Likes
Message 9 of 22

domo.spaji
Advisor
Advisor

Only video format in Max is AVI.

Setings for AVI are in avi.cfg file (somewhere in ENU), normally changed in user interface (save file-settings)

There is no H264 for AVI in Max.

You would have to bring new plugin for whatever format with that codec.

 

Save preview as uncompressed AVI and compress it outside of Max.

I'm using some 1 click FFMPEG app

0 Likes
Message 10 of 22

MehdiZangenehBar
Advocate
Advocate

Yes, the file getdir #plugcfg + "\\avi.cfg" is the only file that will change after we change the codec setting. But we have some problems:

 

  1. File is encrypted.
  2. Strange thing is if we replace it with the old file, the setting is still the same and wouldn't change.
0 Likes
Message 11 of 22

MehdiZangenehBar
Advocate
Advocate
What is "1 click FFMPEG app"?
0 Likes
Message 12 of 22

MehdiZangenehBar
Advocate
Advocate

After replacing the avi.cfg file, if we restart the max, setting will be updated, so we need to force max to reload.

0 Likes
Message 13 of 22

denisT.MaxDoctor
Advisor
Advisor

I agree ... try FFmpeg first. If it works for you, use it with a "command line" or use the source code from their site.

Message 14 of 22

MehdiZangenehBar
Advocate
Advocate

Yea, another reason for this is "autoplay" which is not possible to disable it for the versions before 2024, and it will curropt the batch process.
OK, lets get back to ffmpeg, how we can handle the audio? is it possible to render out audio only from Max?

0 Likes
Message 15 of 22

MehdiZangenehBar
Advocate
Advocate

We have a big problem, autoplay will execute the final result even for image formats! I don't want it! any method to disbale this?

0 Likes
Message 16 of 22

MehdiZangenehBar
Advocate
Advocate

Do we have access to the CreatePreview source code in SDK?

0 Likes
Message 17 of 22

denisT.MaxDoctor
Advisor
Advisor

@MehdiZangenehBar wrote:

Do we have access to the CreatePreview source code in SDK?


If you're asking about autoplay verification see SetPlayPreviewWhenDone and GetPlayPreviewWhenDone in SDK (maxapi.h, Interface19)

 

MXS: 

preferences.playPreviewWhenDone
Message 18 of 22

domo.spaji
Advisor
Advisor

@MehdiZangenehBar wrote:

What is "1 click FFMPEG app"?

 

 

https://codecpack.co/download/Mp4-Video-1-Click.html


What problems you can have with auto-play except if you want to immediately delete result file/s?

0 Likes
Message 19 of 22

MehdiZangenehBar
Advocate
Advocate
Is it possible to use it with command-line?
0 Likes
Message 20 of 22

MehdiZangenehBar
Advocate
Advocate

is it possible to replace avi.cfg and force Max to reload it?

0 Likes