LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   mp3 to swf conversion (https://www.linuxquestions.org/questions/linux-software-2/mp3-to-swf-conversion-699880/)

yonix 01-26-2009 12:23 AM

mp3 to swf conversion
 
Hi,

I'm looking for a tool that can directly convert mp3 file to a swf file.
Tried ffmprg - 'ffmpeg -i master.mp3 -ar 22050 -ab 32 -f swf -y -vn new.swf', output is as follows:

Output #0, swf, to 'new.swf':
Stream #0.0: Audio: 0x0000, 22050 Hz, stereo, 0 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Unsupported codec for output stream #0.0

I found a way to perform this task using ffmpeg to convert the mp3 file to a wav file, and converting the wav into a swf file using swftools (wav2swf), although this is not a good option because the output swf file size is very big - for a 12mb input 320kbps stereo mp3 file, the swf file is 25mb.

Also downloaded a free direct mp3 to swf conversion software, which had an output swf file - with the same 12mb mp3 file - of ~400kb.

The requirements I have from the tool are:
1. Can be ran from the shell.
2. Direct conversion, or an indirect one that will produce a small output swf file.
3. Suport for multiple file conversion is a plus.

Thanks for your help,
YoniX.

David the H. 01-26-2009 12:54 AM

Your ffmpeg command works fine for me. Note that you must have a version of ffmpeg that can handle swf. The ones provided by many distros don't include the full range of codecs ffmpeg can support because of patent issues, etc. Run "ffmpeg -formats" to see what yours supports. If it doesn't have what you need, then you'll have to find a version that does, or compile your own.

Note also that .swf itself is just a container format, and the audio track embedded in it is still .mp3 (although reduced in bitrate and samplerate, from your command), so ffmpeg needs to have liblame support as well.

Finally, the bitrate syntax has changed for ffmpeg. It's now specified in bits-per-second, so you need to change it to "-ab 32k" to get the bitrate you want.

yonix 06-29-2009 03:42 AM

Thanks David for the quick reply and the help. You are correct, the packaged ffmpeg version is compiled without the swf support.

Compiling ffmpeg from source with the '--enable-decoder=adpcm_swf --enable-encoder=adpcm_swf' switches did the work for me.

H_TeXMeX_H 06-29-2009 04:24 AM

Are you sure you don't mean .flv instead of .swf ?

yonix 06-29-2009 07:39 AM

I ment swf, you can say it works also for flv, or flv in a swf container.

H_TeXMeX_H 06-29-2009 07:53 AM

Well try making an flv, then use a swf player ... that should work. I personally have never seen an swf audio file.

yonix 06-29-2009 08:16 AM

It has more sense using flv file, but I have a special reason (more like a demand) for using swf instead.

Thanks for the correct advice.


All times are GMT -5. The time now is 11:45 AM.