<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Martin Rossetto</title>
    <description>The latest articles on DEV Community by Martin Rossetto (@martinrossetto).</description>
    <link>https://dev.to/martinrossetto</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4278738%2F2b264378-1044-4845-8b84-62cad8b4ded8.jpg</url>
      <title>DEV Community: Martin Rossetto</title>
      <link>https://dev.to/martinrossetto</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/martinrossetto"/>
    <language>en</language>
    <item>
      <title>I turned my 2010 Sony Bravia into a smart TV controlled from my phone</title>
      <dc:creator>Martin Rossetto</dc:creator>
      <pubDate>Wed, 02 Dec 2026 14:48:03 +0000</pubDate>
      <link>https://dev.to/martinrossetto/i-turned-my-2010-sony-bravia-into-a-smart-tv-controlled-from-my-phone-58n2</link>
      <guid>https://dev.to/martinrossetto/i-turned-my-2010-sony-bravia-into-a-smart-tv-controlled-from-my-phone-58n2</guid>
      <description>&lt;p&gt;My TV is a Sony Bravia KDL-40NX700 from 2010. The panel is still great. The "smart" part is not: the built-in apps stopped working years ago, there is no YouTube, no Twitch, nothing.&lt;/p&gt;

&lt;p&gt;But it still has one feature that never expires: it's a &lt;strong&gt;DLNA media renderer&lt;/strong&gt;. Any device on the network can tell it "play this stream", and it will.&lt;/p&gt;

&lt;p&gt;So I wrote &lt;strong&gt;&lt;a href="https://github.com/martinrossetto/ReviveTV" rel="noopener noreferrer"&gt;ReviveTV&lt;/a&gt;&lt;/strong&gt;: a small server that runs on the Windows PC I already have at home and turns the old TV into a smart TV I control from my phone.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fywmf1w5ilu3vkdgdiucv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fywmf1w5ilu3vkdgdiucv.png" alt="ReviveTV phone app" width="800" height="555"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What it does
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Sources:&lt;/strong&gt; YouTube (with your account: subscriptions and your personal Home), Twitch (live streams, past broadcasts, channels you follow), Pluto TV (free channels, movies and series), Italian live TV (RaiPlay, La7), and the movies stored on the PC.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Phone app:&lt;/strong&gt; an installable web app (PWA) with a mini player: pause, seek, chapters, subtitles, audio tracks, TV volume, "continue watching". You can also share a link from the YouTube or Twitch app straight to the TV.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;On the TV:&lt;/strong&gt; a home screen with clock, weather and suggestions instead of the TV tuner, animated info bars, an "up next" card with autoplay, a pause screen, YouTube chapters and automatic sponsor skipping via SponsorBlock.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How it works
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ft8edmcec6tbjujc7t2fg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ft8edmcec6tbjujc7t2fg.png" alt="How ReviveTV works: the phone app talks to a Node.js server on the PC; sources go through ffmpeg into a splicer that sends one endless MPEG-PS stream to the TV" width="800" height="425"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Discovery.&lt;/strong&gt; The server sends an SSDP &lt;code&gt;M-SEARCH&lt;/code&gt; for &lt;code&gt;MediaRenderer&lt;/code&gt; devices from every network adapter and reads the TV's device description to find its control URLs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Finding the video.&lt;/strong&gt; yt-dlp resolves YouTube and Twitch, public APIs are used for Pluto TV, and local files are read directly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Converting.&lt;/strong&gt; A 2010 TV is picky about formats, so everything is re-encoded on the fly by ffmpeg to the safest thing it understands: MPEG-2 video and AC3 audio in an MPEG program stream (basically what a DVD contains), up to 1080p.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Playing.&lt;/strong&gt; The server tells the TV, through UPnP &lt;code&gt;AVTransport&lt;/code&gt; SOAP calls, to play a URL on the PC, and serves the converted stream on that URL.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That works, but it feels like 2010: each new video means the TV stops, shows a black screen, buffers, and sometimes drops back to its own menu.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fun part: one stream that never ends
&lt;/h2&gt;

&lt;p&gt;To make it feel like a real smart TV, the TV is only ever told to play &lt;strong&gt;one URL&lt;/strong&gt;: a stream that never ends.&lt;/p&gt;

&lt;p&gt;Everything you see (the home screen, the "coming up" card while a video loads, the video itself, the pause screen) is produced by a separate ffmpeg process, always in exactly the same format. A small "splicer" in Node.js stitches these pieces into the single stream the TV is watching:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;It rewrites the clocks.&lt;/strong&gt; Every MPEG-PS pack has a system clock reference (SCR), and every PES packet has presentation/decoding timestamps (PTS/DTS). When a new piece starts, the splicer shifts all its timestamps so they continue exactly where the previous piece ended. From the TV's point of view it is one long video with no jumps. These are 33-bit values at 90 kHz, so wrap-around has to be handled too.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It cuts only at GOP boundaries.&lt;/strong&gt; The old piece is cut right before an MPEG-2 sequence header, so the decoder never gets half a group of pictures.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It doesn't run too far ahead.&lt;/strong&gt; The TV buffers, so the splicer keeps track of how far it has sent compared to what the TV is showing and stays only a few seconds ahead. That way, when you pick something else on your phone, it shows up quickly instead of after the whole buffer has played.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Because the stream never stops, the TV never goes back to its menu. You press play on the phone, a "coming up" card fades in on the TV, and the video starts when it's ready.&lt;/p&gt;

&lt;p&gt;The same trick gives you a few things for free:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pause&lt;/strong&gt; doesn't actually pause the stream. The video is frozen at the next GOP, and a pause screen built from the last frame (sharp in front, blurred behind) is streamed instead. Resuming starts a new piece from the same position.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sponsor skipping&lt;/strong&gt; prepares the piece that starts after the sponsor segment a few seconds early, and the splicer attaches it right when the current piece ends.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Twitch ads&lt;/strong&gt; inside live streams come with a different clock (and sometimes a different resolution). ffmpeg regenerates the timestamps by counting frames and samples, so the stream stays continuous.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Other details I enjoyed
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;TV graphics.&lt;/strong&gt; The info bar, cards and home screen are drawn as PNGs by a tiny C# program (System.Drawing) that stays running and takes one JSON line per image, then they are animated and overlaid by ffmpeg.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;An installable phone app needs HTTPS&lt;/strong&gt;, and you can't get a public certificate for &lt;code&gt;192.168.1.10&lt;/code&gt;. The installer creates a local certificate authority with X.509 &lt;strong&gt;name constraints&lt;/strong&gt;: it may only sign &lt;code&gt;192.168.x.x&lt;/code&gt; addresses, and the only DNS name it may sign is the reserved &lt;code&gt;invalid&lt;/code&gt; domain. Even if its key leaked, it couldn't be used to impersonate a real website. &lt;em&gt;Update: the first version only constrained IP addresses. A name constraint only restricts the name types it lists, so that CA could still have signed a certificate for a domain name. A reader's comment made me re-check it; it's fixed, and the README explains how to replace an old CA.&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Accounts without handling passwords.&lt;/strong&gt; Connecting YouTube or Twitch opens a separate Microsoft Edge profile on the PC: you sign in on the official page and the server reads the session cookies locally. Twitch no longer gives your followed channels to third-party apps, so that list is read from the &lt;em&gt;Following&lt;/em&gt; page of the same profile.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Limitations (honestly)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Windows only&lt;/strong&gt; for now (installer, overlay renderer, Edge integration).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tested on exactly one TV&lt;/strong&gt;, mine. Other DLNA TVs should work, but DLNA implementations vary a lot.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No DRM.&lt;/strong&gt; Netflix and other protected content can't work, and ReviveTV doesn't try to bypass anything.&lt;/li&gt;
&lt;li&gt;Starting a video takes a few seconds, and quality is limited by real-time MPEG-2 encoding.&lt;/li&gt;
&lt;li&gt;It depends on yt-dlp, so when YouTube changes something, playback can break until yt-dlp is updated.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;The code is on GitHub: &lt;strong&gt;&lt;a href="https://github.com/martinrossetto/ReviveTV" rel="noopener noreferrer"&gt;martinrossetto/ReviveTV&lt;/a&gt;&lt;/strong&gt;. It's free for personal, non-commercial use (PolyForm Noncommercial license). Setup is a single PowerShell script that downloads ffmpeg and yt-dlp and finds your TV on the network.&lt;/p&gt;

&lt;p&gt;If you have an old TV with DLNA lying around, I'd love to know whether it works with yours. Open an issue and I'll add it to the list of tested TVs. Questions about the splicer or anything else are welcome in the comments!&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>node</category>
      <category>selfhosted</category>
      <category>ffmpeg</category>
    </item>
  </channel>
</rss>
