def _get_per_frame_bytes(self):
        """Returns a dictionary mapping frame IDs to document sizes (in bytes)
        for each frame in the video collection.
        """
        if not self._contains_videos():
            return None

        pipeline = [
            {"$unwind": "$frames"},
            {"$replaceRoot": {"newRoot": "$frames"}},
            {"$project": {"size_bytes": {"$bsonSize": "$$ROOT"}}},
        ]

        results = self._aggregate(pipeline=pipeline, attach_frames=True)
        return {str(r["_id"]): r["size_bytes"] for r in results}
Returns a dictionary mapping frame IDs to document sizes (in bytes)
        for each frame in the video collection.
        
fiftyone/core/collections.py