Skip to content
Back to top
View this page

# InputStoryContentVideo

class telegram.InputStoryContentVideo(video, duration=None, cover_frame_timestamp=None, is_animation=None, *, api_kwargs=None)

  Bases: `telegram.InputStoryContent`

  Describes a video to post as a story.

  Use In

  - `telegram.Bot.edit_story()`

  - `telegram.Bot.post_story()`

  Added in version 22.1.

  Parameters:

    - video (file object | `bytes` | `pathlib.Path` | `str`, optional) – The video to post as a story. The video must be of the size `'720'` x `'1080'`, streamable, encoded with `H.265` codec, with key frames added each second in the `MPEG4` format, and must not exceed `'30000000'` MB. To upload a file, you can either pass a file object (e.g. `open("filename", "rb")`) or the file contents as bytes. If the bot is running in `local_mode`, passing the path of the file (as string or `pathlib.Path` object) is supported as well..

    - duration (`datetime.timedelta` | `int` | `float`, optional) – Precise duration of the video in seconds; 0-`'60'`

    - cover_frame_timestamp (`datetime.timedelta` | `int` | `float`, optional) – Timestamp in seconds of the frame that will be used as the static cover for the story. Defaults to `0.0`.

    - is_animation (`bool`, optional) – Pass `True` if the video has no sound

  type

    Type of the content, must be `VIDEO`.

    Type:

      `str`

  video

    The video to post as a story. The video must be of the size `'720'` x `'1080'`, streamable, encoded with `H.265` codec, with key frames added each second in the `MPEG4` format, and must not exceed `'30000000'` MB.

    Type:

      `telegram.InputFile`

  duration

    Optional. Precise duration of the video in seconds; 0-`'60'`

    Type:

      `datetime.timedelta`

  cover_frame_timestamp

    Optional. Timestamp in seconds of the frame that will be used as the static cover for the story. Defaults to `0.0`.

    Type:

      `datetime.timedelta`

  is_animation

    Optional. Pass `True` if the video has no sound

    Type:

      `bool`