Jump to content
FunTimeBliss ::
Sign in to follow this  

Podcast and Encoding guide

Recommended Posts

Encoding Guide.
Overview on encoding video, stripping audio and preparing to submit a podcast.

Prerequisites: Use whatever OS you like!  I have encoded using the same utilities on Linux, but in this case I'm using Windows.  Mac support should be comparable as well.

  • mplayer
  • ffmpeg
  • your favorite text editor
  • some patience while files encode
  • A means to download source stream files. I am using Twitch Leecher in our case.

Since I am talking about Twitch being our source file, I use Twitch Leecher to grab the raw .mp4 file from Twitch.tv servers.  For point of reference your 720p video if it is 2 hours, it will be approximately 2.2 GB!  Shit, that's a pretty big file.  Your size to time ratio may vary but that puts into perspective the next step.  Encoding to .avi files.

Before we start, make sure you grabbed mplayer and ffmpeg.  For the Windows heads, let's make this easy and pick a folder for encoding files.  Let's say


You can set paths and stuf for mencoder and ffmpeg, but let's be lazy and drop those extracted files into D:\encodes.

As you may guess, we will also copy the raw .mp4 file we want to encode into the encodes folder too.

Next step: let's prepare the encode scripts.  Considering you might be doing this for more than one episode, let's just gear up to batch this process out for multiple files and to make your task easier, for each new episode.

Pause for giving an overview of our process:

  • Download the raw file
  • Encode it with Xvid to trim some of the file size down
  • Make an MP3 to strip the audio
  • Run a maintenance task to make sure the timing index (You'll see why below)
  • Upload your files somewhere for people to get them
  • (Optional) Make an XML RSS Feed for your Podcast submissions

Sample Windows Batch file to make an .Avi:

@echo off
echo Cooking it up
mencoder "041_AndrewMorris_GreyNoise_io.mp4" -ovc xvid -xvidencopts bitrate=1800 -o "041_AndrewMorris_GreyNoise_io.avi" -oac mp3lame -lameopts abr:br=192

The 1st .mp4 is your source, I'm setting the bitrate for video to 1800 kbs, -o is outputting the encoded Xvid .avi and the the audio track is being encoded at 192 kbs bitrate for the same .avi output file.

Neat.  So now that we have a newly encoded .avi file.  Be a good encoder and test it!  Granted if one works, you should be golden for your other encodes.  Remember, that's why we are scripting it too.  Nice way to save some sanity while gaining consistency.

This will not be an instantaneous process.  I want to say my average FPS encoding is about 70 to 90 FPS when encoding the video.  So be prepared for that.

Next up: Let's cook up some tasty MP3s.

In this batch script, we are going to extract the audio from the raw .mp4, but label it as fixTimings.mp3.  Try to just run that encoded file and you will see the timing for the track is all broken and randomly changing.  that may have been fixed in a later version of mencoder, but I call ffmpeg to fix it.

@echo off
echo Cooking it up
mencoder "041_AndrewMorris_GreyNoise_io.mp4" -of rawaudio -oac mp3lame -lameopts abr:br=192 -ovc copy -o "041_AndrewMorris_GreyNoise_iofixTimings.mp3"
echo Sync Audio
ffmpeg -i "041_AndrewMorris_GreyNoise_iofixTimings.mp3" -acodec copy "041_AndrewMorris_GreyNoise_io.mp3"

As you can see in the ffmpeg call, I use the source file with bad timings and make a corrected .mp3 with the proper time tables.
Luckily, encoding just audio is crazy faster than doing video and audio.  On an Intel i7-7700k setup I do about 550 FPS in respect to speeds.

As I mentioned previously about the videos TEST YOUR OUTPUT FILES!  Once you have the first few good, you should have no shock or issues processing later files.

Getting into writing an RSS feed in XML:

Let me stop here for now, as the next steps would be uploading your encoded files, writing a RSS feed in XML then submitting that to various podcast services (iTunes, Spotify, Google Podcasts).  You can always view source of your favorite podcast (Duh, it should be ThugCrowd) and edit to your whim.

While most web browsers do not display RSS feeds in a nice format anymore besides OG Firefox engine (IE: PaleMoon web browser), you will see the XML displayed that is key to being processed by the podcast services.  None of the podcast services host your content, they basically point to your RSS XML feed and the file paths you specify for each episode.  So you will want formidably reliable a host.

As I mentioned, there are some specific tags for iTunes you should specify to make sure your podcast gets listed.  Out of respect for your listeners, be sure to add the date of episode, file size and track length.  It should also help you get listed since you gave good info out of the gate, before submission.

Then when you have a new episode, just add a new Item block with the relevant criteria and you have updates or all your subscribers to know there is a new episode!  Ok that is the end of this guide for now.

Share this post

Link to post

Been a bit, let's cook this up cleaner.

ffmpeg -i "thugcrowd_s2e4_origAud.mp4" -vn -acodec copy "thugcrowd_s2e4_origAud.aac"

Shorthand based off https://gist.github.com/protrolium/e0dbd4bb0f1a396fcb55

extract the audio from source file as single audio stream, without video. 

Share this post

Link to post
Sign in to follow this  
  • Create New...