@m_adam said in Setting Quicktime Options:
MEDIASESSION
Awesome! Thanks for your help. I got pretty far in coding the Quicktime settings. But there are a few settings that I am having trouble with. (Datarate, Audio Samplerate and Audio Bitrate)
import c4d
from c4d import bitmaps
import maxon
def main():
QUICKTIME_FORMAT_NUMBER = 1073784596
# Retrieves render data and its container
renderData = doc.GetActiveRenderData()
bc = renderData.GetDataInstance()
# Gets image filters options
saveOptions = bc.GetContainerInstance(c4d.RDATA_SAVEOPTIONS)
# Sets Quicktime Mov output format
bc[c4d.RDATA_FORMAT] = QUICKTIME_FORMAT_NUMBER # c4d.FILTER_MOVIE sets format to mp4 not mov, so I used the call command instead
# Defines Quicktime settings
compressionmethodID = maxon.InternedId('net.maxon.mediasession.mf.export.codec')
datarateID = maxon.InternedId('net.maxon.mediasession.export.datarate') # Problems here needs BytesValue
keyframesID = maxon.InternedId('net.maxon.mediasession.export.keyframes') # Asks for Int32 and works
audiocodecID = maxon.InternedId('net.maxon.mediasession.mf.export.audio.codec')
audiosamplerateID = maxon.InternedId('net.maxon.mediasession.mf.export.audio.samplerate') # Problems here asks for Int but doesn't like it'
audiobitrateID = maxon.InternedId('net.maxon.mediasession.mf.export.audio.kilobitrate') # Problems here asks for Int but doesn't like it'
# Configures Quicktime format options with a maxon.DataDictionary
exportSettings = maxon.DataDictionary()
exportSettings.Set(compressionmethodID, maxon.Id("H.264")) # works
exportSettings.Set(datarateID, 2) # does not work
exportSettings.Set(keyframesID, 2) # works
exportSettings.Set(audiocodecID, maxon.Id("mp3")) # works
exportSettings.Set(audiosamplerateID, 96) # does not work (adds new fake setting)
exportSettings.Set(audiobitrateID, 320) # does not work (adds new fake setting, notice no kBit)
# Stores settings in render data container
bitmaps.SetImageSettingsDictionary(exportSettings, saveOptions, QUICKTIME_FORMAT_NUMBER)
# Updates Cinema 4D
c4d.EventAdd()
if __name__=='__main__':
main()
Datarate, Audio Samplerate and Audio Bitrate are not being set.
Keyframes, which asks for an Int32, does get set successfully.
Datarate asks for BytesValue. I can't figure this out. What is a BytesValue, what does it look like in python, and do I need to import it?
https://developers.maxon.net/docs/cpp/2023_2/namespacemaxon_1_1_m_e_d_i_a_s_e_s_s_i_o_n_1_1_e_x_p_o_r_t.html
Audio Samplerate and Audio Bitrate ask for an int. I include an int, but it doesn't work. It actually adds a new fake value to the bottom of the pull down which is not correct. How is this different than an Int32?
https://developers.maxon.net/docs/cpp/2023_2/namespacemaxon_1_1_m_e_d_i_a_s_e_s_s_i_o_n_1_1_m_f_1_1_e_x_p_o_r_t.html
Thanks for your help.