<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>trailers · My Tech Blog</title><link>https://blog2.ebal.gr/tags/trailers/</link><description>Notes on self-hosted infrastructure, homelabs, Linux and open-source tooling.</description><language>en-US</language><lastBuildDate>Tue, 10 Nov 2026 18:41:36 +0200</lastBuildDate><atom:link href="https://blog2.ebal.gr/tags/trailers/index.xml" rel="self" type="application/rss+xml"/><item><title>Jellyfin Trailers for movies and TV shows in my Samsung TV</title><link>https://blog2.ebal.gr/2026/11/10/jellyfin-trailers-for-movies-and-tv-shows-in-my-samsung-tv/</link><guid isPermaLink="true">https://blog2.ebal.gr/2026/11/10/jellyfin-trailers-for-movies-and-tv-shows-in-my-samsung-tv/</guid><pubDate>Tue, 10 Nov 2026 18:41:36 +0200</pubDate><description>How I got automatic trailers in Jellyfin (Docker) with the JellyTrailers plugin and yt-dlp, and why they would not play on my Samsung TV until I asked YouTube for H.264 and AAC.</description><category>jellyfin</category><category>jellytrailers</category><category>trailers</category><category>yt-dlp</category><category>ffmpeg</category><category>samsung</category><content:encoded><![CDATA[<p>I wanted the <strong>Trailer</strong> button in <strong>Jellyfin</strong> to actually do something for the movies and shows I have at home. Jellyfin can play a trailer file that sits next to your media usually there are no such files.  In this blog post you can find my personal notes on how I got trailers for my movies and series, automatically, with Jellyfin running inside Docker.</p>
<p>There is also another part, the one that took me more time than it should to figure out, when trailers worked in the web browser, but in my Samsung TV the trailer button tried to start the trailer and then &hellip; nothing happened.</p>

    <blockquote>
        <p><strong>JellyTrailers</strong>: Download movie and TV show trailers with yt-dlp and place them next to your media.</p>

    </blockquote>
<h2 id="how-jellyfin-finds-trailers"><a href="#how-jellyfin-finds-trailers" class="header-anchor"></a>How Jellyfin finds trailers
</h2><p>Jellyfin looks for &ldquo;local trailer files&rdquo;. The easiest way is a file called <code>trailer.mp4</code> inside the movie folder (or inside the series folder for TV shows):</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">/media/Movies/Stalker (1979)/
</span></span><span class="line"><span class="cl">├── Stalker (1979).mkv
</span></span><span class="line"><span class="cl">└── trailer.mp4
</span></span></code></pre></div><p>If that file exists, the <strong>Trailer</strong> button in Jellyfin shows up on the item page. No plugin is needed to play it.</p>
<p>The JellyTrailers plugin only creates those files. It searches YouTube and downloads the trailer with <strong>yt-dlp</strong>.</p>
<h2 id="step-1---yt-dlp-and-ffmpeg-inside-the-container"><a href="#step-1---yt-dlp-and-ffmpeg-inside-the-container" class="header-anchor"></a>Step 1 - yt-dlp and ffmpeg inside the container
</h2><p>The official <code>jellyfin/jellyfin</code> image does <strong>NOT</strong> include <code>yt-dlp</code>. I didn&rsquo;t want to build my own image. So I keep two static binaries on the host and mount them read-only into the container. One for yt-dlp and one for <code>ffmpeg</code> for transcoding.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ mkdir -p services/jellyfin/local-bin
</span></span><span class="line"><span class="cl">$ <span class="nb">cd</span> services/jellyfin/local-bin
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">local-bin$ curl -sLo yt-dlp https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux
</span></span><span class="line"><span class="cl">local-bin$ curl -sL https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz <span class="p">|</span> tar xJ --strip-components<span class="o">=</span><span class="m">1</span> --wildcards <span class="s1">&#39;*/ffmpeg&#39;</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">local-bin$ chmod +x yt-dlp ffmpeg
</span></span></code></pre></div><p>verify</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">local-bin$ ./yt-dlp --version
</span></span><span class="line"><span class="cl">2026.08.19
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">local-bin$ ./ffmpeg -version <span class="p">|</span> head -1
</span></span><span class="line"><span class="cl">ffmpeg version 7.0.2-static https://johnvansickle.com/ffmpeg/  Copyright <span class="o">(</span>c<span class="o">)</span> 2000-2024 the FFmpeg developers
</span></span></code></pre></div><p>YouTube gives you video and audio as separate streams. yt-dlp needs ffmpeg to join them into one file, that&rsquo;s why we need both.</p>
<h2 id="step-2---docker-compose"><a href="#step-2---docker-compose" class="header-anchor"></a>Step 2 - docker compose
</h2><p>The important line is the last volume. <code>/usr/local/bin</code> is already in the container&rsquo;s <code>PATH</code>, so there is no need to change any environment variable.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">services</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span><span class="nt">jellyfin</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">image</span><span class="p">:</span><span class="w"> </span><span class="l">jellyfin/jellyfin:latest</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">container_name</span><span class="p">:</span><span class="w"> </span><span class="l">jellyfin</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">restart</span><span class="p">:</span><span class="w"> </span><span class="l">unless-stopped</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">volumes</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span>- <span class="l">./services/jellyfin/config:/config</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span>- <span class="l">/jellyfin_cache:/cache</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span>- <span class="l">./media:/media</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span><span class="c"># yt-dlp + ffmpeg for the JellyTrailers plugin</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span>- <span class="l">./services/jellyfin/local-bin:/usr/local/bin:ro</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">ports</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span>- <span class="s2">&#34;8096:8096&#34;</span><span class="w">
</span></span></span></code></pre></div><p>It is best to use a specific version instead of the <code>latest</code> tag.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ docker compose up -d
</span></span><span class="line"><span class="cl">$ docker <span class="nb">exec</span> jellyfin yt-dlp --version
</span></span><span class="line"><span class="cl">2026.08.19
</span></span></code></pre></div><h2 id="step-3---install-the-plugin"><a href="#step-3---install-the-plugin" class="header-anchor"></a>Step 3 - install the plugin
</h2><p>In Jellyfin, go to <strong>Dashboard</strong> -&gt; <strong>Plugins</strong> -&gt; <strong>Repositories</strong> and add a new repository:</p>
<ul>
<li>Name: <code>JellyTrailers</code></li>
<li>URL: <code>https://raw.githubusercontent.com/fl4pj4ck/JellyTrailers/main/manifest.json</code></li>
</ul>
<p>Then from the <strong>Catalog</strong> install <strong>JellyTrailers</strong> and restart Jellyfin.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ docker restart jellyfin
</span></span><span class="line"><span class="cl">$ grep <span class="s1">&#39;Loaded plugin: &#34;JellyTrailers&#34;&#39;</span> services/jellyfin/config/log/log_*.log <span class="p">|</span> tail -1
</span></span><span class="line"><span class="cl"><span class="o">[</span>2026-11-05 21:39:20.268 +02:00<span class="o">]</span> <span class="o">[</span>INF<span class="o">]</span> <span class="o">[</span>9<span class="o">]</span> Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: <span class="s2">&#34;JellyTrailers&#34;</span> <span class="s2">&#34;1.6.1.0&#34;</span>
</span></span></code></pre></div><p>It&rsquo;s important to look at the logs, maybe somethins is missing or something is not in the right directory.</p>
<p>also <code>docker compose logs -f</code> works.</p>
<h2 id="step-4---configure-the-plugin"><a href="#step-4---configure-the-plugin" class="header-anchor"></a>Step 4 - configure the plugin
</h2><p>Open the plugin settings. These are mine:</p>
<table>
	<thead>
			<tr>
					<th>Setting</th>
					<th>Value</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td>yt-dlp path</td>
					<td><code>/usr/local/bin/yt-dlp</code></td>
			</tr>
			<tr>
					<td>Trailer path</td>
					<td><code>trailer.mp4</code></td>
			</tr>
			<tr>
					<td>Quality</td>
					<td><code>1080p</code></td>
			</tr>
			<tr>
					<td>Max trailers per run</td>
					<td><code>50</code></td>
			</tr>
			<tr>
					<td>TMDb/OMDb fallback</td>
					<td>enabled</td>
			</tr>
	</tbody>
</table>
<p>and the most important one, <strong>yt-dlp options (JSON)</strong>:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span><span class="nt">&#34;format&#34;</span><span class="p">:</span> <span class="s2">&#34;bestvideo[height&lt;=1080][vcodec^=avc1]+bestaudio[ext=m4a]/best[height&lt;=1080][vcodec^=avc1]/best[height&lt;=1080]/best&#34;</span><span class="p">}</span>
</span></span></code></pre></div><p>I will explain below this format string , because I got it wrong twice, three times if you count my wife&rsquo;s request to move from 720 to 1080p for the trailers :D</p>
<h2 id="step-5---run-it"><a href="#step-5---run-it" class="header-anchor"></a>Step 5 - run it
</h2><p>The plugin adds a scheduled task called <strong>Download Trailers (JellyTrailers)</strong>. Mine runs every day at 02:00.</p>
<p>Run it once by hand from <strong>Dashboard</strong> -&gt; <strong>Scheduled Tasks</strong>. Then scan your libraries, so Jellyfin finds the new files.</p>

    <blockquote>
        <p><strong>Be aware:</strong> You just got a new movie from your DVD … the trailer will not show immediatle as the scheduler runs at 02.00 in the morning, but you can run it explicit by hand !</p>

    </blockquote>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ find media -name trailer.mp4 <span class="p">|</span> wc -l
</span></span></code></pre></div><p>Some trailers will fail, eg. when the YouTube video is gone. That&rsquo;s fine, the plugin tries again on the next run.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">WRN Jellyfin.Plugin.JellyTrailers.YtDlpRunner: yt-dlp failed for &#34;Zootopia (2025) trailer&#34;: &#34;ERROR: [youtube] BjkIOU5PhyQ: This video is not available&#34;
</span></span></code></pre></div><hr>
<h2 id="the-wrong-way"><a href="#the-wrong-way" class="header-anchor"></a>The wrong way
</h2><p><code>The format string</code> saga !</p>
<h3 id="wrong-way-number-one"><a href="#wrong-way-number-one" class="header-anchor"></a>Wrong way number one
</h3><p>The plugin&rsquo;s own <code>1080p</code> quality setting becomes something like <code>best[height&lt;=1080]</code>. Which means &ldquo;the best single file that already has video AND audio, up to 1080p&rdquo;. YouTube dont always offers those, so yt-dlp answers:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">ERROR: Requested format is not available
</span></span></code></pre></div><h3 id="wrong-way-number-two"><a href="#wrong-way-number-two" class="header-anchor"></a>Wrong way number two
</h3><p>So I told yt-dlp to download separate streams and join them:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span><span class="nt">&#34;format&#34;</span><span class="p">:</span> <span class="s2">&#34;bestvideo[height&lt;=1080]+bestaudio/best[height&lt;=1080]/best&#34;</span><span class="p">}</span>
</span></span></code></pre></div><p>Trailers started to download. In the web browser everything worked. perfect, I thought.</p>
<p>Then I sat in front of my Samsung TV (Q60 series, with the <strong>Jellyfin for Tizen</strong> app) and clicked the trailer button.
The player tried to start, and then nothing happened. No video, no sound. Had to restart my TV the first time</p>
<p>Jellyfin&rsquo;s log said playback had started:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">[INF] SessionManager: User &#34;username&#34; started playback of &#34;Trailer&#34; (&#34;Jellyfin for Tizen&#34; &#34;0.1.0 ...&#34;)
</span></span></code></pre></div><p>but there was no FFmpeg transcode log for that moment. So Jellyfin sent the file as it is (direct play), and the TV could not play it.</p>
<p>Let&rsquo;s see what yt-dlp actually downloaded:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">    209 av1 opus
</span></span><span class="line"><span class="cl">      8 h264 opus
</span></span><span class="line"><span class="cl">      3 vp9 opus
</span></span><span class="line"><span class="cl">      2 h264 aac
</span></span></code></pre></div><p>If you know, you know.</p>
<p>On YouTube today &ldquo;bestvideo&rdquo; means <strong>AV1</strong> and &ldquo;bestaudio&rdquo; means <strong>Opus</strong>. Both are good codecs and browsers play them fine.</p>
<p>My TV does not understand them, at least not inside an mp4 file. Jellyfin did not convert them for the TV either.</p>
<h3 id="the-correct-way---finally"><a href="#the-correct-way---finally" class="header-anchor"></a>The correct way - finally!
</h3><p>Ask YouTube for <strong>H.264</strong> (<code>avc1</code>) video and <strong>AAC</strong> (<code>m4a</code>) audio. Almost every TV, phone and browser can play that:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span><span class="nt">&#34;format&#34;</span><span class="p">:</span> <span class="s2">&#34;bestvideo[height&lt;=1080][vcodec^=avc1]+bestaudio[ext=m4a]/best[height&lt;=1080][vcodec^=avc1]/best[height&lt;=1080]/best&#34;</span><span class="p">}</span>
</span></span></code></pre></div><p><code>avc1</code> + <code>mp4a</code> at 1080p. YouTube still offers H.264 up to 1080p, so for a trailer on the TV we lose nothing. Above 1080p YouTube only has VP9 and AV1, and we are back to the same problem.</p>
<h2 id="fixing-the-trailers-i-already-had"><a href="#fixing-the-trailers-i-already-had" class="header-anchor"></a>Fixing the trailers I already had
</h2><p>New trailers are fine now, but I already had a few files in AV1/Opus. I did not want to download everything again (some YouTube links are already dead). So I converted them with the ffmpeg that comes inside the Jellyfin container.</p>
<p>My server is an old Intel GPU (no, not really), so I used VAAPI to encode H.264. My GPU (again not really) can&rsquo;t decode AV1, so ffmpeg does that part on the CPU. It is slow, about 30 seconds per trailer, but it works.</p>

    <blockquote>
        <p>My CPU is an Intel Core i7-2600 (Sandy Bridge, 2011, 4 cores / 8 threads), and it has Intel HD Graphics 2000 built in (PCI ID 8086:0102).</p>

    </blockquote>
<p>a 15y old CPU !</p>
<p>Back to the TV, I press the trailer button, and this time the trailer plays !
and happy wife too :)</p>
<p><img alt="jellytrailers 01" class="gallery-image" data-flex-basis="287px" data-flex-grow="119" height="1523" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="/2026/11/10/jellyfin-trailers-for-movies-and-tv-shows-in-my-samsung-tv/jellytrailers1.jpg" srcset="/2026/11/10/jellyfin-trailers-for-movies-and-tv-shows-in-my-samsung-tv/jellytrailers1_hu_1b576ac9ffb526b7.webp 480w, /2026/11/10/jellyfin-trailers-for-movies-and-tv-shows-in-my-samsung-tv/jellytrailers1_hu_9ad8082f6a35b19d.webp 800w, /2026/11/10/jellyfin-trailers-for-movies-and-tv-shows-in-my-samsung-tv/jellytrailers1_hu_178ca928f8e80664.webp 1200w, /2026/11/10/jellyfin-trailers-for-movies-and-tv-shows-in-my-samsung-tv/jellytrailers1_hu_dc289d3c1ac87ff9.webp 1600w" width="1824">
</p>
<p><img alt="jellytrailers 02" class="gallery-image" data-flex-basis="298px" data-flex-grow="124" height="1473" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="/2026/11/10/jellyfin-trailers-for-movies-and-tv-shows-in-my-samsung-tv/jellytrailers2.jpg" srcset="/2026/11/10/jellyfin-trailers-for-movies-and-tv-shows-in-my-samsung-tv/jellytrailers2_hu_c1da6a3e4b79ac65.webp 480w, /2026/11/10/jellyfin-trailers-for-movies-and-tv-shows-in-my-samsung-tv/jellytrailers2_hu_2cf05379a26dc017.webp 800w, /2026/11/10/jellyfin-trailers-for-movies-and-tv-shows-in-my-samsung-tv/jellytrailers2_hu_9832f17b3784d6f8.webp 1200w, /2026/11/10/jellyfin-trailers-for-movies-and-tv-shows-in-my-samsung-tv/jellytrailers2_hu_7592b24d14e81525.webp 1600w" width="1835">
</p>
<p>That&rsquo;s it !
-Evaggelos</p>
]]></content:encoded></item></channel></rss>