Hello group,
TL;DR: would it be possible to define a standard Alembic archive metadata property that declares the scene frame rate?
My question comes from the desire for interoperability. Alembic uses time to denote, well, time, whereas other file formats often refer to frame numbers. Converting between the two is trivial if the frame rate is known. Currently this is a big "if", and not knowing the frame rate results in interoperability issues like described in https://github.com/PixarAnimationStudios/USD/issues/940.
Many importers seem to have a hard-coded assumption that an Alembic file is to be interpreted as 24 FPS, and subsequently perform bad interpolation. See https://developer.blender.org/T55288 where the reporter tried loading a 30 FPS file into various applications.
The root of those issues is that Alembic refers to scene time (without declaring a frame rate), and other file formats and applications refer to scene frames (also without declaring a frame rate), making it impossible to unambiguously convert between the two. Including the scene frame rate in the Alembic file would make it easier to handle the files, as then things like "30 FPS @ 4 samples per frame" and "120 FPS @ 1 sample per frame" can be distinguished. It would also make it easier for people (read: me) to convince other people that hard-coding 24 FPS is unnecessary.
Would you be open to add such a property to the standard?
-- Sybren A. Stüvel https://stuvelfoto.nl/ https://stuvel.eu/
Hi Dorian,
I would say it’s up to the importer to interpolate values correctly depending on what the FPS is in current scene.
This is exactly my point. In some cases there is no "current
scene". Converting an Alembic file to a USD file is such a case.
This conversion is done in a plugin for the USD library, and is
implicit to the application performing the actual loading of the
file.
IMHO, having a metadata for FPS would mostly confuse importer writers even more as they will be tempted to assume a particulare sampling rate (something Alembic can't garantee).
This loosely translates in my head as "if we don't document this
well it may be confusing", and of course you're absolutely right
in that respect. Of course the metadata field needs to be defined
well. Defining it as "the frame rate of this file" would be
problematic, as you describe. Something like "scene frame rate at
time of writing the Alembic file" sounds pretty clear to me. It
doesn't make any promises about the samples themselves, but it
would present a nice default value when there is no scene to fall
back to.
If archive metadata is 24 FPS and merged objects from different sources are 60, how the metadata should react ? How the importer should react if archive metadata states a particular frame rate but some objects don’t follow this rule.
I saw USD hardcode 24 FPS. Wouldn’t it be more efficient to consider Alembic archive follow the current FPS.
This entire proposal is for cases where there is no "current FPS"
and where the Alembic file is the only source of information.
Furthermore, it would allow DCC applications like Blender (I'm a
Blender developer), to update the scene frame rate to match the
imported Alembic file.
Optionally storing the DCC frame rate at time of writing in the archive meta data doesn't sound as scary as having a mandatory forced FPS.
What should Blender do if a user imports multiple Alembic files with these optional different frame rates?
The way I look at it now, there would be an option added to set the scene frame rate to whatever is declared in the Alembic file. It's then up to the user to enable or disable that option during import. Since Blender only loads one Alembic file at a time, this results in well-defined behaviour. Our importer already has an option to set the scene frame range to the time sample range of Alembic, given the current scene FPS. The new option to also set the scene FPS would work in a similar way.