View Full Version : Need help to convert SWF to something else..
mocham
29th January 2009, 09:31
I have SWF decode and encode support in my ffmpeg, but when I try to convert a SWF to MP4 it just encodes the audio. "mediainfo" program shows the following for the SWF input:
Format : ShockWave
File size : 3.43 MiB
Duration : 8mn 37s
Overall bit rate : 55.7 Kbps
Video
Duration : 8mn 37s
Bit rate : 46.6 Kbps
Width : 641 pixels
Height : 481 pixels
Display aspect ratio : 4/3
Frame rate : 10.000 fps
Bits/(Pixel*Frame) : 0.015
On the other hand, "ffmpeg -i" sees the same file as:
Input #0, swf, from 'xxxxx':
Duration: 00:29:59.28, bitrate: 15 kb/s
Stream #0.0: Audio: mp3, 11025 Hz, mono, s16, 16 kb/s
Audio only, and the duration is way off, "mediainfo" got the duration correct.
mencoder doesn't work on this file or any SWF's as far as I know. Any assistance to convert this file to H264 or xvid or something else would be appreciated. Thanks.
Selur
29th January 2009, 10:17
you probably have to use a screen recorder,...
WalterK
29th January 2009, 16:58
What does the playback output of the original file using ffplay (ffmpeg's media player) reveal when launched from the terminal using
ffplay -stats file.swf
mocham
29th January 2009, 21:20
What does the playback output of the original file using ffplay (ffmpeg's media player) reveal when launched from the terminal using
ffplay -stats file.swf
Same thing as ffmpeg -i, only audio playsback with ffplay. swfdec-player plays the video and audio. For some reason ffmpeg isn't seeing the video portion.
Input #0, swf, from 'xxxxx.swf':
Duration: 00:29:59.28, bitrate: 15 kb/s
Stream #0.0: Audio: mp3, 11025 Hz, mono, s16, 16 kb/s
WalterK
29th January 2009, 22:29
You just answered your question then.
Your version of FFMPEG does not have the correct video decoder built in to playback the file so it can't convert the video to something else.
If you are brave you might try the svn/git version of ffmpeg if you haven't already compile that and see if support for that particular codec has been added.
If you are already using the svn/git version then try another library like say mencoder or the videolan player's encoder although that uses ffmpeg i believe.
mocham
30th January 2009, 07:55
What am I missing?
FFmpeg version SVN-r16396, Copyright (c) 2000-2008 Fabrice Bellard, et al.
configuration: --prefix=/usr --enable-gpl --enable-postproc --enable-libvorbis --enable-libtheora --disable-debug --enable-libmp3lame --enable-libfaad --enable-libfaac --enable-pthreads --enable-libx264 --enable-libdc1394 --enable-libgsm --enable-libxvid --enable-libschroedinger
libavutil 49.12. 0 / 49.12. 0
libavcodec 52. 9. 0 / 52. 9. 0
libavformat 52.23. 1 / 52.23. 1
libavdevice 52. 1. 0 / 52. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0
built on Dec 30 2008 03:23:38, gcc: 4.3.2
DE swf Flash format
DEA adpcm_swf Shockwave Flash ADPCM
Is the swf line supposed to say "DEV" instead of just "DE"?
mocham
3rd February 2009, 18:01
I'm still stuck on this. Instead of a realtime screen capture with recordmydesktop (for example), is there some way to pipe the output of the video to mplayer or mencoder and encode it in realtime that way? I think I would need to somehow pipe the output of swfdec to mplayer but I'm not sure how to do this, since ffplay is not decoding the video it's making this a challange. Thanks.
WalterK
6th February 2009, 18:07
hmmm no clue as to how to fix this.
Mencoder supposedly has swf support now, svn version.
skottish
6th February 2009, 21:48
I don't know if this helps, but I remember a post at ffmpeg-devel when one of swfdec developers offered some patches. What I remember is that swf can be zlib compressed, and swfdec handles this internally. At that time FFmpeg didn't even if --enable-zlib was switched when it was built. I don't know if that changed or not, but if you don't have --enable-zlib compiled in to FFmpeg, you may want to try that.
--EDIT--
I just found a test sample, and FFmpeg/FFplay doesn't play back compressed swf files still.
mocham
7th February 2009, 21:40
I didn't realize mencoder is starting to support SWF. I'll look into that.
I believe the files I have are "compressed SWF", that's probably why ffmpeg is not able to see the video. I'll update and try the enable-zlib. Thanks to all. If none of this works I guess I'll just use recordmydesktop.
WalterK
8th February 2009, 22:49
If mencoder fails i found this on the ubuntu forums.
it's not easy. You need to download the next files:
from:
http://davidf.sjsoft.com/files/pyvnc2swf/
download:
pyvnc2swf-0.8.2.1.tar.gz
unrar on desktop
it's necessary because contains the file "edit.py"
from:
http://sourceforge.net/project/showfiles.php?group_id=86491&package_id=89813&release_id=368116
download:
pymedia_1.3.5_i686-py2.4.deb
double click and to install.
it's necessary because contains the codec: mpg
to install python-pygame from synaptic
it's necessary to run the file "edit.py"
if you understand spanish go:
http://cgacimartin.wordpress.com/2007/09/11/convertir-swf-en-avi-y-salvar-videos-de-youtube/
I don't try to convert because i have ubuntu amd64 and the solution is for normal ubuntu (32 bit o x86)
To convert:
copy video_input.swf
cp video_input.swf /Desktop/pyvnc2swf-0.8.2.1/pyvnc2swf
now you go to the file cd /Desktop/pyvnc2swf-0.8.2.1/pyvnc2swf
and to run edit.py:
python edit.py -o video_output.mpg video_input.swf
finally video_output.mpg to avi, you use the mencoder
Good luck
This was a post from 2007 so perhaps by now mencoder properly supports compressed swf.
mocham
9th February 2009, 19:10
Walter, Thanks for that info. I'll try it tonight and let you know if it works.
mocham
12th February 2009, 17:26
That method didn't work either. Compressed SWFs are basically impossible to convert other than using screen capture. I even looked at some Windows programs, and I found 2 so-called "professional swf converter" demo softwares which ironically all they do is some kind of internal screen grab in real time, and then convert to mpg/avi/etc after the capture.
Is it possible to use some Linux screen grabber in a mode where you specify a particular window to grab rather than a region on the screen?
poisondeathray
12th February 2009, 17:32
Maybe you could try xvidcap ? It's supposed to be like Camtasia for Windows, but open source & for Linux. I've never tried it
mocham
14th February 2009, 20:44
Maybe you could try xvidcap ? It's supposed to be like Camtasia for Windows, but open source & for Linux. I've never tried it
I did try the latest version compiled from source, but it just keeps locking up after less than a minute. I guess I'll just use gtk-recordmydesktop.
WalterK
15th February 2009, 01:18
xvidcap hasn't been updated/developed in several years and ffmpeg (the library it depends on) has had several updates to svn code since then and there is probably why you are having problems.
Also recordmydesktop can capture from specified windows like xvidcap.
mocham
16th February 2009, 11:40
Also recordmydesktop can capture from specified windows like xvidcap.
I'll look into that. Thanks.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.