Skip to main content
Glama

tautulli_transcode_stats

Analyze Plex transcoding patterns to identify which devices cause the most load. Get direct play vs transcode breakdown by platform for optimization.

Instructions

Get direct play vs transcode breakdown by platform — shows which devices cause the most transcoding load.

Args: days: Time range in days (default 30).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
daysNo

Implementation Reference

  • The `tautulli_transcode_stats` tool handler retrieves transcode statistics from the Tautulli API and formats them into a readable summary.
    async def tautulli_transcode_stats(days: int = 30) -> str:
        """Get direct play vs transcode breakdown by platform — shows which devices cause the most transcoding load.
    
        Args:
            days: Time range in days (default 30).
        """
        days = _clamp_days(days)
        data = await _api("get_stream_type_by_top_10_platforms", time_range=str(days))
        rows = _chart_totals(data)
    
        if not rows:
            return f"No stream data for the last {days} days."
    
        # Compute overall totals
        all_dp = sum(r.get("Direct Play", 0) for r in rows)
        all_ds = sum(r.get("Direct Stream", 0) for r in rows)
        all_tc = sum(r.get("Transcode", 0) for r in rows)
        all_total = all_dp + all_ds + all_tc
    
        lines = [f"Stream type by platform (last {days} days, {all_total} total plays):\n"]
    
        for r in rows:
            dp = r.get("Direct Play", 0)
            ds = r.get("Direct Stream", 0)
            tc = r.get("Transcode", 0)
            total = r["total"]
            if total == 0:
                continue
            tc_pct = tc / total * 100
    
            parts = []
            if dp:
                parts.append(f"{dp} direct play")
            if ds:
                parts.append(f"{ds} direct stream")
            if tc:
                parts.append(f"{tc} transcode")
    
            lines.append(f"  • {r['name']}: {total} plays — {', '.join(parts)} ({tc_pct:.0f}% transcode)")
    
        if all_total:
            overall_tc_pct = all_tc / all_total * 100
            lines.append(f"\nOverall: {all_dp} direct play, {all_ds} direct stream, {all_tc} transcode ({overall_tc_pct:.0f}% transcode)")
    
        return "\n".join(lines)

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/lodordev/mcp-tautulli'

If you have feedback or need assistance with the MCP directory API, please join our Discord server