Log in

View Full Version : AVISynth/ffdshow combo not working


Dark Morford
26th February 2009, 08:13
I'm trying to do some trivial editing and splicing using AVISynth and ffdshow. The original AVI source I'm using is XviD/MP3, 24 fps, and plays perfectly in Media Player Classic (going through ffdshow's DirectShow side). However, if I try to pipe the same file through AVISynth, things just go south. For now, I'm just using a basic script which calls AVISource() and does nothing else.

First, I tried opening the script without changing any of ffdshow's settings, and AVISynth spat out a 10-second clip claiming that it "could not decompress frame 0". Going into the ffdshow VFW config and switching the Xvid decoder from "Xvid" to "libavcodec" just makes things worse; I get no output at all, and instead a pop-up error dialog:C:\Documents and Settings\Shawn\Desktop\video.avs::Avisynth video #1

Media Type 0:
--------------------------
Video: YV12 640x480 23.98fps

AM_MEDIA_TYPE:
majortype: MEDIATYPE_Video {73646976-0000-0010-8000-00AA00389B71}
subtype: MEDIASUBTYPE_YV12 {32315659-0000-0010-8000-00AA00389B71}
formattype: FORMAT_VideoInfo {05589F80-C356-11CE-BF01-00AA0055595A}
bFixedSizeSamples: 1
bTemporalCompression: 0
lSampleSize: 460800
cbFormat: 88

VIDEOINFOHEADER:
rcSource: (0,0)-(0,0)
rcTarget: (0,0)-(0,0)
dwBitRate: 0
dwBitErrorRate: 0
AvgTimePerFrame: 417083

BITMAPINFOHEADER:
biSize: 40
biWidth: 640
biHeight: 480
biPlanes: 1
biBitCount: 12
biCompression: YV12
biSizeImage: 460800
biXPelsPerMeter: 0
biYPelsPerMeter: 0
biClrUsed: 0
biClrImportant: 0

pbFormat:
0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0020: 00 00 00 00 00 00 00 00 3b 5d 06 00 00 00 00 00 ........;]......
0030: 28 00 00 00 80 02 00 00 e0 01 00 00 01 00 0c 00 (...€...à.......
0040: 59 56 31 32 00 08 07 00 00 00 00 00 00 00 00 00 YV12............
0050: 00 00 00 00 00 00 00 00 ........

Pushing through DirectShowSource() gives me a similar error dialog with both libavcodec and Xvid decoders.

Versions used are AVISynth 2.58 (Dec 22 2008), ffdshow tryout r2527 (Dec 17 2008), and Media Player Classic 6.4.9.1 (r89) on 32-bit WinXP Pro SP3. Any ideas?

Adub
27th February 2009, 02:46
Do you have Xvid installed?

If not, make sure that you have a codec installed that can decode raw yv12 video. This can be enabled in ffdshow at the bottom of the codec list.

halsboss
28th February 2009, 05:10
Just a shot in the dark, anything to do with this ? http://forum.doom9.org/showthread.php?t=145262
I'd thought ffmpeg (ffdshow/libavcodec?) spat at packed bitstream avis (it did for me, had to convert to unpacked using mpeg4modifier).
Under xp using mediainfo, running this batch file in the same folder lets you see if avis are packed bitstream.
Echo on
del z.txt
for %%y in ("*.avi") do (
"c:\software\mediainfo\mediainfo.exe" --full "%%y" >> z.txt
ECHO ----------------------------------------------------------------------- >> z.txt
)
START "results of mediainfo" "notepad.exe" z.txt
I also had strange avi recently, unpacking and repacking with this batch file did the trick (drag and drop the file onto it). ffmpeg liked the unpacked avi although VFW based programs like avisynth and virtualdub didn't.
@echo on
%~d1
CD "%~dp1"
"C:\SOFTWARE\MPEG4Modifier\mmcl.exe" --unpack --always-write "%~1" "%~1-unpacked.AVI"
"C:\SOFTWARE\MPEG4Modifier\mmcl.exe" --pack --always-write "%~1-unpacked.AVI" "%~1-packed.AVI"
pause