<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Pratham ghosalkar]]></title><description><![CDATA[Technical logbook of a .NET Core developer focusing on ASP.NET Core ,C# . Shares solutions, optimization tips, and clean code practices from real-world enterpri]]></description><link>https://prathamghosalkar.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Sat, 03 Oct 2026 17:17:45 GMT</lastBuildDate><atom:link href="https://prathamghosalkar.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[How to Merge Audio Files in .NET Core with FFmpeg by Pratham Ghosalkar]]></title><description><![CDATA[🎵 Why I Built an Audio Mixer
I’m a .NET developer, and my boss gave me a cool task: let users pick audio files (like call recordings), merge them into one MP3, and download it. Easy, right? Not quite! 😅 I needed to:

Let users select audio files wi...]]></description><link>https://prathamghosalkar.hashnode.dev/how-to-merge-audio-files-in-net-core-with-ffmpeg-by-pratham-ghosalkar</link><guid isPermaLink="true">https://prathamghosalkar.hashnode.dev/how-to-merge-audio-files-in-net-core-with-ffmpeg-by-pratham-ghosalkar</guid><category><![CDATA[FFmpeg]]></category><category><![CDATA[audiomerge]]></category><category><![CDATA[asp.net core]]></category><dc:creator><![CDATA[Pratham Ghosalkar]]></dc:creator><pubDate>Fri, 02 May 2025 16:01:36 GMT</pubDate><content:encoded><![CDATA[<h2 id="heading-why-i-built-an-audio-mixer">🎵 Why I Built an Audio Mixer</h2>
<p>I’m a .NET developer, and my boss gave me a cool task: let users pick audio files (like call recordings), merge them into one MP3, and download it. Easy, right? Not quite! 😅 I needed to:</p>
<ul>
<li><p>Let users select audio files with checkboxes.</p>
</li>
<li><p>Send the files to the server.</p>
</li>
<li><p>Use FFmpeg to combine them.</p>
</li>
<li><p>Provide a downloadable MP3.</p>
</li>
</ul>
<p>It was a fun challenge with some sneaky problems. Here’s my simple guide to make it work, including a big issue I fixed with mixed audio formats.</p>
<hr />
<h2 id="heading-how-i-did-it">🛠️ How I Did It</h2>
<h3 id="heading-step-1-get-ffmpeg">🎯 Step 1: Get FFmpeg</h3>
<p>FFmpeg is the tool that merges audio. I downloaded and set it up (check my if you need help)</p>
<p>🔗 <a target="_blank" href="https://hashnode.com/post/cm9pr7ffq000009le04pi6wvd">How to Download FFMPEG</a></p>
<p>To make sure FFmpeg is included when building or publishing, add this to your .csproj file:</p>
<pre><code class="lang-csharp">&lt;ItemGroup&gt;
    &lt;None Include=<span class="hljs-string">"FFMPEG\**\*"</span>&gt;
        &lt;CopyToOutputDirectory&gt;PreserveNewest&lt;/CopyToOutputDirectory&gt;
        &lt;CopyToPublishDirectory&gt;PreserveNewest&lt;/CopyToPublishDirectory&gt;
    &lt;/None&gt;
&lt;/ItemGroup&gt;
</code></pre>
<h3 id="heading-step-2-where-to-put-ffmpeg">📁 Step 2: Where to Put FFmpeg</h3>
<p>I first put FFmpeg in the bin folder . Bad move. When I published the app, bin got wiped, and FFmpeg disappeared. 😞</p>
<p><strong>Fix</strong>: I moved FFmpeg to the project root:</p>
<pre><code class="lang-bash">MyApp
│
├── Controllers
├── Views
├── wwwroot
├── FFMPEG
│   └── bin 
          └── ffmpeg.exe
</code></pre>
<p>Then I coded it to find FFmpeg:</p>
<pre><code class="lang-csharp"><span class="hljs-keyword">string</span> ffmpegPath = Path.Combine(AppContext.BaseDirectory, <span class="hljs-string">"FFMPEG"</span>, <span class="hljs-string">"bin"</span>, <span class="hljs-string">"ffmpeg.exe"</span>);
</code></pre>
<p>Now FFmpeg sticks around after publishing. Awesome! 🎉</p>
<hr />
<h2 id="heading-backend-merging-the-audio">💻 Backend: Merging the Audio</h2>
<p>Here’s the updated code to merge audio files, including a fix for a tricky issue with mixed formats:</p>
<pre><code class="lang-csharp"><span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">async</span> Task&lt;<span class="hljs-keyword">byte</span>[]&gt; MergeAudioFilesAsync(<span class="hljs-keyword">string</span>[] inputPaths)
        {
            <span class="hljs-keyword">string</span> tempDir = <span class="hljs-literal">null</span>;
            <span class="hljs-keyword">try</span>
            {
                <span class="hljs-keyword">var</span> existingFiles = inputPaths.Where(System.IO.File.Exists).ToList();

                <span class="hljs-keyword">if</span> (existingFiles.Count &lt; <span class="hljs-number">2</span>)
                    <span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> ArgumentException(<span class="hljs-string">"At least two valid files are required to merge."</span>);

                <span class="hljs-keyword">string</span> projectRoot = AppDomain.CurrentDomain.BaseDirectory;
                tempDir = Path.Combine(projectRoot, <span class="hljs-string">"MergedAudios"</span>, Guid.NewGuid().ToString());
                Directory.CreateDirectory(tempDir);

                <span class="hljs-keyword">string</span> ffmpegPath = Path.Combine(AppContext.BaseDirectory, <span class="hljs-string">"FFMPEG"</span>, <span class="hljs-string">"bin"</span>, <span class="hljs-string">"ffmpeg.exe"</span>);

                <span class="hljs-comment">// Step 1: Transcode all to WAV (lossless, accurate)</span>
                List&lt;<span class="hljs-keyword">string</span>&gt; wavPaths = <span class="hljs-keyword">new</span> List&lt;<span class="hljs-keyword">string</span>&gt;();
                <span class="hljs-keyword">for</span> (<span class="hljs-keyword">int</span> i = <span class="hljs-number">0</span>; i &lt; existingFiles.Count; i++)
                {
                    <span class="hljs-keyword">string</span> inputFile = existingFiles[i];
                    <span class="hljs-keyword">string</span> outputWav = Path.Combine(tempDir, <span class="hljs-string">$"audio_<span class="hljs-subst">{i}</span>.wav"</span>);

                    <span class="hljs-keyword">var</span> psi = <span class="hljs-keyword">new</span> ProcessStartInfo
                    {
                        FileName = ffmpegPath,
                        Arguments = <span class="hljs-string">$"-y -i \"<span class="hljs-subst">{inputFile}</span>\" -ac 2 -ar 44100 \"<span class="hljs-subst">{outputWav}</span>\""</span>,
                        RedirectStandardError = <span class="hljs-literal">true</span>,
                        RedirectStandardOutput = <span class="hljs-literal">true</span>,
                        UseShellExecute = <span class="hljs-literal">false</span>,
                        CreateNoWindow = <span class="hljs-literal">true</span>
                    };

                    <span class="hljs-keyword">using</span> (<span class="hljs-keyword">var</span> process = <span class="hljs-keyword">new</span> Process { StartInfo = psi })
                    {
                        process.Start();
                        <span class="hljs-keyword">string</span> errorOutput = <span class="hljs-keyword">await</span> process.StandardError.ReadToEndAsync();
                        <span class="hljs-keyword">await</span> process.WaitForExitAsync();

                        <span class="hljs-keyword">if</span> (process.ExitCode != <span class="hljs-number">0</span>)
                            <span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> Exception(<span class="hljs-string">$"FFmpeg transcoding failed for <span class="hljs-subst">{inputFile}</span>: <span class="hljs-subst">{errorOutput}</span>"</span>);
                    }

                    wavPaths.Add(outputWav);
                }

                <span class="hljs-comment">// Step 2: Create concat list for WAV files</span>
                <span class="hljs-keyword">string</span> listPath = Path.Combine(tempDir, <span class="hljs-string">"list.txt"</span>);
                <span class="hljs-keyword">await</span> File.WriteAllLinesAsync(listPath, wavPaths.Select(p =&gt; <span class="hljs-string">$"file '<span class="hljs-subst">{p.Replace(<span class="hljs-string">"\\"</span>, <span class="hljs-string">"/"</span>)}</span>'"</span>));

                <span class="hljs-comment">// Step 3: Merge WAVs into one big WAV</span>
                <span class="hljs-keyword">string</span> combinedWav = Path.Combine(tempDir, <span class="hljs-string">"combined.wav"</span>);
                <span class="hljs-keyword">var</span> mergeWavPsi = <span class="hljs-keyword">new</span> ProcessStartInfo
                {
                    FileName = ffmpegPath,
                    Arguments = <span class="hljs-string">$"-f concat -safe 0 -i \"<span class="hljs-subst">{listPath}</span>\" -c copy \"<span class="hljs-subst">{combinedWav}</span>\""</span>,
                    RedirectStandardError = <span class="hljs-literal">true</span>,
                    RedirectStandardOutput = <span class="hljs-literal">true</span>,
                    UseShellExecute = <span class="hljs-literal">false</span>,
                    CreateNoWindow = <span class="hljs-literal">true</span>
                };

                <span class="hljs-keyword">using</span> (<span class="hljs-keyword">var</span> process = <span class="hljs-keyword">new</span> Process { StartInfo = mergeWavPsi })
                {
                    process.Start();
                    <span class="hljs-keyword">string</span> errorOutput = <span class="hljs-keyword">await</span> process.StandardError.ReadToEndAsync();
                    <span class="hljs-keyword">await</span> process.WaitForExitAsync();

                    <span class="hljs-keyword">if</span> (process.ExitCode != <span class="hljs-number">0</span>)
                        <span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> Exception(<span class="hljs-string">$"FFmpeg WAV merge failed: <span class="hljs-subst">{errorOutput}</span>"</span>);
                }

                <span class="hljs-comment">// Step 4: Convert merged WAV to final MP3</span>
                <span class="hljs-keyword">string</span> finalMp3 = Path.Combine(tempDir, <span class="hljs-string">"merged.mp3"</span>);
                <span class="hljs-keyword">var</span> mp3ConvertPsi = <span class="hljs-keyword">new</span> ProcessStartInfo
                {
                    FileName = ffmpegPath,
                    Arguments = <span class="hljs-string">$"-y -i \"<span class="hljs-subst">{combinedWav}</span>\" -acodec libmp3lame -b:a 192k \"<span class="hljs-subst">{finalMp3}</span>\""</span>,
                    RedirectStandardError = <span class="hljs-literal">true</span>,
                    RedirectStandardOutput = <span class="hljs-literal">true</span>,
                    UseShellExecute = <span class="hljs-literal">false</span>,
                    CreateNoWindow = <span class="hljs-literal">true</span>
                };

                <span class="hljs-keyword">using</span> (<span class="hljs-keyword">var</span> process = <span class="hljs-keyword">new</span> Process { StartInfo = mp3ConvertPsi })
                {
                    process.Start();
                    <span class="hljs-keyword">string</span> errorOutput = <span class="hljs-keyword">await</span> process.StandardError.ReadToEndAsync();
                    <span class="hljs-keyword">await</span> process.WaitForExitAsync();

                    <span class="hljs-keyword">if</span> (process.ExitCode != <span class="hljs-number">0</span>)
                        <span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> Exception(<span class="hljs-string">$"FFmpeg MP3 export failed: <span class="hljs-subst">{errorOutput}</span>"</span>);
                }
                <span class="hljs-comment">// Step 5: Return final merged audio bytes</span>
                <span class="hljs-keyword">return</span> <span class="hljs-keyword">await</span> File.ReadAllBytesAsync(finalMp3);
            }
            <span class="hljs-keyword">catch</span> (Exception ex)
            {
                <span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> Exception(<span class="hljs-string">$"Merging audio files failed: <span class="hljs-subst">{ex.Message}</span>"</span>, ex);
            }
            <span class="hljs-keyword">finally</span>
            {
              <span class="hljs-comment">//clean the directory</span>
            }
        }
</code></pre>
<hr />
<h2 id="heading-frontend-fixing-problems">🎨 Frontend: Fixing Problems</h2>
<h3 id="heading-blank-page-issue">😩 Blank Page Issue</h3>
<p>My JavaScript had this:</p>
<pre><code class="lang-javascript">target: <span class="hljs-string">'hiddenDownloader'</span>
</code></pre>
<p>It opened a blank page after download. Not cool. <strong>Fix</strong>: Removed target:</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">var</span> $form = $(<span class="hljs-string">'&lt;form&gt;'</span>, { <span class="hljs-attr">method</span>: <span class="hljs-string">'POST'</span>, <span class="hljs-attr">action</span>: appurl + <span class="hljs-string">'/DataView/AudioMerging'</span> });
</code></pre>
<p>Now downloads work on the same page. Sweet! 😎</p>
<h3 id="heading-making-it-user-friendly">😄 Making It User-Friendly</h3>
<ul>
<li><p>Added a loading spinner to show progress.</p>
</li>
<li><p>Show an error if users pick too few files.</p>
</li>
<li><p>Named the MP3 with the date, like MergedAudio_2025-04-20_<a target="_blank" href="http://123456.mp">123456.mp</a>3.</p>
</li>
</ul>
<hr />
<h2 id="heading-fixing-mixed-audio-types">🎧 Fixing Mixed Audio Types</h2>
<h3 id="heading-problem-duration-loss-with-mixed-formats">😣 Problem: Duration Loss with Mixed Formats</h3>
<p>Users uploaded MP3, WAV, and G.729 (a VoIP format) files. When I merged them, some audio got cut off, especially with MP3s. The result was incomplete or glitchy recordings. Not good! 😬</p>
<p><strong>Why?</strong> MP3s use lossy compression, which messes with timing when merged with other formats like WAV or G.729. FFmpeg struggled to sync them properly.</p>
<h3 id="heading-fix-convert-to-wav-first">😊 Fix: Convert to WAV First</h3>
<p>To fix this, I changed the process:</p>
<ol>
<li><p>Convert all files to WAV (a lossless format) first.</p>
</li>
<li><p>Merge the WAV files.</p>
</li>
<li><p>Convert the final result to MP3.</p>
</li>
</ol>
<p>This solved the timing issues and kept all audio intact. No more missing chunks! 🎵 The updated code above shows how I did it.</p>
<hr />
<h2 id="heading-what-i-learned">🏆 What I Learned</h2>
<ul>
<li><p>bin folder wipes files when publishing. Don’t use it!</p>
</li>
<li><p>JavaScript forms can be tricky but are fixable.</p>
</li>
<li><p>FFmpeg commands are like magic—learn them well.</p>
</li>
<li><p>Converting to WAV before merging saves the day for mixed formats.</p>
</li>
<li><p>Logging helps track what’s happening.</p>
</li>
</ul>
<hr />
<h2 id="heading-why-its-awesome">Why It’s Awesome</h2>
<p>This feature is live, and my team loves it. They merge audio files easily, even with weird formats like G.729. I also got better at:</p>
<ul>
<li><p>Audio processing</p>
</li>
<li><p>Mixing .NET and JavaScript</p>
</li>
<li><p>Handling files in production</p>
</li>
</ul>
<hr />
<h2 id="heading-need-help">🙌 Need Help?</h2>
<p>Stuck? Drop a comment, and let’s sort it out over virtual snacks. 🍪💻 Hope this guide helps you merge audio like a pro!</p>
<p><strong>What’s your toughest coding challenge? Share it!</strong></p>
]]></content:encoded></item><item><title><![CDATA[How to Download and Set Up FFmpeg on Windows (64-bit) 🎥]]></title><description><![CDATA[Hey there, fellow tech enthusiast! If you’re diving into video or audio processing, whether it’s for a cool .NET project, a Python script, or just some command-line wizardry, FFmpeg is your best friend. But getting it set up on Windows with all the r...]]></description><link>https://prathamghosalkar.hashnode.dev/pratham-ghosalkars-guide-how-to-download-and-set-up-ffmpeg-on-windows-64-bit</link><guid isPermaLink="true">https://prathamghosalkar.hashnode.dev/pratham-ghosalkars-guide-how-to-download-and-set-up-ffmpeg-on-windows-64-bit</guid><category><![CDATA[audiomerge]]></category><category><![CDATA[FFmpeg]]></category><category><![CDATA[C#]]></category><category><![CDATA[audio]]></category><category><![CDATA[#MediaConvert ]]></category><category><![CDATA[dotnetcore]]></category><dc:creator><![CDATA[Pratham Ghosalkar]]></dc:creator><pubDate>Sun, 20 Apr 2025 14:40:01 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1744803848100/6f52c31a-2e56-4deb-b07e-736651cedb11.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hey there, fellow tech enthusiast! If you’re diving into video or audio processing, whether it’s for a cool .NET project, a Python script, or just some command-line wizardry, FFmpeg is your best friend. But getting it set up on Windows with all the right .dll files can feel like a maze. Don’t worry—I’ve got you covered with this super-friendly, step-by-step guide to downloading and installing FFmpeg (64-bit) with full DLL support. Let’s make this as painless as possible! 🚀</p>
<hr />
<h2 id="heading-whats-ffmpeg-anyway">What’s FFmpeg, Anyway? 🤔</h2>
<p>FFmpeg is like a Swiss Army knife for multimedia. It’s an open-source tool that lets you record, convert, and stream audio and video. Whether you’re compressing videos, merging audio files, or inspecting media metadata, FFmpeg is the go-to for developers and creators alike.</p>
<p>Here’s the catch: not all FFmpeg downloads are the same. If you’re building apps (like in C#, Python, or Java), you’ll need the <em>shared full build</em> to get those precious .dll files (like avcodec-61.dll or avformat-61.dll). That’s what we’re setting up today!</p>
<hr />
<h2 id="heading-what-youll-learn-in-this-guide">What You’ll Learn in This Guide</h2>
<ul>
<li><p>Where to grab the perfect FFmpeg build for 64-bit Windows</p>
</li>
<li><p>The difference between static and shared builds (and why it matters)</p>
</li>
<li><p>How to extract the files and make sure you’ve got all the .dlls</p>
</li>
<li><p>How to add FFmpeg to your system PATH (so you can use it anywhere)</p>
</li>
<li><p>A quick way to verify everything’s working</p>
</li>
</ul>
<p>Let’s roll! 🎬</p>
<hr />
<h2 id="heading-step-1-pick-the-right-ffmpeg-build">Step 1: Pick the Right FFmpeg Build 🛠️</h2>
<p>FFmpeg comes in a few flavors, and choosing the right one is key. Here’s a quick breakdown:</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td><strong>Build Type</strong></td><td><strong>Includes DLLs?</strong></td><td><strong>Best For</strong></td></tr>
</thead>
<tbody>
<tr>
<td>Static</td><td>❌ No</td><td>Simple command-line tasks</td></tr>
<tr>
<td>Shared</td><td>✅ Yes</td><td>App development (C#, Python, etc.)</td></tr>
<tr>
<td>Essentials</td><td>⚠️ Some</td><td>Lightweight, but may miss features</td></tr>
<tr>
<td>Full</td><td>✅ Everything</td><td>All codecs, filters, and goodies</td></tr>
</tbody>
</table>
</div><p><strong>What we want:</strong> The <strong>Shared Full Build</strong> (64-bit). This gives us ffmpeg.exe for command-line magic <em>and</em> all the .dll files for coding projects.</p>
<hr />
<h2 id="heading-step-2-download-ffmpeg">Step 2: Download FFmpeg</h2>
<p>Head to a trusted source for FFmpeg builds. I recommend the builds from Gyan, which are linked from the official FFmpeg website.</p>
<p>🔗<a target="_blank" href="https://www.gyan.dev/ffmpeg/builds/">Download</a> (<a target="_blank" href="https://www.gyan.dev/ffmpeg/builds/">https://www.gyan.dev/ffmpeg/builds/</a>)<strong>:</strong> Gy<a target="_blank" href="https://www.gyan.dev/ffmpeg/builds/">an’s FFmpeg Builds</a></p>
<ol>
<li><p><a target="_blank" href="https://www.gyan.dev/ffmpeg/builds/">Scroll to the</a> <strong>Shared builds</strong> section.</p>
</li>
<li><p>Look for <strong>ffmpeg-shared-full.7z (64-bit)</strong> and click to download.</p>
</li>
</ol>
<p>⚠️ <strong>Heads-up:</strong> The file is a .7z archive, so you’ll need 7-Zip to extract it. Don’t have it? No problem—let’s get that next.</p>
<hr />
<h2 id="heading-step-3-get-7-zip-if-you-dont-already-have-it">Step 3: Get 7-Zip (If You Don’t Already Have It)</h2>
<p>7-Zip is a free tool for unzipping .7z files (and tons of other formats). If you don’t have it installed, here’s how to get it:</p>
<p>🔗 <a target="_blank" href="https://www.7-zip.org/"><strong>Download 7-Zip</strong></a> <strong>(</strong><a target="_blank" href="https://www.7-zip.org/">https://www.7-zip.org/</a><strong>) :</strong> Official 7-Zip Website</p>
<ol>
<li><p>Grab the <strong>64-bit Windows</strong> version.</p>
</li>
<li><p>Run the installer and follow the prompts. It’s quick and easy!</p>
</li>
</ol>
<hr />
<h2 id="heading-step-4-extract-your-ffmpeg-files">Step 4: Extract Your FFmpeg Files</h2>
<p>Now that you’ve got 7-Zip, let’s unpack FFmpeg:</p>
<ol>
<li><p>Find your downloaded ffmpeg-shared-full.7z file.</p>
</li>
<li><p>Right-click it, select <strong>7-Zip</strong> &gt; <strong>Extract to "ffmpeg-shared-full"</strong>.</p>
</li>
<li><p>You’ll get a shiny new folder called ffmpeg-shared-full with this structure:</p>
</li>
</ol>
<pre><code class="lang-plaintext">ffmpeg-shared-full\
├── bin\
│   ├── ffmpeg.exe
│   ├── ffprobe.exe
│   ├── avcodec-61.dll
│   ├── avdevice-61.dll
│   ├── avfilter-10.dll
│   ├── avformat-61.dll
│   ├── avutil-59.dll
│   └── more .dlls
├── lib\
├── include\
├── presets\
└── doc\
</code></pre>
<p>🎉 <strong>Congrats!</strong> You’ve got all the executables (ffmpeg.exe, ffprobe.exe) and the .dll files you need for coding or CLI tasks.</p>
<hr />
<h2 id="heading-step-5-optional-add-ffmpeg-to-your-system-path">Step 5: (Optional) Add FFmpeg to Your System PATH</h2>
<p>Want to run ffmpeg from any Command Prompt, anywhere on your computer? Let’s add it to your system PATH. This step is optional but <em>highly</em> recommended for convenience.</p>
<ol>
<li><p><strong>Copy the path to the</strong> bin <strong>folder</strong>:</p>
<ul>
<li><p>Example: C:\ffmpeg-shared-full\bin</p>
</li>
<li><p>If you extracted FFmpeg somewhere else, adjust the path accordingly.</p>
</li>
</ul>
</li>
<li><p><strong>Add it to PATH</strong>:</p>
<ul>
<li><p>Press <strong>Win + S</strong>, type <strong>Environment Variables</strong>, and select <strong>Edit the system environment variables</strong>.</p>
</li>
<li><p>In the window that pops up, click <strong>Environment Variables</strong>.</p>
</li>
<li><p>Under <strong>System Variables</strong>, find <strong>Path</strong> and click <strong>Edit</strong>.</p>
</li>
<li><p>Click <strong>New</strong>, paste your bin folder path (e.g., C:\ffmpeg-shared-full\bin), and hit <strong>OK</strong> all the way out.</p>
</li>
</ul>
</li>
</ol>
<hr />
<h2 id="heading-step-6-test-your-setup">Step 6: Test Your Setup</h2>
<p>Let’s make sure everything’s working like a charm:</p>
<ol>
<li><p>Open a <strong>Command Prompt</strong> (press <strong>Win + R</strong>, type cmd, and hit Enter).</p>
</li>
<li><p>Type this command and press Enter:</p>
</li>
</ol>
<pre><code class="lang-bash">ffmpeg -version
</code></pre>
<p>If all went well, you’ll see FFmpeg’s version info and some configuration details. Woohoo! 🎉</p>
<p>For extra confirmation, try:</p>
<pre><code class="lang-bash"><span class="hljs-built_in">where</span> ffmpeg
</code></pre>
<p>This should show the full path to ffmpeg.exe (e.g., C:\ffmpeg-shared-full\bin\ffmpeg.exe).</p>
<hr />
<h2 id="heading-why-this-setup-rocks-for-developers">Why This Setup Rocks for Developers</h2>
<p>If you’re coding, this shared build is a lifesaver. Those .dll files (like avcodec-61.dll and avformat-61.dll) are critical for:</p>
<ul>
<li><p><strong>C#/.NET</strong>: Libraries like Xabe.FFmpeg or FFmpeg.AutoGen need these .dlls to work.</p>
</li>
<li><p><strong>Python</strong>: Packages like ffmpeg-python or scripts using subprocess rely on them.</p>
</li>
<li><p><strong>Java</strong>: JNA wrappers or command-line calls will fail without them.</p>
</li>
</ul>
<p>Without the right .dlls, you might hit cryptic errors or crashes. This setup ensures you’re ready to rock any FFmpeg-based project.</p>
<hr />
<h2 id="heading-bonus-whats-next">Bonus: What’s Next?</h2>
<p>You’re now equipped with a fully loaded FFmpeg setup! Here are some fun things you can do:</p>
<ul>
<li><p><strong>CLI Magic</strong>: Try commands like ffmpeg -i input.mp4 output.webm to convert videos.</p>
</li>
<li><p><strong>Inspect Media</strong>: Use ffprobe -i file.mp4 to check metadata.</p>
</li>
<li><p><strong>Code Away</strong>: Integrate FFmpeg into your app for automated video processing.</p>
</li>
</ul>
<p>Need a batch script to automate this setup? Or want tips for adding FFmpeg to a CI/CD pipeline? Drop a comment, and I’ll hook you up! 😎</p>
<hr />
<h2 id="heading-final-thoughts">Final Thoughts 🥳</h2>
<p>Setting up FFmpeg doesn’t have to be a headache. With this guide, you’ve got a production-ready installation that’s perfect for both command-line tasks and hardcore development. No more missing .dll errors or weird build issues!</p>
<p>If this helped you out, share it with a friend who’s still Googling “avcodec.dll not found” at 2 a.m. 😅 Got questions or cool FFmpeg tricks? Let’s chat in the comments!</p>
<p>Happy coding, and may your media processing be smooth and error-free! 🎧🎥</p>
]]></content:encoded></item><item><title><![CDATA[How I Fixed Morning 404 Errors in My ASP.NET Core App Without Writing a Single Line of Code]]></title><description><![CDATA[Yo, if you’ve ever hosted an ASP.NET Core app on IIS and got slapped with random 404s first thing in the morning, I feel you. I just went through this nonsense and figured it out without touching a single line of code. Straight-up IIS config fix. Let...]]></description><link>https://prathamghosalkar.hashnode.dev/how-i-fixed-morning-404-errors-in-my-aspnet-core-app-without-writing-a-single-line-of-code</link><guid isPermaLink="true">https://prathamghosalkar.hashnode.dev/how-i-fixed-morning-404-errors-in-my-aspnet-core-app-without-writing-a-single-line-of-code</guid><category><![CDATA[#aspnetcore  #dotnet  #iis  #iisconfiguration #webdevelopment  #devops]]></category><category><![CDATA[Web Development]]></category><category><![CDATA[asp.net core]]></category><category><![CDATA[IIS webserver on windows]]></category><category><![CDATA[webhosting]]></category><category><![CDATA[dotnetcore]]></category><dc:creator><![CDATA[Pratham Ghosalkar]]></dc:creator><pubDate>Fri, 11 Apr 2025 06:05:31 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1744350249196/571ac0c8-aec1-41c8-b3fd-97c2fea47152.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Yo, if you’ve ever hosted an <a target="_blank" href="http://ASP.NET">ASP.NET</a> Core app on IIS and got slapped with random 404s first thing in the morning, I feel you. I just went through this nonsense and figured it out without touching a single line of code. Straight-up IIS config fix. Let me walk you through it.</p>
<h3 id="heading-the-headache"><strong>The Headache</strong></h3>
<p>Every morning, I’d try hitting this URL: <a target="_blank" href="http://10.1.2.09:7004/CCWServer/Accounts/Login">http://10.1.2.09:7004/Ecom/Accounts/Login</a></p>
<p>And boom: 404 - File or directory not found. Like, what? But then I’d go to the root: <a target="_blank" href="http://10.1.2.09:7004/CCWServer">http://10.1.2.09:7004/</a>Ecom</p>
<p>And the app would load fine. After that, the /Accounts/Login link would magically work again. Maddening, right? It only happened first thing in the day, when nobody had touched the app overnight. Total cold-start BS.</p>
<p>What’s Actually Happening?</p>
<p>Turns out, IIS is lazy. If your app sits idle too long, IIS unloads it to save resources. So when that first morning request comes in—especially to a deep link like /Accounts/Login—the app’s not fully awake yet. You get a 404, a delay, or just a bad vibe for whoever’s trying to use it. Lame user experience.</p>
<h3 id="heading-how-i-fixed-it-no-code-i-swear"><strong>How I Fixed It (No Code, I Swear)</strong></h3>
<p>I didn’t touch a single line of C# code or mess with the app logic. The fix was all in <strong>how IIS handles your app when no one’s using it</strong>.</p>
<p>Here’s what I did:</p>
<hr />
<h3 id="heading-step-1-open-iis-manager"><strong>Step 1: Open IIS Manager</strong></h3>
<p>This is the tool Windows uses to host web apps.<br />Just hit the Start menu → type <code>IIS</code> → open <strong>"Internet Information Services (IIS) Manager"</strong>.</p>
<hr />
<h3 id="heading-step-2-find-your-website"><strong>Step 2: Find Your Website</strong></h3>
<p>In the left panel, you’ll see a tree view.<br />Open the <em>Sites</em> node → click on your website (for me, it was something like <code>CCWServer</code>).</p>
<hr />
<h3 id="heading-step-3-go-to-advanced-settings"><strong>Step 3: Go to Advanced Settings</strong></h3>
<p>Right-click your website → click <strong>Manage Website → Advanced Settings</strong>.<br />This opens a window with a lot of options (don’t worry, we only need one).</p>
<hr />
<h3 id="heading-step-4-turn-on-preload-enabled"><strong>Step 4: Turn On "Preload Enabled"</strong></h3>
<p>Scroll down in the settings until you find <strong>Preload Enabled</strong>.<br />Set that to <code>True</code>.</p>
<hr />
<h3 id="heading-what-this-actually-does"><strong>What This Actually Does</strong></h3>
<p>Normally, IIS only "wakes up" your app when the <em>first</em> user opens it — kind of like putting it to sleep when no one's using it to save memory.</p>
<p>That causes a delay... or even 404s on deep URLs (like <code>/Accounts/Login</code>) if the app isn’t ready.</p>
<p>By enabling <strong>Preload</strong>, you’re telling IIS:</p>
<blockquote>
<p>“Hey, load my app in the background as soon as the server starts — don’t wait for a user to hit the URL.”</p>
</blockquote>
<p>So your app is always ready to serve, no warm-up needed, and no weird morning errors.</p>
<p>No tweaks to Startup.cs, no fiddling with web.config, no messing with appsettings.json. Just a checkbox and done.</p>
<h2 id="heading-the-result">The Result</h2>
<ul>
<li><p>No more morning 404s</p>
</li>
<li><p>Application stays warm</p>
</li>
<li><p>Users hit deep URLs directly with no issues</p>
</li>
<li><p>No code changes, no app restarts, no hacky solutions</p>
</li>
</ul>
<hr />
<h2 id="heading-pro-tips">Pro Tips</h2>
<p>If you’re facing a similar issue:</p>
<ul>
<li><p>Use <strong>Application Pool &gt; Advanced Settings</strong> → Set <code>Start Mode = AlwaysRunning</code></p>
</li>
<li><p>Set <code>Idle Timeout = 0</code> to prevent sleeping</p>
</li>
<li><p>Enable <strong>Preload</strong> at the site level</p>
</li>
</ul>
<p>All this combined = blazing fast first load, always-on performance.</p>
<p>Real Talk</p>
<p>Sometimes you don’t need to sling code to fix annoying problems like this. A little IIS know-how can save you hours of pain. If you’ve run into weird deployment issues like this or found other slick fixes, drop a comment—I’m curious what else is out there. Let’s keep learning this stuff together.</p>
]]></content:encoded></item></channel></rss>