Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Rip Audio from SWF

  1. #1
    Join Date
    Nov 2006
    Location
    40.31996,-80.607213
    Beans
    Hidden!
    Distro
    Ubuntu

    Rip Audio from SWF

    Is there some possible way to rip the audio from a SWF? I have tried ffmpeg, but it told me that SWF is an unsupported format for ripping.

    Any ideas?
    "Security lies within the user of who runs the system. Think smart, live safe." - Dr Small
    Linux User #441960 | Wiki: DrSmall

  2. #2
    Join Date
    Mar 2008
    Location
    England
    Beans
    Hidden!
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Rip Audio from SWF

    For nearly any format to format conversion, I have found mencoder to be a decent candidate.

    I've not tried it with swf (though I have successfully with flv), but this page describes how to convert swf to avi, and with a bit of tweaking, we get this command line:

    mencoder file.swf -o file.wav -oa pcm -vo null -vc dummy

    And then once that's done, you can just use lame or whatever to encode the wav into whatever format you want.

  3. #3
    Join Date
    Nov 2006
    Location
    40.31996,-80.607213
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Rip Audio from SWF

    The above command wouldn't work, and kept telling me that -oa and -vo were not mencoder switches. So I removed them, and then mencoder gave this warning:
    Code:
    [swf @ 0x876cbe8]Compressed SWF format not supported
    LAVF_header: av_open_input_stream() failed
    libavformat file format detected.
    [swf @ 0x876cbe8]Compressed SWF format not supported
    LAVF_header: av_open_input_stream() failed
    ============ Sorry, this file format is not recognized/supported =============
    === If this file is an AVI, ASF or MPEG stream, please contact the author! ===
    Cannot open demuxer.
    So... apparently, swf is not supported by mencoder either. Know of any other methods? I been searching around and can't find any. I really didn't want to have to record the audio from the speakers, if I didn't have to, though.

    Dr Small
    "Security lies within the user of who runs the system. Think smart, live safe." - Dr Small
    Linux User #441960 | Wiki: DrSmall

  4. #4
    Join Date
    Sep 2006
    Beans
    3,622

    Re: Rip Audio from SWF

    Works for me with ffmpeg, but I'm not using the crippled version from the repository. If it doesn't work with Ubuntu's ffmpeg, then you can try the Medibuntu repository or compile it yourself with support for restricted formats.

    Investigate the file:
    Code:
    [frink@hedron ~]$ ffmpeg -i apehouse.swf
    Input #0, swf, from 'apehouse.swf':
      Duration: 00:05:06.39, bitrate: 15 kb/s
        Stream #0.0: Audio: mp3, 11025 Hz, mono, s16, 16 kb/s
    Copy the audio stream. No need to re-encode:
    Code:
    ffmpeg -i apehouse.swf -acodec copy apehouse.mp3

  5. #5
    Join Date
    Jan 2009
    Beans
    64

    Re: Rip Audio from SWF

    trying to convert homo format youtube file:
    Code:
    ffmpeg -i megaloop -acodec copy megaloop_converted.mp3
    output:
    Code:
    built on Apr 10 2009 23:18:41, gcc: 4.3.3
    [swf @ 0x8d0aac0]Compressed SWF format not supported
    megaloop: I/O error occurred
    Usually that means that input file is truncated and/or corrupted.
    it is swf format, but seems to be compressed somehow in swf. any solution to get the audio ?

  6. #6
    Join Date
    Jan 2009
    Beans
    64

    Re: Rip Audio from SWF

    okay let's try a different way:

    how to extract music from the following swf-compressed file:

    http://www.youtube.com/watch?v=f_M6cKJku80

  7. #7
    Join Date
    Sep 2006
    Beans
    3,622

    Re: Rip Audio from SWF

    Watch video in Firefox. The video file will appear in the /tmp directory and stay there until you navigate away from the YouTube web page. Get audio details with FFmpeg:
    Code:
    ffmpeg -i /tmp/FlashCXYWR1
    FFmpeg will show audio information:
    Code:
    Stream #0.1: Audio: aac, 22050 Hz, stereo, s16
    Now that you know the audio details you can copy it:
    Code:
    ffmpeg -i /tmp/FlashCXYWR1 -acodec copy output.aac
    Or if you want MP4 container:
    Code:
    ffmpeg -i /tmp/FlashCXYWR1 -acodec copy -vn output.mp4

  8. #8
    Join Date
    Jan 2009
    Beans
    64

    Re: Rip Audio from SWF

    Absolutely works.
    good job
    Thanks man !


    My fail as I suppose:
    First, I should have looked up for code how to find out about the audio format in the flash file. Then I tried to put it into mp3 format what ffmpeg just can't directly from aac. Right ?

  9. #9
    Join Date
    Sep 2006
    Beans
    3,622

    Re: Rip Audio from SWF

    Quote Originally Posted by oponto View Post
    Absolutely works.
    good job
    Thanks man !


    My fail as I suppose:
    First, I should have looked up for code how to find out about the audio format in the flash file. Then I tried to put it into mp3 format what ffmpeg just can't directly from aac. Right ?
    The first command from my example was used to find out the format of the input. If you want to encode to mp3:
    Code:
    ffmpeg -i input -ab 128k -ac 2 output.mp3
    The -ab option is the bitrate, and -ac is the number of channels (1 is mono, 2 is stereo). Note that FFmpeg from the repository has been stripped of restricted encoders, including libmp3lame which FFmpeg uses to encode to mp3. Enabling these encoders is easy though:

    HOWTO: Easily enable MP3, MPEG4, AAC, and other restricted encoding in FFmpeg

  10. #10
    Join Date
    Aug 2005
    Location
    Brussels
    Beans
    135
    Distro
    Ubuntu Development Release

    Re: Rip Audio from SWF

    Quote Originally Posted by FakeOutdoorsman View Post
    Works for me with ffmpeg, but I'm not using the crippled version from the repository. If it doesn't work with Ubuntu's ffmpeg, then you can try the Medibuntu repository or compile it yourself with support for restricted formats.

    Investigate the file:
    Code:
    [frink@hedron ~]$ ffmpeg -i apehouse.swf
    Input #0, swf, from 'apehouse.swf':
      Duration: 00:05:06.39, bitrate: 15 kb/s
        Stream #0.0: Audio: mp3, 11025 Hz, mono, s16, 16 kb/s
    Copy the audio stream. No need to re-encode:
    Code:
    ffmpeg -i apehouse.swf -acodec copy apehouse.mp3
    Hi, this worked for me too.

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •