Skip to content

Instantly share code, notes, and snippets.

@justinribeiro
Last active October 8, 2018 01:57
Show Gist options
  • Save justinribeiro/9410c836e12fab633372 to your computer and use it in GitHub Desktop.
Save justinribeiro/9410c836e12fab633372 to your computer and use it in GitHub Desktop.
The Web Platform Podcast: Pipelines for publishing

Justin's Guide to faster episodes

The follwing is my working document as I create a pipeline for faster YouTube > LibSyn / iTunes distribution. This is not complete, but really cuts down on some time.

Prerequisites

I'm a commandline guy, I like UNIX tooling philosophy. Hence, my prereqs.

  1. youtube-dl
  2. ffmpeg
  3. mutagen

Pull the episode and convert to MP3

➜ youtube-dl --extract-audio --audio-format mp3 YOUTUBE_ID 

Example output:

~/Music
➜ youtube-dl --extract-audio --audio-format mp3 4sZn_dTnhv0      
[youtube] 4sZn_dTnhv0: Downloading webpage
[youtube] 4sZn_dTnhv0: Downloading video info webpage
[youtube] 4sZn_dTnhv0: Extracting video information
[youtube] 4sZn_dTnhv0: Downloading DASH manifest
[youtube] 4sZn_dTnhv0: Downloading DASH manifest
[download] Destination: 74 - FirefoxOS & JanOS-4sZn_dTnhv0.webm
[download] 100% of 45.62MiB in 00:04
[ffmpeg] Destination: 74 - FirefoxOS & JanOS-4sZn_dTnhv0.mp3
Deleting original file 74 - FirefoxOS & JanOS-4sZn_dTnhv0.webm (pass -k to keep)

Concat the opening and ending

Concating the intro can really cut down on work, because the intro can contain the base id3v2.4 frames and that flows to the final output.

➜ ffmpeg -i "concat:intro.mp3|episode-74_firefoxos-janos-tmp.mp3|exit.mp3" -c copy episode-74_firefoxos-janos.mp3

Example output:

➜ ffmpeg -i "concat:intro.mp3|episode-74_firefoxos-janos-tmp.mp3|exit.mp3" -c copy episode-74_firefoxos-janos.mp3
ffmpeg version 2.7.6-0ubuntu0.15.10.1 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.2.1 (Ubuntu 5.2.1-22ubuntu2) 20151010
  configuration: --prefix=/usr --extra-version=0ubuntu0.15.10.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --enable-shared --disable-stripping --enable-avresample --enable-avisynth --enable-frei0r --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-openal --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libxvid --enable-libzvbi --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-libssh --enable-libsoxr --enable-libx264 --enable-libopencv --enable-libx265
  libavutil      54. 27.100 / 54. 27.100
  libavcodec     56. 41.100 / 56. 41.100
  libavformat    56. 36.100 / 56. 36.100
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 16.101 /  5. 16.101
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.100 /  1.  2.100
  libpostproc    53.  3.100 / 53.  3.100
[mp3 @ 0x1d914a0] Skipping 0 bytes of junk at 101888.
[mp3 @ 0x1d914a0] Estimating duration from bitrate, this may be inaccurate
Input #0, mp3, from 'concat:intro.mp3|episode-74_firefoxos-janos-tmp.mp3|exit.mp3':
  Metadata:
    TALB            : The Web Platform Podcast
    TDES            : The Web Platform Podcast is a developer discussion that dives deep into ‘all things’ web. We discuss everything from developing for mobile to building HDTV software. From wearables & robotics to user experience & mentoring, we bring to our listeners e
    TCON            : Other
    TCOM            : The Web Platform Podcast
    TCOP            : The Web Platform Podcast 2016
    TDRC            : 2016
    TBPM            : 120
    TGID            : http://www.thewebplatformpodcast.com
  Duration: 02:31:01.56, start: 0.000000, bitrate: 128 kb/s
    Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p, 128 kb/s
    Stream #0:1: Video: png, rgb24(pc), 1400x1400, 90k tbr, 90k tbn, 90k tbc
    Metadata:
      comment         : Other
Output #0, mp3, to 'episode-74_firefoxos-janos.mp3':
  Metadata:
    TALB            : The Web Platform Podcast
    TDES            : The Web Platform Podcast is a developer discussion that dives deep into ‘all things’ web. We discuss everything from developing for mobile to building HDTV software. From wearables & robotics to user experience & mentoring, we bring to our listeners e
    TCON            : Other
    TCOM            : The Web Platform Podcast
    TCOP            : The Web Platform Podcast 2016
    TDRC            : 2016
    TBPM            : 120
    TGID            : http://www.thewebplatformpodcast.com
    TSSE            : Lavf56.36.100
    Stream #0:0: Video: png, rgb24, 1400x1400, q=2-31, 90k tbr, 90k tbn, 90k tbc
    Metadata:
      comment         : Other
    Stream #0:1: Audio: mp3, 44100 Hz, stereo, 128 kb/s
Stream mapping:
  Stream #0:1 -> #0:0 (copy)
  Stream #0:0 -> #0:1 (copy)
Press [q] to stop, [?] for help

Adding more id3v2.4 information

TODO Pipe text into --comment="DESCRIPTION":"COMMENT":"LANGUAGE"

Make life easier, clean all the tags from the merge:

➜ mid3v2 -D episode-file.mp3

Apply the base set:

➜ mid3v2 --TALB 'The Web Platform Podcast' --TCOM 'The Web Platform Podcast' --TCON 'Other' --TCOP 'The Web Platform Podcast 2016' --TDES 'The Web Platform Podcast is a developer discussion that dives deep into ‘all things’ web. We discuss everything from developing for mobile to building HDTV software. From wearables & robotics to user experience & mentoring, we bring to our listeners everything related to building products & services for The Web Platform of today, tomorrow, and beyond.' --TGID 'http://www.thewebplatformpodcast.com' --TYER '2016' episode-file.mp3

Apply specifics from episode:

➜ mid3v2 --song '76: The Elm Programming Language ' --artist 'Richard Feldman, Justin Ribeiro' --comment "Justin Ribeiro sits down with web developer and Elm pro Richard Feldman (@rtfeldman) to talk about Elm, a functional programming language that compiles to JavaScript." --WXXX=http://traffic.libsyn.com/thewebplatform/episode-76_elm_programming_language.mp3 episode-76_elm_programming_language.mp3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment