User:Gnyers/RecordFlashAudioOutput

Jump to: navigation, search

HOWTO capture the Flash audio output

Flash Player is one of the most widely used multimedia content delivery mechanism. Capturing the audio stream of it can be difficult depending on how badly the content provider wants to hide it. However, in the end, the audio needs go through the sound card in order to reach the speakers. This is the point where using this method one may extract it.

Disclaimer: You should respect the terms and conditions of the content provider.

Pre-requisites

Necessary packages:

  • pulseaudio-utils
  • lame or vorbis-tools
  • flash-player

Optional packages:

  • Your favorite browser, e.g.: MozillaFirefox, chromium, etc...

Steps

1. Create a virtual stream

For a clean recording without any "contamination" from other audio sources create a dedicated virtual stream
$ pactl load-module module-null-sink  sink_name=FlashPlugin

2. Find out the Sink index of the Flash audio output. Look for the 'plugin-container' binary

$ pacmd list-sink-inputs | egrep 'index:|sink:|application.process.binary'
  index: 0
    sink: 0 <alsa_output.pci-0000_00_1b.0.analog-stereo>
      application.process.binary = "plugin-container"
  index: 503
    sink: 0 <alsa_output.pci-0000_00_1b.0.analog-stereo>
      application.process.binary = "mplayer"
In this case: INDEX=0

3. Move the audio output of the Flash plug-in to "FlashPlugin", the dedicated stream.

pactl move-sink-input $INDEX FlashPlugin

4. Record the "FlashPlugin" sink

uncompressed wav:
 parec -d FlashPlugin.monitor --file-format flash-audio-output-capture.wav
with `oggenc`
 parec -d FlashPlugin.monitor |\
  oggenc --raw -b 192 \
   -l "Flash Recordings" \
   -a "Flash" \
   -d `date '+%Y'` \
   -t "Capture title" \
   -n 1 \
   -c "Adobe Flash audio output capture" \
   - -o recorded-flash-audio-output.ogg
with `lame`
 parec -d FlashPlugin.monitor |\
  lame -r -V 0 \
   --tl "Flash Recordings" \
   --ta "Flash" \
   --ty `date '+%Y'` \
   --tt "Capture title" \
   --tn 1 \
   --tc "Adobe Flash audio output capture" \
   - flash-audio-output-capture.mp3

Post processing

It may be useful/necessary to modify some aspects of the captured audio file. There are a many of tools with which one might:

  • add/edit/remove metadata: id3v2, kid3-cli, kid3-qt, easytag
  • break-up a large file into smaller files: sox, cutmp3, audacity
  • apply filters or effects: sox, ffmpeg
  • convert/transcode: ffmpeg