swftools-common
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Swftools-common] Re: New idea for converting an avi to a flash file


From: Amartyo Banerjee
Subject: Re: [Swftools-common] Re: New idea for converting an avi to a flash file -- Was Re: Problems with avi2swf
Date: Sun, 23 Nov 2003 04:14:42 -0800 (PST)

>     ffmpeg -i file.mpeg -t 30 -an -s cif 30sec.avi
> 

I tried to record from an mpeg1 video file. avi2swf still can't convert the 
result. :(

> 
> It may be that that webcam uses some weird color format, which is then
> also encoded in the avi.

I guess this is the case (sigh)
I have tried to convert each frame to a ppm file using transcode as described 
in other emails. 
With the resulting ppms I have tried to create an avi file using the mjpegtools 
suite (ppmtoy4m
piped to yuv2lav)

The resulting avi plays fine using lavplay from mjpegtools , ffplay from ffmpeg 
and mplayer. But
no luck converting.

I have also tried to use transcode to convert the ppm files to an avi file with 
xvid encoding, and
with ffmpeg encoding using in turn mjpeg codec and mpeg4 codec. No luck with 
avi2swf.

O.t.o.h, as mentioned before, turning the ppm files to jpegs with the convert 
(ImageMagick) tool
and then using jpeg2swf works fine. Its just wierd. 

Here are the command lines for each of these attempts, and the conversion 
attempt with avi2swf.
--------------------------------------------------------------------------------------------------------
1. (Turn the avi file into ppm images, one per frame)

transcode -i 30sec.avi -k -z -x ffmpeg -y ppm

transcode v0.6.10 (C) 2001-2003 Thomas Oestreich
[transcode] auto-probing source 30sec.avi (ok)
[transcode] V: import format    | DivX RIFF data, AVI (V=ffmpeg|A=null)
[transcode] V: import frame     | 352x288  1.22:1  
[transcode] V: flip frame       | yes
[transcode] V: rgb2bgr          | yes
[transcode] V: bits/pixel       | 0.710
[transcode] V: decoding fps,frc | 25.000,3
[transcode] A: import           | disabled
[transcode] A: export           | disabled
[transcode] V: encoding fps,frc | 25.000,3
[transcode] A: bytes per frame  | 0 (0.000000)
[transcode] A: adjustment       | address@hidden
[transcode] V: IA32 accel mode  | sse2 (sse2 sse mmxext mmx asm)
[transcode] warning : no option -o found, encoded frames send to "/dev/null"
[transcode] V: video buffer     | 10 @ 352x288
[import_null.so] v0.2.0 (2002-01-19) (video) null | (audio) null
[import_ffmpeg.so] v0.1.5 (2003-08-23) (video) FFMPEG API (build 4669): MS 
MPEG4v1-3/MPEG4/MJPEG
[export_null.so] v0.1.2 (2001-08-17) (video) null | (audio) null
[export_ppm.so] v0.1.1 (2002-02-14) (video) PPM/PGM | (audio) MPEG/AC3/PCM
This file was encoded with libavcodec build 4680
encoding frames [000000-000749],  51.54 fps, EMT: 0:00:29, ( 0| 0| 0) 
clean up | frame threads | unload modules | cancel signal | internal threads | 
done
[transcode] encoded 750 frames (0 dropped, 0 cloned), clip length  30.00 s

******************************************************************
2. (convert ppm files into an avi file using mjpegtools)

 cat *.ppm|ppmtoy4m -I p -F 25:1|yuv2lav -f a -q 100 -b 1024 -o 30secmjpeg.avi

   INFO: [ppmtoy4m] Command-line Parameters:
   INFO: [ppmtoy4m]              framerate:  25:1
   INFO: [ppmtoy4m]     pixel aspect ratio:  1:1
   INFO: [ppmtoy4m]              interlace:  none/progressive
   INFO: [ppmtoy4m]         starting frame:  0
   INFO: [ppmtoy4m]            # of frames:  all, until input exhausted
   INFO: [ppmtoy4m]     chroma subsampling:  4:2:0, JPEG/MPEG-1, interstitial 
siting
   INFO: [ppmtoy4m] Output Stream parameters:
   INFO: [ppmtoy4m]     frame size:  352x288 pixels (152064 bytes)
   INFO: [ppmtoy4m]     frame rate:  25/1 fps (~25.000000)
   INFO: [ppmtoy4m]      interlace:  none/progressive
   INFO: [ppmtoy4m]   sample aspect ratio:  1:1

********************************************************************

3. (try to convert avifile created with mjpegtools into a flash file)

avi2swf -v 30secmjpeg.avi 

<init> : Avifile CVS-0.7.39-031007-11:59-gcc version 3.2 (Mandrake Linux 9.0 
3.2-1mdk)
<init> : Available CPU flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr 
pge mca cmov pat
pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm
<init> : 1900.06 MHz Intel(R) Pentium(R) 4 CPU 1.90GHz processor detected
<reader> : checking: 30secmjpeg.avi
<AVI reader> : MainHeader: MicroSecPerFrame=40000 MaxBytesPerSec=10000000
 PaddingGranularity=0 Flags=[ HAS_INDEX WAS_CAPTURED_FILE ] TotalFrames=750
 InitialFrames=0 Streams=1 SuggestedBufferSize=0 WxH=352x288
 Scale=0 Rate=0 Start=0 Length=0
<AVI reader> : WARNING: unexpected stream header size (64)
<AVI reader> : StreamHeader: Type=vids Handler=MJPG Flags=[ ]
 InitialFrames=0 Scale=40000 Rate=1000000 Start=0 Length=750
 SuggestedBufferSize=0 Quality=-1 SampleSize=0 Rect l,r,t,b=0,0,0,0
<AVI reader> : Reading index from offset: 28090904
<AVI reader> : Stream 0 vids : MJPG (0x47504a4d) 750 chunks (2.93KB)
<StreamCache> : Creating cache for file descriptor: 4
1 streams (1 video, 0 audio)
<reader> : Initialized video stream (chunk tblsz: 750, fmtsz: 40)
Couldn't open video stream
<LDT keeper> : Installed fs segment: 0x40013000
<codec keeper> : Found 11 plugins (/usr/local/lib/avifile-0.7,A:41,V:84)
<codec keeper> : FFMPEG Motion JPEG video decoder created
| video framerate: 25.000000
| video size: 352x288
| audio rate: 0
| audio channels: 0
(v2swf) set parameters verbose to 1
(v2swf) set parameters quality to 80
(v2swf) set parameters blockdiff to 0
(v2swf) set parameters blockdiff_mode to exact
(v2swf) set parameters mp3_bitrate to 32
(v2swf) bitrate 32 requested, setting to 32
(v2swf) set parameters scale to 1.000000
(v2swf) set parameters prescale to 1
(v2swf) set parameters flash_version to 6
(v2swf) set parameters keyframe_interval to 200
(v2swf) v2swf_read(4096)
videoreader_eof()
videoreader_getimage()
<ffmjpeg> : doesn't support DR1
<CImage> : Cannot convert non-YUV image to BGR24
Can't handle Bpp 1, shutting down...
(v2swf) videoreader returned eof
(v2swf) finish(): i->finished=0
(v2swf) write endtag
(v2swf) call videoreader_close(bffff690)
videoreader_close()
(v2swf) finishing done
(v2swf) v2swf_read() done: 46 bytes available in ringbuffer
(v2swf) v2swf_read(4096)
(v2swf) v2swf_read() done: 0 bytes available in ringbuffer
(v2swf) v2swf_backpatch output.swf
(v2swf) close(): i->finished=1
(v2swf) finish(): i->finished=1
(v2swf) finishing done
(v2swf) freeing memory
(v2swf) close() done

***********************************************************************

4. (create an avi file with xvid encoding with transcode, using ppms as the 
source.)

find *.ppm|sort > list
transcode -i list -x imlist,null -g 352x288 -y xvid,null -o transcodexvid.avi 
-H 0

transcode v0.6.10 (C) 2001-2003 Thomas Oestreich
[transcode] V: import frame     | 352x288  1.22:1  
[transcode] V: bits/pixel       | 0.710
[transcode] V: decoding fps,frc | 25.000,0
[transcode] A: import format    | 0x2000  AC3          [48000,16,2]
[transcode] A: export           | disabled
[transcode] V: encoding fps,frc | 25.000,3
[transcode] A: bytes per frame  | 7680 (7680.000000)
[transcode] A: adjustment       | address@hidden
[transcode] V: IA32 accel mode  | sse2 (sse2 sse mmxext mmx asm)
[transcode] V: video buffer     | 10 @ 352x288
[import_null.so] v0.2.0 (2002-01-19) (video) null | (audio) null
[import_imlist.so] v0.0.1 (2002-02-26) (video) RGB
[export_null.so] v0.1.2 (2001-08-17) (video) null | (audio) null
[export_xvid2.so] v0.3.10 (2003-07-30) (video) XviD 0.9.x (aka API 2.1 series)  
| (audio)
MPEG/AC3/PCM
No ./xvid2.cfg nor ~/.transcode/xvid2.cfg file found, falling back to hardcoded 
defaults
encoding frames [000000-000749],  33.51 fps, EMT: 0:00:29, ( 0| 0| 0) 
clean up | frame threads | unload modules | cancel signal | internal threads | 
done
[transcode] encoded 750 frames (0 dropped, 0 cloned), clip length  30.00 s

*************************************************************************************

5. (try to convert transcode created avi file into a flash file)

avi2swf -v transcodexvid.avi 

<init> : Avifile CVS-0.7.39-031007-11:59-gcc version 3.2 (Mandrake Linux 9.0 
3.2-1mdk)
<init> : Available CPU flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr 
pge mca cmov pat
pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm
<init> : 1900.06 MHz Intel(R) Pentium(R) 4 CPU 1.90GHz processor detected
<reader> : checking: transcodexvid.avi
<AVI reader> : MainHeader: MicroSecPerFrame=40000 MaxBytesPerSec=0
 PaddingGranularity=0 Flags=[ HAS_INDEX IS_INTERLEAVED ] TotalFrames=750
 InitialFrames=0 Streams=1 SuggestedBufferSize=0 WxH=352x288
 Scale=0 Rate=0 Start=0 Length=0
<AVI reader> : StreamHeader: Type=vids Handler=XVID Flags=[ ]
 InitialFrames=0 Scale=1000000 Rate=25000000 Start=0 Length=750
 SuggestedBufferSize=0 Quality=0 SampleSize=0 Rect l,r,t,b=0,0,0,0
<AVI reader> : InfoChunk Software:  transcode-0.6.10
<AVI reader> : Reading index from offset: 2331412
<AVI reader> : Stream 0 vids : XVID (0x44495658) 750 chunks (2.93KB)
<StreamCache> : Creating cache for file descriptor: 4
1 streams (1 video, 0 audio)
<reader> : Initialized video stream (chunk tblsz: 750, fmtsz: 40)
Couldn't open video stream
<LDT keeper> : Installed fs segment: 0x40013000
<codec keeper> : Found 11 plugins (/usr/local/lib/avifile-0.7,A:41,V:84)
<XviD plugin> : XviD linux decoder
<codec keeper> : XviD video decoder created
| video framerate: 25.000000
| video size: 352x288
| audio rate: 0
| audio channels: 0
(v2swf) set parameters verbose to 1
(v2swf) set parameters quality to 80
(v2swf) set parameters blockdiff to 0
(v2swf) set parameters blockdiff_mode to exact
(v2swf) set parameters mp3_bitrate to 32
(v2swf) bitrate 32 requested, setting to 32
(v2swf) set parameters scale to 1.000000
(v2swf) set parameters prescale to 1
(v2swf) set parameters flash_version to 6
(v2swf) set parameters keyframe_interval to 200
(v2swf) v2swf_read(4096)
videoreader_eof()
videoreader_getimage()
<CImage> : Cannot convert non-YUV image to BGR24
Can't handle Bpp 1, shutting down...
(v2swf) videoreader returned eof
(v2swf) finish(): i->finished=0
(v2swf) write endtag
(v2swf) call videoreader_close(bffff690)
videoreader_close()
(v2swf) finishing done
(v2swf) v2swf_read() done: 46 bytes available in ringbuffer
(v2swf) v2swf_read(4096)
(v2swf) v2swf_read() done: 0 bytes available in ringbuffer
(v2swf) v2swf_backpatch output.swf
(v2swf) close(): i->finished=1
(v2swf) finish(): i->finished=1
(v2swf) finishing done
(v2swf) freeing memory
(v2swf) close() done

*********************************************************************************

6. (create an avi with transcode, using the ffmpeg export module and the mpeg4 
codec)

transcode -i list -x imlist,null -g 352x288 -y ffmpeg,null -o 
transcode_ffmpeg_mpeg4.avi -H 0 -F
mpeg4 -k -z

transcode v0.6.10 (C) 2001-2003 Thomas Oestreich
[transcode] V: import frame     | 352x288  1.22:1  
[transcode] V: flip frame       | yes
[transcode] V: rgb2bgr          | yes
[transcode] V: bits/pixel       | 0.710
[transcode] V: decoding fps,frc | 25.000,0
[transcode] A: import format    | 0x2000  AC3          [48000,16,2]
[transcode] A: export           | disabled
[transcode] V: encoding fps,frc | 25.000,3
[transcode] A: bytes per frame  | 7680 (7680.000000)
[transcode] A: adjustment       | address@hidden
[transcode] V: IA32 accel mode  | sse2 (sse2 sse mmxext mmx asm)
[transcode] V: video buffer     | 10 @ 352x288
[import_null.so] v0.2.0 (2002-01-19) (video) null | (audio) null
[import_imlist.so] v0.0.1 (2002-02-26) (video) RGB
[export_null.so] v0.1.2 (2001-08-17) (video) null | (audio) null
[export_ffmpeg.so] v0.3.7 (2003-08-24) (video) FFMPEG API (build 4669) | 
(audio) MPEG/AC3/PCM
[export_ffmpeg.so] Using FFMPEG codec 'mpeg4' (FourCC 'DIVX', MPEG4 compliant 
video).
[export_ffmpeg.so] Neither './ffmpeg.cfg' nor '~/.transcode/ffmpeg.cfg'found. 
Default settings
will be used instead.
encoding frames [000000-000749],  26.00 fps, EMT: 0:00:29, ( 0| 0| 0) 
clean up | frame threads | unload modules | cancel signal | internal threads | 
done
[transcode] encoded 750 frames (0 dropped, 0 cloned), clip length  30.00 s

*****************************************************************************

7. (try to convert the avi file created above)

avi2swf -v transcode_ffmpeg_mpeg4.avi 

<init> : Avifile CVS-0.7.39-031007-11:59-gcc version 3.2 (Mandrake Linux 9.0 
3.2-1mdk)
<init> : Available CPU flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr 
pge mca cmov pat
pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm
<init> : 1900.06 MHz Intel(R) Pentium(R) 4 CPU 1.90GHz processor detected
<reader> : checking: transcode_ffmpeg_mpeg4.avi
<AVI reader> : MainHeader: MicroSecPerFrame=40000 MaxBytesPerSec=0
 PaddingGranularity=0 Flags=[ HAS_INDEX IS_INTERLEAVED ] TotalFrames=750
 InitialFrames=0 Streams=1 SuggestedBufferSize=0 WxH=352x288
 Scale=0 Rate=0 Start=0 Length=0
<AVI reader> : StreamHeader: Type=vids Handler=DIVX Flags=[ ]
 InitialFrames=0 Scale=1000000 Rate=25000000 Start=0 Length=750
 SuggestedBufferSize=0 Quality=0 SampleSize=0 Rect l,r,t,b=0,0,0,0
<AVI reader> : InfoChunk Software:  transcode-0.6.10
<AVI reader> : Reading index from offset: 1794228
<AVI reader> : Stream 0 vids : DIVX (0x58564944) 750 chunks (2.93KB)
<StreamCache> : Creating cache for file descriptor: 4
1 streams (1 video, 0 audio)
<reader> : Initialized video stream (chunk tblsz: 750, fmtsz: 40)
Couldn't open video stream
<LDT keeper> : Installed fs segment: 0x40013000
<codec keeper> : Found 11 plugins (/usr/local/lib/avifile-0.7,A:41,V:84)
<XviD plugin> : XviD linux decoder
<codec keeper> : XviD video decoder created
| video framerate: 25.000000
| video size: 352x288
| audio rate: 0
| audio channels: 0
(v2swf) set parameters verbose to 1
(v2swf) set parameters quality to 80
(v2swf) set parameters blockdiff to 0
(v2swf) set parameters blockdiff_mode to exact
(v2swf) set parameters mp3_bitrate to 32
(v2swf) bitrate 32 requested, setting to 32
(v2swf) set parameters scale to 1.000000
(v2swf) set parameters prescale to 1
(v2swf) set parameters flash_version to 6
(v2swf) set parameters keyframe_interval to 200
(v2swf) v2swf_read(4096)
videoreader_eof()
videoreader_getimage()
<CImage> : Cannot convert non-YUV image to BGR24
Can't handle Bpp 1, shutting down...
(v2swf) videoreader returned eof
(v2swf) finish(): i->finished=0
(v2swf) write endtag
(v2swf) call videoreader_close(bffff680)
videoreader_close()
(v2swf) finishing done
(v2swf) v2swf_read() done: 46 bytes available in ringbuffer
(v2swf) v2swf_read(4096)
(v2swf) v2swf_read() done: 0 bytes available in ringbuffer
(v2swf) v2swf_backpatch output.swf
(v2swf) close(): i->finished=1
(v2swf) finish(): i->finished=1
(v2swf) finishing done
(v2swf) freeing memory
(v2swf) close() done

************************************************************************************

8. (create an avi with transcode, using the ffmpeg export module and the mjpeg 
codec)

transcode -i list -x imlist,null -g 352x288 -y ffmpeg,null -o 
transcode_ffmpeg_mjpeg.avi -H 0 -F
mjpeg -k -z

transcode v0.6.10 (C) 2001-2003 Thomas Oestreich
[transcode] V: import frame     | 352x288  1.22:1  
[transcode] V: flip frame       | yes
[transcode] V: rgb2bgr          | yes
[transcode] V: bits/pixel       | 0.710
[transcode] V: decoding fps,frc | 25.000,0
[transcode] A: import format    | 0x2000  AC3          [48000,16,2]
[transcode] A: export           | disabled
[transcode] V: encoding fps,frc | 25.000,3
[transcode] A: bytes per frame  | 7680 (7680.000000)
[transcode] A: adjustment       | address@hidden
[transcode] V: IA32 accel mode  | sse2 (sse2 sse mmxext mmx asm)
[transcode] V: video buffer     | 10 @ 352x288
[import_null.so] v0.2.0 (2002-01-19) (video) null | (audio) null
[import_imlist.so] v0.0.1 (2002-02-26) (video) RGB
[export_null.so] v0.1.2 (2001-08-17) (video) null | (audio) null
[export_ffmpeg.so] v0.3.7 (2003-08-24) (video) FFMPEG API (build 4669) | 
(audio) MPEG/AC3/PCM
[export_ffmpeg.so] Using FFMPEG codec 'mjpeg' (FourCC 'MJPG', Motion JPEG).
[export_ffmpeg.so] Neither './ffmpeg.cfg' nor '~/.transcode/ffmpeg.cfg'found. 
Default settings
will be used instead.
encoding frames [000000-000749],  30.14 fps, EMT: 0:00:29, ( 0| 0| 0) 
clean up | frame threads | unload modules | cancel signal | internal threads | 
done
[transcode] encoded 750 frames (0 dropped, 0 cloned), clip length  30.00 s

*******************************************************************************

9. (try the same as in step 7.)

avi2swf -v transcode_ffmpeg_mjpeg.avi 

<init> : Avifile CVS-0.7.39-031007-11:59-gcc version 3.2 (Mandrake Linux 9.0 
3.2-1mdk)
<init> : Available CPU flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr 
pge mca cmov pat
pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm
<init> : 1900.06 MHz Intel(R) Pentium(R) 4 CPU 1.90GHz processor detected
<reader> : checking: transcode_ffmpeg_mjpeg.avi
<AVI reader> : MainHeader: MicroSecPerFrame=40000 MaxBytesPerSec=0
 PaddingGranularity=0 Flags=[ HAS_INDEX IS_INTERLEAVED ] TotalFrames=750
 InitialFrames=0 Streams=1 SuggestedBufferSize=0 WxH=352x288
 Scale=0 Rate=0 Start=0 Length=0
<AVI reader> : StreamHeader: Type=vids Handler=MJPG Flags=[ ]
 InitialFrames=0 Scale=1000000 Rate=25000000 Start=0 Length=750
 SuggestedBufferSize=0 Quality=0 SampleSize=0 Rect l,r,t,b=0,0,0,0
<AVI reader> : InfoChunk Software:  transcode-0.6.10
<AVI reader> : Reading index from offset: 4632476
<AVI reader> : Stream 0 vids : MJPG (0x47504a4d) 750 chunks (2.93KB)
<StreamCache> : Creating cache for file descriptor: 4
1 streams (1 video, 0 audio)
<reader> : Initialized video stream (chunk tblsz: 750, fmtsz: 40)
Couldn't open video stream
<LDT keeper> : Installed fs segment: 0x40013000
<codec keeper> : Found 11 plugins (/usr/local/lib/avifile-0.7,A:41,V:84)
<codec keeper> : FFMPEG Motion JPEG video decoder created
| video framerate: 25.000000
| video size: 352x288
| audio rate: 0
| audio channels: 0
(v2swf) set parameters verbose to 1
(v2swf) set parameters quality to 80
(v2swf) set parameters blockdiff to 0
(v2swf) set parameters blockdiff_mode to exact
(v2swf) set parameters mp3_bitrate to 32
(v2swf) bitrate 32 requested, setting to 32
(v2swf) set parameters scale to 1.000000
(v2swf) set parameters prescale to 1
(v2swf) set parameters flash_version to 6
(v2swf) set parameters keyframe_interval to 200
(v2swf) v2swf_read(4096)
videoreader_eof()
videoreader_getimage()
<ffmjpeg> : doesn't support DR1
mjpeg comment: 'FFmpeg0.4.6b4669'
<CImage> : Cannot convert non-YUV image to BGR24
Can't handle Bpp 1, shutting down...
(v2swf) videoreader returned eof
(v2swf) finish(): i->finished=0
(v2swf) write endtag
(v2swf) call videoreader_close(bffff680)
videoreader_close()
(v2swf) finishing done
(v2swf) v2swf_read() done: 46 bytes available in ringbuffer
(v2swf) v2swf_read(4096)
(v2swf) v2swf_read() done: 0 bytes available in ringbuffer
(v2swf) v2swf_backpatch output.swf
(v2swf) close(): i->finished=1
(v2swf) finish(): i->finished=1
(v2swf) finishing done
(v2swf) freeing memory
(v2swf) close() done

-------------------------------------------------------------------------------------------------------------------------

__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]