Log in

View Full Version : avs2yuv problems on win32


hellfred
3rd November 2004, 14:26
Hi there.
avs2yuv is a small program written by akupenguin. He wanted to use avisynth script server under linux emulator wine and created avs2yuv to pipe the frames (video only!) to linux programms like mplayer/mencoder.
Syntax:

D:\>avs2yuv.exe
Avs2YUV 0.1
Usage: avs2yuv [options] in.avs out.yuv
-v print the frame number after processing each frame
-seek seek to the given frame number
-frames stop after processing this many frames
The outfile may be "-", meaning stdout.
Output is in yuv4mpeg, as used by MPlayer and mjpegtools


Piping to e.g. mplayer:

D:\>avs2yuv test.avs - | mplayer.exe -


For more information see the hompage (http://students.washington.edu/lorenm/src/avisynth/avs2yuv/)
and for the first steps towards backporting it to win32 in the New A/V Codecs thread x264 development (http://forum.doom9.org/showthread.php?threadid=80910&perpage=20&pagenumber=9)
After fixing issues with the line end difference between unix and windows - done by ak (http://4nykey.nm.ru/tmp/) - the app began to fulfill its task on win32, too. But there is still a problem of error messages that hinder the use of avs2yuv for batch endcoding, as one has to click away the error dialog after each encode to e.g. start the next one or the second pass.
My goal is to get rid of this error message to make the tool universal usable under win32 with the win32 ports of linux tools.

On WinXP cmd.exe, MSYS and cygwin bash are available as console to use this program.

Here some information on the error meassag dialog:

Stefan@CF /opt/mplayer_x264/bin
$ avs2yuv.exe -frames 500 test.avs - | mplayer.exe -
MPlayer dev-CVS-041024-20:04-3.3.3 (C) 2000-2004 MPlayer Team

CPU: Intel Pentium 4/Xeon/Celeron Foster (Family: 8, Stepping: 9)
Detected cache-line size is 64 bytes
CPUflags: MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 0 SSE2: 0
Compiled for x86 CPU with extensions: MMX MMX2 SSE SSE2

Reading config file /opt/mplayer_x264/etc/mplayer/mplayer.conf:
No such file ordirectory
Reading config file C:/Programme/Stefan/msys/1.0/home/Stefan/mplayer/config
Reading C:/Programme/Stefan/msys/1.0/home/Stefan/mplayer/codecs.conf:
Can't open'C:/Programme/Stefan/msys/1.0/home/Stefan/mplayer/codecs.conf':
No such file ordirectory
Reading /opt/mplayer_x264/etc/mplayer/codecs.conf:
Can't open '/opt/mplayer_x264/etc/mplayer/codecs.conf':
No such file or directory
Using built-in default codecs.conf.
font: can't open file: C:/Programme/Stefan/msys/1.0/home/Stefan/mplayer/font/font.desc
font: can't open file: /opt/mplayer_x264/share/mplayer/font/font.desc
Using Windows native timing
Can't open input config file C:/Programme/Stefan/msys/1.0/home/Stefan/mplayer/input.conf:
No such file or directory
Can't open input config file /opt/mplayer_x264/etc/mplayer/input.conf: No such file or directory
Falling back on default (hardcoded) input config

Playing -.
Reading from stdin...
YUV4MPEG2 file format detected.
YUV4MPEG2 Video stream 0 size: display: 640x480, codec: 640x480
VIDEO: [YV12] 640x480 12bpp 23,976 fps 0,0 kbps ( 0,0 kbyte/s)
==========================================================================
Opening video decoder: [raw] RAW Uncompressed Video
VDec: vo config request - 640 x 480 (preferred csp: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is undefined - no prescaling applied.
VO: [directx] 640x480 => 640x480 Planar YV12
Selected video codec: [rawyv12] vfm:raw (RAW YV12)
==========================================================================
Audio: no sound
Starting playback...
test.avs 499 0% 1% 0,0% 0 0 0%
total frames: 34321
V: 20,8 500 0% 1% 0,0% 0 0 0%

Exiting... (End of file)

*Error Message (Dialog)*

Stefan@CF /opt/mplayer_x264/bin
$

Stefan@CF ~/c/Programme/Stefan/msys/1.0/opt/mplayer_x264/bin
$ ./avs2yuv.exe -frames 500 test.avs out.yuv
test.avs
total frames: 34321

*Error Message (Dialog)*

Stefan@CF ~/c/Programme/Stefan/msys/1.0/opt/mplayer_x264/bin
$


Error Message (Dialog):
Caption: "avs2yuv.exe - Fehler in Anwendung"
Symbol: red cyrcle with white x in it -> Error Symbol
Text to its right:
Die Anwendung in "0x0...."verweist auf Speicher in "0x0...". Der Vorgang "read"
konnte nicht auf den Speicher durchgeführt werden.
Klicke auf "OK" um das Programm zu beenden.
Button OK

Translation of the text:
Application in "0x0..." points/referenzes to memeory in "0x0...". Action "read" could not be performed on memory.
Press "OK" to terminate the application/program


By the way:
If you have problems with pipes and temporal files Win98 please refere the 9th page of the x264 developmend thread (use cygwin's bash pipe data).

Hellfred

ak
3rd November 2004, 18:58
hellfred, probably try to compile avs2yuv by yourself and see if it sorts things out.

hellfred
3rd November 2004, 21:08
Originally posted by ak
hellfred, probably try to compile avs2yuv by yourself and see if it sorts things out.
Looks like i am too stupid to invoke patch-command in the right way to apply your diff w32_pipe.diff on avs2yuv.c from avs2yuv-0.11.zip
So i tryed it manually.
Is this correct?

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>

and

FILE* yuv_out = NULL;
if(outfile) {
if(0==strcmp(outfile, "-")) {
yuv_out = stdout;
setmode(fileno(yuv_out),_O_BINARY);
//yuv_out = fdopen(STDOUT_FILENO, "wb");
}
else {
yuv_out = fopen(outfile, "wb");
if(!yuv_out)

If the source is correct like this, just compiling avs2yuv.c is not enough to get avs2yuv to work under Win98.
Compilation was done using MSYS and Cygwin:
MSYS:
Stefan@J5U7R1 ~
$ gcc -v
Reading specs from D:/STEFAN/MSYS/1.0/mingw/bin/../lib/gcc-lib/mingw32/3.3.3/specs
Configured with:
...
Thread model: win32
gcc version 3.3.3 (mingw special)

Cygwin
Stefan@J5U7R1 ~
$ gcc -v
Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/specs
Configured with:
...
Thread model: posix
gcc version 3.3.1 (cygming special)
$

EDIT:
I tryed the cygwin environment on the WinXP SP1 system (PIV).
Recompiling avs2yuv using make command in the unpacked avs2yuv-0.11.zip folder with altered avs2yuv.c in the manner written above does not give me a flawless binary. It is still suffering from the error dialog bug at the end of decoding.

ak
3rd November 2004, 21:34
The diff was against v0.1, so either try new akupenguin's build, or apply patch to v0.1 sources. Command would be

> patch -i w32_pipe.diff -p0

hth

hellfred
3rd November 2004, 22:02
Originally posted by ak
The diff was against v0.1, so either try new akupenguin's build, or apply patch to v0.1 sources. Command would be

> patch -i w32_pipe.diff -p0

hth
Thank you for the command, ak. Now patching works flawlessly at least, but sadly not the binaries of avs2yuv that i build, neither with original 0.11 and 0.1 source, nor with patched 0.1 and 0.11 source. It does no matter if I compile and use them for Win98 or WinXP SP1.
I always get the error dialog, even when avs2yuv writes the output into a file :(
Looks like I am out of options now. Any further suggestions?
Hellfred

akupenguin
3rd November 2004, 22:03
Try running it in gdb, and give me a stackdump. (gdb is provided by cygwin, though maybe not installed by default.)

make debug
gdb avs2yuv.exe
> run foo.avs foo.yuv -frames 1
(runs and, I assume, crashes)
> bt
> disass $pc-32 $pc+32
> info all-registers

hellfred
3rd November 2004, 22:25
Originally posted by akupenguin
Try running it in gdb, and give me a stackdump. (gdb is provided by cygwin, though maybe not installed by default.)

make debug
gdb avs2yuv.exe
> run foo.avs foo.yuv -frames 1
(runs and, I assume, crashes)
> bt
> disass $pc-32 $pc+32
> info all-registers
On the P4 running WinXP SP1 I happened to have gdb installed only for MSYS/MinGW. This is what I get from unpatched avs2yuv v0.11:
Stefan@CF ~/avs2yuv
$ make debug
gcc -O0 -g avs2yuv.c avisynth_c.lib -o avs2yuv -mno-cygwin

Stefan@CF ~/avs2yuv
$ gdb avs2yuv.exe
GNU gdb 5.2.1
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i686-pc-mingw32"...
(gdb) run test.avs foo.yuv -frames 1
Starting program: C:\Programme\Stefan\msys\1.0\home\Stefan\avs2yuv/avs2yuv.exe test.avs foo.yuv -frames 1

Program received signal SIGSEGV, Segmentation fault.
0x0046a77e in ?? ()
(gdb) bt
#0 0x0046a77e in ?? ()
#1 0x560c5d8b in ?? ()
(gdb) Cannot access memory at address 0x53ec8b55
disass $pc-32 $pc+32
Dump of assembler code from 0x46a75e to 0x46a79e:
0x46a75e: sbb $0xe8,%al
0x46a760: int3
0x46a761: cli
0x46a762: push %es
0x46a763: add %dl,0x90909090(%eax)
0x46a769: nop
0x46a76a: nop
0x46a76b: nop
0x46a76c: nop
0x46a76d: nop
0x46a76e: nop
0x46a76f: nop
0x46a770: mov 0xc(%esp,1),%eax
0x46a774: mov 0x8(%esp,1),%ecx
0x46a778: mov 0x4(%esp,1),%edx
0x46a77c: push %eax
0x46a77d: push %ecx
0x46a77e: mov 0x40(%edx),%ecx
0x46a781: call 0x469de0
0x46a786: ret $0xc
0x46a789: nop
0x46a78a: nop
0x46a78b: nop
0x46a78c: nop
0x46a78d: nop
0x46a78e: nop
0x46a78f: nop
0x46a790: mov 0xc(%esp,1),%eax
0x46a794: mov 0x8(%esp,1),%ecx
0x46a798: mov 0x4(%esp,1),%edx
0x46a79c: push %eax
0x46a79d: push %ecx
End of assembler dump.
(gdb) info all-registers
eax 0x4e6160 5136736
ecx 0x77e55f61 2011520865
edx 0x0 0
ebx 0x4e6160 5136736
esp 0x22fa74 0x22fa74
ebp 0x77e55f61 0x77e55f61
esi 0x0 0
edi 0x3d58c8 4020424
eip 0x46a77e 0x46a77e
eflags 0x10206 66054
cs 0x1b 27
ss 0x23 35
ds 0x23 35
es 0x23 35
fs 0x3b 59
gs 0x0 0
st0 0 (raw 0x00000000000000000000)
st1 0 (raw 0x00000000000000000000)
st2 0 (raw 0x00000000000000000000)
st3 0 (raw 0x00000000000000000000)
st4 0 (raw 0x00000000000000000000)
st5 0 (raw 0x00000000000000000000)
st6 0 (raw 0x00000000000000000000)
st7 0 (raw 0x00000000000000000000)
fctrl 0xffff037f -64641
fstat 0xffff0000 -65536
ftag 0xffffffff -1
fiseg 0x0 0
fioff 0x0 0
foseg 0xffff0000 -65536
fooff 0x0 0
fop 0x0 0
(gdb)


Is that ok, or do you need something else? Cygwin, patched avs2yuv.c v0.1?
Hellfred

hellfred
3rd November 2004, 22:57
My Win98 systen running on a PIII Katmai is connected to the internet.
So i have installed the gdb package for cygwin on this system.
Looks like it gieve some more information:

Stefan@j5u7r1 ~
$ cd avs2yuv/

Stefan@j5u7r1 ~/avs2yuv
$ gdb.exe avs2yuv.exe
GNU gdb 2003-09-20-cvs (cygwin-special)
GDB is free software, covered by the GNU General Public License, and you are
Type "show copying" to see the conditions.ies of it under certain conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i686-pc-cygwin"...
(gdb) run test.avs foo.yuv -frames 1
Starting program: /home/Stefan/avs2yuv/avs2yuv.exe test.avs foo.yuv -frames 1

Program received signal SIGSEGV, Segmentation fault.
0x0041a77e in ?? () from /HOME/STEFAN/AVS2YUV/avisynth.dll
(gdb) bt
#0 0x0041a77e in ?? () from /HOME/STEFAN/AVS2YUV/avisynth.dll
#1 0x85718e88 in ?? ()
#2 0x00496160 in ?? () from /HOME/STEFAN/AVS2YUV/avisynth.dll
#3 0x00ac0dc0 in ?? ()
(gdb) disass $pc-32 $pc+32
Dump of assembler code from 0x41a75e to 0x41a79e:
0x0041a75e: sbb $0xe8,%al
0x0041a760: int3
0x0041a761: cli
0x0041a762: push %es
0x0041a763: add %dl,0x90909090(%eax)
0x0041a769: nop
0x0041a76a: nop
0x0041a76b: nop
0x0041a76c: nop
0x0041a76d: nop
0x0041a76e: nop
0x0041a76f: nop
0x0041a770: mov 0xc(%esp,1),%eax
0x0041a774: mov 0x8(%esp,1),%ecx
0x0041a778: mov 0x4(%esp,1),%edx
0x0041a77c: push %eax
0x0041a77d: push %ecx
0x0041a77e: mov 0x40(%edx),%ecx
0x0041a781: call 0x419de0
0x0041a786: ret $0xc
0x0041a789: nop
0x0041a78a: nop
0x0041a78b: nop
0x0041a78c: nop
0x0041a78d: nop
0x0041a78e: nop
0x0041a78f: nop
0x0041a790: mov 0xc(%esp,1),%eax
0x0041a794: mov 0x8(%esp,1),%ecx
0x0041a798: mov 0x4(%esp,1),%edx
0x0041a79c: push %eax
0x0041a79d: push %ecx
End of assembler dump.
(gdb) info all-registers
eax 0x496160 4809056
ecx 0x85718e88 -2056155512
edx 0x0 0
ebx 0x496160 4809056
esp 0x99f8e4 0x99f8e4
ebp 0x85718e88 0x85718e88
esi 0x0 0
edi 0xac0d78 11275640
eip 0x41a77e 0x41a77e
eflags 0x10202 66050
cs 0x15f 351
ss 0x167 359
ds 0x167 359
es 0x167 359
fs 0x4697 18071
gs 0x0 0
st0 0 (raw 0x00000000000000000000)
st1 0 (raw 0x00000000000000000000)
st2 0 (raw 0x00000000000000000000)
st3 0 (raw 0x00000000000000000000)
st4 0 (raw 0x00000000000000000000)
st5 0 (raw 0x00000000000000000000)
st6 0 (raw 0x00000000000000000000)
st7 0 (raw 0x00000000000000000000)
fctrl 0xffff037f -64641
fstat 0xffff0000 -65536
ftag 0xffffffff -1
fiseg 0x0 0
fioff 0x0 0
foseg 0xffff0000 -65536
fooff 0x0 0
fop 0x0 0
xmm0 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0},
uint128 = 0x00000000000000000000000000000000}
xmm1 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0},
uint128 = 0x00000000000000000000000000000000}
xmm2 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0},
uint128 = 0x00000000000000000000000000000000}
xmm3 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0},
uint128 = 0x00000000000000000000000000000000}
xmm4 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0},
uint128 = 0x00000000000000000000000000000000}
xmm5 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0},
uint128 = 0x00000000000000000000000000000000}
xmm6 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0},
uint128 = 0x00000000000000000000000000000000}
xmm7 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0},
uint128 = 0x00000000000000000000000000000000}
mxcsr 0x0 0
mm0 {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, 0x0,
0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}
mm1 {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, 0x0,
0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}
mm2 {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, 0x0,
0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}
mm3 {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, 0x0,
0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}
mm4 {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, 0x0,
0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}
mm5 {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, 0x0,
0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}
mm6 {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, 0x0,
0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}
mm7 {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, 0x0,
0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}
(gdb) quit
The program is running. Exit anyway? (y or n) y

Stefan@j5u7r1 ~/avs2yuv

akupenguin
3rd November 2004, 23:35
weirdness... in gdb it crashes before running (doesn't even print input filename or framecount), while under normal use it crashes only on exit?

I have reproduced something like that... with debug statements, on the win2k3 box I have shell access to, avs2yuv crashes on avs_create_script_environment() in gdb, but on avs_get_video_info() in production (both before outputting any frames).

And you don't get coredumps under windows, so there's no way to examine the state without gdb.

hellfred
4th November 2004, 00:18
Originally posted by akupenguin
weirdness... in gdb it crashes before running (doesn't even print input filename or framecount), while under normal use it crashes only on exit?

I have reproduced something like that... with debug statements, on the win2k3 box I have shell access to, avs2yuv crashes on avs_create_script_environment() in gdb, but on avs_get_video_info() in production (both before outputting any frames).

And you don't get coredumps under windows, so there's no way to examine the state without gdb.
In normal use avs2yuv crashes at the end of playback.
On Win98 I get an error message from kernel32.dll.
This is what you referr to a coredump, isn't it?

AVS2YUV verursachte einen Fehler durch eine ungültige Seite
in Modul KERNEL32.DLL bei 015f:bff7b997.
Register:
EAX=00000000 CS=015f EIP=bff7b997 EFLGS=00000246
EBX=00a6f540 SS=0167 ESP=01d1fb64 EBP=00ab0b40
ECX=00acf760 DS=0167 ESI=6fd30df0 FS=3c97
EDX=00ab0b40 ES=0167 EDI=00000004 GS=0000
Bytes bei CS:EIP:
ff 76 04 e8 26 89 ff ff 5e c2 04 00 56 8b 74 24
Stapelwerte:
009b35bc 6fae4e52 6fd30df0 00a6f540 009b35bc 6fb26e78 00a6f540 3c970167 00000000 6fac2e38 00ab0b40 bff9ab2b bff7b30e 00000000 009b35bc 00000004

On WinXP it just says something like
Application in "0x0..." points/referenzes to memeory in "0x0...". Action "read" could not be performed on memory.
Press "OK" to terminate the application/program
On the WinXP another cmd.exe window is being opened and the name of the input file is being displayed (test.avs).
On Win98 avs2yuv dies right away.
Hellfred

hellfred
4th November 2004, 00:37
On Win98 MSYS the performance is even worse.
The unpatched 0.11 source just gives one or two frames and the mplayer crashes.

Stefan@J5U7R1 ~/avs2yuv
$ avs2yuv.exe ../test.avs -frames 50 - | mplayer.exe -
MPlayer 1.0pre5-3.3.3 (C) 2000-2004 MPlayer Team

...

Audio: no sound
Starting playback...


Exiting... (End of file)
../test.avs
total frames: 198
Output error: wrote only 80972 of 83072 bytes

Stefan@J5U7R1 ~/avs2yuv
$

But writing to file will at least stop the Output error from happening:

Stefan@J5U7R1 ~/avs2yuv
$ avs2yuv.exe ../test.avs -frames 50 out.yuv
../test.avs
total frames: 10759


I am so tired in the moment that there is the danger of me mixing the different builds up. I think I have to stop for now, or we may only walk in circles from now on. I am sorry about that.
Hellfred

akupenguin
4th November 2004, 01:35
Originally posted by hellfred
This is what you referr to a coredump, isn't it? No, a coredump is a file containing not just the registers but also the entire contents of memory allocated to the program. It is sufficient to reconstruct the state of the program for examination, just like running it in a debugger.

sprit
4th November 2004, 17:45
Originally posted by akupenguin
And you don't get coredumps under windows, so there's no way to examine the state without gdb.
There's dumper in cygwin - "dumper (1) - Dump core from WIN32PID to FILENAME.core"

hellfred
4th November 2004, 18:33
Ok, i have that one installed in my cygwin environment.
How to proceed now. Start avs2yuv with a certain win32ProcessID in one bash and while avs2yuv is decoding, start dumper.exe <filename_to_dump_to> <avs2yuv_win32_ProcessID> in another bash and wait for avs2yuv zu fail?
I do not know how to specify the win32PID for avs2yuv so that i can use it right away in the second bash. I can try it with ps, though.
OK ps gives the win32PID :)
Lets try .
Ok, looks like that worked out. I got a file with the size of 70 MB
for decoding 400 frames. Shall i try to do a smaller number of frames to get it down in size?

Hellfred

EDIT: Argh, the size of the dump is not related to the number of frames. For serving just 10 frames i get even a little bit more data writen into the dump. Can you help yourself to a dump, or do i find a way to upload it somewhere / somehow?

akupenguin
4th November 2004, 21:44
No, the point of a coredump in debugging is that it dumps at the point of the crash, not at some random time while it's working.
And even if you do get it working, the analysis would have to be done on your computer (or I would have to generate my own coredump). They're not portable.

akupenguin
9th November 2004, 10:09
Your crash might be fixed now, with v0.12.

hellfred
9th November 2004, 20:04
Things have definitely been improved with this version.
The good news: Decompressing the movies to file now works on every console that i have tested your build on up to now.
The list is Win98 command. com, Win98 msys rxvt, Win98 cygwin bash, Win98 ReactOS cmd.exe, WinXP cmd.exe & WinXP rxvt.
Now the bad news: Piping the uncompressed video Data to mplayer fails in every of the above mentioned combinations of OS and console.
On Win98 the avs2yuv crashes, on WinXP i get one frame displayed and then playback stops. Output below.
The number of frames is correct for the clip that is to be streamed through the pipe.

G:\Dokumente und Einstellungen\Stefan\Desktop\avs2yuv>avs2yuv.exe test.avs - | m
player.exe -
MPlayer dev-CVS-041023-16:21-3.3.3 (C) 2000-2004 MPlayer Team

CPU: Intel Pentium III Katmai/Pentium III Xeon Tanner (Family: 6, Stepping: 3)
Detected cache-line size is 32 bytes
test.avs
CPUflags: MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 0 SSE2: 0
Compiled for x86 CPU with extensions: MMX MMX2 SSE

Reading config file /opt/mplayer_x264/etc/mplayer/mplayer.conf: No such file or
directory
Reading config file G:/Dokumente und Einstellungen/Stefan/Desktop/avs2yuv/mplaye
r/config
Reading G:/Dokumente und Einstellungen/Stefan/Desktop/avs2yuv/mplayer/codecs.con
f: Can't open 'G:/Dokumente und Einstellungen/Stefan/Desktop/avs2yuv/mplayer/cod
ecs.conf': No such file or directory
Reading /opt/mplayer_x264/etc/mplayer/codecs.conf: Can't open '/opt/mplayer_x264
/etc/mplayer/codecs.conf': No such file or directory
Using built-in default codecs.conf.
Font G:/Dokumente und Einstellungen/Stefan/Desktop/avs2yuv/mplayer/font/font.des
c loaded successfully! (206 chars)
Using Windows native timing
Can't open input config file G:/Dokumente und Einstellungen/Stefan/Desktop/avs2y
uv/mplayer/input.conf: No such file or directory
Can't open input config file /opt/mplayer_x264/etc/mplayer/input.conf: No such f
ile or directory
Falling back on default (hardcoded) input config

Playing -.
Reading from stdin...
total frames: 654
YUV4MPEG2 file format detected.
YUV4MPEG2 Video stream 0 size: display: 640x360, codec: 640x360
VIDEO: [YV12] 640x360 12bpp 29,970 fps 0,0 kbps ( 0,0 kbyte/s)
==========================================================================
Opening video decoder: [raw] RAW Uncompressed Video
VDec: vo config request - 640 x 360 (preferred csp: Planar YV12)
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is undefined - no prescaling applied.
SwScaler: using unscaled Planar YV12 -> BGRA special converter
VO: [directx] 640x360 => 640x360 BGRA
Selected video codec: [rawyv12] vfm:raw (RAW YV12)
==========================================================================
Audio: no sound
Starting playback...
V: 0,0 0 0% 0% 0,0% 0 0 0%

Exiting... (End of file)
Output error: wrote only 211401 of 230400 bytes

G:\Dokumente und Einstellungen\Stefan\Desktop\avs2yuv>

This is an example outpu of working output to file:

G:\Dokumente und Einstellungen\Stefan\Desktop\avs2yuv>avs2yuv.exe test.avs out.y
uv
test.avs
total frames: 654

I will try to compile it now myself, and see if things get better. Did you add the enhancements of AK to get streaming to work under win32?

Hellfred

EDIT:
Incorporating AKs modification enabled streaming under win32:
After including header fcntl.h
#include <fcntl.h>
and modifying the code part concerning output like AK pointed out in his diff:

FILE* yuv_out = NULL;
if(outfile) {
if(0==strcmp(outfile, "-")){
yuv_out = stdout;
setmode(fileno(yuv_out),_O_BINARY);
//yuv_out = fdopen(STDOUT_FILENO, "wb");
}

I get output to file and piping to mplayer.exe without any error messages on WinXP.
I will boot to Win98 next and try out the binary there.
Thank you a lot for this tool.

Hellfred

EDIT2:
All consoles are able to stream on Win98 with the patched binary, too.
Thanks once more to both of you, ak and akupenguin

akupenguin
9th November 2004, 22:10
Weird. I figured that setmode(binary) would be equivalent to fdopen(binary), so I used the latter because it's ANSI C. But I guess they're not the same.

Anyway, neither my fdopen nor ak's setmode works for me on win2k3+cygwin+bash, and both work on linux.
Here's what I get with ak's patch, compiled with cygwin/gcc 3.3.1: avs2yuv-ak.exe (http://students.washington.edu/lorenm/src/avisynth/avs2yuv/avs2yuv-ak.exe), avs2yuv-ak.c (http://students.washington.edu/lorenm/src/avisynth/avs2yuv/avs2yuv-ak.c). Does that work the same as your build?

hellfred
10th November 2004, 10:06
Your binary does work here on my WinXP SP2 box in cmd.exe and MinGW rxvt. Both writing to file and piping the output to mplayer.exe!
Did other builds work for you already on the Win2k3 system, at least when writing to a file?
Do you have access to the Desktop of your Win2k3 system and can you check if AviSynth is able to serve the file? Try to play the avs in e.g. mplayer2.exe (AKA M$ MediaPlayer 6.4). On my clean WinXP SP2 I had to install Avisynth and a vfw codecs to get my first output. Both ffdshow and helix vfw yuvcodec work fine for me. ffdshow has to be set up to process raw material in the vfw decoder configuration interface.

Hellfred

akupenguin
10th November 2004, 17:54
Yes, all builds already worked when writing a file.
I don't have write access to the relevent portions of the registry (it's a shared terminal server), so I can't install avisynth. avs2yuv works because it uses avisynth.dll directly, and doesn't go through vfw (as of v0.12). But I can't test any other media players.
The piping problems are unrelated to avisynth: Even if I remove all reference to avisynth from avs2yuv, and just write random data to the pipe, it still dies.

Anyway, avs2yuv-ak is now 0.13

edit: dunno what/when I changed, but it works now.

*WALKER
29th August 2010, 15:56
Pipelined workflow needed.
I have an encoder used for generating avc mvc files for 3D BD.
It will only accept RAW planar 4:2:0 files wih a .yuv suffix
My input material is ProRez .mov files.
How can I frame serve the encoder .yuv files?
Thanks,

*WALKER
29th August 2010, 16:25
Has anybody got this working?
I would like to use this as input to the sony4ven.dll
Thanks,