Jump to content

mp4 file for review wouldn't upload via ftrack-api


kanstantsin.nalobin

Recommended Posts

So i'm trying to upload a mp4 file for the review.

That's what i'm doing:

file_path = r"d:\FtrackPlayground\ftrackreview-mp4.mp4"
assetParent = Shot['parent']
asset_type = session.query('AssetType where name is "Animation"').one()

asset = session.create('Asset', {
'name': 'MY_NAME',
'type': asset_type,
'parent': assetParent

})
asset_version = session.create('AssetVersion', {
'asset': asset,
'task': Shot,
})

session.commit()

asset_version.create_component(FilePath)
session.close()

I've got this from the documentation page: https://ftrack-python-api.rtd.ftrack.com/en/stable/example/publishing.html

the problem is that the file won't upload. I have an empty preview thumbnail.

Could somebody help?

Link to comment
Share on other sites

Hi Kanstantsin,

You may be looking for the `asset_version.encode_media()` method if you want the file to be handled automatically by our cloud transcoder to have a web-playable piece of media and thumbnail created for you.

https://ftrack-python-api.rtd.ftrack.com/en/stable/example/encode_media.html#example-encode-media

Regards,
Patrick

Link to comment
Share on other sites

Hi Kanstantsin,

Which documentation are you referring to?

The file uploaded to the ftrack server and then transcoded for web playback isn't tied to the `Task`. It is a `Component` that is connected to the `AssetVersion`, which in turn is connected to the `Task`. Please let me know if this document that outlines key publishing concepts helps out.

Regards,
Patrick

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...