I need to add several quicktime movie to build a 'edited' version (say movie A + movie B...). I have done the same thing successfully in CSharp.

I initiate 2 QAxObject (Apple QuickTime Control 2.0 / {24BA3CAF-4BE8-4AEC-A7C8-6F47D5684602}). Load an Url/Filename in QAx one.(strange thing that i need to load it twice in URL and FileName)

Create a NewMovie in the second, and try to "InsertSegment" in the second Ax Movie, this is where i get this error message :

"Movie.InsertSegment(Movie_source,0,duration_sourc e,duration) TypeError: unable to convert argument 0 of QAxObject.InsertSegment from 'QAxObject' to 'IDispatch*'".

Already looked at "QuickTime for .NET and COM Developers".

How could i make the "InsertSegment" method accept the QuicktimeControl.Movie as a 'IDispatch*' ?
Is there any other way to do that ?

See Full Code Below:

Qt Code:
  1. from PyQt4 import QtGui
  2. from PyQt4 import QtCore
  3. from PyQt4 import QAxContainer
  4.  
  5. class Example(QtGui.QMainWindow):
  6. def __init__(self):
  7. super(Example, self).__init__()
  8. self.initUI()
  9.  
  10. def initUI(self):
  11. self.frame = QtGui.QFrame()
  12. self.setCentralWidget(self.frame)
  13. self.mainLayout = QtGui.QGridLayout(self)
  14. self.frame.setLayout(self.mainLayout)
  15.  
  16. self.setGeometry(300, 300, 250, 150)
  17. self.setWindowTitle('QuicktimeTest')
  18.  
  19. QAx_quicktime_control = QAxContainer.QAxWidget(self)
  20. QAx_quicktime_control_source = QAxContainer.QAxWidget(self)
  21.  
  22. self.mainLayout.addWidget(QAx_quicktime_control)
  23. self.mainLayout.addWidget(QAx_quicktime_control_source)
  24.  
  25. QAx_quicktime_control.setControl('{24BA3CAF-4BE8-4AEC-A7C8-6F47D5684602}')
  26. QAx_quicktime_control_source.setControl('{24BA3CAF-4BE8-4AEC-A7C8-6F47D5684602}')
  27. QAx_quicktime_control_source.setVisible(False)
  28.  
  29. textbrower = QtGui.QTextBrowser()
  30. self.mainLayout.addWidget(textbrower)
  31.  
  32. textbrower.setHtml(QAx_quicktime_control.generateDocumentation())
  33.  
  34. QAx_quicktime_control_source.QuickTimeInitialize(0,1)
  35. QAx_quicktime_control_source.CreateNewMovie(False)
  36. QAx_quicktime_control_source.setProperty('Sizing',0)
  37. QAx_quicktime_control_source.setProperty('URL' ,'C:\\Whatever.mov')
  38. QAx_quicktime_control_source.setProperty('FileName' ,'C:\\Whatever.mov')
  39. QAx_quicktime_control_source.setProperty('Sizing',2)
  40.  
  41. Movie_source = QAx_quicktime_control_source.querySubObject('Movie')
  42. #textbrower.setHtml(Movie_source.generateDocumentation())
  43. duration_source = Movie_source.dynamicCall('Duration').toInt()
  44.  
  45. #QAx_quicktime_control.QuickTimeInitialize(0,1)
  46. QAx_quicktime_control.CreateNewMovie(False)
  47. Movie = QAx_quicktime_control.querySubObject('Movie')
  48. Movie.SetActive(True)
  49. Movie.SetAllowEditing(True)
  50. duration = Movie.dynamicCall('Duration').toInt()
  51.  
  52. #Does not workt with InsertSegment or the dynamicCall
  53. Movie.InsertSegment(Movie_source,0,duration_source,duration)
  54. #Movie.dynamicCall('InsertSegment',Movie_source,0,duration_source,duration)
  55.  
  56. self.show()
  57.  
  58. def main():
  59.  
  60. app = QtGui.QApplication(sys.argv)
  61. ex = Example()
  62. sys.exit(app.exec_())
  63.  
  64.  
  65. if __name__ == '__main__':
  66. main()
To copy to clipboard, switch view to plain text mode