Skip to content

Getting frame rate #10

@rileyharmon

Description

@rileyharmon

Recently had to write something custom to get the stream frame rate. Here's what I wrote

    # Fetch status
    l1 = vlc_client.fetch_status()

    # Get frame rate
    frame_rate = l1['information']['category']['Stream 0'].get('Frame_rate')

Might want to find a way to incorporate getting FPS from the stream. I'm using it to calculate the estimated current frame position.

    # Fetch media length and current position
    length = vlc_client.media_length()
    position = vlc_client.position()

    # Check if position is available
    if position is not None and frame_rate is not None:
        # Calculate current position in terms of frames
        current_frame = int((length * float(frame_rate)) * position)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions